From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#13981: 24.3.50; Incorrect declaration of image_background Date: Sat, 16 Mar 2013 15:57:09 -0400 Message-ID: <5144CE95.6010600@cornell.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000701070100080404000402" X-Trace: ger.gmane.org 1363482581 7322 80.91.229.3 (17 Mar 2013 01:09:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Mar 2013 01:09:41 +0000 (UTC) To: 13981@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Mar 17 02:10:06 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UH26w-0000gz-Cb for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Mar 2013 02:10:06 +0100 Original-Received: from localhost ([::1]:52137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH26Z-0002NU-C7 for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 Mar 2013 21:09:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH26U-0002N9-3J for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2013 21:09:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UH26T-0007DB-0z for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2013 21:09:38 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH26S-0007D4-U8 for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2013 21:09:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UH27p-0006S3-RC for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2013 21:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Mar 2013 01:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13981 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136348260324726 (code B ref -1); Sun, 17 Mar 2013 01:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Mar 2013 01:10:03 +0000 Original-Received: from localhost ([127.0.0.1]:58239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UH26t-0006Ql-4n for submit@debbugs.gnu.org; Sat, 16 Mar 2013 21:10:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56962) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UH26p-0006QD-Qb for submit@debbugs.gnu.org; Sat, 16 Mar 2013 21:10:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UH25J-0006sO-RE for submit@debbugs.gnu.org; Sat, 16 Mar 2013 21:08:29 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:33388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH25J-0006sK-OI for submit@debbugs.gnu.org; Sat, 16 Mar 2013 21:08:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40078) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH25I-00026v-KO for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2013 21:08:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UH25H-0006rr-Du for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2013 21:08:24 -0400 Original-Received: from limestone8.mail.cornell.edu ([128.253.83.168]:38530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UH25H-0006rb-99 for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2013 21:08:23 -0400 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limestone8.mail.cornell.edu (8.14.4/8.14.4) with ESMTP id r2H18IXV014422 for ; Sat, 16 Mar 2013 21:08:18 -0400 (EDT) Original-Received: from [192.168.1.6] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id r2H18H9M014585 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 16 Mar 2013 21:08:18 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:72605 Archived-At: This is a multi-part message in MIME format. --------------000701070100080404000402 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit image_background() is declared in dispextern.h with a return type of `unsigned long'. But it is defined in image.c with a return type of RGB_PIXEL_COLOR, where the latter is a platform-dependent macro defined in image.c. By luck, this doesn't cause any problems in the currently-supported platforms. But it will cause problems in the cygw32 build on 64-bit Cygwin (which is currently under development). The attached patch fixes this by moving the definition of RGB_PIXEL_COLOR to dispextern.h and changing the return type in the declaration. OK to apply? Ken --------------000701070100080404000402 Content-Type: text/plain; charset=windows-1252; name="image_background.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="image_background.patch" === modified file 'src/dispextern.h' --- src/dispextern.h 2013-01-02 16:13:04 +0000 +++ src/dispextern.h 2013-03-16 19:55:58 +0000 @@ -3160,6 +3160,14 @@ #ifdef HAVE_WINDOW_SYSTEM +#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS) +#define RGB_PIXEL_COLOR unsigned long +#endif + +#ifdef HAVE_NTGUI +#define RGB_PIXEL_COLOR COLORREF +#endif + extern int x_bitmap_height (struct frame *, ptrdiff_t); extern int x_bitmap_width (struct frame *, ptrdiff_t); extern ptrdiff_t x_bitmap_pixmap (struct frame *, ptrdiff_t); @@ -3186,7 +3194,7 @@ void prepare_image_for_display (struct frame *, struct image *); ptrdiff_t lookup_image (struct frame *, Lisp_Object); -unsigned long image_background (struct image *, struct frame *, +RGB_PIXEL_COLOR image_background (struct image *, struct frame *, XImagePtr_or_DC ximg); int image_background_transparent (struct image *, struct frame *, XImagePtr_or_DC mask); === modified file 'src/image.c' --- src/image.c 2013-03-04 17:35:29 +0000 +++ src/image.c 2013-03-16 19:17:45 +0000 @@ -68,8 +68,6 @@ #define GET_PIXEL(ximg, x, y) XGetPixel (ximg, x, y) #define NO_PIXMAP None -#define RGB_PIXEL_COLOR unsigned long - #define PIX_MASK_RETAIN 0 #define PIX_MASK_DRAW 1 #endif /* HAVE_X_WINDOWS */ @@ -88,8 +86,6 @@ #define GET_PIXEL(ximg, x, y) GetPixel (ximg, x, y) #define NO_PIXMAP 0 -#define RGB_PIXEL_COLOR COLORREF - #define PIX_MASK_RETAIN 0 #define PIX_MASK_DRAW 1 @@ -110,7 +106,6 @@ #define GET_PIXEL(ximg, x, y) XGetPixel (ximg, x, y) #define NO_PIXMAP 0 -#define RGB_PIXEL_COLOR unsigned long #define ZPixmap 0 #define PIX_MASK_RETAIN 0 --------------000701070100080404000402--