[Rcpp-commits] r1014 - pkg/Rcpp/inst/include/Rcpp/traits

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 6 13:52:30 CEST 2010


Author: romain
Date: 2010-04-06 13:52:29 +0200 (Tue, 06 Apr 2010)
New Revision: 1014

Modified:
   pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h
   pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h
   pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h
Log:
added support for unsigned short and unsigned long

Modified: pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h	2010-04-06 10:33:00 UTC (rev 1013)
+++ pkg/Rcpp/inst/include/Rcpp/traits/r_sexptype_traits.h	2010-04-06 11:52:29 UTC (rev 1014)
@@ -44,6 +44,7 @@
 /* long are represented as numeric vectors which allows more precision 
    to be preserved than int */
 template<> struct r_sexptype_traits<long>{ enum{ rtype = REALSXP } ; } ;
+template<> struct r_sexptype_traits<unsigned long>{ enum{ rtype = REALSXP } ; } ;
 
 /* long double are represented as numeric vectors because we cannot do better in R
    some precision will be lost though
@@ -53,6 +54,7 @@
 /* short are represented as integer vector in R
 */
 template<> struct r_sexptype_traits<short>{ enum{ rtype = INTSXP } ; } ;
+template<> struct r_sexptype_traits<unsigned short>{ enum{ rtype = INTSXP } ; } ;
 
 
 /**

Modified: pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h	2010-04-06 10:33:00 UTC (rev 1013)
+++ pkg/Rcpp/inst/include/Rcpp/traits/r_type_traits.h	2010-04-06 11:52:29 UTC (rev 1014)
@@ -95,6 +95,10 @@
 template<> struct r_type_traits<long>{ typedef r_type_primitive_tag r_category ; } ;
 template<> struct r_type_traits< std::pair<const std::string,long> >{ typedef r_type_primitive_tag r_category ; } ;
 
+/* unsigned long */
+template<> struct r_type_traits<unsigned long>{ typedef r_type_primitive_tag r_category ; } ;
+template<> struct r_type_traits< std::pair<const std::string,unsigned long> >{ typedef r_type_primitive_tag r_category ; } ;
+
 /* long double */
 template<> struct r_type_traits<long double>{ typedef r_type_primitive_tag r_category ; } ;
 template<> struct r_type_traits< std::pair<const std::string,long double> >{ typedef r_type_primitive_tag r_category ; } ;
@@ -103,6 +107,9 @@
 template<> struct r_type_traits<short>{ typedef r_type_primitive_tag r_category ; } ;
 template<> struct r_type_traits< std::pair<const std::string,short> >{ typedef r_type_primitive_tag r_category ; } ;
 
+/* short */
+template<> struct r_type_traits<unsigned short>{ typedef r_type_primitive_tag r_category ; } ;
+template<> struct r_type_traits< std::pair<const std::string,unsigned short> >{ typedef r_type_primitive_tag r_category ; } ;
 
 } // traits
 } // Rcpp

Modified: pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h	2010-04-06 10:33:00 UTC (rev 1013)
+++ pkg/Rcpp/inst/include/Rcpp/traits/wrap_type_traits.h	2010-04-06 11:52:29 UTC (rev 1014)
@@ -64,8 +64,12 @@
 template <> struct wrap_type_traits< std::complex<double> > { typedef wrap_type_primitive_tag wrap_category; } ;
 
 template <> struct wrap_type_traits<long> { typedef wrap_type_primitive_tag wrap_category; } ;
+template <> struct wrap_type_traits<unsigned long> { typedef wrap_type_primitive_tag wrap_category; } ;
+
 template <> struct wrap_type_traits<long double> { typedef wrap_type_primitive_tag wrap_category; } ;
+
 template <> struct wrap_type_traits<short> { typedef wrap_type_primitive_tag wrap_category; } ;
+template <> struct wrap_type_traits<unsigned short> { typedef wrap_type_primitive_tag wrap_category; } ;
 
 } // namespace traits
 } // namespace Rcpp



More information about the Rcpp-commits mailing list