From 108473868b7d543fcb4f7108cbcc75dc871cd833 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Fri, 9 Dec 2016 11:04:19 -0800 Subject: [PATCH] Enable -Wextra-semi Summary: Because the extra semicolons are useless and all typos... GCC doesn't have this warning. Neither does MSVC, but that won't stop me. Reviewed By: igorsugak Differential Revision: D4304218 fbshipit-source-id: a06586edc6b9bafd5dd074e9fd4e0ed152181abc --- folly/ConcurrentSkipList.h | 2 +- folly/Range.h | 2 +- folly/experimental/FutureDAG.h | 10 +++++----- folly/experimental/symbolizer/Dwarf.h | 2 +- folly/fibers/Baton.h | 2 +- folly/futures/Future-inl.h | 6 +++--- folly/futures/Future-pre.h | 4 ++-- folly/gen/Parallel-inl.h | 2 +- folly/io/async/AsyncSocket.h | 2 +- folly/io/async/AsyncTransport.h | 2 +- folly/ssl/OpenSSLHash.h | 2 +- folly/test/ContainerTraitsTest.cpp | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/folly/ConcurrentSkipList.h b/folly/ConcurrentSkipList.h index 31ca1d1d..e58c34bc 100644 --- a/folly/ConcurrentSkipList.h +++ b/folly/ConcurrentSkipList.h @@ -679,7 +679,7 @@ class detail::csl_iterator : friend class boost::iterator_core_access; template friend class csl_iterator; - void increment() { node_ = node_->next(); }; + void increment() { node_ = node_->next(); } bool equal(const csl_iterator& other) const { return node_ == other.node_; } value_type& dereference() const { return node_->data(); } diff --git a/folly/Range.h b/folly/Range.h index b715e1d0..8ab8ae57 100644 --- a/folly/Range.h +++ b/folly/Range.h @@ -412,7 +412,7 @@ public: const_range_type castToConst() const { return const_range_type(*this); - }; + } // Works only for Range and Range int compare(const const_range_type& o) const { diff --git a/folly/experimental/FutureDAG.h b/folly/experimental/FutureDAG.h index 3f08fff0..71b51976 100644 --- a/folly/experimental/FutureDAG.h +++ b/folly/experimental/FutureDAG.h @@ -210,19 +210,19 @@ class FutureDAGFunctor { std::vector dep_states; T result() { return state; - }; + } // execReset() runs DAG & clears all nodes except for source void execReset() { this->dag->go().get(); this->dag->reset(); - }; + } void exec() { this->dag->go().get(); - }; - virtual void operator()(){}; + } + virtual void operator()(){} explicit FutureDAGFunctor(T init_val) : state(init_val) {} FutureDAGFunctor() : state() {} - virtual ~FutureDAGFunctor(){}; + virtual ~FutureDAGFunctor(){} }; } // folly diff --git a/folly/experimental/symbolizer/Dwarf.h b/folly/experimental/symbolizer/Dwarf.h index 192d0c03..758e4724 100644 --- a/folly/experimental/symbolizer/Dwarf.h +++ b/folly/experimental/symbolizer/Dwarf.h @@ -68,7 +68,7 @@ class Dwarf { Path(folly::StringPiece baseDir, folly::StringPiece subDir, folly::StringPiece file); - folly::StringPiece baseDir() const { return baseDir_; }; + folly::StringPiece baseDir() const { return baseDir_; } folly::StringPiece subDir() const { return subDir_; } folly::StringPiece file() const { return file_; } diff --git a/folly/fibers/Baton.h b/folly/fibers/Baton.h index e5b92d1b..8e1eab94 100644 --- a/folly/fibers/Baton.h +++ b/folly/fibers/Baton.h @@ -154,7 +154,7 @@ class Baton { PreBlockAttempts = 300, }; - explicit Baton(intptr_t state) : waitingFiber_(state){}; + explicit Baton(intptr_t state) : waitingFiber_(state){} void postHelper(intptr_t new_value); void postThread(); diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index 61ea4ba8..52b650c0 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -686,7 +686,7 @@ collectAny(InputIterator first, InputIterator last) { typename std::iterator_traits::value_type::value_type T; struct CollectAnyContext { - CollectAnyContext() {}; + CollectAnyContext() {} Promise>> p; std::atomic done {false}; }; @@ -711,7 +711,7 @@ collectAnyWithoutException(InputIterator first, InputIterator last) { typename std::iterator_traits::value_type::value_type T; struct CollectAnyWithoutExceptionContext { - CollectAnyWithoutExceptionContext(){}; + CollectAnyWithoutExceptionContext(){} Promise> p; std::atomic done{false}; std::atomic nFulfilled{0}; @@ -884,7 +884,7 @@ Future unorderedReduce(It first, It last, T initial, F func) { UnorderedReduceContext(T&& memo, F&& fn, size_t n) : lock_(), memo_(makeFuture(std::move(memo))), func_(std::move(fn)), numThens_(0), numFutures_(n), promise_() - {}; + {} folly::MicroSpinLock lock_; // protects memo_ and numThens_ Future memo_; F func_; diff --git a/folly/futures/Future-pre.h b/folly/futures/Future-pre.h index 2116ce8d..a6f77b44 100644 --- a/folly/futures/Future-pre.h +++ b/folly/futures/Future-pre.h @@ -71,11 +71,11 @@ struct callableWith { template> static constexpr std::true_type - check(std::nullptr_t) { return std::true_type{}; }; + check(std::nullptr_t) { return std::true_type{}; } template static constexpr std::false_type - check(...) { return std::false_type{}; }; + check(...) { return std::false_type{}; } typedef decltype(check(nullptr)) type; static constexpr bool value = type::value; diff --git a/folly/gen/Parallel-inl.h b/folly/gen/Parallel-inl.h index 5a5e347a..4c4156cf 100644 --- a/folly/gen/Parallel-inl.h +++ b/folly/gen/Parallel-inl.h @@ -228,7 +228,7 @@ class Parallel : public Operator> { void work() { puller_ | *ops_ | pusher_; - }; + } public: Executor(size_t threads, const Ops* ops) diff --git a/folly/io/async/AsyncSocket.h b/folly/io/async/AsyncSocket.h index 2fed39a0..fd2240f8 100644 --- a/folly/io/async/AsyncSocket.h +++ b/folly/io/async/AsyncSocket.h @@ -603,7 +603,7 @@ class AsyncSocket : virtual public AsyncTransportWrapper { WriteRequest(AsyncSocket* socket, WriteCallback* callback) : socket_(socket), callback_(callback) {} - virtual void start() {}; + virtual void start() {} virtual void destroy() = 0; diff --git a/folly/io/async/AsyncTransport.h b/folly/io/async/AsyncTransport.h index a1023b2c..2d81e2b6 100644 --- a/folly/io/async/AsyncTransport.h +++ b/folly/io/async/AsyncTransport.h @@ -493,7 +493,7 @@ class AsyncReader { */ virtual void readBufferAvailable(std::unique_ptr /*readBuf*/) - noexcept {}; + noexcept {} /** * readEOF() will be invoked when the transport is closed. diff --git a/folly/ssl/OpenSSLHash.h b/folly/ssl/OpenSSLHash.h index 3a568806..5081faec 100644 --- a/folly/ssl/OpenSSLHash.h +++ b/folly/ssl/OpenSSLHash.h @@ -138,7 +138,7 @@ class OpenSSLHash { hmac.hash_init(md, key); hmac.hash_update(data); hmac.hash_final(out); - }; + } static void hmac( MutableByteRange out, const EVP_MD* md, diff --git a/folly/test/ContainerTraitsTest.cpp b/folly/test/ContainerTraitsTest.cpp index 4ca5a818..079aba9e 100644 --- a/folly/test/ContainerTraitsTest.cpp +++ b/folly/test/ContainerTraitsTest.cpp @@ -23,7 +23,7 @@ using namespace folly; struct Node { size_t copies = 0; - Node() noexcept {}; + Node() noexcept {} Node(const Node& n) noexcept { copies = n.copies; ++copies; } Node(Node&& n) noexcept { swap(copies, n.copies); ++copies; } }; -- 2.34.1