]> granicus.if.org Git - imagemagick/blobdiff - magick/image-private.h
(no commit message)
[imagemagick] / magick / image-private.h
index 1ac0a95d3ec09b6bea3d1bf74c170a12098ac95f..cbc78f88e5ee79d18e0d3bb4c87763d302f69054 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization
+  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
 
   You may not use this file except in compliance with the License.
 extern "C" {
 #endif
 
-#define MagickPI  3.14159265358979323846264338327950288419716939937510
-#define Magick2PI  6.28318530717958647692528676655900576839433879875020
-#define MagickPI2  1.57079632679489661923132169163975144209858469968755
-#define MagickSQ1_2  0.7071067811865475244008443621048490
-#define MagickSQ2PI  2.50662827463100024161235523934010416269302368164062
+#define MagickPI     3.14159265358979323846264338327950288419716939937510L
+#define Magick2PI    6.28318530717958647692528676655900576839433879875020L
+#define MagickPI2    1.57079632679489661923132169163975144209858469968755L
+#define MagickSQ1_2  0.70710678118654752440084436210484903928483593768847L
+#define MagickSQ2    1.41421356237309504880168872420969807856967187537695L
+#define MagickSQ2PI  2.50662827463100024161235523934010416269302368164062L
 #define QuantumScale  ((double) 1.0/(double) QuantumRange)
 #define UndefinedTicksPerSecond  100L
 #define UndefinedCompressionQuality  0UL
@@ -51,32 +52,32 @@ extern MagickExport const double
 
 static inline double DegreesToRadians(const double degrees)
 {
-  return(MagickPI*degrees/180.0);
+  return((double) (MagickPI*degrees/180.0));
 }
 
 static inline MagickRealType RadiansToDegrees(const MagickRealType radians)
 {
-  return(180.0*radians/MagickPI);
+  return((MagickRealType) (180.0*radians/MagickPI));
 }
 
-static inline unsigned char ScaleColor5to8(const unsigned long color)
+static inline unsigned char ScaleColor5to8(const unsigned int color)
 {
   return((unsigned char) (((color) << 3) | ((color) >> 2)));
 }
 
-static inline unsigned char ScaleColor6to8(const unsigned long color)
+static inline unsigned char ScaleColor6to8(const unsigned int color)
 {
   return((unsigned char) (((color) << 2) | ((color) >> 4)));
 }
 
-static inline unsigned long ScaleColor8to5(const unsigned char color)
+static inline unsigned int ScaleColor8to5(const unsigned char color)
 {
-  return((unsigned long) (((color) & ~0x07) >> 3));
+  return((unsigned int) (((color) & ~0x07) >> 3));
 }
 
-static inline unsigned long ScaleColor8to6(const unsigned char color)
+static inline unsigned int ScaleColor8to6(const unsigned char color)
 {
-  return((unsigned long) (((color) & ~0x03) >> 2));
+  return((unsigned int) (((color) & ~0x03) >> 2));
 }
 
 #if defined(__cplusplus) || defined(c_plusplus)