From: Paul Eggert Date: Sun, 6 Feb 2011 03:13:16 +0000 (-0800) Subject: * xterm.c (x_alloc_nearest_color_1): Avoid unportable int assumption. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~1014 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4c83cffccec286575d36b63e0183fed480726352;p=emacs.git * 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. --- 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);