Skip to content

Commit

Permalink
Adjust two format strings for new r-devel warning
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Nov 24, 2023
1 parent e52bd46 commit a7b5d36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions inst/include/Rcpp/iostream/Rstreambuf.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
//
// Rstreambuf.h: Rcpp R/C++ interface class library -- stream buffer
//
// Copyright (C) 2011 - 2020 Dirk Eddelbuettel, Romain Francois and Jelmer Ypma
// Copyright (C) 2021 Dirk Eddelbuettel, Romain Francois, Jelmer Ypma and Iñaki Ucar
// Copyright (C) 2021 - 2023 Dirk Eddelbuettel, Romain Francois, Jelmer Ypma and Iñaki Ucar
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -50,11 +49,11 @@ namespace Rcpp {
};
// #nocov start
template <> inline std::streamsize Rstreambuf<true>::xsputn(const char *s, std::streamsize num) {
Rprintf("%.*s", num, s);
Rprintf("%.*s", static_cast<int>(num), s);
return num;
}
template <> inline std::streamsize Rstreambuf<false>::xsputn(const char *s, std::streamsize num) {
REprintf("%.*s", num, s);
REprintf("%.*s", static_cast<int>(num), s);
return num;
}

Expand Down
6 changes: 2 additions & 4 deletions inst/include/Rcpp/print.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
//
// Copyright (C) 2015 - 2016 Dirk Eddelbuettel
// Copyright (C) 2015 - 2023 Dirk Eddelbuettel
//
// This file is part of Rcpp.
//
Expand All @@ -27,12 +26,11 @@ inline void print(SEXP s) {
}

inline void warningcall(SEXP call, const std::string & s) {
Rf_warningcall(call, s.c_str());
Rf_warningcall(call, "%s", s.c_str());
}

// also note that warning() is defined in file exceptions.h

}

#endif

0 comments on commit a7b5d36

Please sign in to comment.