aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/image.c b/src/image.c
index 4877d262d00..0854d017163 100644
--- a/src/image.c
+++ b/src/image.c
@@ -323,7 +323,7 @@ x_create_bitmap_from_file (struct frame *f, Lisp_Object file)
323 dpyinfo->bitmaps[id - 1].depth = 1; 323 dpyinfo->bitmaps[id - 1].depth = 1;
324 dpyinfo->bitmaps[id - 1].height = ns_image_width (bitmap); 324 dpyinfo->bitmaps[id - 1].height = ns_image_width (bitmap);
325 dpyinfo->bitmaps[id - 1].width = ns_image_height (bitmap); 325 dpyinfo->bitmaps[id - 1].width = ns_image_height (bitmap);
326 strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); 326 strcpy (dpyinfo->bitmaps[id - 1].file, SSDATA (file));
327 return id; 327 return id;
328#endif 328#endif
329 329
@@ -3964,7 +3964,7 @@ xpm_load_image (struct frame *f,
3964 { 3964 {
3965 if (xstrcasecmp (SSDATA (XCDR (specified_color)), "None") == 0) 3965 if (xstrcasecmp (SSDATA (XCDR (specified_color)), "None") == 0)
3966 color_val = Qt; 3966 color_val = Qt;
3967 else if (x_defined_color (f, SDATA (XCDR (specified_color)), 3967 else if (x_defined_color (f, SSDATA (XCDR (specified_color)),
3968 &cdef, 0)) 3968 &cdef, 0))
3969 color_val = make_number (cdef.pixel); 3969 color_val = make_number (cdef.pixel);
3970 } 3970 }
@@ -4039,7 +4039,6 @@ xpm_load_image (struct frame *f,
4039 4039
4040 failure: 4040 failure:
4041 image_error ("Invalid XPM file (%s)", img->spec, Qnil); 4041 image_error ("Invalid XPM file (%s)", img->spec, Qnil);
4042 error:
4043 x_destroy_x_image (ximg); 4042 x_destroy_x_image (ximg);
4044 x_destroy_x_image (mask_img); 4043 x_destroy_x_image (mask_img);
4045 x_clear_image (f, img); 4044 x_clear_image (f, img);
@@ -4072,7 +4071,7 @@ xpm_load (struct frame *f,
4072 return 0; 4071 return 0;
4073 } 4072 }
4074 4073
4075 contents = slurp_file (SDATA (file), &size); 4074 contents = slurp_file (SSDATA (file), &size);
4076 if (contents == NULL) 4075 if (contents == NULL)
4077 { 4076 {
4078 image_error ("Error loading XPM image `%s'", img->spec, Qnil); 4077 image_error ("Error loading XPM image `%s'", img->spec, Qnil);
@@ -4456,9 +4455,8 @@ x_to_xcolors (struct frame *f, struct image *img, int rgb_p)
4456 p = colors; 4455 p = colors;
4457 for (y = 0; y < img->height; ++y) 4456 for (y = 0; y < img->height; ++y)
4458 { 4457 {
4459 XColor *row = p;
4460
4461#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) 4458#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI)
4459 XColor *row = p;
4462 for (x = 0; x < img->width; ++x, ++p) 4460 for (x = 0; x < img->width; ++x, ++p)
4463 p->pixel = GET_PIXEL (ximg, x, y); 4461 p->pixel = GET_PIXEL (ximg, x, y);
4464 if (rgb_p) 4462 if (rgb_p)
@@ -4741,14 +4739,12 @@ x_disable_image (struct frame *f, struct image *img)
4741 if (n_planes < 2 || cross_disabled_images) 4739 if (n_planes < 2 || cross_disabled_images)
4742 { 4740 {
4743#ifndef HAVE_NTGUI 4741#ifndef HAVE_NTGUI
4744 Display *dpy = FRAME_X_DISPLAY (f);
4745 GC gc;
4746
4747#ifndef HAVE_NS /* TODO: NS support, however this not needed for toolbars */ 4742#ifndef HAVE_NS /* TODO: NS support, however this not needed for toolbars */
4748 4743
4749#define MaskForeground(f) WHITE_PIX_DEFAULT (f) 4744#define MaskForeground(f) WHITE_PIX_DEFAULT (f)
4750 4745
4751 gc = XCreateGC (dpy, img->pixmap, 0, NULL); 4746 Display *dpy = FRAME_X_DISPLAY (f);
4747 GC gc = XCreateGC (dpy, img->pixmap, 0, NULL);
4752 XSetForeground (dpy, gc, BLACK_PIX_DEFAULT (f)); 4748 XSetForeground (dpy, gc, BLACK_PIX_DEFAULT (f));
4753 XDrawLine (dpy, img->pixmap, gc, 0, 0, 4749 XDrawLine (dpy, img->pixmap, gc, 0, 0,
4754 img->width - 1, img->height - 1); 4750 img->width - 1, img->height - 1);