diff options
| author | Andreas Schwab | 2011-01-30 00:56:33 +0100 |
|---|---|---|
| committer | Andreas Schwab | 2011-01-30 00:56:33 +0100 |
| commit | df61c79005470fad666b3c3ae257eef1e06bd079 (patch) | |
| tree | 08ee46acbb8455740257536bca5f17fe6e06dd8e | |
| parent | c2e79cb408e118b45ca4566f806d7fb81bb28a4e (diff) | |
| download | emacs-df61c79005470fad666b3c3ae257eef1e06bd079.tar.gz emacs-df61c79005470fad666b3c3ae257eef1e06bd079.zip | |
Fix use of pointers to image library functions
* src/image.c (DEF_IMGLIB_FN): Add parameter rettype, use it instead
of int. All uses adjusted.
(PNG_JMPBUF, png_load, jpeg_load, tiff_load, gif_load)
(svg_load_image): Remove casts.
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/image.c | 197 |
2 files changed, 100 insertions, 104 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1d14be1ab70..af76f670e6c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2011-01-29 Andreas Schwab <schwab@linux-m68k.org> | ||
| 2 | |||
| 3 | * image.c (DEF_IMGLIB_FN): Add parameter rettype, use it instead | ||
| 4 | of int. All uses adjusted. | ||
| 5 | (PNG_JMPBUF, png_load, jpeg_load, tiff_load, gif_load) | ||
| 6 | (svg_load_image): Remove casts. | ||
| 7 | |||
| 1 | 2011-01-29 Chong Yidong <cyd@stupidchicken.com> | 8 | 2011-01-29 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 9 | ||
| 3 | * image.c (fn_png_longjmp, fn_png_set_longjmp_fn): New png | 10 | * image.c (fn_png_longjmp, fn_png_set_longjmp_fn): New png |
diff --git a/src/image.c b/src/image.c index 91b33c45507..b814b795fab 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -1977,7 +1977,7 @@ mark_image_cache (struct image_cache *c) | |||
| 1977 | #ifdef HAVE_NTGUI | 1977 | #ifdef HAVE_NTGUI |
| 1978 | 1978 | ||
| 1979 | /* Macro for defining functions that will be loaded from image DLLs. */ | 1979 | /* Macro for defining functions that will be loaded from image DLLs. */ |
| 1980 | #define DEF_IMGLIB_FN(func) int (FAR CDECL *fn_##func)() | 1980 | #define DEF_IMGLIB_FN(rettype, func) rettype (FAR CDECL *fn_##func)() |
| 1981 | 1981 | ||
| 1982 | /* Macro for loading those image functions from the library. */ | 1982 | /* Macro for loading those image functions from the library. */ |
| 1983 | #define LOAD_IMGLIB_FN(lib,func) { \ | 1983 | #define LOAD_IMGLIB_FN(lib,func) { \ |
| @@ -3387,10 +3387,10 @@ xpm_free_colors (dpy, cmap, pixels, npixels, closure) | |||
| 3387 | 3387 | ||
| 3388 | /* XPM library details. */ | 3388 | /* XPM library details. */ |
| 3389 | 3389 | ||
| 3390 | DEF_IMGLIB_FN (XpmFreeAttributes); | 3390 | DEF_IMGLIB_FN (void, XpmFreeAttributes); |
| 3391 | DEF_IMGLIB_FN (XpmCreateImageFromBuffer); | 3391 | DEF_IMGLIB_FN (int, XpmCreateImageFromBuffer); |
| 3392 | DEF_IMGLIB_FN (XpmReadFileToImage); | 3392 | DEF_IMGLIB_FN (int, XpmReadFileToImage); |
| 3393 | DEF_IMGLIB_FN (XImageFree); | 3393 | DEF_IMGLIB_FN (void, XImageFree); |
| 3394 | 3394 | ||
| 3395 | static int | 3395 | static int |
| 3396 | init_xpm_functions (Lisp_Object libraries) | 3396 | init_xpm_functions (Lisp_Object libraries) |
| @@ -5568,31 +5568,31 @@ png_image_p (object) | |||
| 5568 | #ifdef HAVE_NTGUI | 5568 | #ifdef HAVE_NTGUI |
| 5569 | /* PNG library details. */ | 5569 | /* PNG library details. */ |
| 5570 | 5570 | ||
| 5571 | DEF_IMGLIB_FN (png_get_io_ptr); | 5571 | DEF_IMGLIB_FN (png_voidp, png_get_io_ptr); |
| 5572 | DEF_IMGLIB_FN (png_sig_cmp); | 5572 | DEF_IMGLIB_FN (int, png_sig_cmp); |
| 5573 | DEF_IMGLIB_FN (png_create_read_struct); | 5573 | DEF_IMGLIB_FN (png_structp, png_create_read_struct); |
| 5574 | DEF_IMGLIB_FN (png_create_info_struct); | 5574 | DEF_IMGLIB_FN (png_infop, png_create_info_struct); |
| 5575 | DEF_IMGLIB_FN (png_destroy_read_struct); | 5575 | DEF_IMGLIB_FN (void, png_destroy_read_struct); |
| 5576 | DEF_IMGLIB_FN (png_set_read_fn); | 5576 | DEF_IMGLIB_FN (void, png_set_read_fn); |
| 5577 | DEF_IMGLIB_FN (png_set_sig_bytes); | 5577 | DEF_IMGLIB_FN (void, png_set_sig_bytes); |
| 5578 | DEF_IMGLIB_FN (png_read_info); | 5578 | DEF_IMGLIB_FN (void, png_read_info); |
| 5579 | DEF_IMGLIB_FN (png_get_IHDR); | 5579 | DEF_IMGLIB_FN (png_uint_32, png_get_IHDR); |
| 5580 | DEF_IMGLIB_FN (png_get_valid); | 5580 | DEF_IMGLIB_FN (png_uint_32, png_get_valid); |
| 5581 | DEF_IMGLIB_FN (png_set_strip_16); | 5581 | DEF_IMGLIB_FN (void, png_set_strip_16); |
| 5582 | DEF_IMGLIB_FN (png_set_expand); | 5582 | DEF_IMGLIB_FN (void, png_set_expand); |
| 5583 | DEF_IMGLIB_FN (png_set_gray_to_rgb); | 5583 | DEF_IMGLIB_FN (void, png_set_gray_to_rgb); |
| 5584 | DEF_IMGLIB_FN (png_set_background); | 5584 | DEF_IMGLIB_FN (void, png_set_background); |
| 5585 | DEF_IMGLIB_FN (png_get_bKGD); | 5585 | DEF_IMGLIB_FN (png_uint_32, png_get_bKGD); |
| 5586 | DEF_IMGLIB_FN (png_read_update_info); | 5586 | DEF_IMGLIB_FN (void, png_read_update_info); |
| 5587 | DEF_IMGLIB_FN (png_get_channels); | 5587 | DEF_IMGLIB_FN (png_byte, png_get_channels); |
| 5588 | DEF_IMGLIB_FN (png_get_rowbytes); | 5588 | DEF_IMGLIB_FN (png_size_t, png_get_rowbytes); |
| 5589 | DEF_IMGLIB_FN (png_read_image); | 5589 | DEF_IMGLIB_FN (void, png_read_image); |
| 5590 | DEF_IMGLIB_FN (png_read_end); | 5590 | DEF_IMGLIB_FN (void, png_read_end); |
| 5591 | DEF_IMGLIB_FN (png_error); | 5591 | DEF_IMGLIB_FN (void, png_error); |
| 5592 | 5592 | ||
| 5593 | #if (PNG_LIBPNG_VER >= 10500) | 5593 | #if (PNG_LIBPNG_VER >= 10500) |
| 5594 | DEF_IMGLIB_FN (png_longjmp); | 5594 | DEF_IMGLIB_FN (void, png_longjmp); |
| 5595 | DEF_IMGLIB_FN (png_set_longjmp_fn); | 5595 | DEF_IMGLIB_FN (jmp_buf *, png_set_longjmp_fn); |
| 5596 | #endif /* libpng version >= 1.5 */ | 5596 | #endif /* libpng version >= 1.5 */ |
| 5597 | 5597 | ||
| 5598 | static int | 5598 | static int |
| @@ -5669,13 +5669,10 @@ init_png_functions (Lisp_Object libraries) | |||
| 5669 | #define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1)) | 5669 | #define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1)) |
| 5670 | #define PNG_JMPBUF(ptr) ((ptr)->jmpbuf) | 5670 | #define PNG_JMPBUF(ptr) ((ptr)->jmpbuf) |
| 5671 | #else | 5671 | #else |
| 5672 | /* In libpng version 1.5, the jmpbuf member is hidden. | 5672 | /* In libpng version 1.5, the jmpbuf member is hidden. (Bug#7908) */ |
| 5673 | We need the extra cast for PNG_JMPBUF because, for Windows, | ||
| 5674 | DEF_IMGLIB_FN defines the return value of fn_png_set_longjmp_fn to | ||
| 5675 | be int (Bug#7908). */ | ||
| 5676 | #define PNG_LONGJMP(ptr) (fn_png_longjmp ((ptr), 1)) | 5673 | #define PNG_LONGJMP(ptr) (fn_png_longjmp ((ptr), 1)) |
| 5677 | #define PNG_JMPBUF(ptr) \ | 5674 | #define PNG_JMPBUF(ptr) \ |
| 5678 | (*(jmp_buf *)(fn_png_set_longjmp_fn((ptr), longjmp, sizeof (jmp_buf)))) | 5675 | (*fn_png_set_longjmp_fn((ptr), longjmp, sizeof (jmp_buf))) |
| 5679 | #endif | 5676 | #endif |
| 5680 | 5677 | ||
| 5681 | /* Error and warning handlers installed when the PNG library | 5678 | /* Error and warning handlers installed when the PNG library |
| @@ -5832,11 +5829,10 @@ png_load (f, img) | |||
| 5832 | tbr.bytes += sizeof (sig); | 5829 | tbr.bytes += sizeof (sig); |
| 5833 | } | 5830 | } |
| 5834 | 5831 | ||
| 5835 | /* Initialize read and info structs for PNG lib. Casting return | 5832 | /* Initialize read and info structs for PNG lib. */ |
| 5836 | value avoids a GCC warning on W32. */ | 5833 | png_ptr = fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, |
| 5837 | png_ptr = (png_structp)fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, | 5834 | NULL, my_png_error, |
| 5838 | NULL, my_png_error, | 5835 | my_png_warning); |
| 5839 | my_png_warning); | ||
| 5840 | if (!png_ptr) | 5836 | if (!png_ptr) |
| 5841 | { | 5837 | { |
| 5842 | if (fp) fclose (fp); | 5838 | if (fp) fclose (fp); |
| @@ -5844,8 +5840,7 @@ png_load (f, img) | |||
| 5844 | return 0; | 5840 | return 0; |
| 5845 | } | 5841 | } |
| 5846 | 5842 | ||
| 5847 | /* Casting return value avoids a GCC warning on W32. */ | 5843 | info_ptr = fn_png_create_info_struct (png_ptr); |
| 5848 | info_ptr = (png_infop)fn_png_create_info_struct (png_ptr); | ||
| 5849 | if (!info_ptr) | 5844 | if (!info_ptr) |
| 5850 | { | 5845 | { |
| 5851 | fn_png_destroy_read_struct (&png_ptr, NULL, NULL); | 5846 | fn_png_destroy_read_struct (&png_ptr, NULL, NULL); |
| @@ -5854,8 +5849,7 @@ png_load (f, img) | |||
| 5854 | return 0; | 5849 | return 0; |
| 5855 | } | 5850 | } |
| 5856 | 5851 | ||
| 5857 | /* Casting return value avoids a GCC warning on W32. */ | 5852 | end_info = fn_png_create_info_struct (png_ptr); |
| 5858 | end_info = (png_infop)fn_png_create_info_struct (png_ptr); | ||
| 5859 | if (!end_info) | 5853 | if (!end_info) |
| 5860 | { | 5854 | { |
| 5861 | fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL); | 5855 | fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL); |
| @@ -6222,14 +6216,14 @@ jpeg_image_p (object) | |||
| 6222 | #ifdef HAVE_NTGUI | 6216 | #ifdef HAVE_NTGUI |
| 6223 | 6217 | ||
| 6224 | /* JPEG library details. */ | 6218 | /* JPEG library details. */ |
| 6225 | DEF_IMGLIB_FN (jpeg_CreateDecompress); | 6219 | DEF_IMGLIB_FN (void, jpeg_CreateDecompress); |
| 6226 | DEF_IMGLIB_FN (jpeg_start_decompress); | 6220 | DEF_IMGLIB_FN (boolean, jpeg_start_decompress); |
| 6227 | DEF_IMGLIB_FN (jpeg_finish_decompress); | 6221 | DEF_IMGLIB_FN (boolean, jpeg_finish_decompress); |
| 6228 | DEF_IMGLIB_FN (jpeg_destroy_decompress); | 6222 | DEF_IMGLIB_FN (void, jpeg_destroy_decompress); |
| 6229 | DEF_IMGLIB_FN (jpeg_read_header); | 6223 | DEF_IMGLIB_FN (int, jpeg_read_header); |
| 6230 | DEF_IMGLIB_FN (jpeg_read_scanlines); | 6224 | DEF_IMGLIB_FN (JDIMENSION, jpeg_read_scanlines); |
| 6231 | DEF_IMGLIB_FN (jpeg_std_error); | 6225 | DEF_IMGLIB_FN (struct jpeg_error_mgr *, jpeg_std_error); |
| 6232 | DEF_IMGLIB_FN (jpeg_resync_to_restart); | 6226 | DEF_IMGLIB_FN (boolean, jpeg_resync_to_restart); |
| 6233 | 6227 | ||
| 6234 | static int | 6228 | static int |
| 6235 | init_jpeg_functions (Lisp_Object libraries) | 6229 | init_jpeg_functions (Lisp_Object libraries) |
| @@ -6547,9 +6541,8 @@ jpeg_load (f, img) | |||
| 6547 | } | 6541 | } |
| 6548 | 6542 | ||
| 6549 | /* Customize libjpeg's error handling to call my_error_exit when an | 6543 | /* Customize libjpeg's error handling to call my_error_exit when an |
| 6550 | error is detected. This function will perform a longjmp. | 6544 | error is detected. This function will perform a longjmp. */ |
| 6551 | Casting return value avoids a GCC warning on W32. */ | 6545 | cinfo.err = fn_jpeg_std_error (&mgr.pub); |
| 6552 | cinfo.err = (struct jpeg_error_mgr *)fn_jpeg_std_error (&mgr.pub); | ||
| 6553 | mgr.pub.error_exit = my_error_exit; | 6546 | mgr.pub.error_exit = my_error_exit; |
| 6554 | 6547 | ||
| 6555 | if ((rc = setjmp (mgr.setjmp_buffer)) != 0) | 6548 | if ((rc = setjmp (mgr.setjmp_buffer)) != 0) |
| @@ -6777,14 +6770,14 @@ tiff_image_p (object) | |||
| 6777 | #ifdef HAVE_NTGUI | 6770 | #ifdef HAVE_NTGUI |
| 6778 | 6771 | ||
| 6779 | /* TIFF library details. */ | 6772 | /* TIFF library details. */ |
| 6780 | DEF_IMGLIB_FN (TIFFSetErrorHandler); | 6773 | DEF_IMGLIB_FN (TIFFErrorHandler, TIFFSetErrorHandler); |
| 6781 | DEF_IMGLIB_FN (TIFFSetWarningHandler); | 6774 | DEF_IMGLIB_FN (TIFFErrorHandler, TIFFSetWarningHandler); |
| 6782 | DEF_IMGLIB_FN (TIFFOpen); | 6775 | DEF_IMGLIB_FN (TIFF *, TIFFOpen); |
| 6783 | DEF_IMGLIB_FN (TIFFClientOpen); | 6776 | DEF_IMGLIB_FN (TIFF *, TIFFClientOpen); |
| 6784 | DEF_IMGLIB_FN (TIFFGetField); | 6777 | DEF_IMGLIB_FN (int, TIFFGetField); |
| 6785 | DEF_IMGLIB_FN (TIFFReadRGBAImage); | 6778 | DEF_IMGLIB_FN (int, TIFFReadRGBAImage); |
| 6786 | DEF_IMGLIB_FN (TIFFClose); | 6779 | DEF_IMGLIB_FN (void, TIFFClose); |
| 6787 | DEF_IMGLIB_FN (TIFFSetDirectory); | 6780 | DEF_IMGLIB_FN (int, TIFFSetDirectory); |
| 6788 | 6781 | ||
| 6789 | static int | 6782 | static int |
| 6790 | init_tiff_functions (Lisp_Object libraries) | 6783 | init_tiff_functions (Lisp_Object libraries) |
| @@ -6994,9 +6987,8 @@ tiff_load (f, img) | |||
| 6994 | return 0; | 6987 | return 0; |
| 6995 | } | 6988 | } |
| 6996 | 6989 | ||
| 6997 | /* Try to open the image file. Casting return value avoids a | 6990 | /* Try to open the image file. */ |
| 6998 | GCC warning on W32. */ | 6991 | tiff = fn_TIFFOpen (SDATA (file), "r"); |
| 6999 | tiff = (TIFF *)fn_TIFFOpen (SDATA (file), "r"); | ||
| 7000 | if (tiff == NULL) | 6992 | if (tiff == NULL) |
| 7001 | { | 6993 | { |
| 7002 | image_error ("Cannot open `%s'", file, Qnil); | 6994 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -7011,15 +7003,14 @@ tiff_load (f, img) | |||
| 7011 | memsrc.len = SBYTES (specified_data); | 7003 | memsrc.len = SBYTES (specified_data); |
| 7012 | memsrc.index = 0; | 7004 | memsrc.index = 0; |
| 7013 | 7005 | ||
| 7014 | /* Casting return value avoids a GCC warning on W32. */ | 7006 | tiff = fn_TIFFClientOpen ("memory_source", "r", &memsrc, |
| 7015 | tiff = (TIFF *)fn_TIFFClientOpen ("memory_source", "r", &memsrc, | 7007 | (TIFFReadWriteProc) tiff_read_from_memory, |
| 7016 | (TIFFReadWriteProc) tiff_read_from_memory, | 7008 | (TIFFReadWriteProc) tiff_write_from_memory, |
| 7017 | (TIFFReadWriteProc) tiff_write_from_memory, | 7009 | tiff_seek_in_memory, |
| 7018 | tiff_seek_in_memory, | 7010 | tiff_close_memory, |
| 7019 | tiff_close_memory, | 7011 | tiff_size_of_memory, |
| 7020 | tiff_size_of_memory, | 7012 | tiff_mmap_memory, |
| 7021 | tiff_mmap_memory, | 7013 | tiff_unmap_memory); |
| 7022 | tiff_unmap_memory); | ||
| 7023 | 7014 | ||
| 7024 | if (!tiff) | 7015 | if (!tiff) |
| 7025 | { | 7016 | { |
| @@ -7257,10 +7248,10 @@ gif_image_p (object) | |||
| 7257 | #ifdef HAVE_NTGUI | 7248 | #ifdef HAVE_NTGUI |
| 7258 | 7249 | ||
| 7259 | /* GIF library details. */ | 7250 | /* GIF library details. */ |
| 7260 | DEF_IMGLIB_FN (DGifCloseFile); | 7251 | DEF_IMGLIB_FN (int, DGifCloseFile); |
| 7261 | DEF_IMGLIB_FN (DGifSlurp); | 7252 | DEF_IMGLIB_FN (int, DGifSlurp); |
| 7262 | DEF_IMGLIB_FN (DGifOpen); | 7253 | DEF_IMGLIB_FN (GifFileType *, DGifOpen); |
| 7263 | DEF_IMGLIB_FN (DGifOpenFileName); | 7254 | DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName); |
| 7264 | 7255 | ||
| 7265 | static int | 7256 | static int |
| 7266 | init_gif_functions (Lisp_Object libraries) | 7257 | init_gif_functions (Lisp_Object libraries) |
| @@ -7358,9 +7349,8 @@ gif_load (f, img) | |||
| 7358 | return 0; | 7349 | return 0; |
| 7359 | } | 7350 | } |
| 7360 | 7351 | ||
| 7361 | /* Open the GIF file. Casting return value avoids a GCC warning | 7352 | /* Open the GIF file. */ |
| 7362 | on W32. */ | 7353 | gif = fn_DGifOpenFileName (SDATA (file)); |
| 7363 | gif = (GifFileType *)fn_DGifOpenFileName (SDATA (file)); | ||
| 7364 | if (gif == NULL) | 7354 | if (gif == NULL) |
| 7365 | { | 7355 | { |
| 7366 | image_error ("Cannot open `%s'", file, Qnil); | 7356 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -7376,8 +7366,7 @@ gif_load (f, img) | |||
| 7376 | memsrc.len = SBYTES (specified_data); | 7366 | memsrc.len = SBYTES (specified_data); |
| 7377 | memsrc.index = 0; | 7367 | memsrc.index = 0; |
| 7378 | 7368 | ||
| 7379 | /* Casting return value avoids a GCC warning on W32. */ | 7369 | gif = fn_DGifOpen (&memsrc, gif_read_from_memory); |
| 7380 | gif = (GifFileType *) fn_DGifOpen (&memsrc, gif_read_from_memory); | ||
| 7381 | if (!gif) | 7370 | if (!gif) |
| 7382 | { | 7371 | { |
| 7383 | image_error ("Cannot open memory source `%s'", img->spec, Qnil); | 7372 | image_error ("Cannot open memory source `%s'", img->spec, Qnil); |
| @@ -7674,25 +7663,25 @@ svg_image_p (object) | |||
| 7674 | #ifdef HAVE_NTGUI | 7663 | #ifdef HAVE_NTGUI |
| 7675 | 7664 | ||
| 7676 | /* SVG library functions. */ | 7665 | /* SVG library functions. */ |
| 7677 | DEF_IMGLIB_FN (rsvg_handle_new); | 7666 | DEF_IMGLIB_FN (RsvgHandle *, rsvg_handle_new); |
| 7678 | DEF_IMGLIB_FN (rsvg_handle_get_dimensions); | 7667 | DEF_IMGLIB_FN (void, rsvg_handle_get_dimensions); |
| 7679 | DEF_IMGLIB_FN (rsvg_handle_write); | 7668 | DEF_IMGLIB_FN (gboolean, rsvg_handle_write); |
| 7680 | DEF_IMGLIB_FN (rsvg_handle_close); | 7669 | DEF_IMGLIB_FN (gboolean, rsvg_handle_close); |
| 7681 | DEF_IMGLIB_FN (rsvg_handle_get_pixbuf); | 7670 | DEF_IMGLIB_FN (GdkPixbuf *, rsvg_handle_get_pixbuf); |
| 7682 | DEF_IMGLIB_FN (rsvg_handle_free); | 7671 | DEF_IMGLIB_FN (void, rsvg_handle_free); |
| 7683 | 7672 | ||
| 7684 | DEF_IMGLIB_FN (gdk_pixbuf_get_width); | 7673 | DEF_IMGLIB_FN (int, gdk_pixbuf_get_width); |
| 7685 | DEF_IMGLIB_FN (gdk_pixbuf_get_height); | 7674 | DEF_IMGLIB_FN (int, gdk_pixbuf_get_height); |
| 7686 | DEF_IMGLIB_FN (gdk_pixbuf_get_pixels); | 7675 | DEF_IMGLIB_FN (guchar *, gdk_pixbuf_get_pixels); |
| 7687 | DEF_IMGLIB_FN (gdk_pixbuf_get_rowstride); | 7676 | DEF_IMGLIB_FN (int, gdk_pixbuf_get_rowstride); |
| 7688 | DEF_IMGLIB_FN (gdk_pixbuf_get_colorspace); | 7677 | DEF_IMGLIB_FN (GdkColorspace, gdk_pixbuf_get_colorspace); |
| 7689 | DEF_IMGLIB_FN (gdk_pixbuf_get_n_channels); | 7678 | DEF_IMGLIB_FN (int, gdk_pixbuf_get_n_channels); |
| 7690 | DEF_IMGLIB_FN (gdk_pixbuf_get_has_alpha); | 7679 | DEF_IMGLIB_FN (gboolean, gdk_pixbuf_get_has_alpha); |
| 7691 | DEF_IMGLIB_FN (gdk_pixbuf_get_bits_per_sample); | 7680 | DEF_IMGLIB_FN (int, gdk_pixbuf_get_bits_per_sample); |
| 7692 | 7681 | ||
| 7693 | DEF_IMGLIB_FN (g_type_init); | 7682 | DEF_IMGLIB_FN (void, g_type_init); |
| 7694 | DEF_IMGLIB_FN (g_object_unref); | 7683 | DEF_IMGLIB_FN (void, g_object_unref); |
| 7695 | DEF_IMGLIB_FN (g_error_free); | 7684 | DEF_IMGLIB_FN (void, g_error_free); |
| 7696 | 7685 | ||
| 7697 | Lisp_Object Qgdk_pixbuf, Qglib, Qgobject; | 7686 | Lisp_Object Qgdk_pixbuf, Qglib, Qgobject; |
| 7698 | 7687 | ||
| @@ -7846,7 +7835,7 @@ svg_load_image (f, img, contents, size) | |||
| 7846 | gnome type library functions. */ | 7835 | gnome type library functions. */ |
| 7847 | fn_g_type_init (); | 7836 | fn_g_type_init (); |
| 7848 | /* Make a handle to a new rsvg object. */ | 7837 | /* Make a handle to a new rsvg object. */ |
| 7849 | rsvg_handle = (RsvgHandle *) fn_rsvg_handle_new (); | 7838 | rsvg_handle = fn_rsvg_handle_new (); |
| 7850 | 7839 | ||
| 7851 | /* Parse the contents argument and fill in the rsvg_handle. */ | 7840 | /* Parse the contents argument and fill in the rsvg_handle. */ |
| 7852 | fn_rsvg_handle_write (rsvg_handle, contents, size, &error); | 7841 | fn_rsvg_handle_write (rsvg_handle, contents, size, &error); |
| @@ -7866,14 +7855,14 @@ svg_load_image (f, img, contents, size) | |||
| 7866 | 7855 | ||
| 7867 | /* We can now get a valid pixel buffer from the svg file, if all | 7856 | /* We can now get a valid pixel buffer from the svg file, if all |
| 7868 | went ok. */ | 7857 | went ok. */ |
| 7869 | pixbuf = (GdkPixbuf *) fn_rsvg_handle_get_pixbuf (rsvg_handle); | 7858 | pixbuf = fn_rsvg_handle_get_pixbuf (rsvg_handle); |
| 7870 | if (!pixbuf) goto rsvg_error; | 7859 | if (!pixbuf) goto rsvg_error; |
| 7871 | fn_g_object_unref (rsvg_handle); | 7860 | fn_g_object_unref (rsvg_handle); |
| 7872 | 7861 | ||
| 7873 | /* Extract some meta data from the svg handle. */ | 7862 | /* Extract some meta data from the svg handle. */ |
| 7874 | width = fn_gdk_pixbuf_get_width (pixbuf); | 7863 | width = fn_gdk_pixbuf_get_width (pixbuf); |
| 7875 | height = fn_gdk_pixbuf_get_height (pixbuf); | 7864 | height = fn_gdk_pixbuf_get_height (pixbuf); |
| 7876 | pixels = (const guint8 *) fn_gdk_pixbuf_get_pixels (pixbuf); | 7865 | pixels = fn_gdk_pixbuf_get_pixels (pixbuf); |
| 7877 | rowstride = fn_gdk_pixbuf_get_rowstride (pixbuf); | 7866 | rowstride = fn_gdk_pixbuf_get_rowstride (pixbuf); |
| 7878 | 7867 | ||
| 7879 | /* Validate the svg meta data. */ | 7868 | /* Validate the svg meta data. */ |