[education/rkward] rkward/rbackend: Fix 'not a string literal' compile error
Thomas Friedrichsmeier
null at kde.org
Thu May 9 23:36:39 BST 2024
Git commit b39ab609a91a4b7ff19eecafa49f8e7b8f06c3b3 by Thomas Friedrichsmeier.
Committed on 09/05/2024 at 22:35.
Pushed by tfry into branch 'master'.
Fix 'not a string literal' compile error
M +4 -4 rkward/rbackend/rkrbackend.cpp
https://invent.kde.org/education/rkward/-/commit/b39ab609a91a4b7ff19eecafa49f8e7b8f06c3b3
diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index fe80d1c26..9e98b3ee3 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -937,8 +937,8 @@ SEXP doSubstackCall (SEXP _call, SEXP _args) {
// For now, for simplicity, assume args are always strings, although possibly nested in lists
auto ret = RKRBackend::this_pointer->handleRequestWithSubcommands(call, RKRSupport::SEXPToNestedStrings(_args));
- if (!ret.warning.isEmpty()) Rf_warning(RKTextCodec::toNative(ret.warning).constData()); // print warnings, first, as errors will cause a stop
- if (!ret.error.isEmpty()) Rf_error(RKTextCodec::toNative(ret.error).constData());
+ if (!ret.warning.isEmpty()) Rf_warning("%s", RKTextCodec::toNative(ret.warning).constData()); // print warnings, first, as errors will cause a stop
+ if (!ret.error.isEmpty()) Rf_error("%s", RKTextCodec::toNative(ret.error).constData());
return RKRSupport::QVariantToSEXP(ret.ret);
}
@@ -949,8 +949,8 @@ SEXP doPlainGenericRequest (SEXP call, SEXP synchronous) {
R_CheckUserInterrupt ();
auto ret = RKRBackend::this_pointer->handlePlainGenericRequest(RKRSupport::SEXPToStringList(call), RKRSupport::SEXPToInt(synchronous));
- if (!ret.warning.isEmpty()) Rf_warning(RKTextCodec::toNative(ret.warning).constData()); // print warnings, first, as errors will cause a stop
- if (!ret.error.isEmpty()) Rf_error(RKTextCodec::toNative(ret.error).constData());
+ if (!ret.warning.isEmpty()) Rf_warning("%s", RKTextCodec::toNative(ret.warning).constData()); // print warnings, first, as errors will cause a stop
+ if (!ret.error.isEmpty()) Rf_error("%s", RKTextCodec::toNative(ret.error).constData());
return RKRSupport::QVariantToSEXP(ret.ret);
}
More information about the rkward-tracker
mailing list