]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 17 Jun 2014 23:42:24 +0000 (23:42 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 17 Jun 2014 23:42:24 +0000 (23:42 +0000)
Magick++/lib/Pixels.cpp
MagickCore/composite.c
MagickCore/fx.c
MagickCore/profile.c
MagickCore/quantum.c
MagickWand/import.c
MagickWand/method-attribute.h
coders/jpeg.c
coders/pnm.c

index cffb19a090b4cee87c73fda1f3145d274347a8db..c0a0a6dbb5bb1f740f35be47b8b49d69445c6edb 100644 (file)
@@ -158,7 +158,7 @@ void Magick::PixelData::init(Magick::Image &image_,const ::ssize_t x_,
   _data=(void *) NULL;
   _length=0;
   _size=0;
-  if ((x_ < 0) || (width_ < 0) || (y_ < 0) || (height_ < 0) ||
+  if ((x_ < 0) || (width_ == 0) || (y_ < 0) || (height_ == 0) ||
       (x_ > image_.columns()) || (width_ + x_ > image_.columns()) ||
       (y_ > image_.rows()) || (height_ + y_ > image_.rows()) ||
       (map_.length() == 0))
@@ -210,4 +210,4 @@ void Magick::PixelData::relinquish(void) throw()
     _data=RelinquishMagickMemory(_data);
   _length=0;
   _size=0;
-}
\ No newline at end of file
+}
index d604805b56d59fac1bc8555ffd647bd6b901edd0..fe51f239230488d079fc4dc40bb1576713502ce1 100644 (file)
@@ -194,22 +194,6 @@ static inline MagickRealType MagickMax(const MagickRealType x,
   return(y);
 }
 
-static inline MagickRealType ConvertHueToRGB(MagickRealType m1,
-  MagickRealType m2,MagickRealType hue)
-{
-  if (hue < 0.0)
-    hue+=1.0;
-  if (hue > 1.0)
-    hue-=1.0;
-  if ((6.0*hue) < 1.0)
-    return(m1+6.0*(m2-m1)*hue);
-  if ((2.0*hue) < 1.0)
-    return(m2);
-  if ((3.0*hue) < 2.0)
-    return(m1+6.0*(m2-m1)*(2.0/3.0-hue));
-  return(m1);
-}
-
 static void HCLComposite(const MagickRealType hue,const MagickRealType chroma,
   const MagickRealType luma,MagickRealType *red,MagickRealType *green,
   MagickRealType *blue)
index 320d9102a7ba9823dff7b530659d8af00838b8ef..900bd3717c421fb2209e15458e5be36a9a63da04 100644 (file)
@@ -1115,13 +1115,6 @@ static inline double MagickMax(const double x,const double y)
   return(y);
 }
 
