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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 23 08:13:59 CET 2012


Author: romain
Date: 2012-11-23 08:13:59 +0100 (Fri, 23 Nov 2012)
New Revision: 4027

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/NEWS.Rd
   pkg/Rcpp/inst/include/Rcpp/DataFrame.h
   pkg/Rcpp/src/AttributesParser.cpp
Log:
try to fix the mac build issue from r-forge

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-11-23 01:07:34 UTC (rev 4026)
+++ pkg/Rcpp/ChangeLog	2012-11-23 07:13:59 UTC (rev 4027)
@@ -1,3 +1,8 @@
+2012-11-23 Romain Francois <romain at r-enthusiasts.com>
+
+        * src/AttributesParser.cpp : attempt to fix build issue on r-forge
+        * include/Rcpp/DataFrame.h: nrows() method
+
 2012-11-22  JJ Allaire <jj at rstudio.org>
 
         * include/exceptions.h: new exception constructor / stop function

Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd	2012-11-23 01:07:34 UTC (rev 4026)
+++ pkg/Rcpp/inst/NEWS.Rd	2012-11-23 07:13:59 UTC (rev 4027)
@@ -21,8 +21,9 @@
             \item New helper class \code{no_init} that can be used to 
             create a vector without initializing its data, e.g. : 
             \code{ IntegerVector out = no_init(n) ; }
-            \item New exception constructor requiring only a message; stop
+            \item New exception constructor requiring only a message; \code{stop}
             function to throw an exception
+            \item \code{DataFrame} gains a \code{nrows} method  
         }
         \item Changes in Rcpp attributes: 
         \itemize{

Modified: pkg/Rcpp/inst/include/Rcpp/DataFrame.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/DataFrame.h	2012-11-23 01:07:34 UTC (rev 4026)
+++ pkg/Rcpp/inst/include/Rcpp/DataFrame.h	2012-11-23 07:13:59 UTC (rev 4027)
@@ -61,6 +61,8 @@
 
         static DataFrame create(){ return DataFrame() ; }
                 
+        int nrows(){ return Rf_length( VECTOR_ELT(m_sexp, 0) ); }
+        
 #include <Rcpp/DataFrame_generated.h>           
 
     private:

Modified: pkg/Rcpp/src/AttributesParser.cpp
===================================================================
--- pkg/Rcpp/src/AttributesParser.cpp	2012-11-23 01:07:34 UTC (rev 4026)
+++ pkg/Rcpp/src/AttributesParser.cpp	2012-11-23 07:13:59 UTC (rev 4027)
@@ -403,7 +403,7 @@
         // delimites the type and name 
         Type type;
         std::string name;
-        std::string preambleText = signature.substr(0, beginParenLoc);
+        const std::string preambleText = signature.substr(0, beginParenLoc);
         for (std::string::const_reverse_iterator 
             it = preambleText.rbegin(); it != preambleText.rend(); ++it) {
             char ch = *it;



More information about the Rcpp-commits mailing list