From df0f2150a57d86bb07814bed096a18764d0bdddf Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Mon, 6 Jan 2025 14:06:14 -0600 Subject: [PATCH] Fix R-devel tests, fix R API calls for R 4.5.0 R_NO_REMAP changes --- test/testpkg/src/add.c | 4 ++-- test/testpkg/src/subtract.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testpkg/src/add.c b/test/testpkg/src/add.c index 77cd5f3..1bc5036 100644 --- a/test/testpkg/src/add.c +++ b/test/testpkg/src/add.c @@ -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; } diff --git a/test/testpkg/src/subtract.cpp b/test/testpkg/src/subtract.cpp index c9ef0a1..175043d 100644 --- a/test/testpkg/src/subtract.cpp +++ b/test/testpkg/src/subtract.cpp @@ -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; }