Drop redundant void parameters from function declarations
authorChristopher Dykes <cdykes@fb.com>
Fri, 20 Oct 2017 17:29:30 +0000 (10:29 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 20 Oct 2017 17:35:31 +0000 (10:35 -0700)
Summary:
This is C++, not C, so let's keep things modern.
This is applying the modernize-redundant-void-arg clang-tidy check to Folly.

Reviewed By: yfeldblum

Differential Revision: D6106921

fbshipit-source-id: 06a56f036f59426df5dd475bf91a3f4a335266f5

folly/IPAddressException.h
folly/detail/ThreadLocalDetail.h
folly/executors/ThreadPoolExecutor.h
folly/experimental/exception_tracer/ExceptionTracer.cpp
folly/experimental/exception_tracer/ExceptionTracerLib.h
folly/experimental/symbolizer/SignalHandler.h
folly/io/async/AsyncSSLSocket.cpp
folly/ssl/OpenSSLVersionFinder.h
folly/ssl/detail/SSLSessionImpl.cpp
folly/test/function_benchmark/test_functions.cpp

index 82d5d0440badcea991ee776b06860ffaf240c6a5..37a163efd82f17d8739ea90865a8f2752135370f 100644 (file)
@@ -38,7 +38,7 @@ class IPAddressFormatException : public std::exception {
   IPAddressFormatException& operator=(IPAddressFormatException&&) = default;
 
   ~IPAddressFormatException() noexcept override {}
-  const char* what(void) const noexcept override {
+  const char* what() const noexcept override {
     return msg_.c_str();
   }
 
index a88bfbb1d36a9e8f14b5db9455be3d029093a0d1..363196b0fe86d2b029fb9d7d6ebfc3945f88419c 100644 (file)
@@ -379,13 +379,15 @@ struct StaticMeta : StaticMetaBase {
 #endif
   }
 
-  static void preFork(void) {
+  static void preFork() {
     instance().lock_.lock();  // Make sure it's created
   }
 
-  static void onForkParent(void) { instance().lock_.unlock(); }
+  static void onForkParent() {
+    instance().lock_.unlock();
+  }
 
-  static void onForkChild(void) {
+  static void onForkChild() {
     // only the current thread survives
     instance().head_.next = instance().head_.prev = &instance().head_;
     ThreadEntry* threadEntry = getThreadEntry();
index 79ca29057088a41ba151582ae404fd6628658106..3de9ec591c3d0effebb2b5beab0758b46a559ff3 100644 (file)
@@ -50,7 +50,7 @@ class ThreadPoolExecutor : public virtual folly::Executor {
     threadFactory_ = std::move(threadFactory);
   }
 
-  std::shared_ptr<ThreadFactory> getThreadFactory(void) {
+  std::shared_ptr<ThreadFactory> getThreadFactory() {
     return threadFactory_;
   }
 
index bae1c8753a44b05acf7e9e284c2321d3ba6b0a42..329535403623c94595f04680f3263bbfe30c1512 100644 (file)
@@ -36,7 +36,7 @@ using namespace __cxxabiv1;
 
 extern "C" {
 StackTraceStack* getExceptionStackTraceStack(void) __attribute__((__weak__));
-typedef StackTraceStack* (*GetExceptionStackTraceStackType)(void);
+typedef StackTraceStack* (*GetExceptionStackTraceStackType)();
 GetExceptionStackTraceStackType getExceptionStackTraceStackFn;
 }
 
index 263dc5eafc1cc4d898a48bb0bb0be51c2354c8ca..ce5ea80c7e7f353a44b584e2a485fd146b965464 100644 (file)
@@ -31,8 +31,8 @@ namespace detail {
  */
 void dummyCxaThrow(void*, std::type_info*, void (*)(void*)) noexcept;
 void dummyCxaBeginCatch(void*) noexcept;
-void dummyCxaRethrow(void) noexcept;
-void dummyCxaEndCatch(void) noexcept;
+void dummyCxaRethrow() noexcept;
+void dummyCxaEndCatch() noexcept;
 void dummyRethrowException(std::exception_ptr) noexcept;
 }
 
index ae68fd59c16f4344e30e54928525f6c8a4c81fb5..f9d7a6c3f49fca122648b68e817351e245077421 100644 (file)
@@ -40,7 +40,7 @@ void installFatalSignalHandler();
  * All these fatal callback must be added before calling
  * installFatalSignalCallbacks(), below.
  */
-typedef void (*SignalCallback)(void);
+typedef void (*SignalCallback)();
 void addFatalSignalCallback(SignalCallback callback);
 
 /**
index 1f8cd7ddea3c00d8d8e9f4fe93267d08df975374..3a7562dcf80d1e959e88ad1a2beb445211551c87 100644 (file)
@@ -184,7 +184,7 @@ static BIO_METHOD* getSSLBioMethod() {
   return instance;
 }
 
-void* initsslBioMethod(void) {
+void* initsslBioMethod() {
   auto sslBioMethod = getSSLBioMethod();
   // override the bwrite method for MSG_EOR support
   OpenSSLUtils::setCustomBioWriteMethod(sslBioMethod, AsyncSSLSocket::bioWrite);
index 19914f97103726d105694db9b8f097c6271d4230..54da65d7150268c2d35b96e44133694741b8dfa8 100644 (file)
@@ -22,7 +22,7 @@
 // OPENSSL_VERSION_NUMBER is insufficient as runtime version may be different
 // from the compile-time version
 struct OpenSSLVersionFinder {
-  static std::string getOpenSSLLongVersion(void) {
+  static std::string getOpenSSLLongVersion() {
 #ifdef OPENSSL_VERSION_TEXT
     return SSLeay_version(SSLEAY_VERSION);
 #elif defined(OPENSSL_VERSION_NUMBER)
@@ -32,7 +32,7 @@ struct OpenSSLVersionFinder {
 #endif
   }
 
-  uint64_t getOpenSSLNumericVersion(void) {
+  uint64_t getOpenSSLNumericVersion() {
 #ifdef OPENSSL_VERSION_NUMBER
     return SSLeay();
 #else
index 7dc39d1ac6937fdebe05a2ae15c359073d184d80..2f72538767c38fec18c0e156071836fdb6b79ed9 100644 (file)
@@ -51,7 +51,7 @@ SSLSessionImpl::~SSLSessionImpl() {
   downRef();
 }
 
-std::string SSLSessionImpl::serialize(void) const {
+std::string SSLSessionImpl::serialize() const {
   std::string ret;
 
   // Get the length first, then we know how much space to allocate.
index 020a440180d2396bb7d8b81e52b7130de065f537..57bdc7b584e2aeef18e1d1a5adea4f8966d80d13 100644 (file)
 class Exception : public std::exception {
  public:
   explicit Exception(const std::string& value) : value_(value) {}
-  ~Exception(void) noexcept override {}
+  ~Exception() noexcept override {}
 
-  const char* what(void) const noexcept override { return value_.c_str(); }
+  const char* what() const noexcept override {
+    return value_.c_str();
+  }
 
  private:
   std::string value_;