Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid using SET_TYPEOF #1315

Merged
merged 8 commits into from
Jul 25, 2024
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
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
* inst/include/Rcpp/Environment.h: Drop support for UserDefinedDatabase
[ merged 2024-07-22 after release of Rcpp 1.0.13 ]

* inst/include/Rcpp/Language.h: Avoid using SET_TYPEOF
* inst/include/Rcpp/Pairlist.h: Idem
* inst/include/Rcpp/r_cast.h: Idem

2024-06-22 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version, Date): Roll micro version
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: Rcpp
Title: Seamless R and C++ Integration
Version: 1.0.13.0.1
Version: 1.0.13.0.2
Date: 2024-07-22
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
Nathan Russell, Inaki Ucar, Douglas Bates and John Chambers
Expand Down
6 changes: 4 additions & 2 deletions inst/include/Rcpp/Language.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ namespace Rcpp{
return internal::Rcpp_eval_impl( Storage::get__(), env);
}

void update( SEXP x){
SET_TYPEOF( x, LANGSXP );
void update(SEXP x) {
if (TYPEOF(x) != LANGSXP) {
Storage::set__(r_cast<LANGSXP>(x));
}
SET_TAG( x, R_NilValue );
}

Expand Down
6 changes: 4 additions & 2 deletions inst/include/Rcpp/Pairlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ namespace Rcpp{
#else
#include <Rcpp/generated/Pairlist__ctors.h>
#endif
void update(SEXP x){
SET_TYPEOF( x, LISTSXP ) ;
void update(SEXP x) {
if (TYPEOF(x) != LISTSXP) {
Storage::set__(r_cast<LISTSXP>(x));
}
}
} ;

Expand Down
11 changes: 3 additions & 8 deletions inst/include/Rcpp/r_cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,9 @@ namespace Rcpp {
}
template<>
inline SEXP r_true_cast<LISTSXP>(SEXP x) {
switch( TYPEOF(x) ){
case LANGSXP:
{
Shield<SEXP> y( Rf_duplicate( x ));
SET_TYPEOF(y,LISTSXP);
return y;
}
default:
if (TYPEOF(x) == LANGSXP) {
return Rf_cons(CAR(x), CDR(x));
} else {
return convert_using_rfunction(x, "as.pairlist" );
}
}
Expand Down
Loading