From 7f31770d102a777269fa2452cc6a1ce304da4e12 Mon Sep 17 00:00:00 2001 From: cristy Date: Fri, 18 Feb 2011 20:40:28 +0000 Subject: [PATCH] --- magick/blob-private.h | 6 ++++-- magick/blob.c | 8 ++------ magick/cache.c | 6 +++--- magick/nt-base.h | 8 ++++---- magick/shear.c | 6 +++--- magick/string.c | 4 ++-- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/magick/blob-private.h b/magick/blob-private.h index cbd8b2c06..409605e49 100644 --- a/magick/blob-private.h +++ b/magick/blob-private.h @@ -26,8 +26,10 @@ extern "C" { #include "magick/stream.h" #define MagickMinBlobExtent 32767L -#define MagickSeek(file,offset,whence) lseek(file,offset,whence) -#define MagickTell(file) tell(file) +#if defined(MAGICKCORE_HAVE_FSEEKO) +# define fseek fseeko +# define ftell ftello +#endif typedef enum { diff --git a/magick/blob.c b/magick/blob.c index a3adbc26c..8b00c4bbc 100644 --- a/magick/blob.c +++ b/magick/blob.c @@ -75,10 +75,6 @@ Define declarations. */ #define MagickMaxBlobExtent 65541 -#if defined(MAGICKCORE_HAVE_FSEEKO) -# define fseek fseeko -# define ftell ftello -#endif #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) # define MAP_ANONYMOUS MAP_ANON #endif @@ -928,7 +924,7 @@ MagickExport unsigned char *FileToBlob(const char *filename,const size_t extent, ThrowFileException(exception,BlobError,"UnableToOpenFile",filename); return((unsigned char *) NULL); } - offset=(MagickOffsetType) MagickSeek(file,0,SEEK_END); + offset=(MagickOffsetType) lseek(file,0,SEEK_END); count=0; if ((offset < 0) || (offset != (MagickOffsetType) ((ssize_t) offset))) { @@ -1002,7 +998,7 @@ MagickExport unsigned char *FileToBlob(const char *filename,const size_t extent, } else { - (void) MagickSeek(file,0,SEEK_SET); + (void) lseek(file,0,SEEK_SET); for (i=0; i < *length; i+=count) { count=(ssize_t) read(file,blob+i,MagickMin(*length-i,(size_t) diff --git a/magick/cache.c b/magick/cache.c index 028004b66..19be74231 100644 --- a/magick/cache.c +++ b/magick/cache.c @@ -691,7 +691,7 @@ static inline MagickOffsetType ReadPixelCacheRegion(CacheInfo *cache_info, cache_info->timestamp=time(0); #if !defined(MAGICKCORE_HAVE_PREAD) LockSemaphoreInfo(cache_info->disk_semaphore); - if (MagickSeek(cache_info->file,offset,SEEK_SET) < 0) + if (lseek(cache_info->file,offset,SEEK_SET) < 0) { UnlockSemaphoreInfo(cache_info->disk_semaphore); return((MagickOffsetType) -1); @@ -735,7 +735,7 @@ static inline MagickOffsetType WritePixelCacheRegion(CacheInfo *cache_info, cache_info->timestamp=time(0); #if !defined(MAGICKCORE_HAVE_PWRITE) LockSemaphoreInfo(cache_info->disk_semaphore); - if (MagickSeek(cache_info->file,offset,SEEK_SET) < 0) + if (lseek(cache_info->file,offset,SEEK_SET) < 0) { UnlockSemaphoreInfo(cache_info->disk_semaphore); return((MagickOffsetType) -1); @@ -3958,7 +3958,7 @@ static MagickBooleanType ExtendCache(Image *image,MagickSizeType length) } if (length != (MagickSizeType) ((MagickOffsetType) length)) return(MagickFalse); - extent=(MagickOffsetType) MagickSeek(cache_info->file,0,SEEK_END); + extent=(MagickOffsetType) lseek(cache_info->file,0,SEEK_END); if (extent < 0) return(MagickFalse); if ((MagickSizeType) extent >= length) diff --git a/magick/nt-base.h b/magick/nt-base.h index 8f781ee1a..e1ae30cfc 100644 --- a/magick/nt-base.h +++ b/magick/nt-base.h @@ -92,8 +92,8 @@ extern "C" { #if !defined(fileno) # define fileno _fileno #endif -#if !defined(fseeko) -# define fseeko _fseeki64 +#if !defined(fseek) +# define fseek _fseeki64 #endif #if !defined(fstat) && !defined(__BORLANDC__) #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \ @@ -106,8 +106,8 @@ extern "C" { #if !defined(fsync) # define fsync _commit #endif -#if !defined(ftello) -# define ftello _ftelli64 +#if !defined(ftell) +# define ftell _ftelli64 #endif #if !defined(ftruncate) # define ftruncate(file,length) NTTruncateFile(file,length) diff --git a/magick/shear.c b/magick/shear.c index ee3c6a509..88b596029 100644 --- a/magick/shear.c +++ b/magick/shear.c @@ -346,7 +346,7 @@ static MagickBooleanType ResetRadonCells(RadonInfo *radon_info) return(MagickTrue); } value=0; - (void) MagickSeek(radon_info->file,0,SEEK_SET); + (void) lseek(radon_info->file,0,SEEK_SET); for (y=0; y < (ssize_t) radon_info->height; y++) { for (x=0; x < (ssize_t) radon_info->width; x++) @@ -453,7 +453,7 @@ static inline ssize_t ReadRadonCell(const RadonInfo *radon_info, #endif { i=(-1); - if (MagickSeek(radon_info->file,offset,SEEK_SET) >= 0) + if (lseek(radon_info->file,offset,SEEK_SET) >= 0) { #endif count=0; @@ -496,7 +496,7 @@ static inline ssize_t WriteRadonCell(const RadonInfo *radon_info, #pragma omp critical (MagickCore_WriteRadonCell) #endif { - if (MagickSeek(radon_info->file,offset,SEEK_SET) >= 0) + if (lseek(radon_info->file,offset,SEEK_SET) >= 0) { #endif count=0; diff --git a/magick/string.c b/magick/string.c index 007cafed4..2bf857405 100644 --- a/magick/string.c +++ b/magick/string.c @@ -542,7 +542,7 @@ MagickExport StringInfo *ConfigureFileToStringInfo(const char *filename) file=open(filename,O_RDONLY | O_BINARY); if (file == -1) return((StringInfo *) NULL); - offset=(MagickOffsetType) MagickSeek(file,0,SEEK_END); + offset=(MagickOffsetType) lseek(file,0,SEEK_END); if ((offset < 0) || (offset != (MagickOffsetType) ((ssize_t) offset))) { file=close(file)-1; @@ -571,7 +571,7 @@ MagickExport StringInfo *ConfigureFileToStringInfo(const char *filename) ssize_t count; - (void) MagickSeek(file,0,SEEK_SET); + (void) lseek(file,0,SEEK_SET); for (i=0; i < length; i+=count) { count=read(file,string+i,(size_t) MagickMin(length-i,(size_t) -- 2.40.0