From badc7524fff0d4d412aaeae28a65ea73a0451c8d Mon Sep 17 00:00:00 2001 From: cristy Date: Thu, 25 Dec 2014 18:05:31 +0000 Subject: [PATCH] Make MagickMax()/MagickMin() a macro rather than an inline. --- MagickCore/animate.c | 7 ------- MagickCore/annotate.c | 7 ------- MagickCore/attribute.c | 8 -------- MagickCore/blob.c | 9 --------- MagickCore/cache.c | 8 -------- MagickCore/channel.c | 7 ------- MagickCore/cipher.c | 7 ------- MagickCore/color.c | 8 -------- MagickCore/colormap.c | 9 --------- MagickCore/compare.c | 14 -------------- MagickCore/composite.c | 16 ---------------- MagickCore/compress.c | 15 --------------- MagickCore/display.c | 14 -------------- MagickCore/distort.c | 9 --------- MagickCore/draw.c | 21 --------------------- MagickCore/enhance.c | 17 ----------------- MagickCore/feature.c | 7 ------- MagickCore/fx.c | 7 ------- MagickCore/gem.c | 15 --------------- MagickCore/image-private.h | 3 +++ MagickCore/montage.c | 14 -------------- MagickCore/morphology.c | 8 -------- MagickCore/paint.c | 6 ------ MagickCore/pixel.c | 17 ----------------- MagickCore/property.c | 14 -------------- MagickCore/quantize.c | 14 -------------- MagickCore/resize.c | 14 -------------- MagickCore/segment.c | 22 ---------------------- MagickCore/statistic.c | 21 --------------------- MagickCore/xwindow.c | 16 ---------------- MagickWand/mogrify.c | 7 ------- coders/bmp.c | 22 ---------------------- coders/cip.c | 8 -------- coders/dcm.c | 15 --------------- coders/dib.c | 23 ----------------------- coders/gif.c | 15 --------------- coders/histogram.c | 8 -------- coders/inline.c | 8 -------- coders/jpeg.c | 7 ------- coders/mat.c | 8 -------- coders/miff.c | 14 -------------- coders/mpeg.c | 15 --------------- coders/palm.c | 15 --------------- coders/pcd.c | 8 -------- coders/pcx.c | 22 ---------------------- coders/pdf.c | 14 -------------- coders/pict.c | 8 -------- coders/plasma.c | 7 ------- coders/png.c | 16 ---------------- coders/ps.c | 7 ------- coders/psd.c | 7 ------- coders/rle.c | 8 -------- coders/sgi.c | 7 ------- coders/stegano.c | 9 --------- coders/tga.c | 8 -------- coders/tiff.c | 16 ---------------- coders/viff.c | 8 -------- coders/xcf.c | 7 ------- coders/xpm.c | 7 ------- 59 files changed, 3 insertions(+), 675 deletions(-) diff --git a/MagickCore/animate.c b/MagickCore/animate.c index 98de3078fc..8105c5ba57 100644 --- a/MagickCore/animate.c +++ b/MagickCore/animate.c @@ -708,13 +708,6 @@ static Image *XMagickCommand(Display *display,XResourceInfo *resource_info, % */ -static inline ssize_t MagickMax(const ssize_t x,const ssize_t y) -{ - if (x > y) - return(x); - return(y); -} - #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif diff --git a/MagickCore/annotate.c b/MagickCore/annotate.c index 378b994d1a..dcd385694a 100644 --- a/MagickCore/annotate.c +++ b/MagickCore/annotate.c @@ -1619,13 +1619,6 @@ static MagickBooleanType RenderFreetype(Image *image,const DrawInfo *draw_info, % */ -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static char *EscapeParenthesis(const char *text) { char diff --git a/MagickCore/attribute.c b/MagickCore/attribute.c index 75f8d4f6be..dbad005830 100644 --- a/MagickCore/attribute.c +++ b/MagickCore/attribute.c @@ -533,14 +533,6 @@ MagickExport size_t GetImageDepth(const Image *image,ExceptionInfo *exception) % a maximum of MAGICKCORE_QUANTUM_DEPTH. % */ - -static inline double MagickMin(const double x,const double y) -{ - if (x < y) - return(x); - return(y); -} - MagickExport size_t GetImageQuantumDepth(const Image *image, const MagickBooleanType constrain) { diff --git a/MagickCore/blob.c b/MagickCore/blob.c index e60bf8cbff..d3e67e664c 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -235,15 +235,6 @@ MagickExport void AttachBlob(BlobInfo *blob_info,const void *blob, % o exception: return any errors or warnings in this structure. % */ - -static inline MagickSizeType MagickMin(const MagickSizeType x, - const MagickSizeType y) -{ - if (x < y) - return(x); - return(y); -} - MagickExport MagickBooleanType BlobToFile(char *filename,const void *blob, const size_t length,ExceptionInfo *exception) { diff --git a/MagickCore/cache.c b/MagickCore/cache.c index 757b3bc987..51b92ef8bb 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -471,14 +471,6 @@ MagickPrivate void ClonePixelCacheMethods(Cache clone,const Cache cache) % */ -static inline MagickSizeType MagickMin(const MagickSizeType x, - const MagickSizeType y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType ClonePixelCacheRepository( CacheInfo *restrict clone_info,CacheInfo *restrict cache_info, ExceptionInfo *exception) diff --git a/MagickCore/channel.c b/MagickCore/channel.c index 8250fa588a..856425e14a 100644 --- a/MagickCore/channel.c +++ b/MagickCore/channel.c @@ -113,13 +113,6 @@ typedef enum TransferChannelOp } ChannelFx; -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType ChannelImage(Image *destination_image, const PixelChannel destination_channel,const ChannelFx channel_op, const Image *source_image,const PixelChannel source_channel, diff --git a/MagickCore/cipher.c b/MagickCore/cipher.c index 7822487085..2fadb705a5 100644 --- a/MagickCore/cipher.c +++ b/MagickCore/cipher.c @@ -534,13 +534,6 @@ static inline void IncrementCipherNonce(const size_t length, ThrowFatalException(ResourceLimitFatalError,"Sequence wrap error `%s'"); } -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - MagickExport MagickBooleanType DecipherImage(Image *image, const char *passphrase,ExceptionInfo *exception) { diff --git a/MagickCore/color.c b/MagickCore/color.c index e80b3312f8..c3301f365d 100644 --- a/MagickCore/color.c +++ b/MagickCore/color.c @@ -1657,14 +1657,6 @@ static MagickBooleanType IsColorCacheInstantiated(ExceptionInfo *exception) % o q: Pixel q. % */ - -static inline double MagickMax(const double x,const double y) -{ - if (x > y) - return(x); - return(y); -} - MagickPrivate MagickBooleanType IsEquivalentAlpha(const Image *image, const PixelInfo *p,const PixelInfo *q) { diff --git a/MagickCore/colormap.c b/MagickCore/colormap.c index a73cd52a7d..560d64baa7 100644 --- a/MagickCore/colormap.c +++ b/MagickCore/colormap.c @@ -101,15 +101,6 @@ % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMax(const size_t x, - const size_t y) -{ - if (x > y) - return(x); - return(y); -} - MagickExport MagickBooleanType AcquireImageColormap(Image *image, const size_t colors,ExceptionInfo *exception) { diff --git a/MagickCore/compare.c b/MagickCore/compare.c index ff100733f4..057a223ede 100644 --- a/MagickCore/compare.c +++ b/MagickCore/compare.c @@ -338,13 +338,6 @@ MagickExport Image *CompareImages(Image *image,const Image *reconstruct_image, % */ -static inline double MagickMax(const double x,const double y) -{ - if (x > y) - return(x); - return(y); -} - static MagickBooleanType GetAbsoluteDistortion(const Image *image, const Image *reconstruct_image,double *distortion,ExceptionInfo *exception) { @@ -1682,13 +1675,6 @@ static double GetSimilarityMetric(const Image *image,const Image *reference, return(distortion); } -static inline double MagickMin(const double x,const double y) -{ - if (x < y) - return(x); - return(y); -} - MagickExport Image *SimilarityImage(Image *image,const Image *reference, const MetricType metric,const double similarity_threshold, RectangleInfo *offset,double *similarity_metric,ExceptionInfo *exception) diff --git a/MagickCore/composite.c b/MagickCore/composite.c index f19777a8b7..71d970b3a9 100644 --- a/MagickCore/composite.c +++ b/MagickCore/composite.c @@ -178,22 +178,6 @@ operations. */ -static inline MagickRealType MagickMin(const MagickRealType x, - const MagickRealType y) -{ - if (x < y) - return(x); - return(y); -} - -static inline MagickRealType MagickMax(const MagickRealType x, - const MagickRealType y) -{ - if (x > y) - return(x); - return(y); -} - static void HCLComposite(const MagickRealType hue,const MagickRealType chroma, const MagickRealType luma,MagickRealType *red,MagickRealType *green, MagickRealType *blue) diff --git a/MagickCore/compress.c b/MagickCore/compress.c index 5e05b42f25..e5b18006a0 100644 --- a/MagickCore/compress.c +++ b/MagickCore/compress.c @@ -363,21 +363,6 @@ MagickExport void Ascii85Encode(Image *image,const unsigned char code) % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - MagickExport MagickBooleanType HuffmanDecodeImage(Image *image, ExceptionInfo *exception) { diff --git a/MagickCore/display.c b/MagickCore/display.c index 3f1c55fa31..9fdebf18c0 100644 --- a/MagickCore/display.c +++ b/MagickCore/display.c @@ -1802,20 +1802,6 @@ MagickExport MagickBooleanType RemoteDisplayCommand(const ImageInfo *image_info, % */ -static inline ssize_t MagickMax(const ssize_t x,const ssize_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType XAnnotateEditImage(Display *display, XResourceInfo *resource_info,XWindows *windows,Image *image, ExceptionInfo *exception) diff --git a/MagickCore/distort.c b/MagickCore/distort.c index 97c5f092dd..6f494a1e8d 100644 --- a/MagickCore/distort.c +++ b/MagickCore/distort.c @@ -77,15 +77,6 @@ /* Numerous internal routines for image distortions. */ -static inline double MagickMin(const double x,const double y) -{ - return( x < y ? x : y); -} -static inline double MagickMax(const double x,const double y) -{ - return( x > y ? x : y); -} - static inline void AffineArgsToCoefficients(double *affine) { /* map external sx,ry,rx,sy,tx,ty to internal c0,c2,c4,c1,c3,c5 */ diff --git a/MagickCore/draw.c b/MagickCore/draw.c index 3478c3669d..f2cb83524e 100644 --- a/MagickCore/draw.c +++ b/MagickCore/draw.c @@ -1059,27 +1059,6 @@ static AffineMatrix InverseAffineMatrix(const AffineMatrix *affine) return(inverse_affine); } -static inline ssize_t MagickAbsoluteValue(const ssize_t x) -{ - if (x < 0) - return(-x); - return(x); -} - -static inline double MagickMax(const double x,const double y) -{ - if (x > y) - return(x); - return(y); -} - -static inline double MagickMin(const double x,const double y) -{ - if (x < y) - return(x); - return(y); -} - MagickExport MagickBooleanType DrawAffineImage(Image *image, const Image *source,const AffineMatrix *affine,ExceptionInfo *exception) { diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index f1f8cde807..bc06d88565 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -1922,23 +1922,6 @@ MagickExport MagickBooleanType GammaImage(Image *image,const double gamma, % o exception: return any errors or warnings in this structure. % */ - -static inline MagickRealType MagickMax(const MagickRealType x, - const MagickRealType y) -{ - if (x > y) - return(x); - return(y); -} - -static inline MagickRealType MagickMin(const MagickRealType x, - const MagickRealType y) -{ - if (x < y) - return(x); - return(y); -} - MagickExport MagickBooleanType GrayscaleImage(Image *image, const PixelIntensityMethod method,ExceptionInfo *exception) { diff --git a/MagickCore/feature.c b/MagickCore/feature.c index 44a1ffb129..b8bb014586 100644 --- a/MagickCore/feature.c +++ b/MagickCore/feature.c @@ -609,13 +609,6 @@ MagickExport Image *CannyEdgeImage(const Image *image,const double radius, % */ -static inline ssize_t MagickAbsoluteValue(const ssize_t x) -{ - if (x < 0) - return(-x); - return(x); -} - static inline double MagickLog10(const double x) { #define Log10Epsilon (1.0e-11) diff --git a/MagickCore/fx.c b/MagickCore/fx.c index 44c4e5e56b..e5b5dfba6b 100644 --- a/MagickCore/fx.c +++ b/MagickCore/fx.c @@ -1108,13 +1108,6 @@ MagickPrivate FxInfo *DestroyFxInfo(FxInfo *fx_info) % */ -static inline double MagickMax(const double x,const double y) -{ - if (x > y) - return(x); - return(y); -} - static double FxChannelStatistics(FxInfo *fx_info,Image *image, PixelChannel channel,const char *symbol,ExceptionInfo *exception) { diff --git a/MagickCore/gem.c b/MagickCore/gem.c index 15f40c0b05..a1a0a61ba4 100644 --- a/MagickCore/gem.c +++ b/MagickCore/gem.c @@ -847,21 +847,6 @@ MagickPrivate void ConvertLCHuvToRGB(const double luma,const double chroma, % component of the HCL color space. % */ - -static inline double MagickMax(const double x,const double y) -{ - if (x > y) - return(x); - return(y); -} - -static inline double MagickMin(const double x,const double y) -{ - if (x < y) - return(x); - return(y); -} - MagickPrivate void ConvertRGBToHCL(const double red,const double green, const double blue,double *hue,double *chroma,double *luma) { diff --git a/MagickCore/image-private.h b/MagickCore/image-private.h index 41c9dcc44e..8a854fc40e 100644 --- a/MagickCore/image-private.h +++ b/MagickCore/image-private.h @@ -22,6 +22,9 @@ extern "C" { #endif +#define MagickAbsoluteValue(x) ((x) < 0 ? -(x) : (x)) +#define MagickMax(x,y) (((x) > (y)) ? (x) : (y)) +#define MagickMin(x,y) (((x) < (y)) ? (x) : (y)) #define Magick2PI 6.28318530717958647692528676655900576839433879875020 #define MagickPHI 1.61803398874989484820458683436563811772030917980576 #define MagickPI 3.14159265358979323846264338327950288419716939937510 diff --git a/MagickCore/montage.c b/MagickCore/montage.c index 3de4b417e7..c84097d92b 100644 --- a/MagickCore/montage.c +++ b/MagickCore/montage.c @@ -285,20 +285,6 @@ static void GetMontageGeometry(char *geometry,const size_t number_images, *tiles_per_row=(size_t) ceil((double) number_images/(*tiles_per_column)); } -static inline ssize_t MagickMax(const ssize_t x,const ssize_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - #if defined(__cplusplus) || defined(c_plusplus) extern "C" { #endif diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c index 8018edff0f..195bb9ffbd 100644 --- a/MagickCore/morphology.c +++ b/MagickCore/morphology.c @@ -89,14 +89,6 @@ /* Other global definitions used by module. */ -static inline double MagickMin(const double x,const double y) -{ - return( x < y ? x : y); -} -static inline double MagickMax(const double x,const double y) -{ - return( x > y ? x : y); -} #define Minimize(assign,value) assign=MagickMin(assign,value) #define Maximize(assign,value) assign=MagickMax(assign,value) diff --git a/MagickCore/paint.c b/MagickCore/paint.c index 28e8ae55be..81064df5eb 100644 --- a/MagickCore/paint.c +++ b/MagickCore/paint.c @@ -405,12 +405,6 @@ MagickExport MagickBooleanType FloodfillPaintImage(Image *image, % o exception: return any errors or warnings in this structure. % */ - -static inline double MagickMax(const double x,const double y) -{ - return(x > y ? x : y); -} - MagickExport MagickBooleanType GradientImage(Image *image, const GradientType type,const SpreadMethod method, const PixelInfo *start_color,const PixelInfo *stop_color, diff --git a/MagickCore/pixel.c b/MagickCore/pixel.c index 16dd9cec8b..33f98f8698 100644 --- a/MagickCore/pixel.c +++ b/MagickCore/pixel.c @@ -2217,23 +2217,6 @@ MagickExport void GetPixelInfo(const Image *image,PixelInfo *pixel) % o pixel: Specifies a pointer to a Quantum structure. % */ - -static inline MagickRealType MagickMax(const MagickRealType x, - const MagickRealType y) -{ - if (x > y) - return(x); - return(y); -} - -static inline MagickRealType MagickMin(const MagickRealType x, - const MagickRealType y) -{ - if (x < y) - return(x); - return(y); -} - MagickExport MagickRealType GetPixelIntensity(const Image *restrict image, const Quantum *restrict pixel) { diff --git a/MagickCore/property.c b/MagickCore/property.c index 3724a12e8d..d79f7c3c85 100644 --- a/MagickCore/property.c +++ b/MagickCore/property.c @@ -487,20 +487,6 @@ static MagickBooleanType GetIPTCProperty(const Image *image,const char *key, return(MagickTrue); } -static inline ssize_t MagickMax(const ssize_t x,const ssize_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - static inline int ReadPropertyByte(const unsigned char **p,size_t *length) { int diff --git a/MagickCore/quantize.c b/MagickCore/quantize.c index 5de7bcf22c..134e1e6e39 100644 --- a/MagickCore/quantize.c +++ b/MagickCore/quantize.c @@ -1926,20 +1926,6 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, return(MagickTrue); } -static inline ssize_t MagickMax(const ssize_t x,const ssize_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType DitherImage(Image *image,CubeInfo *cube_info, ExceptionInfo *exception) { diff --git a/MagickCore/resize.c b/MagickCore/resize.c index efa0d1233a..6aa1c5f32b 100644 --- a/MagickCore/resize.c +++ b/MagickCore/resize.c @@ -2383,20 +2383,6 @@ static ContributionInfo **AcquireContributionThreadSet(const size_t count) return(contribution); } -static inline double MagickMax(const double x,const double y) -{ - if (x > y) - return(x); - return(y); -} - -static inline double MagickMin(const double x,const double y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType HorizontalFilter(const ResizeFilter *resize_filter, const Image *image,Image *resize_image,const double x_factor, const MagickSizeType span,MagickOffsetType *offset,ExceptionInfo *exception) diff --git a/MagickCore/segment.c b/MagickCore/segment.c index 3489ee3603..4f267dce5e 100644 --- a/MagickCore/segment.c +++ b/MagickCore/segment.c @@ -696,28 +696,6 @@ static MagickBooleanType Classify(Image *image,short **extrema, % in the zero_crossing array. % */ - -static inline ssize_t MagickAbsoluteValue(const ssize_t x) -{ - if (x < 0) - return(-x); - return(x); -} - -static inline ssize_t MagickMax(const ssize_t x,const ssize_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - static void ConsolidateCrossings(ZeroCrossing *zero_crossing, const size_t number_crossings) { diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index d01a4dc464..e9b103712c 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -225,13 +225,6 @@ static int IntensityCompare(const void *x,const void *y) } #endif -static inline double MagickMin(const double x,const double y) -{ - if (x < y) - return(x); - return(y); -} - static double ApplyEvaluateOperator(RandomInfo *random_info,const Quantum pixel, const MagickEvaluateOperator op,const double value) { @@ -2915,20 +2908,6 @@ static inline void InsertPixelList(const Quantum pixel,PixelList *pixel_list) AddNodePixelList(pixel_list,index); } -static inline double MagickAbsoluteValue(const double x) -{ - if (x < 0) - return(-x); - return(x); -} - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - static void ResetPixelList(PixelList *pixel_list) { int diff --git a/MagickCore/xwindow.c b/MagickCore/xwindow.c index b41f8374db..8274f1e1a7 100644 --- a/MagickCore/xwindow.c +++ b/MagickCore/xwindow.c @@ -1144,22 +1144,6 @@ MagickPrivate void XBestPixel(Display *display,const Colormap colormap, % o resource_info: Specifies a pointer to a X11 XResourceInfo structure. % */ - -static inline int MagickMax(const int x,const int y) -{ - if (x > y) - return(x); - return(y); -} - -static inline size_t MagickMin(const unsigned int x, - const unsigned int y) -{ - if (x < y) - return(x); - return(y); -} - MagickPrivate XVisualInfo *XBestVisualInfo(Display *display, XStandardColormap *map_info,XResourceInfo *resource_info) { diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index b110bfb39b..820d38d235 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -381,13 +381,6 @@ static inline MagickBooleanType IsPathWritable(const char *path) return(MagickTrue); } -static inline ssize_t MagickMax(const ssize_t x,const ssize_t y) -{ - if (x > y) - return(x); - return(y); -} - static MagickBooleanType MonitorProgress(const char *text, const MagickOffsetType offset,const MagickSizeType extent, void *wand_unused(client_data)) diff --git a/coders/bmp.c b/coders/bmp.c index 25ef657d98..1218d89217 100644 --- a/coders/bmp.c +++ b/coders/bmp.c @@ -185,28 +185,6 @@ static MagickBooleanType % the decoding process. % */ - -static inline ssize_t MagickAbsoluteValue(const ssize_t x) -{ - if (x < 0) - return(-x); - return(x); -} - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType DecodeImage(Image *image,const size_t compression, unsigned char *pixels) { diff --git a/coders/cip.c b/coders/cip.c index e90f7fae16..86a3427a06 100644 --- a/coders/cip.c +++ b/coders/cip.c @@ -159,14 +159,6 @@ ModuleExport void UnregisterCIPImage(void) % o exception: return any errors or warnings in this structure. % */ - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType WriteCIPImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { diff --git a/coders/dcm.c b/coders/dcm.c index 12a4c2e556..12d45d2fc1 100644 --- a/coders/dcm.c +++ b/coders/dcm.c @@ -2675,21 +2675,6 @@ static MagickBooleanType IsDCM(const unsigned char *magick,const size_t length) % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - typedef struct _DCMStreamInfo { size_t diff --git a/coders/dib.c b/coders/dib.c index 17df06a59c..9d735a4762 100644 --- a/coders/dib.c +++ b/coders/dib.c @@ -143,14 +143,6 @@ static MagickBooleanType % the decoding process. % */ - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType DecodeImage(Image *image, const MagickBooleanType compression,unsigned char *pixels) { @@ -441,21 +433,6 @@ static MagickBooleanType IsDIB(const unsigned char *magick,const size_t length) % o exception: return any errors or warnings in this structure. % */ - -static inline ssize_t MagickAbsoluteValue(const ssize_t x) -{ - if (x < 0) - return(-x); - return(x); -} - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - static Image *ReadDIBImage(const ImageInfo *image_info,ExceptionInfo *exception) { DIBInfo diff --git a/coders/gif.c b/coders/gif.c index ab26ea9d4e..df06bf3adc 100644 --- a/coders/gif.c +++ b/coders/gif.c @@ -917,21 +917,6 @@ static ssize_t ReadBlobBlock(Image *image,unsigned char *data) % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType PingGIFImage(Image *image,ExceptionInfo *exception) { unsigned char diff --git a/coders/histogram.c b/coders/histogram.c index a91811bd34..479b28cb90 100644 --- a/coders/histogram.c +++ b/coders/histogram.c @@ -171,14 +171,6 @@ ModuleExport void UnregisterHISTOGRAMImage(void) % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - static MagickBooleanType WriteHISTOGRAMImage(const ImageInfo *image_info, Image *image,ExceptionInfo *exception) { diff --git a/coders/inline.c b/coders/inline.c index b9d3c765b0..3a51ecae8d 100644 --- a/coders/inline.c +++ b/coders/inline.c @@ -86,14 +86,6 @@ % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static Image *ReadINLINEImage(const ImageInfo *image_info, ExceptionInfo *exception) { diff --git a/coders/jpeg.c b/coders/jpeg.c index b445ff4522..21688e6b52 100644 --- a/coders/jpeg.c +++ b/coders/jpeg.c @@ -1878,13 +1878,6 @@ static void InitializeDestination(j_compress_ptr cinfo) destination->manager.free_in_buffer=MaxBufferExtent; } -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static void TerminateDestination(j_compress_ptr cinfo) { DestinationManager diff --git a/coders/mat.c b/coders/mat.c index 1bb112fe74..9dd6f4fe3b 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -594,14 +594,6 @@ UnlinkFile: % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) { Image *image, *image2=NULL, diff --git a/coders/miff.c b/coders/miff.c index 89a5f0171d..652392c80d 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -185,20 +185,6 @@ static voidpf AcquireZIPMemory(voidpf context,unsigned int items, } #endif -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static void PushRunlengthPacket(Image *image,const unsigned char *pixels, size_t *length,PixelInfo *pixel,ExceptionInfo *exception) { diff --git a/coders/mpeg.c b/coders/mpeg.c index 18aa4b99ee..b464fa94b9 100644 --- a/coders/mpeg.c +++ b/coders/mpeg.c @@ -366,21 +366,6 @@ ModuleExport void UnregisterMPEGImage(void) % o exception: return any errors or warnings in this structure. % */ - -static inline double MagickMax(const double x,const double y) -{ - if (x > y) - return(x); - return(y); -} - -static inline double MagickMin(const double x,const double y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType CopyDelegateFile(const char *source, const char *destination) { diff --git a/coders/palm.c b/coders/palm.c index 9396ee5a2b..b0d15c352b 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -229,21 +229,6 @@ static ssize_t FindColor(PixelInfo *packet) % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - static Image *ReadPALMImage(const ImageInfo *image_info, ExceptionInfo *exception) { diff --git a/coders/pcd.c b/coders/pcd.c index a1b9d94280..1586f2975e 100644 --- a/coders/pcd.c +++ b/coders/pcd.c @@ -385,14 +385,6 @@ static MagickBooleanType IsPCD(const unsigned char *magick,const size_t length) % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static Image *OverviewImage(const ImageInfo *image_info,Image *image, ExceptionInfo *exception) { diff --git a/coders/pcx.c b/coders/pcx.c index 60b696d518..57fcb1758e 100644 --- a/coders/pcx.c +++ b/coders/pcx.c @@ -197,28 +197,6 @@ static MagickBooleanType IsPCX(const unsigned char *magick,const size_t length) % o exception: return any errors or warnings in this structure. % */ - -static inline ssize_t MagickAbsoluteValue(const ssize_t x) -{ - if (x < 0) - return(-x); - return(x); -} - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define ThrowPCXException(severity,tag) \ diff --git a/coders/pdf.c b/coders/pdf.c index 13b8978286..1645a39540 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -952,20 +952,6 @@ ModuleExport void UnregisterPDFImage(void) % */ -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static char *EscapeParenthesis(const char *text) { register char diff --git a/coders/pict.c b/coders/pict.c index 175e503bac..38417d1290 100644 --- a/coders/pict.c +++ b/coders/pict.c @@ -778,14 +778,6 @@ static MagickBooleanType IsPICT(const unsigned char *magick,const size_t length) % */ -static inline size_t MagickMax(const size_t x, - const size_t y) -{ - if (x > y) - return(x); - return(y); -} - static MagickBooleanType ReadRectangle(Image *image,PICTRectangle *rectangle) { rectangle->top=(short) ReadBlobMSBShort(image); diff --git a/coders/plasma.c b/coders/plasma.c index 7314b2fdff..469071be4d 100644 --- a/coders/plasma.c +++ b/coders/plasma.c @@ -91,13 +91,6 @@ % */ -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - static inline void PlasmaPixel(Image *image,RandomInfo *random_info,double x, double y,ExceptionInfo *exception) { diff --git a/coders/png.c b/coders/png.c index 145dd9405f..9decb30ee1 100644 --- a/coders/png.c +++ b/coders/png.c @@ -1038,14 +1038,6 @@ Magick_RenderingIntentString_from_PNG_RenderingIntent(const int ping_intent) } } -static inline ssize_t MagickMax(const ssize_t x,const ssize_t y) -{ - if (x > y) - return(x); - - return(y); -} - static const char * Magick_ColorType_from_PNG_ColorType(const int ping_colortype) { @@ -1071,14 +1063,6 @@ Magick_ColorType_from_PNG_ColorType(const int ping_colortype) } } - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - - return(y); -} #endif /* PNG_LIBPNG_VER > 10011 */ #endif /* MAGICKCORE_PNG_DELEGATE */ diff --git a/coders/ps.c b/coders/ps.c index b11d785eb5..f9ebfee74f 100644 --- a/coders/ps.c +++ b/coders/ps.c @@ -1143,13 +1143,6 @@ ModuleExport void UnregisterPSImage(void) % */ -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static inline unsigned char *PopHexPixel(const char **hex_digits, const size_t pixel,unsigned char *pixels) { diff --git a/coders/psd.c b/coders/psd.c index a4d7d455f3..4a34344f44 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -500,13 +500,6 @@ static inline size_t GetPSDRowSize(Image *image) return(image->columns*GetPSDPacketSize(image)); } -static inline ssize_t MagickAbsoluteValue(const ssize_t x) -{ - if (x < 0) - return(-x); - return(x); -} - static const char *ModeToString(PSDImageType type) { switch (type) diff --git a/coders/rle.c b/coders/rle.c index d4f90fa65f..dd77e43c94 100644 --- a/coders/rle.c +++ b/coders/rle.c @@ -124,14 +124,6 @@ static MagickBooleanType IsRLE(const unsigned char *magick,const size_t length) % % */ - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - static Image *ReadRLEImage(const ImageInfo *image_info,ExceptionInfo *exception) { #define SkipLinesOp 0x01 diff --git a/coders/sgi.c b/coders/sgi.c index d9d0f8a217..97fe91479e 100644 --- a/coders/sgi.c +++ b/coders/sgi.c @@ -164,13 +164,6 @@ static MagickBooleanType IsSGI(const unsigned char *magick,const size_t length) % */ -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType SGIDecode(const size_t bytes_per_pixel, ssize_t number_packets,unsigned char *packets,ssize_t number_pixels, unsigned char *pixels) diff --git a/coders/stegano.c b/coders/stegano.c index 823d2ae096..26c2aff095 100644 --- a/coders/stegano.c +++ b/coders/stegano.c @@ -87,15 +87,6 @@ % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMin(const size_t x, - const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static Image *ReadSTEGANOImage(const ImageInfo *image_info, ExceptionInfo *exception) { diff --git a/coders/tga.c b/coders/tga.c index 03d2a23322..8b614791dc 100644 --- a/coders/tga.c +++ b/coders/tga.c @@ -654,14 +654,6 @@ ModuleExport void UnregisterTGAImage(void) % o image: The image. % */ - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static inline void WriteTGAPixel(Image *image,TGAImageType image_type, const Quantum *p,const QuantumAny range,const double midpoint) { diff --git a/coders/tiff.c b/coders/tiff.c index 028e12deb5..ec27e9d158 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -499,20 +499,6 @@ static MagickBooleanType DecodeLabImage(Image *image,ExceptionInfo *exception) return(status); } -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline ssize_t MagickMin(const ssize_t x,const ssize_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType ReadProfile(Image *image,const char *name, unsigned char *datum,ssize_t length,ExceptionInfo *exception) { @@ -1435,8 +1421,6 @@ RestoreMSCWarning samples_per_pixel); if (compress_tag == COMPRESSION_JBIG) method=ReadStripMethod; - if ((photometric != PHOTOMETRIC_SEPARATED) && - if (TIFFIsTiled(tiff) != MagickFalse) method=ReadTileMethod; quantum_info->endian=LSBEndian; diff --git a/coders/viff.c b/coders/viff.c index 85d93e3aad..74329a0953 100644 --- a/coders/viff.c +++ b/coders/viff.c @@ -841,14 +841,6 @@ ModuleExport void UnregisterVIFFImage(void) % o exception: return any errors or warnings in this structure. % */ - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static MagickBooleanType WriteVIFFImage(const ImageInfo *image_info, Image *image,ExceptionInfo *exception) { diff --git a/coders/xcf.c b/coders/xcf.c index b27d55fd87..577bdcd28f 100644 --- a/coders/xcf.c +++ b/coders/xcf.c @@ -287,13 +287,6 @@ static CompositeOperator GIMPBlendModeToCompositeOperator( % */ -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static char *ReadBlobStringWithLongSize(Image *image,char *string,size_t max, ExceptionInfo *exception) { diff --git a/coders/xpm.c b/coders/xpm.c index f2e8e36f28..10d5337afb 100644 --- a/coders/xpm.c +++ b/coders/xpm.c @@ -172,13 +172,6 @@ static char *NextXPMLine(char *p) return(p); } -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - static char *ParseXPMColor(char *color,MagickBooleanType search_start) { #define NumberTargets 6