Skip to content

Commit

Permalink
Other call sites
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Jul 12, 2024
1 parent 56e8a13 commit b0bb38e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/frollR.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ SEXP frollfunR(SEXP fun, SEXP obj, SEXP k, SEXP fill, SEXP algo, SEXP align, SEX
error(_("fill must be a vector of length 1"));
if (!isInteger(fill) && !isReal(fill) && !isLogical(fill))
error(_("fill must be numeric or logical"));
double dfill = REAL(PROTECT(coerceAs(fill, ScalarReal(NA_REAL), ScalarLogical(true))))[0]; protecti++;
double dfill = REAL(PROTECT(coerceAs(fill, PROTECT(ScalarReal(NA_REAL)), PROTECT(ScalarLogical(true)))))[0]; protecti++;
UNPROTECT(2); // Scalar* inputs to coerceAs()

bool bnarm = LOGICAL(narm)[0];

Expand Down Expand Up @@ -258,7 +259,8 @@ SEXP frollapplyR(SEXP fun, SEXP obj, SEXP k, SEXP fill, SEXP align, SEXP rho) {
error(_("fill must be a vector of length 1"));
if (!isInteger(fill) && !isReal(fill) && !isLogical(fill))
error(_("fill must be numeric or logical"));
double dfill = REAL(PROTECT(coerceAs(fill, ScalarReal(NA_REAL), ScalarLogical(true))))[0]; protecti++;
double dfill = REAL(PROTECT(coerceAs(fill, PROTECT(ScalarReal(NA_REAL)), PROTECT(ScalarLogical(true)))))[0]; protecti++;
UNPROTECT(2); // Scalar* inputs to coerceAs()

SEXP ans = PROTECT(allocVector(VECSXP, nk * nx)); protecti++;
if (verbose)
Expand Down
3 changes: 2 additions & 1 deletion src/gsumm.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ SEXP gmean(SEXP x, SEXP narmArg)
x = PROTECT(coerceVector(x, REALSXP)); protecti++;
case REALSXP: {
if (INHERITS(x, char_integer64)) {
x = PROTECT(coerceAs(x, /*as=*/ScalarReal(1), /*copyArg=*/ScalarLogical(TRUE))); protecti++;
x = PROTECT(coerceAs(x, /*as=*/PROTECT(ScalarReal(1)), /*copyArg=*/PROTECT(ScalarLogical(TRUE)))); protecti++;
UNPROTECT(2); // Scalar* inputs to coerceAs()
}
const double *restrict gx = gather(x, &anyNA);
ans = PROTECT(allocVector(REALSXP, ngrp)); protecti++;
Expand Down

0 comments on commit b0bb38e

Please sign in to comment.