From f6f04634e6dd8f2bab086c0502738b1e4d1ae4e7 Mon Sep 17 00:00:00 2001 From: Thom Volker Date: Wed, 29 May 2024 14:26:32 +0200 Subject: [PATCH] Fix string literal cpp code --- src/spectral.cpp | 4 ++-- src/ulsif.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spectral.cpp b/src/spectral.cpp index ad7bfc0..3fd2ada 100644 --- a/src/spectral.cpp +++ b/src/spectral.cpp @@ -99,14 +99,14 @@ List spectral_dre(const arma::mat& dist_nu, #else if (parallel) { std::string warn = "OpenMP is not available, parallel processing is disabled."; - Rf_warningcall(R_NilValue, warn.c_str()); + Rf_warningcall(R_NilValue, "%s", warn.c_str()); } #endif Progress p(nsigma, progressbar); for (int sig = 0; sig < nsigma; sig++) { if(Progress::check_abort()) { - if (progressbar) Rprintf("%s", "\n"); + if (progressbar) Rprintf("\n"); Rcpp::stop("User terminated execution."); R_FlushConsole(); } else { diff --git a/src/ulsif.cpp b/src/ulsif.cpp index b9b55fa..adc07b1 100644 --- a/src/ulsif.cpp +++ b/src/ulsif.cpp @@ -32,7 +32,7 @@ int set_threads(int nthreads) { if (nthreads > max_threads) { nthreads = max_threads; std::string warn = "'nthreads' exceeds the maximum number of threads to use for parallel processing; it is set to the maximum number of threads available (" + std::to_string(nthreads) + ")"; - Rf_warningcall(R_NilValue, warn.c_str()); + Rf_warningcall(R_NilValue, "%s", warn.c_str()); } return nthreads; } @@ -117,7 +117,7 @@ List compute_ulsif(const arma::mat& dist_nu, const arma::mat& dist_de, const arm } if (stopped) { if (progressbar) { - Rprintf("%s", "\n"); + Rprintf("\n"); } Rcpp::stop("User terminated execution."); R_FlushConsole();