From 2172544bcd6f38bc7c0888a148a6dc8a903314c0 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 18 Apr 2011 23:34:43 -0700 Subject: [PATCH] * xfns.c (Fx_window_property): Simplify a bit, to make a bit faster and to avoid GCC 4.6.0 warning. * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise. --- src/ChangeLog | 4 ++++ src/xfns.c | 2 +- src/xselect.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ef511ffc211..2b2a9510435 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2011-04-19 Paul Eggert + * xfns.c (Fx_window_property): Simplify a bit, + to make a bit faster and to avoid GCC 4.6.0 warning. + * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise. + * fns.c (internal_equal): Don't assume size_t fits in int. * alloc.c (compact_small_strings): Tighten assertion a little. diff --git a/src/xfns.c b/src/xfns.c index 7a575150687..f3dc493ff85 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4352,7 +4352,7 @@ no value of TYPE (always string in the MS Windows case). */) property and those are indeed in 32 bit quantities if format is 32. */ - if (actual_format == 32 && actual_format < BITS_PER_LONG) + if (32 < BITS_PER_LONG && actual_format == 32) { unsigned long i; int *idata = (int *) tmp_data; diff --git a/src/xselect.c b/src/xselect.c index edf00226404..1141f2c6b68 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1477,7 +1477,7 @@ x_get_window_property (Display *display, Window window, Atom property, The bytes and offsets passed to XGetWindowProperty refers to the property and those are indeed in 32 bit quantities if format is 32. */ - if (*actual_format_ret == 32 && *actual_format_ret < BITS_PER_LONG) + if (32 < BITS_PER_LONG && *actual_format_ret == 32) { unsigned long i; int *idata = (int *) ((*data_ret) + offset); @@ -2432,7 +2432,7 @@ x_handle_dnd_message (struct frame *f, XClientMessageEvent *event, struct x_disp function expects them to be of size int (i.e. 32). So to be able to use that function, put the data in the form it expects if format is 32. */ - if (event->format == 32 && event->format < BITS_PER_LONG) + if (32 < BITS_PER_LONG && event->format == 32) { for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */ idata[i] = (int) event->data.l[i]; -- 2.39.2