[Rcpp-commits] r2399 - in pkg/Rcpp: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 5 17:43:05 CET 2010


Author: romain
Date: 2010-11-05 17:43:05 +0100 (Fri, 05 Nov 2010)
New Revision: 2399

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/src/Module.cpp
Log:
simple mangling of class names

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2010-11-05 13:15:39 UTC (rev 2398)
+++ pkg/Rcpp/ChangeLog	2010-11-05 16:43:05 UTC (rev 2399)
@@ -1,3 +1,11 @@
+2010-11-05  Romain Francois <romain at r-enthusiasts.com>
+
+	* inst/include/Rcpp/Module.h: exposing multiple constructors in modules
+	
+	* src/Module.cpp: The mangled class name is now "Rcpp_" plus the class
+	name. The previous version used the address of the external pointer to the 
+	module, which was not constant. 
+
 2010-11-04  Douglas Bates  <bates at stat.wisc.edu>
 
 	* inst/include/Rcpp/module/Module_generated_Constructor.h: remove

Modified: pkg/Rcpp/src/Module.cpp
===================================================================
--- pkg/Rcpp/src/Module.cpp	2010-11-05 13:15:39 UTC (rev 2398)
+++ pkg/Rcpp/src/Module.cpp	2010-11-05 16:43:05 UTC (rev 2399)
@@ -283,12 +283,7 @@
 		slot( "module"  ) = XP( p, false ) ;
 		slot( "pointer" ) = clxp ;
 		
-		std::string mangled_name( "rcpp_" ) ;
-		char buffer[20] ;
-		sprintf( buffer, "%p", (void*)EXTPTR_PTR(clxp) ) ;
-	
-		mangled_name += (const char*) buffer ;
-		mangled_name += "_" ;
+		std::string mangled_name( "Rcpp_" ) ;
 		mangled_name += cl->name ;
 		slot( ".Data" ) = mangled_name ;
 		



More information about the Rcpp-commits mailing list