[Rcpp-commits] r2153 - in pkg/Rcpp: . R inst/include/Rcpp/vector tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 24 10:04:14 CEST 2010


Author: romain
Date: 2010-09-24 10:04:13 +0200 (Fri, 24 Sep 2010)
New Revision: 2153

Modified:
   pkg/Rcpp/DESCRIPTION
   pkg/Rcpp/R/02_completion.R
   pkg/Rcpp/R/Module.R
   pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
   pkg/Rcpp/inst/include/Rcpp/vector/traits.h
   pkg/Rcpp/tests/modref.R
Log:
higher R svn version requirement and making codetools happy

Modified: pkg/Rcpp/DESCRIPTION
===================================================================
--- pkg/Rcpp/DESCRIPTION	2010-09-24 00:49:27 UTC (rev 2152)
+++ pkg/Rcpp/DESCRIPTION	2010-09-24 08:04:13 UTC (rev 2153)
@@ -39,4 +39,4 @@
 License: GPL (>= 2)
 BugReports: http://r-forge.r-project.org/tracker/?atid=637&group_id=155&func=browse
 MailingList: Please send questions and comments regarding Rcpp to rcpp-devel at lists.r-forge.r-project.org
-MinimumSvnRev: 52961
+MinimumSvnRev: 52986

Modified: pkg/Rcpp/R/02_completion.R
===================================================================
--- pkg/Rcpp/R/02_completion.R	2010-09-24 00:49:27 UTC (rev 2152)
+++ pkg/Rcpp/R/02_completion.R	2010-09-24 08:04:13 UTC (rev 2153)
@@ -21,7 +21,7 @@
     if(identical(pointer, .badModulePointer)) {
         stop( "unitialized module" )
     }
-	grep( pattern , .Call( "Module__complete", pointer, PACKAGE = "Rcpp"), value = TRUE )	
+    grep( pattern , .Call( "Module__complete", pointer, PACKAGE = "Rcpp"), value = TRUE )	
 }
 setMethod( ".DollarNames", "Module", .DollarNames.Module )
 

Modified: pkg/Rcpp/R/Module.R
===================================================================
--- pkg/Rcpp/R/Module.R	2010-09-24 00:49:27 UTC (rev 2152)
+++ pkg/Rcpp/R/Module.R	2010-09-24 08:04:13 UTC (rev 2153)
@@ -164,7 +164,11 @@
                                  methods = methods,
                                  where = where
                                  )
+        # just to make codetools happy
+        .self <- .refClassDef <- NULL
         generator$methods(initialize = function(...) Rcpp:::cpp_object_initializer(.self,.refClassDef, ...))
+        rm( .self, .refClassDef )
+        
         classDef <- getClass(clname)
         ## non-public (static) fields in class representation
         ## <fixme>  Should these become real fields? </fixme>

Modified: pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/Vector.h	2010-09-24 00:49:27 UTC (rev 2152)
+++ pkg/Rcpp/inst/include/Rcpp/vector/Vector.h	2010-09-24 08:04:13 UTC (rev 2153)
@@ -318,8 +318,8 @@
 	inline iterator begin() const{ return cache.get() ; }
 	inline iterator end() const{ return cache.get(size()) ; }
 	
-	inline Proxy operator[]( const int& i ){ return cache.ref(i) ; }
-	inline Proxy operator[]( const int& i ) const { return cache.ref(i) ; }
+	inline Proxy operator[]( int i ){ return cache.ref(i) ; }
+	inline Proxy operator[]( int i ) const { return cache.ref(i) ; }
 	inline Proxy operator()( const size_t& i) throw(index_out_of_bounds){
 		return cache.ref( offset(i) ) ;
 	}

Modified: pkg/Rcpp/inst/include/Rcpp/vector/traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/traits.h	2010-09-24 00:49:27 UTC (rev 2152)
+++ pkg/Rcpp/inst/include/Rcpp/vector/traits.h	2010-09-24 08:04:13 UTC (rev 2153)
@@ -38,8 +38,12 @@
 		}
 		inline iterator get() const { return start; }
 		inline iterator get(int i) const { return start + i ; }
+		
+		inline proxy ref() { return *start ;}
+		inline proxy ref(int i) { return start[i] ; }
+		
 		inline proxy ref() const { return *start ;}
-		inline proxy ref(int i) const { return *(start+i) ; }
+		inline proxy ref(int i) const { return start[i] ; }
 		
 		private:
 			iterator start ;

Modified: pkg/Rcpp/tests/modref.R
===================================================================
--- pkg/Rcpp/tests/modref.R	2010-09-24 00:49:27 UTC (rev 2152)
+++ pkg/Rcpp/tests/modref.R	2010-09-24 08:04:13 UTC (rev 2153)
@@ -39,6 +39,7 @@
 	fx <- inline::cxxfunction( signature(), "" , include = inc, plugin = "Rcpp" )
 
 	mod <- Module( "yada", getDynLib(fx) )
+
     World <- mod$World
 
 ww = new(World)



More information about the Rcpp-commits mailing list