From 4c83cffccec286575d36b63e0183fed480726352 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 5 Feb 2011 19:13:16 -0800 Subject: [PATCH] * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. Emacs assumes two's complement elsewhere, but the assumption is easy to remove here, and this suppresses a warning with Sun C 5.8. --- src/ChangeLog | 4 ++++ src/xterm.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 90c64e143be..5a269965186 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2011-02-06 Paul Eggert + * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. + Emacs assumes two's complement elsewhere, but the assumption is + easy to remove here, and this suppresses a warning with Sun C 5.8. + conform to C89 pointer rules * xterm.c (x_draw_fringe_bitmap, handle_one_xevent, x_bitmap_icon): diff --git a/src/xterm.c b/src/xterm.c index 034df89679c..31f002fa05c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1706,7 +1706,7 @@ x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color) a least-squares matching, which is what X uses for closest color matching with StaticColor visuals. */ int nearest, i; - unsigned long nearest_delta = ~0; + unsigned long nearest_delta = ~ (unsigned long) 0; int ncells; const XColor *cells = x_color_cells (dpy, &ncells); -- 2.39.5