Commit 41729b81 authored by Paul Eggert's avatar Paul Eggert

* xgselect.c (xg_select): Remove unused var.

parent ec6cf4c6
2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
* xgselect.c (xg_select): Remove unused var.
* image.c (four_corners_best): Mark locals as initialized.
(gif_load): Initialize transparent_p to zero (Bug#8238).
Mark another local as initialized.
......@@ -38,7 +38,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
GMainContext *context = g_main_context_default ();
int have_wfds = wfds != NULL;
int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0;
int prio, i, nfds, tmo_in_millisec;
int i, nfds, tmo_in_millisec;
if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds));
else FD_ZERO (&all_rfds);
......@@ -49,9 +49,9 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
g_main_context_pending (context);
do {
if (n_gfds > gfds_size)
if (n_gfds > gfds_size)
{
while (n_gfds > gfds_size)
while (n_gfds > gfds_size)
gfds_size *= 2;
xfree (gfds);
gfds = xmalloc (sizeof (*gfds) * gfds_size);
......@@ -64,7 +64,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
gfds_size);
} while (n_gfds > gfds_size);
for (i = 0; i < n_gfds; ++i)
for (i = 0; i < n_gfds; ++i)
{
if (gfds[i].events & G_IO_IN)
{
......@@ -87,7 +87,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
else
{
EMACS_TIME difference;
EMACS_SUB_TIME (difference, tmo, *timeout);
if (EMACS_TIME_NEG_P (difference)) our_tmo = 1;
}
......@@ -100,7 +100,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
if (nfds < 0)
retval = nfds;
else if (nfds > 0)
else if (nfds > 0)
{
for (i = 0; i < max_fds+1; ++i)
{
......@@ -127,7 +127,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
if (our_fds > 0 || (nfds == 0 && our_tmo))
{
/* If Gtk+ is in use eventually gtk_main_iteration will be called,
unless retval is zero. */
#ifdef USE_GTK
......@@ -137,7 +137,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
g_main_context_dispatch (context);
/* To not have to recalculate timeout, return like this. */
if (retval == 0)
if (retval == 0)
{
retval = -1;
errno = EINTR;
......@@ -156,4 +156,3 @@ xgselect_initialize (void)
gfds = xmalloc (sizeof (*gfds)*gfds_size);
#endif /* defined (USE_GTK) || defined (HAVE_GCONF) */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment