X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fdgif_lib.c;h=6d91c90349c19a0298d8c011afed8f1c2e1bb897;hb=b0ffa51c7f9f63d01761bd5e335e54babee21009;hp=b53b85e57f81603eeea16292cc2c930984dee85f;hpb=77dcef404dc78635f6ffa8f71a803d2bc7cc8921;p=chise%2Fxemacs-chise.git diff --git a/src/dgif_lib.c b/src/dgif_lib.c index b53b85e..6d91c90 100644 --- a/src/dgif_lib.c +++ b/src/dgif_lib.c @@ -11,23 +11,10 @@ * 19 Feb 98 - Version 1.2 by Jareth Hein (Support for user specified I/O) * ******************************************************************************/ -#ifdef __MSDOS__ -#include -#include -#include -#include -#else -#include -#include -#endif /* __MSDOS__ */ - -#include -#include -#include +#include +#include "lisp.h" -#ifdef HAVE_FCNTL_H -#include -#endif +#include "sysfile.h" #include "gifrlib.h" @@ -52,11 +39,11 @@ void DGifOpenFileName(GifFileType *GifFile, const char *FileName) FILE *f; if ((f = fopen(FileName, -#ifdef __MSDOS__ +#ifdef WIN32_NATIVE "rb" #else "r" -#endif /* __MSDOS__ */ +#endif /* WIN32_NATIVE */ )) == NULL) GifInternError(GifFile, D_GIF_ERR_OPEN_FAILED); @@ -73,13 +60,13 @@ void DGifOpenFileHandle(GifFileType *GifFile, int FileHandle) { FILE *f; -#ifdef __MSDOS__ +#ifdef WIN32_NATIVE setmode(FileHandle, O_BINARY); /* Make sure it is in binary mode. */ f = fdopen(FileHandle, "rb"); /* Make it into a stream: */ setvbuf(f, NULL, _IOFBF, GIF_FILE_BUFFER_SIZE);/* And inc. stream buffer.*/ #else f = fdopen(FileHandle, "r"); /* Make it into a stream: */ -#endif /* __MSDOS__ */ +#endif /* WIN32_NATIVE */ GifStdIOInit(GifFile, f, -1); DGifInitRead(GifFile); @@ -277,11 +264,11 @@ void DGifGetLine(GifFileType *GifFile, GifPixelType *Line, int LineLen) if (!LineLen) LineLen = GifFile->Image.Width; -#if defined(__MSDOS__) || defined(__GNUC__) +#if defined(WIN32_NATIVE) || defined(__GNUC__) if ((Private->PixelCount -= LineLen) > 0xffff0000UL) #else if ((Private->PixelCount -= LineLen) > 0xffff0000) -#endif /* __MSDOS__ */ +#endif /* WIN32_NATIVE */ { GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG); } @@ -310,11 +297,11 @@ void DGifGetPixel(GifFileType *GifFile, GifPixelType Pixel) GifInternError(GifFile, D_GIF_ERR_NOT_READABLE); } -#if defined(__MSDOS__) || defined(__GNUC__) +#if defined(WIN32_NATIVE) || defined(__GNUC__) if (--Private->PixelCount > 0xffff0000UL) #else if (--Private->PixelCount > 0xffff0000) -#endif /* __MSDOS__ */ +#endif /* WIN32_NATIVE */ { GifInternError(GifFile, D_GIF_ERR_DATA_TOO_BIG); } @@ -753,11 +740,11 @@ void DGifSlurp(GifFileType *GifFile) case EXTENSION_RECORD_TYPE: DGifGetExtension(GifFile,&sp->Function,&ExtData); - do { + while (ExtData != NULL) { if (AddExtensionBlock(sp, ExtData[0], ExtData+1) == GIF_ERROR) GifInternError(GifFile, D_GIF_ERR_NOT_ENOUGH_MEM); DGifGetExtensionNext(GifFile, &ExtData); - } while (ExtData != NULL); + } break; case TERMINATE_RECORD_TYPE: