From 44e6c8aea6b163247f4e578218db14bb3027e3ff Mon Sep 17 00:00:00 2001 From: David Cortes Date: Mon, 6 Sep 2021 20:03:37 -0300 Subject: [PATCH] fix linter complaints --- R-package/src/lightgbm_R.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R-package/src/lightgbm_R.cpp b/R-package/src/lightgbm_R.cpp index 228663375980..75ec5c1003b2 100644 --- a/R-package/src/lightgbm_R.cpp +++ b/R-package/src/lightgbm_R.cpp @@ -44,30 +44,30 @@ struct LGBM_R_ErrorClass { SEXP cont_token; }; // after an R allocation error, which would trigger a long jump. SEXP wrapped_R_string(void *len) { - return Rf_allocVector(STRSXP, *(R_xlen_t*)len); + return Rf_allocVector(STRSXP, *(reinterpret_cast(len))); } SEXP wrapped_Rf_mkChar(void *txt) { - return Rf_mkChar((char*)txt); + return Rf_mkChar(reinterpret_cast(txt)); } void throw_R_memerr(void *ptr_cont_token, Rboolean jump) { if (jump) { - LGBM_R_ErrorClass err{*(SEXP*)ptr_cont_token}; + LGBM_R_ErrorClass err{*(reinterpret_cast(ptr_cont_token))}; throw err; } } SEXP safe_R_string(R_xlen_t len, SEXP &cont_token) { - return R_UnwindProtect(wrapped_R_string, (void*)&len, throw_R_memerr, &cont_token, cont_token); + return R_UnwindProtect(wrapped_R_string, reinterpret_cast(&len), throw_R_memerr, &cont_token, cont_token); } SEXP safe_R_mkChar(char *txt, SEXP &cont_token) { - return R_UnwindProtect(wrapped_Rf_mkChar, (void*)txt, throw_R_memerr, &cont_token, cont_token); + return R_UnwindProtect(wrapped_Rf_mkChar, reinterpret_cast(txt), throw_R_memerr, &cont_token, cont_token); } using LightGBM::Common::Split;