Revision: 4492
          http://pd-gem.svn.sourceforge.net/pd-gem/?rev=4492&view=rev
Author:   zmoelnig
Date:     2011-08-26 09:45:44 +0000 (Fri, 26 Aug 2011)
Log Message:
-----------
try to not break the incoming "const" filename

Modified Paths:
--------------
    trunk/Gem/plugins/imageQT/imageQT.cpp

Modified: trunk/Gem/plugins/imageQT/imageQT.cpp
===================================================================
--- trunk/Gem/plugins/imageQT/imageQT.cpp       2011-08-26 08:43:57 UTC (rev 
4491)
+++ trunk/Gem/plugins/imageQT/imageQT.cpp       2011-08-26 09:45:44 UTC (rev 
4492)
@@ -331,11 +331,11 @@
   GraphicsImportComponent    importer = NULL;
 
   ::verbose(2, "reading '%s' with QuickTime", filename.c_str());
-
+  std::string myfilename=filename;
   // does the file even exist?
   if (!filename.empty()) {
     FSSpec   spec;
-    err = ::FSPathMakeFSSpec( reinterpret_cast<const 
UInt8*>(filename.c_str()), &spec);
+    err = ::FSPathMakeFSSpec( reinterpret_cast<const 
UInt8*>(myfilename.c_str()), &spec);
     if (err) {
       error("GemImageLoad: Unable to find file: %s", filename.c_str());
       error("parID : %d", spec.parID); 
@@ -386,8 +386,9 @@
 
   OSType                       osFileType=kQTFileTypeTIFF;
   mime2type(mimetype, osFileType);
+  std::string myfilename=filename.c_str();
 
-  const UInt8*filename8=reinterpret_cast<const UInt8*>(filename.c_str());
+  const UInt8*filename8=reinterpret_cast<const UInt8*>(myfilename.c_str());
     
 #if defined __APPLE__
   FSRef                        ref;
@@ -395,7 +396,7 @@
 
   if (err == fnfErr) {
     // if the file does not yet exist, then let's create the file
-    if(touch(filename)) {
+    if(touch(myfilename)) {
       return false;
     }
     err = FSPathMakeRef(filename8, &ref, NULL);
@@ -414,7 +415,7 @@
   err = FSMakeFSSpec(spec.vRefNum, spec.parID, filename8, &spec);  //this 
always gives an error -37 ???
 
 #elif defined _WIN32
-  touch(filename);
+  touch(myfilename);
   err = FSMakeFSSpec (0, 0L, filename8, &spec);
 #endif
   if (err != noErr && err != -37){

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
pd-gem-CVS mailing list
pd-gem-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pd-gem-cvs

Reply via email to