GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
ptrdiff_t
x_create_bitmap_from_file (struct frame *f, Lisp_Object file)
{
- Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
-
#ifdef HAVE_NTGUI
return -1; /* W32_TODO : bitmap support */
#endif /* HAVE_NTGUI */
+ Display_Info *dpyinfo = FRAME_DISPLAY_INFO (f);
+
#ifdef HAVE_NS
ptrdiff_t id;
void *bitmap = ns_image_from_file (file);
four_corners_best (XImagePtr_or_DC ximg, int *corners,
unsigned long width, unsigned long height)
{
- RGB_PIXEL_COLOR corner_pixels[4], best IF_LINT (= 0);
+ RGB_PIXEL_COLOR corner_pixels[4];
+ RGB_PIXEL_COLOR best UNINIT;
int i, best_count;
if (corners && corners[BOT_CORNER] >= 0)
struct image_cache *c = FRAME_IMAGE_CACHE (f);
ptrdiff_t i;
+ if (!c)
+ c = FRAME_IMAGE_CACHE (f) = make_image_cache ();
+
/* Find a free slot in c->images. */
for (i = 0; i < c->used; ++i)
if (c->images[i] == NULL)
happens, e.g., under Auto Image File Mode.) 'openp'
didn't open the file, so we should, because the caller
expects that. */
- fd = emacs_open (SSDATA (file_found), O_RDONLY | O_BINARY, 0);
+ fd = emacs_open (SSDATA (file_found), O_RDONLY, 0);
}
}
else /* fd < 0, but not -2 */
#define XColor xpm_XColor
#define XImage xpm_XImage
#define Display xpm_Display
-#define PIXEL_ALREADY_TYPEDEFED
+#ifdef CYGWIN
+#include "noX/xpm.h"
+#else /* not CYGWIN */
#include "X11/xpm.h"
+#endif /* not CYGWIN */
#undef FOR_MSW
#undef XColor
#undef XImage
#undef Display
-#undef PIXEL_ALREADY_TYPEDEFED
-#else
+#else /* not HAVE_NTGUI */
#include "X11/xpm.h"
-#endif /* HAVE_NTGUI */
+#endif /* not HAVE_NTGUI */
#endif /* HAVE_XPM */
#if defined (HAVE_XPM) || defined (HAVE_NS)
#endif
/* XpmReadFileToPixmap is not available in the Windows port of
libxpm. But XpmReadFileToImage almost does what we want. */
- rc = XpmReadFileToImage (&hdc, SDATA (file),
+ rc = XpmReadFileToImage (&hdc, SSDATA (file),
&xpm_image, &xpm_mask,
&attrs);
#else
#ifdef HAVE_NTGUI
/* XpmCreatePixmapFromBuffer is not available in the Windows port
of libxpm. But XpmCreateImageFromBuffer almost does what we want. */
- rc = XpmCreateImageFromBuffer (&hdc, SDATA (buffer),
+ rc = XpmCreateImageFromBuffer (&hdc, SSDATA (buffer),
&xpm_image, &xpm_mask,
&attrs);
#else
png_load_body (struct frame *f, struct image *img, struct png_load_context *c)
{
Lisp_Object specified_file;
- Lisp_Object specified_data;
+ Lisp_Object NONVOLATILE specified_data;
+ FILE *NONVOLATILE fp = NULL;
int x, y;
ptrdiff_t i;
png_struct *png_ptr;
png_info *info_ptr = NULL, *end_info = NULL;
- FILE *fp = NULL;
png_byte sig[8];
png_byte *pixels = NULL;
png_byte **rows = NULL;
/* Find out what file to load. */
specified_file = image_spec_value (img->spec, QCfile, NULL);
specified_data = image_spec_value (img->spec, QCdata, NULL);
- IF_LINT (Lisp_Object volatile specified_data_volatile = specified_data);
if (NILP (specified_data))
{
return 0;
}
- /* Silence a bogus diagnostic; see GCC bug 54561. */
- IF_LINT (fp = c->fp);
- IF_LINT (specified_data = specified_data_volatile);
-
/* Read image info. */
if (!NILP (specified_data))
png_set_read_fn (png_ptr, &tbr, png_read_from_memory);
struct my_jpeg_error_mgr *mgr)
{
Lisp_Object specified_file;
- Lisp_Object specified_data;
- /* The 'volatile' silences a bogus diagnostic; see GCC bug 54561. */
- FILE * IF_LINT (volatile) fp = NULL;
+ Lisp_Object NONVOLATILE specified_data;
+ FILE *volatile fp = NULL;
JSAMPARRAY buffer;
int row_stride, x, y;
unsigned long *colors;
/* Open the JPEG file. */
specified_file = image_spec_value (img->spec, QCfile, NULL);
specified_data = image_spec_value (img->spec, QCdata, NULL);
- IF_LINT (Lisp_Object volatile specified_data_volatile = specified_data);
if (NILP (specified_data))
{
return 0;
}
- /* Silence a bogus diagnostic; see GCC bug 54561. */
- IF_LINT (specified_data = specified_data_volatile);
-
/* Create the JPEG decompression object. Let it read from fp.
Read the JPEG image header. */
jpeg_CreateDecompress (&mgr->cinfo, JPEG_LIB_VERSION, sizeof *&mgr->cinfo);
{
img->lisp_data
= Fcons (make_number (ext->Function),
- Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount),
+ Fcons (make_unibyte_string ((char *) ext->Bytes,
+ ext->ByteCount),
img->lisp_data));
if (ext->Function == GIF_LOCAL_DESCRIPTOR_EXTENSION
&& ext->ByteCount == 4)