Skip to content

Commit

Permalink
Fix string literal cpp code
Browse files Browse the repository at this point in the history
  • Loading branch information
thomvolker committed May 29, 2024
1 parent 922a881 commit f6f0463
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/spectral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/ulsif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit f6f0463

Please sign in to comment.