[Rcpp-commits] r389 - pkg/src/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jan 17 05:38:53 CET 2010


Author: edd
Date: 2010-01-17 05:38:49 +0100 (Sun, 17 Jan 2010)
New Revision: 389

Modified:
   pkg/src/Rcpp/Language.h
   pkg/src/Rcpp/Pairlist.h
   pkg/src/Rcpp/RObject.h
   pkg/src/Rcpp/VectorBase.h
Log:
when we use Rf_length from R, call it as ::Rf_length to make sure we get the top-level namespace


Modified: pkg/src/Rcpp/Language.h
===================================================================
--- pkg/src/Rcpp/Language.h	2010-01-17 03:24:21 UTC (rev 388)
+++ pkg/src/Rcpp/Language.h	2010-01-17 04:38:49 UTC (rev 389)
@@ -143,7 +143,7 @@
 			if( index <  0 ) throw index_out_of_bounds() ;
 			if( isNULL( ) ) throw index_out_of_bounds() ;
 			
-			if( index < 0 || index > Rf_length(m_sexp) ) throw index_out_of_bounds() ;
+			if( index < 0 || index > ::Rf_length(m_sexp) ) throw index_out_of_bounds() ;
 			
 			int i=1;
 			SEXP x = m_sexp ;
@@ -176,7 +176,7 @@
 	 */
 	template <typename T>
 	void replace( const int& index, const T& object ) throw(index_out_of_bounds){
-		if( index < 0 || index >= Rf_length(m_sexp) ) throw index_out_of_bounds() ;
+ 	        if( index < 0 || index >= ::Rf_length(m_sexp) ) throw index_out_of_bounds() ;
 		
 		if( index == 0 ){
 			/* special handling */
@@ -196,8 +196,8 @@
 		}
 	}
 
-	inline size_t length() const { return Rf_length(m_sexp) ; }
-	inline size_t size() const { return Rf_length(m_sexp) ; }
+        inline size_t length() const { return ::Rf_length(m_sexp) ; }
+        inline size_t size() const { return ::Rf_length(m_sexp) ; }
 	
 	/**
 	 * Remove the element at the given position

Modified: pkg/src/Rcpp/Pairlist.h
===================================================================
--- pkg/src/Rcpp/Pairlist.h	2010-01-17 03:24:21 UTC (rev 388)
+++ pkg/src/Rcpp/Pairlist.h	2010-01-17 04:38:49 UTC (rev 389)
@@ -115,7 +115,7 @@
 			if( index <  0 ) throw index_out_of_bounds() ;
 			if( isNULL( ) ) throw index_out_of_bounds() ;
 			
-			if( index < 0 || index > Rf_length(m_sexp) ) throw index_out_of_bounds() ;
+			if( index < 0 || index > ::Rf_length(m_sexp) ) throw index_out_of_bounds() ;
 			
 			int i=1;
 			SEXP x = m_sexp ;
@@ -137,7 +137,7 @@
 	 */
 	template <typename T>
 	void replace( const int& index, const T& object ) throw(index_out_of_bounds){
-		if( index < 0 || index >= Rf_length(m_sexp) ) throw index_out_of_bounds() ;
+	        if( index < 0 || index >= ::Rf_length(m_sexp) ) throw index_out_of_bounds() ;
 		
 		/* pretend we do a pairlist so that we get Named to work for us */
 		SEXP x = PROTECT(pairlist( object ));
@@ -150,8 +150,8 @@
 		UNPROTECT(1) ;
 	}
 
-	inline size_t length() const { return Rf_length(m_sexp) ; }
-	inline size_t size() const { return Rf_length(m_sexp) ; }
+        inline size_t length() const { return ::Rf_length(m_sexp) ; }
+        inline size_t size() const { return ::Rf_length(m_sexp) ; }
 
 	/**
 	 * Remove the element at the given position

Modified: pkg/src/Rcpp/RObject.h
===================================================================
--- pkg/src/Rcpp/RObject.h	2010-01-17 03:24:21 UTC (rev 388)
+++ pkg/src/Rcpp/RObject.h	2010-01-17 04:38:49 UTC (rev 389)
@@ -184,12 +184,12 @@
     /**
      * Tests if the SEXP has the object bit set
      */
-    inline bool isObject() const { return Rf_isObject(m_sexp) ;}
+    inline bool isObject() const { return ::Rf_isObject(m_sexp) ;}
 
     /**
      * Tests if the SEXP is an S4 object
      */
-    inline bool isS4() const { return Rf_isS4(m_sexp) ; }
+    inline bool isS4() const { return ::Rf_isS4(m_sexp) ; }
 
     /**
      * Indicates if this S4 object has the given slot

Modified: pkg/src/Rcpp/VectorBase.h
===================================================================
--- pkg/src/Rcpp/VectorBase.h	2010-01-17 03:24:21 UTC (rev 388)
+++ pkg/src/Rcpp/VectorBase.h	2010-01-17 04:38:49 UTC (rev 389)
@@ -30,18 +30,18 @@
 class VectorBase : public RObject {     
 public:
 	
-	VectorBase() ;
-	virtual ~VectorBase() = 0;
+    VectorBase() ;
+    virtual ~VectorBase() = 0;
 	
-	/**
-	 * the length of the vector, uses Rf_length
-	 */
-	inline int length() const { return Rf_length( m_sexp ) ; }
+    /**
+     * the length of the vector, uses Rf_length
+     */
+    inline int length() const { return ::Rf_length( m_sexp ) ; }
 	
-	/**
-	 * alias of length
-	 */
-	inline int size() const { return Rf_length( m_sexp ) ; }
+    /**
+     * alias of length
+     */
+    inline int size() const { return ::Rf_length( m_sexp ) ; }
 	
 } ;
 



More information about the Rcpp-commits mailing list