[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/image.c
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] Changes to emacs/src/image.c |
Date: |
Sat, 11 Jun 2005 12:24:36 -0400 |
Index: emacs/src/image.c
diff -c emacs/src/image.c:1.26 emacs/src/image.c:1.27
*** emacs/src/image.c:1.26 Tue Jun 7 13:02:04 2005
--- emacs/src/image.c Sat Jun 11 16:24:36 2005
***************
*** 1972,1978 ****
and store its handle in *pixmap. */
*pixmap = CreateDIBSection (hdc, &((*ximg)->info),
(depth < 16) ? DIB_PAL_COLORS : DIB_RGB_COLORS,
! &((*ximg)->data), NULL, 0);
/* Realize display palette and garbage all frames. */
release_frame_dc (f, hdc);
--- 1972,1979 ----
and store its handle in *pixmap. */
*pixmap = CreateDIBSection (hdc, &((*ximg)->info),
(depth < 16) ? DIB_PAL_COLORS : DIB_RGB_COLORS,
! /* casting avoids a GCC warning */
! (void **)&((*ximg)->data), NULL, 0);
/* Realize display palette and garbage all frames. */
release_frame_dc (f, hdc);
***************
*** 5517,5523 ****
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
! IMAGE_BACKGROUND (img, f, ximg);
/* Put the image into a pixmap. */
x_put_x_image (f, ximg, img->pixmap, width, height);
--- 5518,5525 ----
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
! /* Casting avoids a GCC warning. */
! IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
/* Put the image into a pixmap. */
x_put_x_image (f, ximg, img->pixmap, width, height);
***************
*** 5843,5851 ****
tbr.bytes += sizeof (sig);
}
! /* Initialize read and info structs for PNG lib. */
! png_ptr = fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL,
! my_png_error, my_png_warning);
if (!png_ptr)
{
if (fp) fclose (fp);
--- 5845,5855 ----
tbr.bytes += sizeof (sig);
}
! /* Initialize read and info structs for PNG lib. Casting return
! value avoids a GCC warning on W32. */
! png_ptr = (png_structp)fn_png_create_read_struct (PNG_LIBPNG_VER_STRING,
! NULL, my_png_error,
! my_png_warning);
if (!png_ptr)
{
if (fp) fclose (fp);
***************
*** 5853,5859 ****
return 0;
}
! info_ptr = fn_png_create_info_struct (png_ptr);
if (!info_ptr)
{
fn_png_destroy_read_struct (&png_ptr, NULL, NULL);
--- 5857,5864 ----
return 0;
}
! /* Casting return value avoids a GCC warning on W32. */
! info_ptr = (png_infop)fn_png_create_info_struct (png_ptr);
if (!info_ptr)
{
fn_png_destroy_read_struct (&png_ptr, NULL, NULL);
***************
*** 5862,5868 ****
return 0;
}
! end_info = fn_png_create_info_struct (png_ptr);
if (!end_info)
{
fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
--- 5867,5874 ----
return 0;
}
! /* Casting return value avoids a GCC warning on W32. */
! end_info = (png_infop)fn_png_create_info_struct (png_ptr);
if (!end_info)
{
fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
***************
*** 6135,6142 ****
img->width = width;
img->height = height;
! /* Maybe fill in the background field while we have ximg handy. */
! IMAGE_BACKGROUND (img, f, ximg);
/* Put the image into the pixmap, then free the X image and its buffer. */
x_put_x_image (f, ximg, img->pixmap, width, height);
--- 6141,6149 ----
img->width = width;
img->height = height;
! /* Maybe fill in the background field while we have ximg handy.
! Casting avoids a GCC warning. */
! IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
/* Put the image into the pixmap, then free the X image and its buffer. */
x_put_x_image (f, ximg, img->pixmap, width, height);
***************
*** 6145,6153 ****
/* Same for the mask. */
if (mask_img)
{
! /* Fill in the background_transparent field while we have the mask
! handy. */
! image_background_transparent (img, f, mask_img);
x_put_x_image (f, mask_img, img->mask, img->width, img->height);
x_destroy_x_image (mask_img);
--- 6152,6160 ----
/* Same for the mask. */
if (mask_img)
{
! /* Fill in the background_transparent field while we have the
! mask handy. Casting avoids a GCC warning. */
! image_background_transparent (img, f, (XImagePtr_or_DC)mask_img);
x_put_x_image (f, mask_img, img->mask, img->width, img->height);
x_destroy_x_image (mask_img);
***************
*** 6494,6501 ****
}
/* Customize libjpeg's error handling to call my_error_exit when an
! error is detected. This function will perform a longjmp. */
! cinfo.err = fn_jpeg_std_error (&mgr.pub);
mgr.pub.error_exit = my_error_exit;
if ((rc = setjmp (mgr.setjmp_buffer)) != 0)
--- 6501,6509 ----
}
/* Customize libjpeg's error handling to call my_error_exit when an
! error is detected. This function will perform a longjmp.
! Casting return value avoids a GCC warning on W32. */
! cinfo.err = (struct jpeg_error_mgr *)fn_jpeg_std_error (&mgr.pub);
mgr.pub.error_exit = my_error_exit;
if ((rc = setjmp (mgr.setjmp_buffer)) != 0)
***************
*** 6606,6612 ****
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
! IMAGE_BACKGROUND (img, f, ximg);
/* Put the image into the pixmap. */
x_put_x_image (f, ximg, img->pixmap, width, height);
--- 6614,6621 ----
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
! /* Casting avoids a GCC warning. */
! IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
/* Put the image into the pixmap. */
x_put_x_image (f, ximg, img->pixmap, width, height);
***************
*** 6932,6939 ****
return 0;
}
! /* Try to open the image file. */
! tiff = fn_TIFFOpen (SDATA (file), "r");
if (tiff == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
--- 6941,6949 ----
return 0;
}
! /* Try to open the image file. Casting return value avoids a
! GCC warning on W32. */
! tiff = (TIFF *)fn_TIFFOpen (SDATA (file), "r");
if (tiff == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
***************
*** 6948,6961 ****
memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
! tiff = fn_TIFFClientOpen ("memory_source", "r", &memsrc,
! (TIFFReadWriteProc) tiff_read_from_memory,
! (TIFFReadWriteProc) tiff_write_from_memory,
! tiff_seek_in_memory,
! tiff_close_memory,
! tiff_size_of_memory,
! tiff_mmap_memory,
! tiff_unmap_memory);
if (!tiff)
{
--- 6958,6972 ----
memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
! /* Casting return value avoids a GCC warning on W32. */
! tiff = (TIFF *)fn_TIFFClientOpen ("memory_source", "r", &memsrc,
! (TIFFReadWriteProc)
tiff_read_from_memory,
! (TIFFReadWriteProc)
tiff_write_from_memory,
! tiff_seek_in_memory,
! tiff_close_memory,
! tiff_size_of_memory,
! tiff_mmap_memory,
! tiff_unmap_memory);
if (!tiff)
{
***************
*** 7018,7024 ****
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
! IMAGE_BACKGROUND (img, f, ximg);
/* Put the image into the pixmap, then free the X image and its buffer. */
x_put_x_image (f, ximg, img->pixmap, width, height);
--- 7029,7036 ----
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
! /* Casting avoids a GCC warning on W32. */
! IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
/* Put the image into the pixmap, then free the X image and its buffer. */
x_put_x_image (f, ximg, img->pixmap, width, height);
***************
*** 7126,7131 ****
--- 7138,7148 ----
#ifdef HAVE_GIF
#if defined (HAVE_NTGUI) || defined (MAC_OS)
+ /* winuser.h might define DrawText to DrawTextA or DrawTextW.
+ Undefine before redefining to avoid a preprocessor warning. */
+ #ifdef DrawText
+ #undef DrawText
+ #endif
/* avoid conflict with QuickdrawText.h */
#define DrawText gif_DrawText
#include <gif_lib.h>
***************
*** 7239,7246 ****
return 0;
}
! /* Open the GIF file. */
! gif = fn_DGifOpenFileName (SDATA (file));
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
--- 7256,7264 ----
return 0;
}
! /* Open the GIF file. Casting return value avoids a GCC warning
! on W32. */
! gif = (GifFileType *)fn_DGifOpenFileName (SDATA (file));
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
***************
*** 7256,7262 ****
memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
! gif = fn_DGifOpen(&memsrc, gif_read_from_memory);
if (!gif)
{
image_error ("Cannot open memory source `%s'", img->spec, Qnil);
--- 7274,7281 ----
memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
! /* Casting return value avoids a GCC warning on W32. */
! gif = (GifFileType *)fn_DGifOpen(&memsrc, gif_read_from_memory);
if (!gif)
{
image_error ("Cannot open memory source `%s'", img->spec, Qnil);
***************
*** 7390,7396 ****
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
! IMAGE_BACKGROUND (img, f, ximg);
/* Put the image into the pixmap, then free the X image and its buffer. */
x_put_x_image (f, ximg, img->pixmap, width, height);
--- 7409,7416 ----
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
! /* Casting avoids a GCC warning. */
! IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg);
/* Put the image into the pixmap, then free the X image and its buffer. */
x_put_x_image (f, ximg, img->pixmap, width, height);
***************
*** 7400,7406 ****
return 1;
}
! #else
#ifdef MAC_OS
static int
--- 7420,7426 ----
return 1;
}
! #else /* !HAVE_GIF */
#ifdef MAC_OS
static int