-static inline double MagickMin(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)
 {
index 60cdddc0bbe125ec25466e7889659292765c7943..2a2d0c7bcab2aff3a2e77b206b60a3c9bccd076e 100644 (file)
@@ -1119,17 +1119,6 @@ static inline const unsigned char *ReadResourceByte(const unsigned char *p,
   return(p);
 }
 
-static inline const unsigned char *ReadResourceBytes(const unsigned char *p,
-  const ssize_t count,unsigned char *quantum)
-{
-  register ssize_t
-    i;
-
-  for (i=0; i < count; i++)
-    *quantum++=(*p++);
-  return(p);
-}
-
 static inline const unsigned char *ReadResourceLong(const unsigned char *p,
   unsigned int *quantum)
 {
index 914e4aefbc2c6a9769ce3bbf103c9a989d00cbcd..b1659fd5b68dda9559727b62cd57b627fcd72ac1 100644 (file)
@@ -103,14 +103,6 @@ static void
 %    o image: the image.
 %
 */
-
-static inline size_t MagickMax(const size_t x,const size_t y)
-{
-  if (x > y)
-    return(x);
-  return(y);
-}
-
 MagickExport QuantumInfo *AcquireQuantumInfo(const ImageInfo *image_info,
   Image *image)
 {
index 8e60b1b67c5b5b372afb5fb4d98f15fe9677121c..aee4774b7fb3b6f90696af39be59e6fe00c0b5b4 100644 (file)
@@ -209,13 +209,6 @@ static MagickBooleanType ImportUsage(void)
   return(MagickFalse);
 }
 
-static inline ssize_t MagickMax(const ssize_t x,const ssize_t y)
-{
-  if (x > y)
-    return(x);
-  return(y);
-}
-
 WandExport MagickBooleanType ImportImageCommand(ImageInfo *image_info,
   int argc,char **argv,char **wand_unused(metadata),ExceptionInfo *exception)
 {
index 9ee27aaef6442b4f20c83ea1c824860e8fb73f3e..ccc71b0cb8094ae9c209f25da9e260ca8e522804 100644 (file)
@@ -109,13 +109,7 @@ extern "C" {
 #  define wand_unused(x) x
 #endif
 
-#if defined(__apple_build_version__)
-#  define magick_alloc_size(x)  __attribute__((__alloc_size__(x)))
-#  define magick_alloc_sizes(x,y)  __attribute__((__alloc_size__(x,y)))
-#  define magick_cold_spot
-#  define magick_hot_spot
-#else
-#if defined(__clang__) || (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
+#if (defined(__clang__) || (((__GNUC__) > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))) && !defined(__apple_build_version__)
 #  define wand_alloc_size(x)  __attribute__((__alloc_size__(x)))
 #  define wand_alloc_sizes(x,y)  __attribute__((__alloc_size__(x,y)))
 #  define wand_cold_spot  __attribute__((__cold__))
@@ -126,7 +120,6 @@ extern "C" {
 #  define wand_cold_spot
 #  define wand_hot_spot
 #endif
-#endif
 
 #if defined(__cplusplus) || defined(c_plusplus)
 }
index e782190a51e7efb12938b7e203c067ae66eeb721..6c487420ca45c2efbbc83aeb6fe83abcbb5dd1eb 100644 (file)
@@ -520,8 +520,11 @@ static boolean ReadICCProfile(j_decompress_ptr jpeg_info)
       status=SetImageProfile(image,"icc",profile,exception);
       profile=DestroyStringInfo(profile);
       if (status == MagickFalse)
-        ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
-          image->filename);
+        {
+          (void) ThrowMagickException(exception,GetMagickModule(),
+            ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+          return(FALSE);
+        }
     }
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
@@ -623,8 +626,11 @@ static boolean ReadIPTCProfile(j_decompress_ptr jpeg_info)
       status=SetImageProfile(image,"8bim",profile,exception);
       profile=DestroyStringInfo(profile);
       if (status == MagickFalse)
-        ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
-          image->filename);
+        {
+          (void) ThrowMagickException(exception,GetMagickModule(),
+            ResourceLimitError,"MemoryAllocationFailed","`%s'",image->filename);
+          return(FALSE);
+        }
     }
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(CoderEvent,GetMagickModule(),
@@ -2360,7 +2366,7 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
         }
       jpeg_info=DestroyImageInfo(jpeg_info);
     }
-  jpeg_set_quality(&jpeg_info,quality,MagickTrue);
+  jpeg_set_quality(&jpeg_info,quality,TRUE);
 #if (JPEG_LIB_VERSION >= 70)
   option=GetImageOption(image_info,"quality");
   if (option != (const char *) NULL)
@@ -2381,7 +2387,7 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
             (geometry_info.rho+0.5));
           jpeg_info.q_scale_factor[1]=jpeg_quality_scaling((int)
             (geometry_info.sigma+0.5));
-          jpeg_default_qtables(&jpeg_info,MagickTrue);
+          jpeg_default_qtables(&jpeg_info,TRUE);
         }
     }
 #endif
@@ -2500,7 +2506,7 @@ static MagickBooleanType WriteJPEGImage(const ImageInfo *image_info,
           table=DestroyQuantizationTable(table);
         }
     }
-  jpeg_start_compress(&jpeg_info,MagickTrue);
+  jpeg_start_compress(&jpeg_info,TRUE);
   if (image->debug != MagickFalse)
     {
       if (image->storage_class == PseudoClass)
index 5d79b2d5d26d7af726f61580db27bccebe0d317f..ce0e559687c48c9717b41b477a16724bae4b93bd 100644 (file)
@@ -135,19 +135,6 @@ static MagickBooleanType IsPNM(const unsigned char *magick,const size_t extent)
 %    o exception: return any errors or warnings in this structure.
 %
 */
-
-static inline ssize_t ConstrainPixel(Image *image,const ssize_t offset,
-  const size_t extent,ExceptionInfo *exception)
-{
-  if ((offset < 0) || (offset > (ssize_t) extent))
-    {
-      (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
-        "InvalidPixel","`%s'",image->filename);
-      return(0);
-    }
-  return(offset);
-}
-
 static void PNMComment(Image *image,ExceptionInfo *exception)
 {
   int