fixing compiler errors when compiling with Wunused-parameter
authorOndrej Lehecka <lehecka@fb.com>
Mon, 20 Jul 2015 23:37:52 +0000 (16:37 -0700)
committerfacebook-github-bot-4 <folly-bot@fb.com>
Tue, 21 Jul 2015 23:52:41 +0000 (16:52 -0700)
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

folly/ExceptionWrapper.h
folly/Executor.h
folly/FBString.h
folly/FBVector.h
folly/Format.h
folly/futures/Unit.h
folly/io/async/AsyncSocket.h
folly/io/async/AsyncTransport.h

index bfe19a03791e8bb5db99175e77ee41460c98f52a..98ff9cb513de5f0efd73c4c44ac9912f01434947 100644 (file)
@@ -414,7 +414,7 @@ class try_and_catch<LastException, Exceptions...> :
 
   template <typename Ex>
   typename std::enable_if<exception_wrapper::optimize<Ex>::value>::type
-  assign_exception(Ex& e, std::exception_ptr eptr) {
+  assign_exception(Ex& e, std::exception_ptr /*eptr*/) {
     this->item_ = std::make_shared<Ex>(e);
     this->throwfn_ = folly::detail::Thrower<Ex>::doThrow;
   }
index 2af0b809c27059ea48f3e06d92dd0c30c97bb0c0..168b6595173516c2e62793affa7125eebbf82d77 100644 (file)
@@ -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");
   }
index e492e8f560f04eb317c340f6965528f298d13c50..23bfeb47b816002e5b80ef5bed7917b5b5e9a45f 100644 (file)
@@ -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) {
   }
 
index b4e253ed1dd24e024d384978dfa44aa07a953187..22d76034bf084d5ce249fe50665e286c13f7777a 100644 (file)
@@ -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<T>::value && usingStdAllocator::value) {
       // used memcpy; data has been relocated, do not call destructor
     } else {
index 02e5d1a893083e63f6864e9e52397963b7643173..c7b729d41cb02a7f448dc7a1bade47a371117d6a 100644 (file)
@@ -108,7 +108,7 @@ class BaseFormatter {
 
   template <size_t K, class Callback>
   typename std::enable_if<K == valueCount>::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);
   }
 
index 8a8b932c6906e19bf756f171f69ae31cbd972766..521b206bcd150b0a159c097523e6638cf50e8664 100644 (file)
@@ -30,8 +30,8 @@ struct Unit {
   template <class T> 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.
index c0525bbea2fa253aadd43430ddd361fef007afa4..38939ee786e908dbc11dadcd453292cb84e32ba7 100644 (file)
@@ -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);
index b4ab7721a903411c742d8f77910715c611575411..b45ed96d5fc3c4c459dfecc575a2e928ae021f45 100644 (file)
@@ -430,7 +430,7 @@ class AsyncTransportWrapper : virtual public AsyncTransport {
      * @param readBuf The unique pointer of read buffer.
      */
 
-    virtual void readBufferAvailable(std::unique_ptr<IOBuf> readBuf)
+    virtual void readBufferAvailable(std::unique_ptr<IOBuf> /*readBuf*/)
       noexcept {};
 
     /**