emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list-colors-display shows only one color


From: Juanma Barranquero
Subject: Re: list-colors-display shows only one color
Date: Wed, 13 Feb 2002 18:07:15 +0100

On Wed, 13 Feb 2002 08:39:00 -0700 (MST), Richard Stallman <address@hidden> 
wrote:

> It is an error to use the C shift operator with those arguments.
> So this code clearly is one bug, and needs to be fixed.
> Maybe that fix will solve the problem you are encountering.

cap is make_number'd, so this is a posible fix.


                                                           /L/e/k/t/u



2002-02-13  Juanma Barranquero  <address@hidden>

        * w32fns.c (Fx_display_color_cells): Don't allow number of color
        cells to overflow EMACS_INT size.


Index: w32fns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32fns.c,v
retrieving revision 1.154
diff -u -c -r1.154 w32fns.c
*** w32fns.c    9 Feb 2002 01:31:07 -0000       1.154
--- w32fns.c    13 Feb 2002 17:01:13 -0000
***************
*** 7654,7660 ****
      cap = GetDeviceCaps (hdc,NUMCOLORS);
  
    if (cap < 0)
!     cap = 1 << (dpyinfo->n_planes * dpyinfo->n_cbits);
    
    ReleaseDC (dpyinfo->root_window, hdc);
    
--- 7654,7660 ----
      cap = GetDeviceCaps (hdc,NUMCOLORS);
  
    if (cap < 0)
!     cap = 1 << min(dpyinfo->n_planes * dpyinfo->n_cbits, VALBITS - 2);
    
    ReleaseDC (dpyinfo->root_window, hdc);
    





reply via email to

[Prev in Thread] Current Thread [Next in Thread]