[R] Fix warnings from R check --as-cran (#6374)

* Remove exit and printf.

* Fix warnings.
This commit is contained in:
Jiaming Yuan
2020-11-11 18:39:37 +08:00
committed by GitHub
parent 6e12c2a6f8
commit debeae2509
7 changed files with 42 additions and 20 deletions

View File

@@ -69,10 +69,6 @@ inline bool StringToBool(const char* s) {
return CompareStringsCaseInsensitive(s, "true") == 0 || atoi(s) != 0;
}
inline void HandlePrint(const char *msg) {
printf("%s", msg);
}
/*! \brief printf, prints messages to the console */
inline void Printf(const char *fmt, ...) {
std::string msg(kPrintBuffer, '\0');
@@ -80,7 +76,7 @@ inline void Printf(const char *fmt, ...) {
va_start(args, fmt);
vsnprintf(&msg[0], kPrintBuffer, fmt, args);
va_end(args);
HandlePrint(msg.c_str());
LOG(CONSOLE) << msg;
}
/*! \brief assert a condition is true, use this to handle debug information */