Skip to content

Commit

Permalink
Change use of REAL0 to REAL (former is not part of R public API)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdavies committed Jul 1, 2024
1 parent a3c9c1d commit 164b2dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/lua_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 164b2dd

Please sign in to comment.