[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r18780 - gnunet-gtk/src/lib
From: |
gnunet |
Subject: |
[GNUnet-SVN] r18780 - gnunet-gtk/src/lib |
Date: |
Fri, 23 Dec 2011 16:53:10 +0100 |
Author: grothoff
Date: 2011-12-23 16:53:10 +0100 (Fri, 23 Dec 2011)
New Revision: 18780
Modified:
gnunet-gtk/src/lib/eventloop.c
Log:
-some i's are signed, some i's are unsigned
Modified: gnunet-gtk/src/lib/eventloop.c
===================================================================
--- gnunet-gtk/src/lib/eventloop.c 2011-12-23 15:43:25 UTC (rev 18779)
+++ gnunet-gtk/src/lib/eventloop.c 2011-12-23 15:53:10 UTC (rev 18780)
@@ -295,7 +295,8 @@
int max_nfds;
gint poll_result;
gint delay;
- guint i;
+ int i;
+ guint ui;
guint fd_counter;
guint need_gfds;
fd_set aread;
@@ -523,21 +524,21 @@
#endif
ml->cached_poll_array[fd_counter].fd = (intptr_t) ml->hEventWrite;
ml->cached_poll_array[fd_counter].events = G_IO_OUT;
- for (i = 0; i < wfds->sds.fd_count; i++)
+ for (ui = 0; ui < wfds->sds.fd_count; ui++)
{
DWORD error;
int status;
- status = send (wfds->sds.fd_array[i], NULL, 0, 0);
+ status = send (wfds->sds.fd_array[ui], NULL, 0, 0);
error = GetLastError ();
#if DEBUG_EVENTLOOP
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "pre-send to the socket %d returned %d (%u)\n", i, status,
+ "pre-send to the socket %u returned %d (%u)\n", ui, status,
error);
#endif
if (status == 0 || (error != WSAEWOULDBLOCK && error != WSAENOTCONN))
wakeup = 1;
- WSAEventSelect (wfds->sds.fd_array[i], ml->hEventWrite,
+ WSAEventSelect (wfds->sds.fd_array[ui], ml->hEventWrite,
FD_WRITE | FD_CONNECT | FD_CLOSE);
}
if (wakeup)
@@ -554,8 +555,8 @@
#endif
ml->cached_poll_array[fd_counter].fd = (intptr_t) ml->hEventException;
ml->cached_poll_array[fd_counter].events = G_IO_ERR;
- for (i = 0; i < efds->sds.fd_count; i++)
- WSAEventSelect (efds->sds.fd_array[i], ml->hEventException,
+ for (ui = 0; ui < efds->sds.fd_count; ui++)
+ WSAEventSelect (efds->sds.fd_array[ui], ml->hEventException,
FD_OOB | FD_CLOSE);
fd_counter++;
sock_err = efds->sds.fd_count;
@@ -635,27 +636,27 @@
GNUNET_NETWORK_fdset_zero (wfds);
if (NULL != efds)
GNUNET_NETWORK_fdset_zero (efds);
- for (i = 0; i < fd_counter; i++)
+ for (ui = 0; ui < fd_counter; ui++)
{
int set = 0;
if ((NULL != rfds) &&
(set |=
- (FD_ISSET (ml->cached_poll_array[i].fd, &aread) &&
+ (FD_ISSET (ml->cached_poll_array[ui].fd, &aread) &&
(0 !=
- (ml->cached_poll_array[i].
+ (ml->cached_poll_array[ui].
revents & (G_IO_IN | G_IO_HUP | G_IO_ERR))))))
- GNUNET_NETWORK_fdset_set_native (rfds, ml->cached_poll_array[i].fd);
+ GNUNET_NETWORK_fdset_set_native (rfds, ml->cached_poll_array[ui].fd);
if ((NULL != wfds) &&
(set |=
- (FD_ISSET (ml->cached_poll_array[i].fd, &awrite) &&
- (0 != (ml->cached_poll_array[i].revents & (G_IO_OUT | G_IO_ERR))))))
- GNUNET_NETWORK_fdset_set_native (wfds, ml->cached_poll_array[i].fd);
+ (FD_ISSET (ml->cached_poll_array[ui].fd, &awrite) &&
+ (0 != (ml->cached_poll_array[ui].revents & (G_IO_OUT | G_IO_ERR))))))
+ GNUNET_NETWORK_fdset_set_native (wfds, ml->cached_poll_array[ui].fd);
if ((NULL != efds) &&
(set |=
- (FD_ISSET (ml->cached_poll_array[i].fd, &aexcept) &&
- (0 != (ml->cached_poll_array[i].revents & G_IO_ERR)))))
- GNUNET_NETWORK_fdset_set_native (efds, ml->cached_poll_array[i].fd);
+ (FD_ISSET (ml->cached_poll_array[ui].fd, &aexcept) &&
+ (0 != (ml->cached_poll_array[ui].revents & G_IO_ERR)))))
+ GNUNET_NETWORK_fdset_set_native (efds, ml->cached_poll_array[ui].fd);
if (set)
result++;
}
@@ -741,27 +742,27 @@
#endif
if (waitstatus == WAIT_OBJECT_0)
{
- for (i = 0; i < wfds->sds.fd_count; i++)
+ for (ui = 0; ui < wfds->sds.fd_count; ui++)
{
DWORD error;
int status;
int so_error = 0;
int sizeof_so_error = sizeof (so_error);
- int gso_result = getsockopt (wfds->sds.fd_array[i],
+ int gso_result = getsockopt (wfds->sds.fd_array[ui],
SOL_SOCKET, SO_ERROR,
(char *) &so_error, &sizeof_so_error);
- status = send (wfds->sds.fd_array[i], NULL, 0, 0);
+ status = send (wfds->sds.fd_array[ui], NULL, 0, 0);
error = GetLastError ();
#if DEBUG_EVENTLOOP
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "send to the socket %d returned %d (%u)\n", i, status,
error);
+ "send to the socket %u returned %d (%u)\n", ui, status,
error);
#endif
if (status == 0 || (error != WSAEWOULDBLOCK && error != WSAENOTCONN) ||
(status == -1 && gso_result == 0 && error == WSAENOTCONN &&
so_error == WSAECONNREFUSED))
{
- FD_SET (wfds->sds.fd_array[i], &awrite);
+ FD_SET (wfds->sds.fd_array[ui], &awrite);
result += 1;
}
}
@@ -770,8 +771,8 @@
{
struct GNUNET_CONTAINER_SList_Iterator t;
- for (i = 0; i < rfds->sds.fd_count; i++)
- WSAEventSelect (rfds->sds.fd_array[i], ml->hEventRead, 0);
+ for (ui = 0; ui < rfds->sds.fd_count; ui++)
+ WSAEventSelect (rfds->sds.fd_array[ui], ml->hEventRead, 0);
for (t = GNUNET_CONTAINER_slist_begin (rfds->handles);
GNUNET_CONTAINER_slist_end (&t) != GNUNET_YES;
GNUNET_CONTAINER_slist_next (&t))
@@ -788,8 +789,8 @@
}
if (wfds)
{
- for (i = 0; i < wfds->sds.fd_count; i++)
- WSAEventSelect (wfds->sds.fd_array[i], ml->hEventWrite, 0);
+ for (ui = 0; ui < wfds->sds.fd_count; ui++)
+ WSAEventSelect (wfds->sds.fd_array[ui], ml->hEventWrite, 0);
GNUNET_NETWORK_fdset_zero (wfds);
if (select_ret != -1 && socks > 0)
GNUNET_NETWORK_fdset_copy_native (wfds, &awrite, select_ret);
@@ -797,8 +798,8 @@
}
if (efds)
{
- for (i = 0; i < efds->sds.fd_count; i++)
- WSAEventSelect (efds->sds.fd_array[i], ml->hEventException, 0);
+ for (ui = 0; ui < efds->sds.fd_count; ui++)
+ WSAEventSelect (efds->sds.fd_array[ui], ml->hEventException, 0);
GNUNET_NETWORK_fdset_zero (efds);
if (select_ret != -1 && socks > 0)
GNUNET_NETWORK_fdset_copy_native (efds, &aexcept, select_ret);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r18780 - gnunet-gtk/src/lib,
gnunet <=