Skip to content

Commit a4546a8

Browse files
committed
replace STRING_ELT with SET_STRING_ELT (closes #377)
1 parent 8c6bff2 commit a4546a8

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2015-09-28 Dirk Eddelbuettel <[email protected]>
2+
3+
* src/barrier.cpp: Use SET_STRING_ELT() on LHS (with thanks to Luke)
4+
15
2015-09-21 Dirk Eddelbuettel <[email protected]>
26

37
* inst/include/Rcpp/String.h: Before assigning ensure we received

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.12.1.1
4-
Date: 2015-09-21
3+
Version: 0.12.1.2
4+
Date: 2015-09-28
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
66
Qiang Kou, Douglas Bates and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

inst/NEWS.Rd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
\item Changes in Rcpp API:
88
\itemize{
99
\item Before creating a single String object from a \code{SEXP}, ensure
10-
that it is from a vector of length one (issue #375)
10+
that it is from a vector of length one (issue #375).
11+
\item No longer use \code{STRING_ELT} as left-hand side, thanks to a
12+
heads-up by Luke Tierney (issue #377).
1113
}
1214
}
1315
}

src/barrier.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ const char* char_get_string_elt(SEXP x, int i) {
4040

4141
// [[Rcpp::register]]
4242
void set_string_elt(SEXP x, int i, SEXP value) {
43-
STRING_ELT(x, i) = value;
43+
SET_STRING_ELT(x, i, value);
4444
}
4545

4646
// [[Rcpp::register]]
4747
void char_set_string_elt(SEXP x, int i, const char* value) {
48-
STRING_ELT(x, i) = Rf_mkChar(value);
48+
SET_STRING_ELT(x, i, Rf_mkChar(value));
4949
}
5050

5151
// [[Rcpp::register]]

0 commit comments

Comments
 (0)