Mercurial > hg > xemacs-beta
comparison src/dgif_lib.c @ 185:3d6bfa290dbd r20-3b19
Import from CVS: tag r20-3b19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:55:28 +0200 |
parents | 2d532a89d707 |
children | b405438285a2 |
comparison
equal
deleted
inserted
replaced
184:bcd2674570bf | 185:3d6bfa290dbd |
---|---|
12 * 3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names). * | 12 * 3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names). * |
13 ******************************************************************************/ | 13 ******************************************************************************/ |
14 | 14 |
15 #ifdef emacs | 15 #ifdef emacs |
16 #include <config.h> | 16 #include <config.h> |
17 void *xmalloc (unsigned int size); | 17 void *xmalloc (size_t size); |
18 void *xrealloc (void *ptr, unsigned int size); | 18 void *xrealloc (void *ptr, size_t size); |
19 #ifdef ERROR_CHECK_MALLOC | 19 #ifdef ERROR_CHECK_MALLOC |
20 void *xfree_1 (void *); | 20 void *xfree_1 (void *); |
21 #define xfree xfree_1 | 21 #define xfree xfree_1 |
22 #else | 22 #else |
23 void *xfree (void *); | 23 void *xfree (void *); |
323 | 323 |
324 if (GifFile->Image.ColorMap && GifFile->SavedImages == NULL) | 324 if (GifFile->Image.ColorMap && GifFile->SavedImages == NULL) |
325 FreeMapObject(GifFile->Image.ColorMap); | 325 FreeMapObject(GifFile->Image.ColorMap); |
326 | 326 |
327 GifFile->Image.ColorMap = MakeMapObject(1 << BitsPerPixel, NULL); | 327 GifFile->Image.ColorMap = MakeMapObject(1 << BitsPerPixel, NULL); |
328 | 328 |
329 /* Get the image local color map: */ | 329 /* Get the image local color map: */ |
330 for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) { | 330 for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) { |
331 if (fread(Buf, 1, 3, Private->File) != 3) { | 331 if (fread(Buf, 1, 3, Private->File) != 3) { |
332 _GifError = D_GIF_ERR_READ_FAILED; | 332 _GifError = D_GIF_ERR_READ_FAILED; |
333 return GIF_ERROR; | 333 return GIF_ERROR; |
981 memcpy(ep->Bytes,ExtData,ep->ByteCount * sizeof(char)); | 981 memcpy(ep->Bytes,ExtData,ep->ByteCount * sizeof(char)); |
982 } | 982 } |
983 } | 983 } |
984 #else | 984 #else |
985 /* Skip any extension blocks in the file. */ | 985 /* Skip any extension blocks in the file. */ |
986 if (DGifGetExtension (GifFile, &ExtCode, &ExtData) | 986 if (DGifGetExtension (GifFile, &ExtCode, &ExtData) |
987 == GIF_ERROR) | 987 == GIF_ERROR) |
988 return GIF_ERROR; | 988 return GIF_ERROR; |
989 | 989 |
990 while (ExtData != NULL) { | 990 while (ExtData != NULL) { |
991 if (DGifGetExtensionNext (GifFile, &ExtData) == GIF_ERROR) | 991 if (DGifGetExtensionNext (GifFile, &ExtData) == GIF_ERROR) |