From 164b2dd4325b6190909369216c554cf210629485 Mon Sep 17 00:00:00 2001 From: nicholasdavies Date: Mon, 1 Jul 2024 15:18:59 +0100 Subject: [PATCH] Change use of REAL0 to REAL (former is not part of R public API) --- NEWS.md | 2 ++ src/lua_api.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index e2ded76..bd6fc5f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,6 +15,8 @@ issue [#3](https://github.com/nicholasdavies/luajr/issues/3). Thanks to @SugarRayLua for bringing my attention to this! +- Addressed some further issues turned up by CRAN checks. + # luajr 0.1.7 - Added support for passing the R type "raw" to Lua, as a string potentially diff --git a/src/lua_api.cpp b/src/lua_api.cpp index 87881cf..d752016 100644 --- a/src/lua_api.cpp +++ b/src/lua_api.cpp @@ -43,11 +43,11 @@ static SEXP new_compact_intseq(R_xlen_t n, int n1, int inc) if (inc != 1 && inc != -1) Rf_error("compact sequences with increment %d not supported yet", inc); - // info used REALSXP to allow for long vectors + // info uses REALSXP to allow for long vectors SEXP info = Rf_allocVector(REALSXP, 3); - REAL0(info)[0] = (double) n; - REAL0(info)[1] = (double) n1; - REAL0(info)[2] = (double) inc; + REAL(info)[0] = (double) n; + REAL(info)[1] = (double) n1; + REAL(info)[2] = (double) inc; SEXP ans = R_new_altrep(R_compact_intseq_class, info, R_NilValue); MARK_NOT_MUTABLE(ans); // force duplicate on modify