2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
+ * xgselect.c (xg_select): Put maxfds+1 into a var.
+ This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
+
* sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
2012-05-10 Dave Abrahams <dave@boostpro.com>
GMainContext *context = g_main_context_default ();
int have_wfds = wfds != NULL;
int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0;
- int i, nfds, tmo_in_millisec;
+ int i, nfds, fds_lim, tmo_in_millisec;
if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds));
else FD_ZERO (&all_rfds);
if (our_tmo) tmop = &tmo;
}
- nfds = select (max_fds+1, &all_rfds, have_wfds ? &all_wfds : NULL,
- efds, tmop);
+ fds_lim = max_fds + 1;
+ nfds = select (fds_lim, &all_rfds, have_wfds ? &all_wfds : NULL, efds, tmop);
if (nfds < 0)
retval = nfds;
else if (nfds > 0)
{
- for (i = 0; i < max_fds+1; ++i)
+ for (i = 0; i < fds_lim; ++i)
{
if (FD_ISSET (i, &all_rfds))
{