aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/image.c b/src/image.c
index 2db44d07c81..59347161576 100644
--- a/src/image.c
+++ b/src/image.c
@@ -145,7 +145,7 @@ static Lisp_Object QCmax_width, QCmax_height;
145 145
146#ifdef HAVE_NS 146#ifdef HAVE_NS
147/* Use with images created by ns_image_for_XPM. */ 147/* Use with images created by ns_image_for_XPM. */
148unsigned long 148static unsigned long
149XGetPixel (XImagePtr ximage, int x, int y) 149XGetPixel (XImagePtr ximage, int x, int y)
150{ 150{
151 return ns_get_pixel (ximage, x, y); 151 return ns_get_pixel (ximage, x, y);
@@ -153,7 +153,7 @@ XGetPixel (XImagePtr ximage, int x, int y)
153 153
154/* Use with images created by ns_image_for_XPM; alpha set to 1; 154/* Use with images created by ns_image_for_XPM; alpha set to 1;
155 pixel is assumed to be in RGB form. */ 155 pixel is assumed to be in RGB form. */
156void 156static void
157XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel) 157XPutPixel (XImagePtr ximage, int x, int y, unsigned long pixel)
158{ 158{
159 ns_put_pixel (ximage, x, y, pixel); 159 ns_put_pixel (ximage, x, y, pixel);
@@ -2713,10 +2713,13 @@ xbm_read_bitmap_data (struct frame *f, unsigned char *contents, unsigned char *e
2713 LA1 = xbm_scan (&s, end, buffer, &value) 2713 LA1 = xbm_scan (&s, end, buffer, &value)
2714 2714
2715#define expect(TOKEN) \ 2715#define expect(TOKEN) \
2716 if (LA1 != (TOKEN)) \ 2716 do \
2717 goto failure; \ 2717 { \
2718 else \ 2718 if (LA1 != (TOKEN)) \
2719 match () 2719 goto failure; \
2720 match (); \
2721 } \
2722 while (0)
2720 2723
2721#define expect_ident(IDENT) \ 2724#define expect_ident(IDENT) \
2722 if (LA1 == XBM_TK_IDENT && strcmp (buffer, (IDENT)) == 0) \ 2725 if (LA1 == XBM_TK_IDENT && strcmp (buffer, (IDENT)) == 0) \
@@ -3976,10 +3979,13 @@ xpm_load_image (struct frame *f,
3976 LA1 = xpm_scan (&s, end, &beg, &len) 3979 LA1 = xpm_scan (&s, end, &beg, &len)
3977 3980
3978#define expect(TOKEN) \ 3981#define expect(TOKEN) \
3979 if (LA1 != (TOKEN)) \ 3982 do \
3980 goto failure; \ 3983 { \
3981 else \ 3984 if (LA1 != (TOKEN)) \
3982 match () 3985 goto failure; \
3986 match (); \
3987 } \
3988 while (0)
3983 3989
3984#define expect_ident(IDENT) \ 3990#define expect_ident(IDENT) \
3985 if (LA1 == XPM_TK_IDENT \ 3991 if (LA1 == XPM_TK_IDENT \
@@ -4932,7 +4938,7 @@ x_build_heuristic_mask (struct frame *f, struct image *img, Lisp_Object how)
4932 int row_width; 4938 int row_width;
4933#endif /* HAVE_NTGUI */ 4939#endif /* HAVE_NTGUI */
4934 int x, y; 4940 int x, y;
4935 bool rc, use_img_background; 4941 bool use_img_background;
4936 unsigned long bg = 0; 4942 unsigned long bg = 0;
4937 4943
4938 if (img->mask) 4944 if (img->mask)
@@ -4941,9 +4947,8 @@ x_build_heuristic_mask (struct frame *f, struct image *img, Lisp_Object how)
4941#ifndef HAVE_NTGUI 4947#ifndef HAVE_NTGUI
4942#ifndef HAVE_NS 4948#ifndef HAVE_NS
4943 /* Create an image and pixmap serving as mask. */ 4949 /* Create an image and pixmap serving as mask. */
4944 rc = image_create_x_image_and_pixmap (f, img, img->width, img->height, 1, 4950 if (! image_create_x_image_and_pixmap (f, img, img->width, img->height, 1,
4945 &mask_img, 1); 4951 &mask_img, 1))
4946 if (!rc)
4947 return; 4952 return;
4948#endif /* !HAVE_NS */ 4953#endif /* !HAVE_NS */
4949#else 4954#else