File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change
1
+ 2024-06-11 Kevin Ushey <
[email protected] >
2
+
3
+ * inst/include/Rcpp/internal/r_vector.h: Use template specializations to
4
+ avoid DATAPTR usage
5
+
1
6
2024-06-02 Dirk Eddelbuettel <
[email protected] >
2
7
3
8
* inst/include/Rcpp/internal/export.h: More R_xlen_t switching
Original file line number Diff line number Diff line change 9
9
\itemize {
10
10
\item Set R_NO_REMAP if not already defined (Dirk in \ghpr {1296 })
11
11
\item Add variadic templates to be used instead of generated code
12
- (Andrew Johnson in \ghpr {1303 }
12
+ (Andrew Johnson in \ghpr {1303 })
13
13
\item Count variables were switches to \code {size_t } to avoid warnings
14
14
about conversion - narrowing (Dirk in \ghpr {1307 })
15
+ \item Rcpp now avoids the usage of the (non - API ) DATAPTR function when
16
+ accessing the contents of Rcpp Vector objects where possible.
15
17
}
16
18
\item Changes in Rcpp Deployment :
17
19
\itemize {
Original file line number Diff line number Diff line change @@ -32,6 +32,21 @@ typename Rcpp::traits::storage_type<RTYPE>::type* r_vector_start(SEXP x) {
32
32
return reinterpret_cast <pointer>(dataptr (x));
33
33
}
34
34
35
+ // add specializations to avoid use of dataptr
36
+ #define RCPP_VECTOR_START_IMPL (__RTYPE__, __ACCESSOR__ ) \
37
+ template <> \
38
+ inline typename Rcpp::traits::storage_type<__RTYPE__>::type* r_vector_start<__RTYPE__>(SEXP x) { \
39
+ return __ACCESSOR__ (x); \
40
+ }
41
+
42
+ RCPP_VECTOR_START_IMPL (LGLSXP, LOGICAL);
43
+ RCPP_VECTOR_START_IMPL (INTSXP, INTEGER);
44
+ RCPP_VECTOR_START_IMPL (RAWSXP, RAW);
45
+ RCPP_VECTOR_START_IMPL (CPLXSXP, COMPLEX);
46
+ RCPP_VECTOR_START_IMPL (REALSXP, REAL);
47
+
48
+ #undef RCPP_VECTOR_START_IMPL
49
+
35
50
/* *
36
51
* The value 0 statically casted to the appropriate type for
37
52
* the given SEXP type
You can’t perform that action at this time.
0 commit comments