]> git.eshelyaron.com Git - emacs.git/commitdiff
Pacify -Wdouble-promotion in ImageMagick code
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 Aug 2018 17:03:43 +0000 (10:03 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 Aug 2018 17:04:17 +0000 (10:04 -0700)
* src/image.c (imagemagick_load_image): Use double division, and
eliminate a cast.  This avoids a -Wdouble-promotion warning with
GCC 7.3 on Ubuntu 18.04.

src/image.c

index 69aeab5d657f3f75d653589264b5e1435efefbf3..24decbc09977b5315c8d35e71a1fbc9da207ff1c 100644 (file)
@@ -8824,7 +8824,8 @@ imagemagick_load_image (struct frame *f, struct image *img,
 #endif /* HAVE_MAGICKEXPORTIMAGEPIXELS */
     {
       size_t image_height;
-      MagickRealType color_scale = 65535.0 / (MagickRealType) QuantumRange;
+      double quantum_range = QuantumRange;
+      MagickRealType color_scale = 65535.0 / quantum_range;
 #ifdef USE_CAIRO
       data = xmalloc (width * height * 4);
       color_scale /= 256;