From: Ken Brown <kbrown@cornell.edu>
To: 13981@debbugs.gnu.org
Subject: bug#13981: 24.3.50; Incorrect declaration of image_background
Date: Sat, 16 Mar 2013 15:57:09 -0400 [thread overview]
Message-ID: <5144CE95.6010600@cornell.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]
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
[-- Attachment #2: image_background.patch --]
[-- Type: text/plain, Size: 1689 bytes --]
=== 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
next reply other threads:[~2013-03-16 19:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-16 19:57 Ken Brown [this message]
2013-03-17 3:48 ` bug#13981: 24.3.50; Incorrect declaration of image_background Eli Zaretskii
2013-03-17 14:36 ` Ken Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5144CE95.6010600@cornell.edu \
--to=kbrown@cornell.edu \
--cc=13981@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.