Not all string references are fully qualified

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
hwright
Posts: 6
Joined: 2015-02-20T10:24:16-07:00
Authentication code: 6789

Not all string references are fully qualified

Post by hwright »

Most string references in Magick++ are fully qualified (e.g., they use 'std::string' rather than 'string'). A few cases are missing, though, which causes build problems in environments which define their own string in the global namespace.

The attached patch fully qualifies string references which weren't previously.

Code: Select all

Index: Magick++/lib/CoderInfo.cpp
===================================================================
--- Magick++/lib/CoderInfo.cpp	(revision 18240)
+++ Magick++/lib/CoderInfo.cpp	(working copy)
@@ -55,9 +55,9 @@
     }
   else
     {
-      _name=string(magickInfo->name);
-      _description=string(magickInfo->description);
-      _mimeType=string(magickInfo->mime_type ? magickInfo->mime_type : "");
+      _name=std::string(magickInfo->name);
+      _description=std::string(magickInfo->description);
+      _mimeType=std::string(magickInfo->mime_type ? magickInfo->mime_type : "");
       _isReadable=((magickInfo->decoder == 0) ? false : true);
       _isWritable=((magickInfo->encoder == 0) ? false : true);
       _isMultiFrame=((magickInfo->adjoin == 0) ? false : true);
@@ -119,9 +119,9 @@
 }
 
 Magick::CoderInfo::CoderInfo(const MagickCore::MagickInfo *magickInfo_)
-  : _name(string(magickInfo_->name ? magickInfo_->name : "")),
-    _description(string(magickInfo_->description ? magickInfo_->description : "")),
-    _mimeType(string(magickInfo_->mime_type ? magickInfo_->mime_type : "")),
+  : _name(std::string(magickInfo_->name ? magickInfo_->name : "")),
+    _description(std::string(magickInfo_->description ? magickInfo_->description : "")),
+    _mimeType(std::string(magickInfo_->mime_type ? magickInfo_->mime_type : "")),
     _isReadable(magickInfo_->decoder ? true : false),
     _isWritable(magickInfo_->encoder ? true : false),
     _isMultiFrame(magickInfo_->adjoin ? true : false)
Index: Magick++/lib/Geometry.cpp
===================================================================
--- Magick++/lib/Geometry.cpp	(revision 18240)
+++ Magick++/lib/Geometry.cpp	(working copy)
@@ -288,7 +288,7 @@
   char
     buffer[MaxTextExtent];
 
-  string
+  std::string
     geometry;
 
   if (!isValid())
Index: Magick++/lib/Image.cpp
===================================================================
--- Magick++/lib/Image.cpp	(revision 18240)
+++ Magick++/lib/Image.cpp	(working copy)
@@ -1865,8 +1865,8 @@
         }
       else
         {
-          (void) CopyMagickString(boundingArea,string(boundingArea_).c_str(),
-            MaxTextExtent);
+          (void) CopyMagickString(boundingArea,
+            std::string(boundingArea_).c_str(), MaxTextExtent);
         }
       drawInfo->geometry=boundingArea;
     }
-Hyrum
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Not all string references are fully qualified

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.9.1-0 Beta, available by sometime tomorrow. Thanks.
Post Reply