From a4546a8dd8ae2bc022bd568d7e2b8fc88213f0e7 Mon Sep 17 00:00:00 2001 From: Dirk Eddelbuettel Date: Mon, 28 Sep 2015 06:10:35 -0500 Subject: [PATCH] replace STRING_ELT with SET_STRING_ELT (closes #377) --- ChangeLog | 4 ++++ DESCRIPTION | 4 ++-- inst/NEWS.Rd | 4 +++- src/barrier.cpp | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 473f40b99..982bcc105 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2015-09-28 Dirk Eddelbuettel + + * src/barrier.cpp: Use SET_STRING_ELT() on LHS (with thanks to Luke) + 2015-09-21 Dirk Eddelbuettel * inst/include/Rcpp/String.h: Before assigning ensure we received diff --git a/DESCRIPTION b/DESCRIPTION index e057e02b2..5f31ac186 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Rcpp Title: Seamless R and C++ Integration -Version: 0.12.1.1 -Date: 2015-09-21 +Version: 0.12.1.2 +Date: 2015-09-28 Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou, Douglas Bates and John Chambers Maintainer: Dirk Eddelbuettel diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 0413e393b..efefbf808 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -7,7 +7,9 @@ \item Changes in Rcpp API: \itemize{ \item Before creating a single String object from a \code{SEXP}, ensure - that it is from a vector of length one (issue #375) + that it is from a vector of length one (issue #375). + \item No longer use \code{STRING_ELT} as left-hand side, thanks to a + heads-up by Luke Tierney (issue #377). } } } diff --git a/src/barrier.cpp b/src/barrier.cpp index f1fd0d2a2..c4a371fbd 100644 --- a/src/barrier.cpp +++ b/src/barrier.cpp @@ -40,12 +40,12 @@ const char* char_get_string_elt(SEXP x, int i) { // [[Rcpp::register]] void set_string_elt(SEXP x, int i, SEXP value) { - STRING_ELT(x, i) = value; + SET_STRING_ELT(x, i, value); } // [[Rcpp::register]] void char_set_string_elt(SEXP x, int i, const char* value) { - STRING_ELT(x, i) = Rf_mkChar(value); + SET_STRING_ELT(x, i, Rf_mkChar(value)); } // [[Rcpp::register]]