Skip to content

Commit 85f6b27

Browse files
authored
Merge pull request #1098 from RcppCore/bugfix/r-external-ptr-addr
use documented R API function for extptr addr
2 parents a9ca85d + 740b891 commit 85f6b27

File tree

7 files changed

+33
-11
lines changed

7 files changed

+33
-11
lines changed

ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2020-07-06 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION (Version, Date): Roll minor version
4+
* inst/include/Rcpp/config.h: Idem
5+
6+
2020-07-06 Kevin Ushey <[email protected]>
7+
8+
* inst/include/Rcpp/module/class.h: EXTPTR_PTR -> R_ExternalPtrAddr
9+
* src/api.cpp: Idem
10+
* src/module.cpp: Idem
11+
112
2020-07-01 Dirk Eddelbuettel <[email protected]>
213

314
* DESCRIPTION (Date, Version): Release 1.0.5

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: 1.0.5
4-
Date: 2020-07-01
3+
Version: 1.0.5.1
4+
Date: 2020-07-06
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
66
Nathan Russell, Douglas Bates and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

inst/NEWS.Rd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
\newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}}
44
\newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}}
55

6+
\section{Changes in Rcpp patch release version 1.0.6 (2021-01-xx)}{
7+
\itemize{
8+
\item Changes in Rcpp API:
9+
\itemize{
10+
\item Replace remaining few uses of \code{EXTPTR_PTR} with
11+
\code{R_ExternalPtrAddr} (Kevin in \ghpr{1098} fixing
12+
\ghit{1097}).
13+
}
14+
}
15+
}
16+
617
\section{Changes in Rcpp patch release version 1.0.5 (2020-07-01)}{
718
\itemize{
819
\item Changes in Rcpp API:

inst/include/Rcpp/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define RCPP_VERSION_STRING "1.0.5"
3131

3232
// the current source snapshot
33-
#define RCPP_DEV_VERSION RcppDevVersion(1,0,5,0)
34-
#define RCPP_DEV_VERSION_STRING "1.0.5"
33+
#define RCPP_DEV_VERSION RcppDevVersion(1,0,5,1)
34+
#define RCPP_DEV_VERSION_STRING "1.0.5.1"
3535

3636
#endif

inst/include/Rcpp/module/class.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
SEXP invoke( SEXP method_xp, SEXP object, SEXP *args, int nargs ){
168168
BEGIN_RCPP
169169

170-
vec_signed_method* mets = reinterpret_cast< vec_signed_method* >( EXTPTR_PTR( method_xp ) ) ;
170+
vec_signed_method* mets = reinterpret_cast< vec_signed_method* >( R_ExternalPtrAddr( method_xp ) ) ;
171171
typename vec_signed_method::iterator it = mets->begin() ;
172172
int n = mets->size() ;
173173
method_class* m = 0 ;
@@ -194,7 +194,7 @@
194194
SEXP invoke_void( SEXP method_xp, SEXP object, SEXP *args, int nargs ){
195195
BEGIN_RCPP
196196

197-
vec_signed_method* mets = reinterpret_cast< vec_signed_method* >( EXTPTR_PTR( method_xp ) ) ;
197+
vec_signed_method* mets = reinterpret_cast< vec_signed_method* >( R_ExternalPtrAddr( method_xp ) ) ;
198198
typename vec_signed_method::iterator it = mets->begin() ;
199199
int n = mets->size() ;
200200
method_class* m = 0 ;
@@ -216,7 +216,7 @@
216216
SEXP invoke_notvoid( SEXP method_xp, SEXP object, SEXP *args, int nargs ){
217217
BEGIN_RCPP
218218

219-
vec_signed_method* mets = reinterpret_cast< vec_signed_method* >( EXTPTR_PTR( method_xp ) ) ;
219+
vec_signed_method* mets = reinterpret_cast< vec_signed_method* >( R_ExternalPtrAddr( method_xp ) ) ;
220220
typename vec_signed_method::iterator it = mets->begin() ;
221221
int n = mets->size() ;
222222
method_class* m = 0 ;
@@ -393,14 +393,14 @@
393393

394394
SEXP getProperty( SEXP field_xp , SEXP object) {
395395
BEGIN_RCPP
396-
prop_class* prop = reinterpret_cast< prop_class* >( EXTPTR_PTR( field_xp ) ) ;
396+
prop_class* prop = reinterpret_cast< prop_class* >( R_ExternalPtrAddr( field_xp ) ) ;
397397
return prop->get( XP(object) );
398398
END_RCPP
399399
}
400400

401401
void setProperty( SEXP field_xp, SEXP object, SEXP value) {
402402
BEGIN_RCPP
403-
prop_class* prop = reinterpret_cast< prop_class* >( EXTPTR_PTR( field_xp ) ) ;
403+
prop_class* prop = reinterpret_cast< prop_class* >( R_ExternalPtrAddr( field_xp ) ) ;
404404
return prop->set( XP(object), value );
405405
VOID_END_RCPP
406406
}

src/api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const char* short_file_name(const char* file) { // #nocov start
145145
// [[Rcpp::internal]]
146146
SEXP as_character_externalptr(SEXP xp) {
147147
char buffer[20];
148-
snprintf(buffer, 20, "%p", (void*)EXTPTR_PTR(xp));
148+
snprintf(buffer, 20, "%p", (void*)R_ExternalPtrAddr(xp));
149149
return Rcpp::wrap((const char*)buffer);
150150
} // #nocov end
151151

src/module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ RCPP_FUN_2(Rcpp::CppClass, Module__get_class, XP_Module module, std::string cl)
5353
return module->get_class(cl);
5454
}
5555
RCPP_FUN_1(bool, CppObject__needs_init, SEXP xp) { // #nocov start
56-
return EXTPTR_PTR(xp) == 0;
56+
return R_ExternalPtrAddr(xp) == 0;
5757
}
5858
RCPP_FUN_1(Rcpp::CharacterVector, CppClass__methods, XP_Class cl) {
5959
return cl->method_names();

0 commit comments

Comments
 (0)