[Rcpp-commits] r4310 - in pkg/Rcpp: . inst inst/include/Rcpp/api/meat src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 16 20:38:27 CEST 2013


Author: romain
Date: 2013-04-16 20:38:26 +0200 (Tue, 16 Apr 2013)
New Revision: 4310

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/NEWS.Rd
   pkg/Rcpp/inst/include/Rcpp/api/meat/Vector.h
   pkg/Rcpp/src/
   pkg/Rcpp/src/attributes.cpp
Log:
portabilty fix from Martyn Plummer

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-04-16 09:52:35 UTC (rev 4309)
+++ pkg/Rcpp/ChangeLog	2013-04-16 18:38:26 UTC (rev 4310)
@@ -2,7 +2,9 @@
 
         * include/Rcpp/sugar/functions/na_omit.h : new function na_omit to remove
         missing values from a vector. 
-
+        * src/attributes.cpp : portability fix (from Martyn Plummer)
+        * include/Rcpp/api/meat/Vector.h : portability fix (from Martyn Plummer)
+        
 2013-04-14  Romain Francois <romain at r-enthusiasts.com>
 
         * include/Rcpp/traits/is_na.h: complex version did not work. 

Modified: pkg/Rcpp/inst/NEWS.Rd
===================================================================
--- pkg/Rcpp/inst/NEWS.Rd	2013-04-16 09:52:35 UTC (rev 4309)
+++ pkg/Rcpp/inst/NEWS.Rd	2013-04-16 18:38:26 UTC (rev 4310)
@@ -19,6 +19,10 @@
         \item New function \code{na_omit} based on the stack overflow thread
         http://stackoverflow.com/questions/15953768/templated-rcpp-function-to-erase-na-values
     }
+    \item Portability
+    \itemize{
+        \item Fix (from Martyn Plummer) for solaris in handling SingleLogicalResult.     
+    }
 }
 
 \section{Changes in Rcpp version 0.10.3 (2013-03-23)}{

Modified: pkg/Rcpp/inst/include/Rcpp/api/meat/Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/api/meat/Vector.h	2013-04-16 09:52:35 UTC (rev 4309)
+++ pkg/Rcpp/inst/include/Rcpp/api/meat/Vector.h	2013-04-16 18:38:26 UTC (rev 4310)
@@ -151,11 +151,11 @@
         import_sugar_expression( other, typename traits::same_type<Vector,VEC>::type() ) ;
     }
     
-    template <>
+    template <int RTYPE>
     template <bool NA, typename T>
-    Vector<LGLSXP>::Vector( const sugar::SingleLogicalResult<NA,T>& obj ) : RObject(const_cast<sugar::SingleLogicalResult<NA,T>&>( obj ).get_sexp() ) {
+    Vector<RTYPE>::Vector( const sugar::SingleLogicalResult<NA,T>& obj ) : RObject( r_cast<RTYPE>( const_cast<sugar::SingleLogicalResult<NA,T>&>(obj).get_sexp() ) ) {
         update_vector() ;
-        RCPP_DEBUG_2( "Vector<%d>( const sugar::SingleLogicalResult<NA,T>& ) [T = %s]", LGLSXP, DEMANGLE(T) )
+        RCPP_DEBUG_2( "Vector<%d>( const sugar::SingleLogicalResult<NA,T>& ) [T = %s]", RTYPE, DEMANGLE(T) )
     }
     
     


Property changes on: pkg/Rcpp/src
___________________________________________________________________
Added: svn:ignore
   + symbols.rds



Modified: pkg/Rcpp/src/attributes.cpp
===================================================================
--- pkg/Rcpp/src/attributes.cpp	2013-04-16 09:52:35 UTC (rev 4309)
+++ pkg/Rcpp/src/attributes.cpp	2013-04-16 18:38:26 UTC (rev 4310)
@@ -2,7 +2,7 @@
 //
 // attributes.cpp: Rcpp R/C++ interface class library -- Rcpp attributes
 //
-// Copyright (C) 2012 JJ Allaire, Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2012 - 2013 JJ Allaire, Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -1033,7 +1033,7 @@
                     // extract the type
                     std::string typeText;
                     while (++it != preambleText.rend())
-                        typeText.insert(0, 1, *it);    
+                        typeText.insert(0U, 1U, *it);    
                     type = parseType(typeText);
                     
                     // break (since we now have the name and the type)
@@ -1042,7 +1042,7 @@
                 else
                     continue;
             } else { 
-                name.insert(0, 1, ch);
+                name.insert(0U, 1U, ch);
             }
         }
         



More information about the Rcpp-commits mailing list