From: Ondrej Lehecka Date: Mon, 20 Jul 2015 23:37:52 +0000 (-0700) Subject: fixing compiler errors when compiling with Wunused-parameter X-Git-Tag: v0.52.0~18 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=58ddb58be76d43be88709cd45afabe0c785ea9e2;p=folly.git fixing compiler errors when compiling with Wunused-parameter Summary: fixing C++ compiler warnings for the -Wunused-parameter warning switch on. This is fixing only the header files, not the library cpp files. Reviewed By: @yfeldblum Differential Revision: D2259957 --- diff --git a/folly/ExceptionWrapper.h b/folly/ExceptionWrapper.h index bfe19a03..98ff9cb5 100644 --- a/folly/ExceptionWrapper.h +++ b/folly/ExceptionWrapper.h @@ -414,7 +414,7 @@ class try_and_catch : template typename std::enable_if::value>::type - assign_exception(Ex& e, std::exception_ptr eptr) { + assign_exception(Ex& e, std::exception_ptr /*eptr*/) { this->item_ = std::make_shared(e); this->throwfn_ = folly::detail::Thrower::doThrow; } diff --git a/folly/Executor.h b/folly/Executor.h index 2af0b809..168b6595 100644 --- a/folly/Executor.h +++ b/folly/Executor.h @@ -37,7 +37,7 @@ class Executor { /// Enqueue a function with a given priority, where 0 is the medium priority /// This is up to the implementation to enforce - virtual void addWithPriority(Func, int8_t priority) { + virtual void addWithPriority(Func, int8_t /*priority*/) { throw std::runtime_error( "addWithPriority() is not implemented for this Executor"); } diff --git a/folly/FBString.h b/folly/FBString.h index e492e8f5..23bfeb47 100644 --- a/folly/FBString.h +++ b/folly/FBString.h @@ -999,7 +999,7 @@ private: public: // C++11 21.4.2 construct/copy/destroy - explicit basic_fbstring(const A& a = A()) noexcept { + explicit basic_fbstring(const A& /*a*/ = A()) noexcept { } basic_fbstring(const basic_fbstring& str) @@ -1023,7 +1023,7 @@ public: assign(str, pos, n); } - /* implicit */ basic_fbstring(const value_type* s, const A& a = A()) + /* implicit */ basic_fbstring(const value_type* s, const A& /*a*/ = A()) : store_(s, s ? traits_type::length(s) : (std::__throw_logic_error( @@ -1031,7 +1031,7 @@ public: 0)) { } - basic_fbstring(const value_type* s, size_type n, const A& a = A()) + basic_fbstring(const value_type* s, size_type n, const A& /*a*/ = A()) : store_(s, n) { } diff --git a/folly/FBVector.h b/folly/FBVector.h index b4e253ed..22d76034 100644 --- a/folly/FBVector.h +++ b/folly/FBVector.h @@ -654,7 +654,7 @@ private: } // done - void relocate_done(T* dest, T* first, T* last) noexcept { + void relocate_done(T* /*dest*/, T* first, T* last) noexcept { if (folly::IsRelocatable::value && usingStdAllocator::value) { // used memcpy; data has been relocated, do not call destructor } else { diff --git a/folly/Format.h b/folly/Format.h index 02e5d1a8..c7b729d4 100644 --- a/folly/Format.h +++ b/folly/Format.h @@ -108,7 +108,7 @@ class BaseFormatter { template typename std::enable_if::type - doFormatFrom(size_t i, FormatArg& arg, Callback& cb) const { + doFormatFrom(size_t i, FormatArg& arg, Callback& /*cb*/) const { arg.error("argument index out of range, max=", i); } diff --git a/folly/futures/Unit.h b/folly/futures/Unit.h index 8a8b932c..521b206b 100644 --- a/folly/futures/Unit.h +++ b/folly/futures/Unit.h @@ -30,8 +30,8 @@ struct Unit { template struct Drop : public std::false_type { using type = T; }; - bool operator==(const Unit& other) const { return true; } - bool operator!=(const Unit& other) const { return false; } + bool operator==(const Unit& /*other*/) const { return true; } + bool operator!=(const Unit& /*other*/) const { return false; } }; // Lift void into Unit. diff --git a/folly/io/async/AsyncSocket.h b/folly/io/async/AsyncSocket.h index c0525bbe..38939ee7 100644 --- a/folly/io/async/AsyncSocket.h +++ b/folly/io/async/AsyncSocket.h @@ -363,7 +363,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper { bool isEorTrackingEnabled() const override { return false; } - void setEorTracking(bool track) override {} + void setEorTracking(bool /*track*/) override {} bool connecting() const override { return (state_ == StateEnum::CONNECTING); diff --git a/folly/io/async/AsyncTransport.h b/folly/io/async/AsyncTransport.h index b4ab7721..b45ed96d 100644 --- a/folly/io/async/AsyncTransport.h +++ b/folly/io/async/AsyncTransport.h @@ -430,7 +430,7 @@ class AsyncTransportWrapper : virtual public AsyncTransport { * @param readBuf The unique pointer of read buffer. */ - virtual void readBufferAvailable(std::unique_ptr readBuf) + virtual void readBufferAvailable(std::unique_ptr /*readBuf*/) noexcept {}; /**