[Rcpp-commits] r2348 - in pkg/Rcpp: . inst/include/Rcpp inst/include/Rcpp/vector
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Oct 20 23:40:00 CEST 2010
Author: edd
Date: 2010-10-20 23:40:00 +0200 (Wed, 20 Oct 2010)
New Revision: 2348
Modified:
pkg/Rcpp/ChangeLog
pkg/Rcpp/inst/include/Rcpp/XPtr.h
pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
Log:
applied patch by Karl Millar
Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog 2010-10-20 20:52:20 UTC (rev 2347)
+++ pkg/Rcpp/ChangeLog 2010-10-20 21:40:00 UTC (rev 2348)
@@ -1,3 +1,8 @@
+2010-10-20 Dirk Eddelbuettel <edd at debian.org>
+
+ * include/Rcpp/XPtr.h: Applied patch by Karl Millar
+ * include/Rcpp/vector/Vector.h): Idem
+
2010-10-19 Dirk Eddelbuettel <edd at debian.org>
* src/posixt.cpp: Correct POSIXct, POSIXt ordering for R 2.12.0
@@ -35,7 +40,7 @@
NumericVector x0 = x.row(0) ;
* inst/include/Rcpp/vector/MatrixColumn.h: idem for columns
-
+
* cleanup: run make clean in the inst/doc directory to install
the fake vignettes
Modified: pkg/Rcpp/inst/include/Rcpp/XPtr.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/XPtr.h 2010-10-20 20:52:20 UTC (rev 2347)
+++ pkg/Rcpp/inst/include/Rcpp/XPtr.h 2010-10-20 21:40:00 UTC (rev 2348)
@@ -59,7 +59,7 @@
* so you need to make sure the pointer can be "delete" d
* this way (has to be a C++ object)
*/
- explicit XPtr(T* p, bool set_delete_finalizer, SEXP tag, SEXP prot);
+ explicit XPtr(T* p, bool set_delete_finalizer = true, SEXP tag = R_NilValue, SEXP prot = R_NilValue);
XPtr( const XPtr& other ) : RObject( other.asSexp() ) {}
@@ -168,7 +168,7 @@
};
template<typename T>
-XPtr<T>::XPtr(T* p, bool set_delete_finalizer = true, SEXP tag = R_NilValue, SEXP prot = R_NilValue) : RObject() {
+XPtr<T>::XPtr(T* p, bool set_delete_finalizer, SEXP tag, SEXP prot) : RObject() {
setSEXP( R_MakeExternalPtr( (void*)p , tag, prot) ) ;
if( set_delete_finalizer ){
setDeleteFinalizer() ;
Modified: pkg/Rcpp/inst/include/Rcpp/vector/Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/Vector.h 2010-10-20 20:52:20 UTC (rev 2347)
+++ pkg/Rcpp/inst/include/Rcpp/vector/Vector.h 2010-10-20 21:40:00 UTC (rev 2348)
@@ -311,7 +311,7 @@
// when this is not trivial, this is SEXP
SEXP elem = PROTECT( converter_type::get( u ) );
iterator it(begin());
- for( int i=0; i<size ; i++, ++it){
+ for( int i=0; i<size() ; i++, ++it){
*it = ::Rf_duplicate( elem ) ;
}
UNPROTECT(1) ; /* elem */
More information about the Rcpp-commits
mailing list