Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinushey committed Oct 6, 2024
1 parent cd3d5cd commit a818171
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions .Rinstignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\\.clang-format
20 changes: 12 additions & 8 deletions inst/ext/renv.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
#define INT_PTR INTEGER
#define LGL_PTR LOGICAL

static const int _NILSXP = NILSXP;
static const int _INTSXP = INTSXP;
static const int _DBLSXP = DBLSXP;
static const int _LGLSXP = LGLSXP;
static const int _STRSXP = STRSXP;
static const int _VECSXP = VECSXP;
static const int _ENVSXP = ENVSXP;
enum {
_NILSXP = NILSXP,
_INTSXP = INTSXP,
_DBLSXP = DBLSXP,
_LGLSXP = LGLSXP,
_STRSXP = STRSXP,
_VECSXP = VECSXP,
_ENVSXP = ENVSXP,
};

// Initialized in R_init_renv
static SEXP s_callbacksym;
Expand Down Expand Up @@ -297,7 +299,9 @@ static SEXP recurse(SEXP object,
{
symbol = TAG(FORMALS(callback));
expr = BODY(callback);
frame = PROTECT(R_NewEnv(CLOENV(callback), 0, 29));
SEXP call = PROTECT(Rf_lang3(Rf_install("new.env"), Rf_ScalarLogical(0), CLOENV(callback)));
frame = PROTECT(Rf_eval(call, R_BaseNamespace));
UNPROTECT(1);
}

const int size = 16384;
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-enumerate.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_that("enumerate() handles identity maps", {

for (i in seq_along(data)) {
expect_identical(
enumerate(data[[i]], function(key, value) value, FUN.VALUE = data[[i]]),
enumerate(data[[i]], function(key, value) value, FUN.VALUE = data[[i]][[1L]]),
data[[i]]
)
}
Expand Down

0 comments on commit a818171

Please sign in to comment.