[Rcpp-devel] [Rcpp-commits] r322 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jan 8 20:01:34 CET 2010


Author: romain
Date: 2010-01-08 20:01:34 +0100 (Fri, 08 Jan 2010)
New Revision: 322

Modified:
   pkg/src/GenericVector.cpp
   pkg/src/wrap.cpp
Log:
more uses of size_t instead of int

Modified: pkg/src/GenericVector.cpp
===================================================================
--- pkg/src/GenericVector.cpp	2010-01-08 18:59:00 UTC (rev 321)
+++ pkg/src/GenericVector.cpp	2010-01-08 19:01:34 UTC (rev 322)
@@ -54,7 +54,7 @@
 	GenericVector::GenericVector( std::initializer_list<RObject> list ) {
 		SEXP x = PROTECT( Rf_allocVector( VECSXP, list.size() ) ) ;
 		const RObject* p = list.begin() ;
-		for( int i=0; i<list.size() ; i++, p++){
+		for( size_t i=0; i<list.size() ; i++, p++){
 			SET_VECTOR_ELT( x, i, p->asSexp() ) ;
 		}
 		setSEXP( x ) ;
@@ -81,10 +81,12 @@
 
 GenericVector::Proxy& GenericVector::Proxy::operator=( const Proxy& rhs){
 	SET_VECTOR_ELT( parent, index, VECTOR_ELT( rhs.parent, rhs.index) ) ;
+	return *this ;
 }
 
 GenericVector::Proxy& GenericVector::Proxy::operator=( SEXP rhs){
 	SET_VECTOR_ELT( parent, index, rhs ) ;
+	return *this ;
 }
 
 const GenericVector::Proxy GenericVector::operator[](int i) const {

Modified: pkg/src/wrap.cpp
===================================================================
--- pkg/src/wrap.cpp	2010-01-08 18:59:00 UTC (rev 321)
+++ pkg/src/wrap.cpp	2010-01-08 19:01:34 UTC (rev 322)
@@ -187,7 +187,7 @@
     logTxt("RObject from set<string>\n");
     size_t n = v.size();
     SEXP m_sexp = PROTECT( Rf_allocVector(STRSXP, n) );
-    int i=0;
+    size_t i=0;
     std::set<std::string>::iterator it = v.begin(); 
     while( i<n ){
     	SET_STRING_ELT(m_sexp, i, Rf_mkChar(it->c_str()));

_______________________________________________
Rcpp-commits mailing list
Rcpp-commits at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-commits


More information about the Rcpp-devel mailing list