emacs-devel
[Top][All Lists]
Advanced

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

Patch for RC: w32_defined_color passed bad argument


From: Juanma Barranquero
Subject: Patch for RC: w32_defined_color passed bad argument
Date: Fri, 08 Nov 2002 10:49:27 +0100

This patch (already in the trunk) should be applied to the RC.

http://mail.gnu.org/pipermail/emacs-devel/2002-October/013402.html
http://mail.gnu.org/pipermail/emacs-devel/2002-October/013420.html

Reasons:

1.- Fixes a potential memory corruption.
2.- It's just passing the right argument and moving around the
definition of XColor. No new code or features.
3.- Once checked that all affected targets compile, that's it.  It
shouldn't negatively affect stability at all.


                                                           /L/e/k/t/u



2002-11-08  Juanma Barranquero  <address@hidden>

        * dispextern.h [!HAVE_X_WINDOWS]: Define XColor.

        * w32fns.c:
        * xfaces.c: Remove definition of XColor.

        * w32term.c (w32_term_init): Pass XColor to w32_define_color, not
        COLORREF.


Index: dispextern.h
===================================================================
RCS file: /cvs/emacs/src/dispextern.h,v
retrieving revision 1.111.4.3
diff -u -2 -r1.111.4.3 dispextern.h
--- dispextern.h        16 May 2002 16:11:41 -0000      1.111.4.3
+++ dispextern.h        8 Nov 2002 09:28:28 -0000
@@ -26,8 +26,21 @@
 
 #ifdef HAVE_X_WINDOWS
+
 #include <X11/Xlib.h>
 #ifdef USE_X_TOOLKIT
 #include <X11/Intrinsic.h>
 #endif /* USE_X_TOOLKIT */
+
+#else /* !HAVE_X_WINDOWS */
+
+/* X-related stuff used by non-X gui code. */
+
+typedef struct {
+  unsigned long pixel;
+  unsigned short red, green, blue;
+  char flags;
+  char pad;
+} XColor;
+
 #endif /* HAVE_X_WINDOWS */
 
Index: w32fns.c
===================================================================
RCS file: /cvs/emacs/src/w32fns.c,v
retrieving revision 1.123.2.16
diff -u -2 -r1.123.2.16 w32fns.c
--- w32fns.c    23 Oct 2002 17:41:38 -0000      1.123.2.16
+++ w32fns.c    8 Nov 2002 09:28:29 -0000
@@ -61,14 +61,4 @@
 extern int quit_char;
 
-/* A definition of XColor for non-X frames.  */
-#ifndef HAVE_X_WINDOWS
-typedef struct {
-  unsigned long pixel;
-  unsigned short red, green, blue;
-  char flags;
-  char pad;
-} XColor;
-#endif
-
 extern char *lispy_function_keys[];
 
Index: w32term.c
===================================================================
RCS file: /cvs/emacs/src/w32term.c,v
retrieving revision 1.109.4.16
diff -u -2 -r1.109.4.16 w32term.c
--- w32term.c   16 May 2002 16:11:41 -0000      1.109.4.16
+++ w32term.c   8 Nov 2002 09:28:30 -0000
@@ -10690,5 +10690,5 @@
   /* initialise palette with white and black */
   {
-    COLORREF color;
+    XColor color;
     w32_defined_color (0, "white", &color, 1);
     w32_defined_color (0, "black", &color, 1);
Index: xfaces.c
===================================================================
RCS file: /cvs/emacs/src/xfaces.c,v
retrieving revision 1.225.4.3
diff -u -2 -r1.225.4.3 xfaces.c
--- xfaces.c    1 Nov 2001 10:14:28 -0000       1.225.4.3
+++ xfaces.c    8 Nov 2002 09:28:31 -0000
@@ -322,19 +322,4 @@
 #define FACE_CACHE_BUCKETS_SIZE 1001
 
-/* A definition of XColor for non-X frames.  */
-
-#ifndef HAVE_X_WINDOWS
-
-typedef struct
-{
-  unsigned long pixel;
-  unsigned short red, green, blue;
-  char flags;
-  char pad;
-}
-XColor;
-
-#endif /* not HAVE_X_WINDOWS */
-
 /* Keyword symbols used for face attribute names.  */
 





reply via email to

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