Skip to content

Commit

Permalink
Fix R-devel tests, fix R API calls for R 4.5.0 R_NO_REMAP changes
Browse files Browse the repository at this point in the history
  • Loading branch information
glin committed Jan 6, 2025
1 parent 0e65256 commit df0f215
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/testpkg/src/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

SEXP add(SEXP a, SEXP b)
{
SEXP result = PROTECT(allocVector(REALSXP, 1));
REAL(result)[0] = asReal(a) + asReal(b);
SEXP result = PROTECT(Rf_allocVector(REALSXP, 1));
REAL(result)[0] = Rf_asReal(a) + Rf_asReal(b);
UNPROTECT(1);
return result;
}
4 changes: 2 additions & 2 deletions test/testpkg/src/subtract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

extern "C" SEXP subtract(SEXP a, SEXP b)
{
SEXP result = PROTECT(allocVector(REALSXP, 1));
REAL(result)[0] = asReal(a) - asReal(b);
SEXP result = PROTECT(Rf_allocVector(REALSXP, 1));
REAL(result)[0] = Rf_asReal(a) - Rf_asReal(b);
UNPROTECT(1);
return result;
}

0 comments on commit df0f215

Please sign in to comment.