From e85213563c04fff3591bcfe6f7dbc25bf0c1f2c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Fri, 14 Apr 2017 15:11:18 +0200 Subject: [PATCH] Remove name for unused arguments (#672) * annotate unused arguments * remove name for unused args --- inst/include/Rcpp/sugar/functions/rep.h | 2 +- src/Rcpp_init.cpp | 2 +- src/attributes.cpp | 14 +++++--------- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/inst/include/Rcpp/sugar/functions/rep.h b/inst/include/Rcpp/sugar/functions/rep.h index 24576d664..47c1194ca 100644 --- a/inst/include/Rcpp/sugar/functions/rep.h +++ b/inst/include/Rcpp/sugar/functions/rep.h @@ -53,7 +53,7 @@ class Rep_Single : public Rcpp::VectorBase< public: Rep_Single( const T& x_, R_xlen_t n_) : x(x_), n(n_){} - inline T operator[]( R_xlen_t i ) const { + inline T operator[]( R_xlen_t ) const { return x; } inline R_xlen_t size() const { return n ; } diff --git a/src/Rcpp_init.cpp b/src/Rcpp_init.cpp index a7e7421f6..6db4398eb 100644 --- a/src/Rcpp_init.cpp +++ b/src/Rcpp_init.cpp @@ -121,7 +121,7 @@ void registerFunctions(){ } -extern "C" void R_unload_Rcpp(DllInfo *info) { // #nocov start +extern "C" void R_unload_Rcpp(DllInfo *) { // #nocov start // Release resources } // #nocov end diff --git a/src/attributes.cpp b/src/attributes.cpp index 85efa86be..c4adb8f07 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -696,8 +696,7 @@ namespace attributes { virtual bool commit(const std::vector& includes); private: - virtual void doWriteFunctions(const SourceFileAttributes& attributes, - bool verbose) {} + virtual void doWriteFunctions(const SourceFileAttributes&, bool) {} std::string getHeaderGuard() const; private: @@ -2002,7 +2001,7 @@ namespace attributes { void CppExportsIncludeGenerator::doWriteFunctions( const SourceFileAttributes& attributes, - bool verbose) { + bool) { // don't write anything if there is no C++ interface if (!attributes.hasInterface(kInterfaceCpp)) @@ -2180,9 +2179,7 @@ namespace attributes { } } - bool CppPackageIncludeGenerator::commit( - const std::vector& includes) { - + bool CppPackageIncludeGenerator::commit(const std::vector&) { if (hasCppInterface()) { // create the include dir if necessary @@ -2212,8 +2209,7 @@ namespace attributes { void RExportsGenerator::doWriteFunctions( const SourceFileAttributes& attributes, - bool verbose) { - + bool) { // write standalone roxygen chunks const std::vector >& roxygenChunks = attributes.roxygenChunks(); @@ -2282,7 +2278,7 @@ namespace attributes { } } - bool RExportsGenerator::commit(const std::vector& includes) { + bool RExportsGenerator::commit(const std::vector&) { return ExportsGenerator::commit(); }