Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2016-10-21 Qiang Kou <qkou@umail.iu.edu>

* inst/include/Rcpp/barrier.h: Change string_elt/vector_elt to accept R_xlen_t
* inst/include/Rcpp/routines.h: Ditto
* src/barrier.cpp: Ditto

2016-10-19 Dirk Eddelbuettel <edd@debian.org>

* inst/include/Rcpp/date_datetime/Datetime.h (Rcpp): Additional
Expand Down
12 changes: 6 additions & 6 deletions inst/include/Rcpp/barrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
#ifndef Rcpp__barrier__h
#define Rcpp__barrier__h

SEXP get_string_elt(SEXP, int) ;
const char* char_get_string_elt(SEXP, int) ;
void set_string_elt(SEXP, int, SEXP) ;
void char_set_string_elt(SEXP, int, const char*) ;
SEXP get_string_elt(SEXP, R_xlen_t) ;
const char* char_get_string_elt(SEXP, R_xlen_t) ;
void set_string_elt(SEXP, R_xlen_t, SEXP) ;
void char_set_string_elt(SEXP, R_xlen_t, const char*) ;
SEXP* get_string_ptr(SEXP) ;

SEXP get_vector_elt(SEXP, int) ;
void set_vector_elt(SEXP, int, SEXP ) ;
SEXP get_vector_elt(SEXP, R_xlen_t) ;
void set_vector_elt(SEXP, R_xlen_t, SEXP ) ;
SEXP* get_vector_ptr(SEXP) ;
const char* char_nocheck( SEXP ) ;
void* dataptr(SEXP) ;
Expand Down
36 changes: 18 additions & 18 deletions inst/include/Rcpp/routines.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ std::string demangle(const std::string& name);
const char* short_file_name(const char* );
int* get_cache(int n);
SEXP stack_trace( const char *file, int line);
SEXP get_string_elt(SEXP s, int i);
const char* char_get_string_elt(SEXP s, int i);
void set_string_elt(SEXP s, int i, SEXP v);
void char_set_string_elt(SEXP s, int i, const char* v);
SEXP get_string_elt(SEXP s, R_xlen_t i);
const char* char_get_string_elt(SEXP s, R_xlen_t i);
void set_string_elt(SEXP s, R_xlen_t i, SEXP v);
void char_set_string_elt(SEXP s, R_xlen_t i, const char* v);
SEXP* get_string_ptr(SEXP s);
SEXP get_vector_elt(SEXP v, int i);
void set_vector_elt(SEXP v, int i, SEXP x);
SEXP get_vector_elt(SEXP v, R_xlen_t i);
void set_vector_elt(SEXP v, R_xlen_t i, SEXP x);
SEXP* get_vector_ptr(SEXP v);
const char* char_nocheck(SEXP x);
void* dataptr(SEXP x);
Expand Down Expand Up @@ -149,26 +149,26 @@ inline attribute_hidden SEXP stack_trace( const char *file, int line){
return fun(file, line);
}

inline attribute_hidden SEXP get_string_elt(SEXP s, int i){
typedef SEXP (*Fun)(SEXP, int);
inline attribute_hidden SEXP get_string_elt(SEXP s, R_xlen_t i){
typedef SEXP (*Fun)(SEXP, R_xlen_t);
static Fun fun = GET_CALLABLE("get_string_elt");
return fun(s, i);
}

inline attribute_hidden const char* char_get_string_elt(SEXP s, int i){
typedef const char* (*Fun)(SEXP, int);
inline attribute_hidden const char* char_get_string_elt(SEXP s, R_xlen_t i){
typedef const char* (*Fun)(SEXP, R_xlen_t);
static Fun fun = GET_CALLABLE("char_get_string_elt");
return fun(s, i);
}

inline attribute_hidden void set_string_elt(SEXP s, int i, SEXP v){
typedef void (*Fun)(SEXP,int,SEXP);
inline attribute_hidden void set_string_elt(SEXP s, R_xlen_t i, SEXP v){
typedef void (*Fun)(SEXP, R_xlen_t, SEXP);
static Fun fun = GET_CALLABLE("set_string_elt");
fun(s, i, v);
}

inline attribute_hidden void char_set_string_elt(SEXP s, int i, const char* v){
typedef void (*Fun)(SEXP,int, const char*);
inline attribute_hidden void char_set_string_elt(SEXP s, R_xlen_t i, const char* v){
typedef void (*Fun)(SEXP, R_xlen_t, const char*);
static Fun fun = GET_CALLABLE("char_set_string_elt");
fun(s, i, v );
}
Expand All @@ -179,14 +179,14 @@ inline attribute_hidden SEXP* get_string_ptr(SEXP s){
return fun(s);
}

inline attribute_hidden SEXP get_vector_elt(SEXP v, int i){
typedef SEXP (*Fun)(SEXP, int );
inline attribute_hidden SEXP get_vector_elt(SEXP v, R_xlen_t i){
typedef SEXP (*Fun)(SEXP, R_xlen_t);
static Fun fun = GET_CALLABLE("get_vector_elt");
return fun(v, i);
}

inline attribute_hidden void set_vector_elt(SEXP v, int i, SEXP x){
typedef void (*Fun)(SEXP, int, SEXP);
inline attribute_hidden void set_vector_elt(SEXP v, R_xlen_t i, SEXP x){
typedef void (*Fun)(SEXP, R_xlen_t, SEXP);
static Fun fun = GET_CALLABLE("set_vector_elt");
fun(v, i, x);
}
Expand Down
12 changes: 6 additions & 6 deletions src/barrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
namespace Rcpp { SEXP Rcpp_eval(SEXP, SEXP); }

// [[Rcpp::register]]
SEXP get_string_elt(SEXP x, int i) {
SEXP get_string_elt(SEXP x, R_xlen_t i) {
return STRING_ELT(x, i);
}

// [[Rcpp::register]]
const char* char_get_string_elt(SEXP x, int i) {
const char* char_get_string_elt(SEXP x, R_xlen_t i) {
return CHAR(STRING_ELT(x, i));
}

// [[Rcpp::register]]
void set_string_elt(SEXP x, int i, SEXP value) {
void set_string_elt(SEXP x, R_xlen_t i, SEXP value) {
SET_STRING_ELT(x, i, value);
}

// [[Rcpp::register]]
void char_set_string_elt(SEXP x, int i, const char* value) {
void char_set_string_elt(SEXP x, R_xlen_t i, const char* value) {
SET_STRING_ELT(x, i, Rf_mkChar(value));
}

Expand All @@ -56,12 +56,12 @@ SEXP* get_string_ptr(SEXP x) {
}

// [[Rcpp::register]]
SEXP get_vector_elt(SEXP x, int i) {
SEXP get_vector_elt(SEXP x, R_xlen_t i) {
return VECTOR_ELT(x, i);
}

// [[Rcpp::register]]
void set_vector_elt(SEXP x, int i, SEXP value) {
void set_vector_elt(SEXP x, R_xlen_t i, SEXP value) {
SET_VECTOR_ELT(x, i, value);
}

Expand Down