[Rcpp-commits] r319 - in pkg/src: . Rcpp
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Jan 8 19:33:58 CET 2010
Author: romain
Date: 2010-01-08 19:33:58 +0100 (Fri, 08 Jan 2010)
New Revision: 319
Removed:
pkg/src/Rcpp/Rcpp_Rinternals.h
Modified:
pkg/src/CharacterVector.cpp
pkg/src/ExpressionVector.cpp
pkg/src/GenericVector.cpp
pkg/src/Rcpp/wrap.h
pkg/src/RcppCommon.h
Log:
removed use of VECTOR_PTR since it goes against the write barrier and will only lead to trouble'
Modified: pkg/src/CharacterVector.cpp
===================================================================
--- pkg/src/CharacterVector.cpp 2010-01-08 18:20:13 UTC (rev 318)
+++ pkg/src/CharacterVector.cpp 2010-01-08 18:33:58 UTC (rev 319)
@@ -82,14 +82,14 @@
SET_STRING_ELT(m_sexp,i, Rf_mkChar(value.c_str()) ) ;
}
-SEXP* CharacterVector::begin(){
- return RCPP_VECTOR_PTR(m_sexp) ;
-}
+// SEXP* CharacterVector::begin(){
+// return RCPP_VECTOR_PTR(m_sexp) ;
+// }
+//
+// SEXP* CharacterVector::end(){
+// return RCPP_VECTOR_PTR(m_sexp) + LENGTH(m_sexp) ;
+// }
-SEXP* CharacterVector::end(){
- return RCPP_VECTOR_PTR(m_sexp) + LENGTH(m_sexp) ;
-}
-
/* proxy stuff */
CharacterVector::StringProxy::StringProxy(CharacterVector& v, int i) :
Modified: pkg/src/ExpressionVector.cpp
===================================================================
--- pkg/src/ExpressionVector.cpp 2010-01-08 18:20:13 UTC (rev 318)
+++ pkg/src/ExpressionVector.cpp 2010-01-08 18:33:58 UTC (rev 319)
@@ -62,14 +62,14 @@
}
#endif
-SEXP* ExpressionVector::begin(){
- return RCPP_VECTOR_PTR(m_sexp) ;
-}
+// SEXP* ExpressionVector::begin(){
+// return RCPP_VECTOR_PTR(m_sexp) ;
+// }
+//
+// SEXP* ExpressionVector::end(){
+// return RCPP_VECTOR_PTR(m_sexp) + LENGTH(m_sexp) ;
+// }
-SEXP* ExpressionVector::end(){
- return RCPP_VECTOR_PTR(m_sexp) + LENGTH(m_sexp) ;
-}
-
/* proxy stuff */
ExpressionVector::Proxy::Proxy(ExpressionVector& v, int i) :
Modified: pkg/src/GenericVector.cpp
===================================================================
--- pkg/src/GenericVector.cpp 2010-01-08 18:20:13 UTC (rev 318)
+++ pkg/src/GenericVector.cpp 2010-01-08 18:33:58 UTC (rev 319)
@@ -62,14 +62,14 @@
}
#endif
-SEXP* GenericVector::begin(){
- return RCPP_VECTOR_PTR(m_sexp) ;
-}
+// SEXP* GenericVector::begin(){
+// return RCPP_VECTOR_PTR(m_sexp) ;
+// }
+//
+// SEXP* GenericVector::end(){
+// return RCPP_VECTOR_PTR(m_sexp) + LENGTH(m_sexp) ;
+// }
-SEXP* GenericVector::end(){
- return RCPP_VECTOR_PTR(m_sexp) + LENGTH(m_sexp) ;
-}
-
/* proxy stuff */
GenericVector::Proxy::Proxy(GenericVector& v, int i) :
Deleted: pkg/src/Rcpp/Rcpp_Rinternals.h
===================================================================
--- pkg/src/Rcpp/Rcpp_Rinternals.h 2010-01-08 18:20:13 UTC (rev 318)
+++ pkg/src/Rcpp/Rcpp_Rinternals.h 2010-01-08 18:33:58 UTC (rev 319)
@@ -1,106 +0,0 @@
-#ifndef Rcpp_Rinternals_h
-#define Rcpp_Rinternals_h
-
-/* all of this comes from Rinternals.h so that we can get access to
- DATA_PTR since R forbids to use VECTOR_PTR, we need to be able to call
- VECTOR_PTR to have pointer arithmetics on generic vectors, character
- vectors, expression vectors, etc...
-
- below we define RCPP_VECTOR_PTR we can use where we would use
- VECTOR_PTR
-
- We cannot just define USE_RINTERNALS because it clashes with our use
- of R_NOREMAP
-
- There might be a possibility to not have to use pointer arithmztics
- with VECTOR_PTR but we would need to implement a custom iterator
- for Rcpp::GenericVector, ..., if we manage this then we will remove
- these
-
- */
-
-/* Flags */
-struct sxpinfo_struct {
- SEXPTYPE type : 5;/* ==> (FUNSXP == 99) %% 2^5 == 3 == CLOSXP
- * -> warning: `type' is narrower than values
- * of its type
- * when SEXPTYPE was an enum */
- unsigned int obj : 1;
- unsigned int named : 2;
- unsigned int gp : 16;
- unsigned int mark : 1;
- unsigned int debug : 1;
- unsigned int trace : 1; /* functions and memory tracing */
- unsigned int spare : 1; /* currently unused */
- unsigned int gcgen : 1; /* old generation number */
- unsigned int gccls : 3; /* node class */
-}; /* Tot: 32 */
-
-struct vecsxp_struct {
- R_len_t length;
- R_len_t truelength;
-};
-
-struct primsxp_struct {
- int offset;
-};
-
-struct symsxp_struct {
- struct SEXPREC *pname;
- struct SEXPREC *value;
- struct SEXPREC *internal;
-};
-
-struct listsxp_struct {
- struct SEXPREC *carval;
- struct SEXPREC *cdrval;
- struct SEXPREC *tagval;
-};
-
-struct envsxp_struct {
- struct SEXPREC *frame;
- struct SEXPREC *enclos;
- struct SEXPREC *hashtab;
-};
-
-struct closxp_struct {
- struct SEXPREC *formals;
- struct SEXPREC *body;
- struct SEXPREC *env;
-};
-
-struct promsxp_struct {
- struct SEXPREC *value;
- struct SEXPREC *expr;
- struct SEXPREC *env;
-};
-
-#define SEXPREC_HEADER \
- struct sxpinfo_struct sxpinfo; \
- struct SEXPREC *attrib; \
- struct SEXPREC *gengc_next_node, *gengc_prev_node
-
-/* The standard node structure consists of a header followed by the
- node data. */
-typedef struct SEXPREC {
- SEXPREC_HEADER;
- union {
- struct primsxp_struct primsxp;
- struct symsxp_struct symsxp;
- struct listsxp_struct listsxp;
- struct envsxp_struct envsxp;
- struct closxp_struct closxp;
- struct promsxp_struct promsxp;
- } u;
-} SEXPREC, *SEXP;
-
-typedef struct VECTOR_SEXPREC {
- SEXPREC_HEADER;
- struct vecsxp_struct vecsxp;
-} VECTOR_SEXPREC, *VECSEXP;
-typedef union { VECTOR_SEXPREC s; double align; } SEXPREC_ALIGN;
-#define RCPP_DATAPTR(x) (((SEXPREC_ALIGN *) (x)) + 1)
-#define RCPP_VECTOR_PTR(x) ((SEXP *) RCPP_DATAPTR(x))
-
-#endif
-
Modified: pkg/src/Rcpp/wrap.h
===================================================================
--- pkg/src/Rcpp/wrap.h 2010-01-08 18:20:13 UTC (rev 318)
+++ pkg/src/Rcpp/wrap.h 2010-01-08 18:33:58 UTC (rev 319)
@@ -45,7 +45,7 @@
LogicalVector wrap(const bool & v);
NumericVector wrap(const double & v);
IntegerVector wrap(const int & v);
-inline IntegerVector wrap(const size_t & v){ return wrap( (int)v ) } ;
+inline IntegerVector wrap(const size_t & v){ return wrap( (int)v ) ; } ;
RawVector wrap(const Rbyte & v);
IntegerVector wrap(const std::vector<int> & v);
Modified: pkg/src/RcppCommon.h
===================================================================
--- pkg/src/RcppCommon.h 2010-01-08 18:20:13 UTC (rev 318)
+++ pkg/src/RcppCommon.h 2010-01-08 18:33:58 UTC (rev 319)
@@ -51,7 +51,6 @@
#include <R_ext/Complex.h>
#include <Rversion.h>
#define GET_NAMES(x) Rf_getAttrib(x, R_NamesSymbol)
-#include <Rcpp/Rcpp_Rinternals.h>
// #ifdef BUILDING_DLL
// #define RcppExport extern "C" __declspec(dllexport)
More information about the Rcpp-commits
mailing list