Skip to content

Commit

Permalink
reverted SEXP stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Mar 24, 2020
1 parent 836943d commit 527f755
Show file tree
Hide file tree
Showing 3 changed files with 418 additions and 418 deletions.
8 changes: 4 additions & 4 deletions include/LightGBM/R_object_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ typedef union { VECTOR_SER s; double align; } SEXPREC_ALIGN;

#define R_ADDR(x) (reinterpret_cast<int64_t*> DATAPTR(x))

inline void R_SET_PTR(SEXP x, void* ptr) {
inline void R_SET_PTR(LGBM_SE x, void* ptr) {
if (ptr == nullptr) {
R_ADDR(x)[0] = (int64_t)(NULL);
} else {
R_ADDR(x)[0] = (int64_t)(ptr);
}
}

inline void* R_GET_PTR(SEXP x) {
inline void* R_GET_PTR(LGBM_SE x) {
if (R_IS_NULL(x)) {
return nullptr;
} else {
Expand All @@ -175,15 +175,15 @@ typedef union { VECTOR_SER s; double align; } SEXPREC_ALIGN;

#define R_ADDR(x) (reinterpret_cast<int32_t*> DATAPTR(x))

inline void R_SET_PTR(SEXP x, void* ptr) {
inline void R_SET_PTR(LGBM_SE x, void* ptr) {
if (ptr == nullptr) {
R_ADDR(x)[0] = (int32_t)(NULL);
} else {
R_ADDR(x)[0] = (int32_t)(ptr);
}
}

inline void* R_GET_PTR(SEXP x) {
inline void* R_GET_PTR(LGBM_SE x) {
if (R_IS_NULL(x)) {
return nullptr;
} else {
Expand Down
Loading

0 comments on commit 527f755

Please sign in to comment.