From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: [jay_finger@hotmail.com: Two problems in Emacs-21.2.91 on Windows] Date: Wed, 23 Oct 2002 14:06:10 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <20021023134918.2AAE.LEKTU@terra.es> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035374922 21803 80.91.224.249 (23 Oct 2002 12:08:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 12:08:42 +0000 (UTC) Cc: andrewi@gnu.org, eliz@is.elta.co.il, akochoi@mac.com, jay_finger@hotmail.com, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 184KJU-0005fO-00 for ; Wed, 23 Oct 2002 14:08:40 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 184KLA-0005iu-00 for ; Wed, 23 Oct 2002 14:10:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 184KI5-0007wg-00; Wed, 23 Oct 2002 08:07:13 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 184KHA-0007F9-00 for emacs-devel@gnu.org; Wed, 23 Oct 2002 08:06:16 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 184KH7-0007EM-00 for emacs-devel@gnu.org; Wed, 23 Oct 2002 08:06:15 -0400 Original-Received: from [62.22.27.141] (helo=mail.peoplecall.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 184KH7-0007Dc-00; Wed, 23 Oct 2002 08:06:13 -0400 Original-Received: from [62.22.27.143] (jbarranquero.ofi.peoplecall.com [62.22.27.143]) by mail.peoplecall.com (8.11.6/8.11.6) with ESMTP id g9NC69C15747; Wed, 23 Oct 2002 14:06:09 +0200 Original-To: rms@gnu.org In-Reply-To: X-Mailer: Becky! ver. 2.05.06 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:8685 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:8685 On Wed, 23 Oct 2002 03:10:35 -0400, Richard Stallman wrote: > Any ideas for what to do here? With respect to: > 2) Bug in w32_term_init in w32term.c. > > This function calls w32_defined_color to do lookups of colors "white" and > "black". It passes a pointer to a COLORDEF, but w32_term_init expects a > pointer to an XColor. Debug builds run fine, but on optimized builds you > get a stack corruption and Emacs fails before painting the first window. I > hacked this by pasting in the definition for XColor into w32term.c and > passing in one of those, but I figure somebody would want to actually move > that structure to a header. A function prototype wouldn't hurt either :-) the following patch would do, I think. Basically it makes sense to extract the definition of XColor from the three or four places it happens now and define it specifically in the *gui.h files of the platforms that need it (w32gui.h and macgui.h at this moment). The same bug is also present in EMACS_21_1_RC, BTW. If the patch is approved it should be applied to the pretest too. It works on my system. I've not commited the patch because I don't want to change Mac files without Andrew Choi's approval, specially as I can not test the changes on that platform. I've maintained the #ifndef HAVE_X_WINDOWS guards. On Window systems probably that's unnecesary, but on Macs I bet they're needed if you happen to build on Mac OS X. Comments? /L/e/k/t/u Index: macfns.c =================================================================== RCS file: /cvs/emacs/src/macfns.c,v retrieving revision 1.16 diff -u -2 -r1.16 macfns.c --- macfns.c 18 Oct 2002 09:57:48 -0000 1.16 +++ macfns.c 23 Oct 2002 11:48:30 -0000 @@ -100,14 +100,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: macgui.h =================================================================== RCS file: /cvs/emacs/src/macgui.h,v retrieving revision 1.1 diff -u -2 -r1.1 macgui.h --- macgui.h 26 Apr 2002 23:39:05 -0000 1.1 +++ macgui.h 23 Oct 2002 11:48:30 -0000 @@ -38,4 +38,14 @@ #endif +/* 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 + #define FACE_DEFAULT (~0) Index: w32fns.c =================================================================== RCS file: /cvs/emacs/src/w32fns.c,v retrieving revision 1.185 diff -u -2 -r1.185 w32fns.c --- w32fns.c 18 Oct 2002 09:54:27 -0000 1.185 +++ w32fns.c 23 Oct 2002 11:48:31 -0000 @@ -65,14 +65,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: w32gui.h =================================================================== RCS file: /cvs/emacs/src/w32gui.h,v retrieving revision 1.15 diff -u -2 -r1.15 w32gui.h --- w32gui.h 20 Mar 2002 21:00:50 -0000 1.15 +++ w32gui.h 23 Oct 2002 11:48:31 -0000 @@ -87,4 +87,14 @@ } XImage; +/* 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 + #define FACE_DEFAULT (~0) Index: w32term.c =================================================================== RCS file: /cvs/emacs/src/w32term.c,v retrieving revision 1.166 diff -u -2 -r1.166 w32term.c --- w32term.c 30 Aug 2002 13:19:45 -0000 1.166 +++ w32term.c 23 Oct 2002 11:48:32 -0000 @@ -11125,5 +11125,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.264 diff -u -2 -r1.264 xfaces.c --- xfaces.c 27 Sep 2002 00:43:40 -0000 1.264 +++ xfaces.c 23 Oct 2002 11:48:33 -0000 @@ -298,19 +298,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. */