A silly error in libfpx -- ph_image.h vs. f_fpxio.h

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
mi
Posts: 123
Joined: 2005-01-25T14:14:43-07:00
Contact:

A silly error in libfpx -- ph_image.h vs. f_fpxio.h

Post by mi »

The same virtual method (CreateEmptyResolutionLevel) is declared with a slightly different signature in the two files.

GNU C++ did not mind, but clang is throwing a warning. The below patch (already part of FreeBSD port graphics/libfpx) resolves the problem by using the signature of the implementation in f_fpxio.cpp, where the method, actually, does something...

Code: Select all

--- ri_image/ph_image.h 2007-11-02 03:10:05.000000000 -0400
+++ ri_image/ph_image.h 2012-10-04 22:38:52.000000000 -0400
@@ -173,5 +173,5 @@
         virtual FPXStatus CreateInitResolutionLevelList();                    // Make a sub image list in read or write mode
         virtual FPXStatus CreateEmptyResolutionLevelList();                   // Make a sub image list in create mode
-    virtual PResolutionLevel* CreateEmptyResolutionLevel(int width, int height, long* quelImage); // Make a sub image in cre
ate mode
+    virtual PResolutionLevel* CreateEmptyResolutionLevel(int width, int height, int* quelImage); // Make a sub image in crea
te mode
     virtual PResolutionLevel* CreateInitResolutionLevel(int* offset, long id);           // Make a sub image in read or writ
e mode

--- ri_image/ph_image.cpp       2007-11-02 03:10:05.000000000 -0400
+++ ri_image/ph_image.cpp       2012-10-04 22:38:31.000000000 -0400
@@ -1127,5 +1127,5 @@
 //  ----------------------------------------------------------------------------
 // Make a sub resolution level in create mode
-PResolutionLevel* PHierarchicalImage::CreateEmptyResolutionLevel(int , int , long int*)
+PResolutionLevel* PHierarchicalImage::CreateEmptyResolutionLevel(int , int , int*)
 {
   return NULL;
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: A silly error in libfpx -- ph_image.h vs. f_fpxio.h

Post by magick »

Thanks for the problem report and patch. We get an updated distribution of FPX with your patch out by sometime tomorrow.
Post Reply