[Rinside-commits] r129 - in pkg: inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 20 20:11:10 CET 2010


Author: edd
Date: 2010-03-20 20:11:09 +0100 (Sat, 20 Mar 2010)
New Revision: 129

Modified:
   pkg/inst/ChangeLog
   pkg/src/RInside.cpp
Log:
use explicit std::string() ctors for all text arguments inside throw


Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2010-03-20 18:47:43 UTC (rev 128)
+++ pkg/inst/ChangeLog	2010-03-20 19:11:09 UTC (rev 129)
@@ -1,5 +1,10 @@
-2010-03-16  Dirk Eddelbuettel  <edd at dexter>
+2010-03-20  Dirk Eddelbuettel  <edd at debian.org>
 
+	* src/RInside.cpp: Use explicit std::string() constructors for all
+	  text arguments inside throw() calls (to satisfy the Windows compiler)
+
+2010-03-16  Dirk Eddelbuettel  <edd at debian.org>
+
 	* src/RInside.{h,cpp}: parseEval* function changed slightly so that
 	  SEXP parseEval(string) is now preferred, and it as well as
 	  void parseEvalQ(string) now throw exceptions; they call the
@@ -9,7 +14,7 @@
 	  accordingly, mostly by removing no-longer-needed error checking
 	  and exepction throw which has now move 'up' into RInside.cpp
 
-2010-02-25  Dirk Eddelbuettel  <edd at dexter>
+2010-02-25  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/examples/mpi/: Added two variants using the C++ API to MPI
 

Modified: pkg/src/RInside.cpp
===================================================================
--- pkg/src/RInside.cpp	2010-03-20 18:47:43 UTC (rev 128)
+++ pkg/src/RInside.cpp	2010-03-20 19:11:09 UTC (rev 129)
@@ -67,8 +67,9 @@
 	    if (setenv(R_VARS[i],R_VARS[i+1],1) != 0){
 		//perror("ERROR: couldn't set/replace an R environment variable");
 		//exit(1);
-		throw std::runtime_error("Could not set R environment variable " + 
-					 std::string(R_VARS[i]) + " to " +  std::string(R_VARS[i+1]));
+		throw std::runtime_error(std::string("Could not set R environment variable ") +
+					 std::string(R_VARS[i]) + std::string(" to ") +  
+					 std::string(R_VARS[i+1]));
 	    }
 	}
     }
@@ -127,7 +128,7 @@
     if (setenv("R_SESSION_TMPDIR",tmp,1) != 0){
 	//perror("Fatal Error: couldn't set/replace R_SESSION_TMPDIR!");
 	//exit(1);
-	throw std::runtime_error("Could not set / replace R_SESSION_TMPDIR to " + std::string(tmp));
+	throw std::runtime_error(std::string("Could not set / replace R_SESSION_TMPDIR to ") + std::string(tmp));
     }
 }
 
@@ -224,7 +225,7 @@
     } catch( std::exception& ex){
 	// fprintf(stderr,"%s: Error calling delayedAssign:\n %s", programName, ex.what() );
 	// exit(1);	    
-	throw std::runtime_error("Error calling delayedAssign: " + std::string(ex.what()));
+	throw std::runtime_error(std::string("Error calling delayedAssign: ") + std::string(ex.what()));
     }
 }
 
@@ -287,7 +288,7 @@
     SEXP ans;
     int rc = parseEval(line, ans);
     if (rc != 0) {
-	throw std::runtime_error("Error evaluating: " + line);
+	throw std::runtime_error(std::string("Error evaluating: ") + line);
     }
 }
 
@@ -295,7 +296,7 @@
     SEXP ans;
     int rc = parseEval(line, ans);
     if (rc != 0) {
-	throw std::runtime_error("Error evaluating: " + line);
+	throw std::runtime_error(std::string("Error evaluating: ") + line);
     }
     return ans;
 }



More information about the Rinside-commits mailing list