From aa740119c4ccdb93a0e4fb4e7def67a99438f74b Mon Sep 17 00:00:00 2001 From: cristy Date: Tue, 30 Mar 2010 17:58:44 +0000 Subject: [PATCH] --- coders/dpx.c | 20 ++-------- coders/hald.c | 14 ++----- coders/pnm.c | 86 ++++++++++-------------------------------- magick/token-private.h | 4 +- 4 files changed, 28 insertions(+), 96 deletions(-) diff --git a/coders/dpx.c b/coders/dpx.c index 15129fc07..1877b3d45 100644 --- a/coders/dpx.c +++ b/coders/dpx.c @@ -539,9 +539,6 @@ static void TimeCodeToString(const unsigned long timestamp,char *code) static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) { - CacheView - *image_view; - char magick[4], value[MaxTextExtent]; @@ -1079,10 +1076,6 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) SetQuantumQuantum(quantum_info,32); SetQuantumPack(quantum_info,dpx.image.image_element[0].packing == 0 ? MagickTrue : MagickFalse); - image_view=AcquireCacheView(image); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type) -#endif for (y=0; y < (long) image->rows; y++) { long @@ -1106,9 +1099,6 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) continue; pixels=GetQuantumPixels(quantum_info); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp critical (MagickCore_ReadDPXImage) -#endif { count=ReadBlob(image,extent,pixels); if ((image->progress_monitor != (MagickProgressMonitor) NULL) && @@ -1125,20 +1115,18 @@ static Image *ReadDPXImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (count != (ssize_t) extent) status=MagickFalse; - q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1, - exception); + q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception); if (q == (PixelPacket *) NULL) { status=MagickFalse; continue; } - length=ImportQuantumPixels(image,image_view,quantum_info,quantum_type, - pixels,exception); - sync=SyncCacheViewAuthenticPixels(image_view,exception); + length=ImportQuantumPixels(image,(const CacheView *) NULL,quantum_info, + quantum_type,pixels,exception); + sync=SyncAuthenticPixels(image,exception); if (sync == MagickFalse) status=MagickFalse; } - image_view=DestroyCacheView(image_view); quantum_info=DestroyQuantumInfo(quantum_info); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"UnableToReadImageData"); diff --git a/coders/hald.c b/coders/hald.c index a800d2d7e..47bc79a34 100644 --- a/coders/hald.c +++ b/coders/hald.c @@ -102,9 +102,6 @@ static Image *ReadHALDImage(const ImageInfo *image_info, cube_size, level; - CacheView - *image_view; - /* Create HALD color lookup table image. */ @@ -125,10 +122,6 @@ static Image *ReadHALDImage(const ImageInfo *image_info, cube_size=level*level; image->columns=(unsigned long) (level*cube_size); image->rows=(unsigned long) (level*cube_size); - image_view=AcquireCacheView(image); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp parallel for shared(status) -#endif for (y=0; y < (long) image->rows; y+=(long) level) { long @@ -141,8 +134,8 @@ static Image *ReadHALDImage(const ImageInfo *image_info, if (status == MagickFalse) continue; - q=QueueCacheViewAuthenticPixels(image_view,0,y,image->columns, - (unsigned long) level,exception); + q=QueueAuthenticPixels(image,0,y,image->columns,(unsigned long) level, + exception); if (q == (PixelPacket *) NULL) { status=MagickFalse; @@ -160,10 +153,9 @@ static Image *ReadHALDImage(const ImageInfo *image_info, q++; } } - if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse) + if (SyncAuthenticPixels(image,exception) == MagickFalse) status=MagickFalse; } - image_view=DestroyCacheView(image_view); return(GetFirstImageInList(image)); } diff --git a/coders/pnm.c b/coders/pnm.c index fb048c622..f3120eb61 100644 --- a/coders/pnm.c +++ b/coders/pnm.c @@ -265,9 +265,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) depth, max_value; - CacheView - *image_view; - /* Open image file. */ @@ -593,10 +590,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); SetQuantumMinIsWhite(quantum_info,MagickTrue); extent=GetQuantumExtent(image,quantum_info,quantum_type); - image_view=AcquireCacheView(image); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type) -#endif for (y=0; y < (long) image->rows; y++) { long @@ -620,9 +613,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) continue; pixels=GetQuantumPixels(quantum_info); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp critical (MagickCore_ReadPNMImage) -#endif { count=ReadBlob(image,extent,pixels); if ((image->progress_monitor != (MagickProgressMonitor) NULL) && @@ -639,22 +629,20 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (count != (ssize_t) extent) status=MagickFalse; - q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1, - exception); + q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception); if (q == (PixelPacket *) NULL) { status=MagickFalse; continue; } - length=ImportQuantumPixels(image,image_view,quantum_info,quantum_type, - pixels,exception); + length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, + quantum_type,pixels,exception); if (length != extent) status=MagickFalse; - sync=SyncCacheViewAuthenticPixels(image_view,exception); + sync=SyncAuthenticPixels(image,exception); if (sync == MagickFalse) status=MagickFalse; } - image_view=DestroyCacheView(image_view); quantum_info=DestroyQuantumInfo(quantum_info); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"UnableToReadImageData"); @@ -675,10 +663,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - image_view=AcquireCacheView(image); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type) -#endif for (y=0; y < (long) image->rows; y++) { long @@ -705,9 +689,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) continue; pixels=GetQuantumPixels(quantum_info); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp critical (MagickCore_ReadPNMImage) -#endif { count=ReadBlob(image,extent,pixels); if ((image->progress_monitor != (MagickProgressMonitor) NULL) && @@ -724,8 +705,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (count != (ssize_t) extent) status=MagickFalse; - q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1, - exception); + q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception); if (q == (PixelPacket *) NULL) { status=MagickFalse; @@ -733,7 +713,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) } p=pixels; if ((image->depth == 8) || (image->depth == 16)) - (void) ImportQuantumPixels(image,image_view,quantum_info, + (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, quantum_type,pixels,exception); else if (image->depth <= 8) @@ -764,11 +744,10 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) q++; } } - sync=SyncCacheViewAuthenticPixels(image_view,exception); + sync=SyncAuthenticPixels(image,exception); if (sync == MagickFalse) status=MagickFalse; } - image_view=DestroyCacheView(image_view); quantum_info=DestroyQuantumInfo(quantum_info); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"UnableToReadImageData"); @@ -793,10 +772,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - image_view=AcquireCacheView(image); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp parallel for schedule(static,1) shared(row,status,type) -#endif for (y=0; y < (long) image->rows; y++) { long @@ -823,9 +798,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) continue; pixels=GetQuantumPixels(quantum_info); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp critical (MagickCore_ReadPNMImage) -#endif { count=ReadBlob(image,extent,pixels); if ((image->progress_monitor != (MagickProgressMonitor) NULL) && @@ -842,8 +814,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (count != (ssize_t) extent) status=MagickFalse; - q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1, - exception); + q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception); if (q == (PixelPacket *) NULL) { status=MagickFalse; @@ -914,8 +885,7 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) } if ((type == BilevelType) || (type == GrayscaleType)) { - q=QueueCacheViewAuthenticPixels(image_view,0,offset, - image->columns,1,exception); + q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception); for (x=0; x < (long) image->columns; x++) { if ((type == BilevelType) && @@ -929,11 +899,10 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) q++; } } - sync=SyncCacheViewAuthenticPixels(image_view,exception); + sync=SyncAuthenticPixels(image,exception); if (sync == MagickFalse) status=MagickFalse; } - image_view=DestroyCacheView(image_view); quantum_info=DestroyQuantumInfo(quantum_info); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"UnableToReadImageData"); @@ -982,10 +951,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) quantum_info=AcquireQuantumInfo(image_info,image); if (quantum_info == (QuantumInfo *) NULL) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - image_view=AcquireCacheView(image); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type) -#endif for (y=0; y < (long) image->rows; y++) { long @@ -1012,9 +977,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) continue; pixels=GetQuantumPixels(quantum_info); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp critical (MagickCore_ReadPNMImage) -#endif { count=ReadBlob(image,extent,pixels); if ((image->progress_monitor != (MagickProgressMonitor) NULL) && @@ -1031,17 +993,16 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) } if (count != (ssize_t) extent) status=MagickFalse; - q=QueueCacheViewAuthenticPixels(image_view,0,offset,image->columns,1, - exception); + q=QueueAuthenticPixels(image,0,offset,image->columns,1,exception); if (q == (PixelPacket *) NULL) { status=MagickFalse; continue; } - indexes=GetCacheViewAuthenticIndexQueue(image_view); + indexes=GetAuthenticIndexQueue(image); p=pixels; if ((image->depth == 8) || (image->depth == 16)) - (void) ImportQuantumPixels(image,image_view,quantum_info, + (void) ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, quantum_type,pixels,exception); else switch (quantum_type) @@ -1193,11 +1154,10 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) break; } } - sync=SyncCacheViewAuthenticPixels(image_view,exception); + sync=SyncAuthenticPixels(image,exception); if (sync == MagickFalse) status=MagickFalse; } - image_view=DestroyCacheView(image_view); quantum_info=DestroyQuantumInfo(quantum_info); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"UnableToReadImageData"); @@ -1225,10 +1185,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) SetQuantumScale(quantum_info,(MagickRealType) QuantumRange* fabs(quantum_scale)); extent=GetQuantumExtent(image,quantum_info,quantum_type); - image_view=AcquireCacheView(image); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp parallel for schedule(static,1) shared(row,status,quantum_type) -#endif for (y=0; y < (long) image->rows; y++) { long @@ -1252,9 +1208,6 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) if (status == MagickFalse) continue; pixels=GetQuantumPixels(quantum_info); -#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP > 202001) - #pragma omp critical (MagickCore_ReadPNMImage) -#endif { count=ReadBlob(image,extent,pixels); if ((image->progress_monitor != (MagickProgressMonitor) NULL) && @@ -1271,22 +1224,21 @@ static Image *ReadPNMImage(const ImageInfo *image_info,ExceptionInfo *exception) } if ((size_t) count != extent) status=MagickFalse; - q=QueueCacheViewAuthenticPixels(image_view,0,(long) (image->rows- - offset-1),image->columns,1,exception); + q=QueueAuthenticPixels(image,0,(long) (image->rows-offset-1), + image->columns,1,exception); if (q == (PixelPacket *) NULL) { status=MagickFalse; continue; } - length=ImportQuantumPixels(image,image_view,quantum_info,quantum_type, - pixels,exception); + length=ImportQuantumPixels(image,(CacheView *) NULL,quantum_info, + quantum_type,pixels,exception); if (length != extent) status=MagickFalse; - sync=SyncCacheViewAuthenticPixels(image_view,exception); + sync=SyncAuthenticPixels(image,exception); if (sync == MagickFalse) status=MagickFalse; } - image_view=DestroyCacheView(image_view); quantum_info=DestroyQuantumInfo(quantum_info); if (status == MagickFalse) ThrowReaderException(CorruptImageError,"UnableToReadImageData"); diff --git a/magick/token-private.h b/magick/token-private.h index a2d6be7e1..54cd8e413 100644 --- a/magick/token-private.h +++ b/magick/token-private.h @@ -134,7 +134,7 @@ static inline long GetNextUTFCode(const char *text,size_t *octets) return(-1); } -static long GetUTFCode(const char *text) +static inline long GetUTFCode(const char *text) { size_t octets; @@ -142,7 +142,7 @@ static long GetUTFCode(const char *text) return(GetNextUTFCode(text,&octets)); } -static size_t GetUTFOctets(const char *text) +static inline size_t GetUTFOctets(const char *text) { size_t octets; -- 2.50.1