[Rcpp-commits] r4215 - in pkg/Rcpp: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jan 15 23:05:49 CET 2013


Author: edd
Date: 2013-01-15 23:05:49 +0100 (Tue, 15 Jan 2013)
New Revision: 4215

Modified:
   pkg/Rcpp/.Rbuildignore
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/src/Timer.cpp
   pkg/Rcpp/src/api.cpp
Log:
commented-out coerce_to_string() as its use of three non-API functions from R_ext/PrtUtil.h given today's R-devel the shivers
added inst/include/Rcpp/preprocessor and sugar/functions/impl to .Rbuildignore
avoided a 'long long' warning in src/Timer.cpp


Modified: pkg/Rcpp/.Rbuildignore
===================================================================
--- pkg/Rcpp/.Rbuildignore	2013-01-15 17:25:09 UTC (rev 4214)
+++ pkg/Rcpp/.Rbuildignore	2013-01-15 22:05:49 UTC (rev 4215)
@@ -6,3 +6,5 @@
 inst/doc/jss.bst
 ^.*\.Rproj$
 ^\.Rproj\.user$
+inst/include/Rcpp/preprocessor
+inst/include/Rcpp/sugar/functions/impl

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-01-15 17:25:09 UTC (rev 4214)
+++ pkg/Rcpp/ChangeLog	2013-01-15 22:05:49 UTC (rev 4215)
@@ -1,3 +1,14 @@
+2013-01-15  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/api.cpp (Rcpp): Commented-out coerce_to_string() for real and
+	complex arguments as R-devel (as of today) dislikes use of non-API
+	functions Rf_EncodeComplex’, ‘Rf_EncodeReal’, ‘Rf_formatComplex’ 
+
+	* .Rbuildignore: Added inst/include/Rcpp/preprocessor and
+	sugar/functions/impl which are currently empty directories
+
+	* src/Timer.cpp (Rcpp): Avoid a 'long long' warning from a const
+
 2014-01-15  JJ Allaire <jj at rstudio.org>
 
         * R/Attributes.R: don't add source directory as an include path for

Modified: pkg/Rcpp/src/Timer.cpp
===================================================================
--- pkg/Rcpp/src/Timer.cpp	2013-01-15 17:25:09 UTC (rev 4214)
+++ pkg/Rcpp/src/Timer.cpp	2013-01-15 22:05:49 UTC (rev 4215)
@@ -64,7 +64,7 @@
 
 #elif defined(linux) || defined(__linux) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__GLIBC__) || defined(__GNU__)
 
-    static const nanotime_t nanoseconds_in_second = 1000000000LL;
+    static const nanotime_t nanoseconds_in_second = static_cast<nanotime_t>(1000000000.0);
     
     nanotime_t get_nanotime(void) {
         struct timespec time_var;

Modified: pkg/Rcpp/src/api.cpp
===================================================================
--- pkg/Rcpp/src/api.cpp	2013-01-15 17:25:09 UTC (rev 4214)
+++ pkg/Rcpp/src/api.cpp	2013-01-15 22:05:49 UTC (rev 4215)
@@ -226,7 +226,7 @@
         
     }
 
-    RObject::RObject() : m_sexp(R_NilValue) {} ; 
+    RObject::RObject() : m_sexp(R_NilValue) {}  
     RObject::RObject(SEXP x)  : m_sexp(Rcpp_PreserveObject(x)){}
 
     /* copy constructor */
@@ -1673,18 +1673,18 @@
     return s;
 }
 
-template <> const char* coerce_to_string<REALSXP>(double x){
-    int w,d,e ;
-    Rf_formatReal( &x, 1, &w, &d, &e, 0 ) ;
-    char* tmp = const_cast<char*>( Rf_EncodeReal(x, w, d, e, '.') );
-	return dropTrailing0(tmp, '.');
+// template <> const char* coerce_to_string<REALSXP>(double x){
+//     int w,d,e ;
+//     Rf_formatReal( &x, 1, &w, &d, &e, 0 ) ;
+//     char* tmp = const_cast<char*>( Rf_EncodeReal(x, w, d, e, '.') );
+// 	return dropTrailing0(tmp, '.');
         
-}
-template <> const char* coerce_to_string<CPLXSXP>(Rcomplex x){
-    int wr, dr, er, wi, di, ei;
-    Rf_formatComplex(&x, 1, &wr, &dr, &er, &wi, &di, &ei, 0);
-    return Rf_EncodeComplex(x, wr, dr, er, wi, di, ei, '.' );
-}
+// }
+// template <> const char* coerce_to_string<CPLXSXP>(Rcomplex x){
+//     int wr, dr, er, wi, di, ei;
+//     Rf_formatComplex(&x, 1, &wr, &dr, &er, &wi, &di, &ei, 0);
+//     return Rf_EncodeComplex(x, wr, dr, er, wi, di, ei, '.' );
+// }
 
 
 } // internal



More information about the Rcpp-commits mailing list