Skip to content

Commit

Permalink
Use API setter/unsetter for S4 objects
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico committed Jun 15, 2024
1 parent 920903d commit 8b920fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ SEXP r_clone_referenced(SEXP x);
SEXP r_call_n(SEXP fn, SEXP* tags, SEXP* cars);

static inline SEXP r_mark_s4(SEXP x) {
SET_S4_OBJECT(x);
return(x);
x = Rf_asS4(x, (Rboolean) 1, 1);
return x;
}
static inline SEXP r_unmark_s4(SEXP x) {
UNSET_S4_OBJECT(x);
return(x);
x = Rf_asS4(x, (Rboolean) 0, 1);
return x;
}

bool r_has_name_at(SEXP names, R_len_t i);
Expand Down

0 comments on commit 8b920fd

Please sign in to comment.