Commit fa3c87e1 authored by Paul Eggert's avatar Paul Eggert
Browse files

* process.c (Fnetwork_interface_info): Avoid left-shift undefined

behavior with 1 << 31.  GCC 4.6.0 warns about this on 32-bit hosts.
parent 2172544b
2011-04-19 Paul Eggert <eggert@cs.ucla.edu> 2011-04-19 Paul Eggert <eggert@cs.ucla.edu>
* process.c (Fnetwork_interface_info): Avoid left-shift undefined
behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
* xfns.c (Fx_window_property): Simplify a bit, * xfns.c (Fx_window_property): Simplify a bit,
to make a bit faster and to avoid GCC 4.6.0 warning. to make a bit faster and to avoid GCC 4.6.0 warning.
* xselect.c (x_get_window_property, x_handle_dnd_message): Likewise. * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
......
...@@ -3723,9 +3723,9 @@ FLAGS is the current flags of the interface. */) ...@@ -3723,9 +3723,9 @@ FLAGS is the current flags of the interface. */)
flags -= fp->flag_bit; flags -= fp->flag_bit;
} }
} }
for (fnum = 0; flags && fnum < 32; fnum++) for (fnum = 0; flags && fnum < 32; flags >>= 1, fnum++)
{ {
if (flags & (1 << fnum)) if (flags & 1)
{ {
elt = Fcons (make_number (fnum), elt); elt = Fcons (make_number (fnum), elt);
} }
......
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