[Rcpp-commits] r424 - in pkg: . inst src src/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 22 15:20:56 CET 2010


Author: romain
Date: 2010-01-22 15:20:56 +0100 (Fri, 22 Jan 2010)
New Revision: 424

Modified:
   pkg/DESCRIPTION
   pkg/inst/ChangeLog
   pkg/src/Environment.cpp
   pkg/src/Rcpp/Named.h
   pkg/src/Rcpp/wrap.h
   pkg/src/RcppCommon.h
Log:
pre declare Rcpp::* classes

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2010-01-22 13:55:32 UTC (rev 423)
+++ pkg/DESCRIPTION	2010-01-22 14:20:56 UTC (rev 424)
@@ -1,6 +1,6 @@
 Package: Rcpp
 Title: Rcpp R/C++ interface package
-Version: 0.7.3
+Version: 0.7.3.1
 Date: $Date$
 Author: Dirk Eddelbuettel and Romain Francois, with contributions 
  by Simon Urbanek and David Reiss; based on code written during 

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2010-01-22 13:55:32 UTC (rev 423)
+++ pkg/inst/ChangeLog	2010-01-22 14:20:56 UTC (rev 424)
@@ -4,6 +4,9 @@
 
 	* src/Rcpp/Environment.h: make sure what() is const. (suncc finding)
 
+	* src/RcppCommon.h: pre declare classes, as an ettempt to 
+	deal with the suncc warning "RObject may not have a type qualifier."
+
 2010-01-21  Dirk Eddelbuettel  <edd at debian.org>
 
 	* DESCRIPTION: Release 0.7.3

Modified: pkg/src/Environment.cpp
===================================================================
--- pkg/src/Environment.cpp	2010-01-22 13:55:32 UTC (rev 423)
+++ pkg/src/Environment.cpp	2010-01-22 14:20:56 UTC (rev 424)
@@ -27,16 +27,6 @@
 
 namespace Rcpp {
 
-/* this comes from JRI, where it was introduced to cope with cases
-   where bindings are locked */
-struct safeAssign_s {
-    SEXP sym, val, rho;
-};
-static void safeAssign(void *data) {
-    struct safeAssign_s *s = (struct safeAssign_s*) data;
-    Rf_defineVar(s->sym, s->val, s->rho);
-}
-
 struct safeFindNamespace_s {
     SEXP sym, val ;
 };
@@ -131,19 +121,8 @@
     
     bool Environment::assign( const std::string& name, SEXP x = R_NilValue) const throw(binding_is_locked){
     	if( exists( name) && bindingIsLocked(name) ) throw binding_is_locked(name) ;
-    	
-    	/* borrowed from JRI, we cannot just use defineVar since it might 
-    	   crash on locked bindings */
-    	   
-    	/* TODO: we need to modify R_ToplevelExec so that it does not print 
-    	         the error message as it currently does*/
-    	struct safeAssign_s s;
-    	s.sym = Rf_install( name.c_str() ) ;
-    	if( !s.sym || s.sym == R_NilValue ) return false ;
-    	
-    	s.rho = m_sexp ;
-    	s.val = x ;
-    	return static_cast<bool>( R_ToplevelExec(safeAssign, (void*) &s) );
+    	Rf_defineVar( Rf_install( name.c_str() ) , x, m_sexp );
+    	return true ;
     }
     
     bool Environment::remove( const std::string& name) throw(binding_is_locked){

Modified: pkg/src/Rcpp/Named.h
===================================================================
--- pkg/src/Rcpp/Named.h	2010-01-22 13:55:32 UTC (rev 423)
+++ pkg/src/Rcpp/Named.h	2010-01-22 14:20:56 UTC (rev 424)
@@ -22,6 +22,7 @@
 #ifndef Rcpp_Named_h
 #define Rcpp_Named_h
 
+#include <RcppCommon.h>
 #include <Rcpp/RObject.h>
 #include <Rcpp/Symbol.h>
 

Modified: pkg/src/Rcpp/wrap.h
===================================================================
--- pkg/src/Rcpp/wrap.h	2010-01-22 13:55:32 UTC (rev 423)
+++ pkg/src/Rcpp/wrap.h	2010-01-22 14:20:56 UTC (rev 424)
@@ -22,11 +22,12 @@
 #ifndef Rcpp_wrap_h
 #define Rcpp_wrap_h
 
+#include <RcppCommon.h>
+
 #ifdef HAS_INIT_LISTS
 #include <initializer_list>
 #endif
 
-#include <RcppCommon.h>
 #include <Rcpp/RObject.h>
 #include <set>
 #include <Rcpp/IntegerVector.h>

Modified: pkg/src/RcppCommon.h
===================================================================
--- pkg/src/RcppCommon.h	2010-01-22 13:55:32 UTC (rev 423)
+++ pkg/src/RcppCommon.h	2010-01-22 14:20:56 UTC (rev 424)
@@ -93,4 +93,27 @@
 const char * sexp_to_name(int sexp_type); 
 
 RcppExport SEXP initRcpp() ;
+
+namespace Rcpp{
+	
+	class RObject ;
+	class Environment;
+	class Evaluator ;
+	class Symbol ;
+	class Language ;
+	class Named ;
+	class Pairlist ;
+	class Function ;
+	class IntegerVector; 
+	class NumericVector; 
+	class RawVector; 
+	class LogicalVector; 
+	class GenericVector; 
+	class WeakReference; 
+	class CharacterVector; 
+	class ExpressionVector; 
+	class ComplexVector; 
+}
+
+
 #endif



More information about the Rcpp-commits mailing list