From f2925b23df8d85ebca72d62a69f1282528c086de Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Mon, 23 Oct 2017 17:34:54 -0700 Subject: [PATCH] Consistently have the namespace closing comment Summary: It's done in a lot of places, but not all. clang-tidy gives us llvm-namespace-comment, which can force this consistently. Reviewed By: yfeldblum Differential Revision: D6108129 fbshipit-source-id: 1b44c5a26250364f9edf70f84173e9ba6389f06c --- folly/Array.h | 4 +- folly/Assume.cpp | 4 +- folly/Assume.h | 2 +- folly/AtomicStruct.h | 2 +- folly/AtomicUnorderedMap.h | 3 +- folly/CachelinePadded.h | 2 +- folly/Chrono.h | 6 +- folly/ClockGettimeWrappers.cpp | 6 +- folly/ClockGettimeWrappers.h | 4 +- folly/ConcurrentSkipList-inl.h | 3 +- folly/ContainerTraits.h | 2 +- folly/Conv.h | 4 +- folly/Demangle.h | 2 +- folly/DynamicConverter.h | 8 +- folly/ExceptionWrapper-inl.h | 2 +- folly/ExceptionWrapper.cpp | 2 +- folly/Executor.cpp | 2 +- folly/Expected.h | 2 +- folly/FBVector.h | 6 +- folly/FixedString.h | 8 +- folly/Format.h | 4 +- folly/FormatArg.cpp | 2 +- folly/FormatTraits.h | 3 +- folly/Function.h | 4 +- folly/Functional.h | 2 +- folly/Indestructible.h | 2 +- folly/IndexedMemPool.h | 4 +- folly/Lazy.h | 4 +- folly/LifoSem.cpp | 2 +- folly/LockTraitsBoost.h | 2 +- folly/MapUtil.h | 2 +- folly/Math.h | 2 +- folly/Memory.h | 2 +- folly/MicroLock.cpp | 2 +- folly/MicroLock.h | 2 +- folly/MicroSpinLock.h | 2 +- folly/MoveWrapper.h | 2 +- folly/Optional.h | 2 +- folly/PackedSyncPtr.h | 2 +- folly/PicoSpinLock.h | 2 +- folly/Portability.h | 12 +- folly/ProducerConsumerQueue.h | 2 +- folly/Random.cpp | 2 +- folly/Random.h | 2 +- folly/Range.h | 4 +- folly/SafeAssert.cpp | 3 +- folly/SafeAssert.h | 3 +- folly/SharedMutex.cpp | 2 +- folly/Singleton-inl.h | 4 +- folly/Singleton.cpp | 6 +- folly/Singleton.h | 4 +- folly/SingletonStackTrace.cpp | 4 +- folly/SingletonThreadLocal.h | 2 +- folly/SocketAddress.h | 4 +- folly/SpinLock.h | 2 +- folly/String-inl.h | 2 +- folly/ThreadCachedInt.h | 2 +- folly/TokenBucket.h | 2 +- folly/Traits.h | 8 +- folly/UncaughtExceptions.h | 2 +- folly/Unicode.cpp | 2 +- folly/Unicode.h | 2 +- folly/Unit.h | 2 +- folly/Utility.h | 2 +- folly/compression/Compression.cpp | 2 +- folly/compression/test/CompressionTest.cpp | 2 +- folly/concurrency/ConcurrentHashMap.h | 2 +- folly/concurrency/CoreCachedSharedPtr.h | 2 +- folly/container/Foreach.h | 3 +- folly/container/Iterator.h | 4 +- folly/container/Merge.h | 2 +- folly/container/SparseByteSet.h | 2 +- folly/container/test/IteratorTest.cpp | 2 +- .../container/test/SparseByteSetBenchmark.cpp | 2 +- folly/container/test/SparseByteSetTest.cpp | 2 +- folly/detail/AtomicHashUtils.h | 3 +- folly/detail/AtomicUnorderedMapUtils.h | 3 +- folly/detail/AtomicUtils.h | 4 +- folly/detail/FileUtilDetail.h | 3 +- folly/detail/Futex.h | 3 +- folly/detail/IPAddressSource.h | 4 +- folly/detail/MPMCPipelineDetail.h | 3 +- folly/detail/MemoryIdler.cpp | 3 +- folly/detail/MemoryIdler.h | 5 +- folly/detail/RangeCommon.cpp | 4 +- folly/detail/RangeCommon.h | 4 +- folly/detail/RangeSse42.cpp | 4 +- folly/detail/RangeSse42.h | 4 +- folly/detail/Sleeper.h | 50 ++--- folly/detail/SocketFastOpen.cpp | 4 +- folly/detail/SocketFastOpen.h | 4 +- folly/detail/StaticSingletonManager.cpp | 4 +- folly/detail/StaticSingletonManager.h | 4 +- folly/detail/ThreadLocalDetail.cpp | 5 +- folly/detail/UncaughtExceptionCounter.h | 3 +- folly/dynamic-inl.h | 55 ++--- folly/dynamic.cpp | 2 +- folly/dynamic.h | 2 +- folly/executors/GlobalExecutor.cpp | 2 +- folly/executors/GlobalThreadPoolList.cpp | 2 +- folly/executors/GlobalThreadPoolList.h | 2 +- folly/executors/IOExecutor.h | 2 +- folly/executors/ManualExecutor.h | 2 +- folly/executors/QueuedImmediateExecutor.cpp | 2 +- folly/executors/ScheduledExecutor.h | 2 +- folly/executors/ThreadedExecutor.cpp | 2 +- folly/executors/ThreadedExecutor.h | 2 +- folly/executors/test/FiberIOExecutorTest.cpp | 2 +- folly/executors/test/ThreadedExecutorTest.cpp | 2 +- .../thread_factory/PriorityThreadFactory.h | 2 +- .../experimental/AsymmetricMemoryBarrier.cpp | 4 +- folly/experimental/AsymmetricMemoryBarrier.h | 2 +- folly/experimental/AutoTimer.h | 2 +- folly/experimental/BitVectorCoding.h | 3 +- folly/experimental/CodingDetail.h | 6 +- folly/experimental/EliasFanoCoding.h | 3 +- folly/experimental/FunctionScheduler.cpp | 2 +- folly/experimental/FunctionScheduler.h | 2 +- folly/experimental/JSONSchema.cpp | 6 +- folly/experimental/JSONSchema.h | 4 +- folly/experimental/RCURefCount.h | 2 +- folly/experimental/RCUUtils.cpp | 4 +- folly/experimental/RCUUtils.h | 2 +- folly/experimental/ReadMostlySharedPtr.h | 4 +- folly/experimental/Select64.cpp | 3 +- folly/experimental/TLRefCount.h | 2 +- folly/experimental/TestUtil.h | 2 +- folly/experimental/bser/Bser.h | 4 +- folly/experimental/bser/Dump.cpp | 4 +- folly/experimental/bser/Load.cpp | 4 +- .../exception_tracer/ExceptionTracerLib.h | 6 +- .../hazptr/example/LockFreeLIFO.h | 2 +- folly/experimental/hazptr/example/MWMRSet.h | 2 +- folly/experimental/hazptr/example/SWMRList.h | 2 +- folly/experimental/hazptr/example/WideCAS.h | 2 +- folly/experimental/hazptr/hazptr-impl.h | 2 +- folly/experimental/hazptr/memory_resource.h | 2 +- folly/experimental/hazptr/test/HazptrUse1.h | 2 +- folly/experimental/hazptr/test/HazptrUse2.h | 2 +- .../experimental/logging/AsyncFileWriter.cpp | 2 +- folly/experimental/logging/AsyncFileWriter.h | 2 +- .../logging/GlogStyleFormatter.cpp | 4 +- .../experimental/logging/GlogStyleFormatter.h | 2 +- .../logging/ImmediateFileWriter.cpp | 2 +- .../logging/ImmediateFileWriter.h | 2 +- folly/experimental/logging/Init.cpp | 2 +- folly/experimental/logging/Init.h | 2 +- folly/experimental/logging/LogCategory.cpp | 2 +- folly/experimental/logging/LogCategory.h | 2 +- folly/experimental/logging/LogFormatter.h | 2 +- folly/experimental/logging/LogHandler.h | 2 +- folly/experimental/logging/LogLevel.cpp | 2 +- folly/experimental/logging/LogLevel.h | 2 +- folly/experimental/logging/LogMessage.cpp | 2 +- folly/experimental/logging/LogMessage.h | 2 +- folly/experimental/logging/LogName.cpp | 2 +- folly/experimental/logging/LogName.h | 2 +- folly/experimental/logging/LogStream.cpp | 2 +- folly/experimental/logging/LogStream.h | 2 +- .../logging/LogStreamProcessor.cpp | 6 +- .../experimental/logging/LogStreamProcessor.h | 4 +- folly/experimental/logging/LogWriter.h | 2 +- folly/experimental/logging/Logger.cpp | 2 +- folly/experimental/logging/Logger.h | 2 +- folly/experimental/logging/LoggerDB.cpp | 4 +- folly/experimental/logging/LoggerDB.h | 2 +- folly/experimental/logging/RateLimiter.cpp | 4 +- folly/experimental/logging/RateLimiter.h | 4 +- .../logging/StandardLogHandler.cpp | 2 +- .../experimental/logging/StandardLogHandler.h | 2 +- folly/experimental/logging/example/lib.cpp | 2 +- folly/experimental/logging/example/lib.h | 2 +- folly/experimental/logging/printf.cpp | 2 +- folly/experimental/logging/printf.h | 2 +- .../logging/test/AsyncFileWriterTest.cpp | 4 +- .../experimental/logging/test/FatalHelper.cpp | 4 +- .../logging/test/ImmediateFileWriterTest.cpp | 2 +- .../experimental/logging/test/LoggerTest.cpp | 2 +- .../logging/test/StandardLogHandlerTest.cpp | 2 +- .../logging/test/TestLogHandler.h | 2 +- folly/experimental/logging/test/XlogFile1.cpp | 2 +- folly/experimental/logging/test/XlogFile2.cpp | 2 +- folly/experimental/logging/test/XlogHeader1.h | 2 +- folly/experimental/logging/test/XlogHeader2.h | 2 +- folly/experimental/logging/xlog.cpp | 2 +- folly/experimental/logging/xlog.h | 6 +- folly/experimental/observer/Observable-inl.h | 4 +- folly/experimental/observer/Observable.h | 4 +- folly/experimental/observer/Observer-inl.h | 4 +- folly/experimental/observer/Observer.h | 4 +- .../observer/SimpleObservable-inl.h | 4 +- .../experimental/observer/SimpleObservable.h | 4 +- folly/experimental/observer/detail/Core.cpp | 4 +- folly/experimental/observer/detail/Core.h | 4 +- .../observer/detail/GraphCycleDetector.h | 4 +- .../observer/detail/Observer-pre.h | 4 +- .../observer/detail/ObserverManager.cpp | 6 +- .../observer/detail/ObserverManager.h | 4 +- folly/experimental/test/CodingTestUtils.h | 3 +- .../test/NestedCommandLineAppTest.cpp | 3 +- .../experimental/test/ProgramOptionsTest.cpp | 3 +- folly/experimental/test/RefCountBenchmark.cpp | 2 +- folly/experimental/test/RefCountTest.cpp | 2 +- folly/experimental/test/TupleOpsTest.cpp | 3 +- folly/fibers/AddTasks-inl.h | 4 +- folly/fibers/AddTasks.h | 4 +- folly/fibers/BatchDispatcher.h | 4 +- folly/fibers/Baton-inl.h | 4 +- folly/fibers/Baton.cpp | 4 +- folly/fibers/Baton.h | 4 +- folly/fibers/Fiber.cpp | 4 +- folly/fibers/Fiber.h | 4 +- folly/fibers/FiberManager-inl.h | 4 +- folly/fibers/FiberManager.cpp | 6 +- folly/fibers/FiberManagerInternal-inl.h | 4 +- folly/fibers/FiberManagerInternal.h | 4 +- folly/fibers/FiberManagerMap.cpp | 4 +- folly/fibers/FiberManagerMap.h | 4 +- folly/fibers/GenericBaton.h | 4 +- folly/fibers/GuardPageAllocator.cpp | 2 +- folly/fibers/Promise-inl.h | 4 +- folly/fibers/Promise.h | 4 +- folly/fibers/TimedMutex-inl.h | 4 +- folly/fibers/TimedMutex.h | 4 +- folly/fibers/TimeoutController.cpp | 4 +- folly/fibers/TimeoutController.h | 4 +- folly/fibers/WhenN-inl.h | 4 +- folly/fibers/WhenN.h | 4 +- folly/fibers/test/FibersTest.cpp | 2 +- folly/functional/ApplyTuple.h | 2 +- folly/functional/test/ApplyTupleTest.cpp | 2 +- folly/futures/Barrier.cpp | 3 +- folly/futures/Barrier.h | 3 +- folly/futures/Future-inl.h | 14 +- folly/futures/Future-pre.h | 2 +- folly/futures/Future.cpp | 5 +- folly/futures/FutureException.cpp | 2 +- folly/futures/FutureException.h | 2 +- folly/futures/FutureSplitter.h | 2 +- folly/futures/Promise-inl.h | 2 +- folly/futures/Promise.h | 2 +- folly/futures/SharedPromise-inl.h | 2 +- folly/futures/SharedPromise.h | 2 +- folly/futures/detail/Types.h | 2 +- folly/futures/test/BarrierTest.cpp | 4 +- folly/futures/test/CallbackLifetimeTest.cpp | 2 +- folly/futures/test/ConversionOperatorTest.cpp | 2 +- folly/futures/test/FutureTest.cpp | 2 +- folly/futures/test/ThenCompileTest.h | 2 +- folly/futures/test/ThenTest.cpp | 2 +- folly/gen/Base-inl.h | 2 +- folly/gen/Base.h | 2 +- folly/gen/File-inl.h | 6 +- folly/gen/File.h | 4 +- folly/gen/Parallel.h | 6 +- folly/gen/test/BaseTest.cpp | 2 +- folly/hash/detail/ChecksumDetail.cpp | 4 +- folly/hash/detail/ChecksumDetail.h | 3 +- folly/init/Init.cpp | 2 +- folly/io/async/AsyncSSLSocket.cpp | 2 +- folly/io/async/AsyncSSLSocket.h | 2 +- folly/io/async/AsyncSocket.cpp | 2 +- folly/io/async/AsyncSocketBase.h | 2 +- .../io/async/DecoratedAsyncTransportWrapper.h | 2 +- folly/io/async/DestructorCheck.h | 2 +- folly/io/async/EventBase.h | 2 +- folly/io/async/EventBaseLocal.cpp | 3 +- folly/io/async/EventBaseLocal.h | 5 +- folly/io/async/EventBaseThread.cpp | 2 +- folly/io/async/EventBaseThread.h | 2 +- folly/io/async/Request.cpp | 2 +- folly/io/async/Request.h | 2 +- folly/io/async/SSLOptions.cpp | 2 +- folly/io/async/SSLOptions.h | 2 +- folly/io/async/ScopedEventBaseThread.cpp | 2 +- folly/io/async/ScopedEventBaseThread.h | 2 +- folly/io/async/TimeoutManager.cpp | 2 +- folly/io/async/VirtualEventBase.cpp | 2 +- folly/io/async/VirtualEventBase.h | 2 +- .../async/WriteChainAsyncTransportWrapper.h | 2 +- folly/io/async/ssl/OpenSSLUtils.cpp | 4 +- folly/io/async/ssl/SSLErrors.cpp | 4 +- folly/io/async/ssl/SSLErrors.h | 2 +- folly/io/async/test/AsyncSSLSocketTest.cpp | 2 +- folly/io/async/test/AsyncSSLSocketTest.h | 2 +- .../io/async/test/AsyncSSLSocketWriteTest.cpp | 2 +- .../io/async/test/AsyncSignalHandlerTest.cpp | 2 +- folly/io/async/test/AsyncSocketTest.cpp | 2 +- folly/io/async/test/AsyncSocketTest2.h | 4 +- folly/io/async/test/AsyncTransportTest.cpp | 2 +- folly/io/async/test/MockAsyncTransport.h | 3 +- folly/io/async/test/SSLContextTest.cpp | 2 +- folly/io/async/test/SSLOptionsTest.cpp | 2 +- folly/io/async/test/SSLSessionTest.cpp | 2 +- folly/io/async/test/ScopedBoundPort.cpp | 2 +- folly/io/async/test/ScopedBoundPort.h | 2 +- folly/io/async/test/SocketPair.cpp | 2 +- folly/io/async/test/SocketPair.h | 2 +- folly/io/async/test/TestSSLServer.cpp | 2 +- folly/io/async/test/TestSSLServer.h | 2 +- folly/io/async/test/TimeUtil.cpp | 2 +- folly/io/async/test/TimeUtil.h | 2 +- folly/io/async/test/TimeUtilTest.cpp | 4 +- folly/io/async/test/UndelayedDestruction.h | 2 +- .../WriteChainAsyncTransportWrapperTest.cpp | 3 +- folly/io/async/test/WriteFlagsTest.cpp | 2 +- folly/io/test/IOBufQueueTest.cpp | 2 +- folly/json.cpp | 6 +- folly/json.h | 182 ++++++++--------- folly/portability/Asm.h | 2 +- folly/portability/Constexpr.h | 2 +- folly/portability/Event.h | 2 +- folly/portability/Libgen.cpp | 4 +- folly/portability/Libgen.h | 4 +- folly/portability/Math.h | 2 +- folly/portability/Memory.cpp | 4 +- folly/portability/Memory.h | 4 +- folly/portability/OpenSSL.cpp | 6 +- folly/portability/OpenSSL.h | 6 +- folly/portability/Sockets.h | 6 +- folly/portability/SysMembarrier.cpp | 4 +- folly/portability/SysMembarrier.h | 4 +- folly/portability/SysUio.h | 2 +- folly/portability/test/ConstexprTest.cpp | 2 +- folly/small_vector.h | 2 +- folly/sorted_vector_types.h | 190 +++++++++--------- folly/ssl/Init.cpp | 2 +- folly/ssl/OpenSSLCertUtils.h | 4 +- folly/ssl/OpenSSLHash.cpp | 4 +- folly/ssl/OpenSSLHash.h | 4 +- folly/ssl/OpenSSLPtrTypes.h | 4 +- folly/ssl/detail/OpenSSLThreading.h | 6 +- folly/ssl/test/OpenSSLHashTest.cpp | 2 +- folly/stats/BucketedTimeSeries.cpp | 2 +- folly/stats/MultiLevelTimeSeries.cpp | 2 +- folly/stats/TimeseriesHistogram.cpp | 2 +- folly/stats/test/TimeSeriesTest.cpp | 6 +- folly/stats/test/TimeseriesHistogramTest.cpp | 6 +- folly/stop_watch.h | 2 +- folly/synchronization/CallOnce.h | 2 +- folly/system/Shell.h | 4 +- folly/system/ThreadId.h | 2 +- folly/system/ThreadName.cpp | 2 +- folly/system/ThreadName.h | 2 +- folly/system/VersionCheck.cpp | 3 +- folly/test/AHMIntStressTest.cpp | 2 +- folly/test/AtomicBitSetTest.cpp | 3 +- folly/test/AtomicHashMapTest.cpp | 8 +- folly/test/AtomicUnorderedMapTest.cpp | 2 +- folly/test/BenchmarkTest.cpp | 2 +- folly/test/BitIteratorTest.cpp | 2 +- folly/test/ChronoTest.cpp | 2 +- folly/test/ConcurrentSkipListBenchmark.cpp | 2 +- folly/test/ConcurrentSkipListTest.cpp | 4 +- folly/test/ConstexprMathTest.cpp | 2 +- folly/test/ConvBenchmark.cpp | 20 +- folly/test/ConvTest.cpp | 6 +- folly/test/DeterministicSchedule.cpp | 8 +- folly/test/DynamicConverterTest.cpp | 6 +- folly/test/ExceptionTest.cpp | 3 +- folly/test/ExceptionWrapperTest.cpp | 6 +- folly/test/ExpectedTest.cpp | 2 +- folly/test/FBStringTest.cpp | 2 +- folly/test/FBVectorTest.cpp | 4 +- folly/test/FileUtilTest.cpp | 9 +- folly/test/FormatTest.cpp | 2 +- folly/test/FunctionSchedulerTest.cpp | 2 +- folly/test/HashBenchmark.cpp | 2 +- folly/test/HashTest.cpp | 2 +- folly/test/IndestructibleTest.cpp | 2 +- folly/test/LazyTest.cpp | 2 +- folly/test/MPMCPipelineTest.cpp | 3 +- folly/test/MapUtilTest.cpp | 4 +- folly/test/MathBenchmark.cpp | 2 +- folly/test/MathTest.cpp | 2 +- folly/test/MemcpyTest.cpp | 2 +- folly/test/MemoryIdlerTest.cpp | 3 +- folly/test/MoveWrapperTest.cpp | 2 +- folly/test/OptionalTest.cpp | 2 +- folly/test/PackedSyncPtrTest.cpp | 2 +- folly/test/ProducerConsumerQueueBenchmark.cpp | 2 +- folly/test/ProducerConsumerQueueTest.cpp | 2 +- folly/test/RWSpinLockTest.cpp | 2 +- folly/test/RangeTest.cpp | 2 +- folly/test/SingletonTest.cpp | 6 +- folly/test/SingletonTestGlobal.cpp | 2 +- folly/test/SingletonTestStructs.cpp | 2 +- folly/test/SingletonThreadLocalTest.cpp | 2 +- folly/test/SmallLocksBenchmark.cpp | 2 +- folly/test/SmallLocksTest.cpp | 4 +- folly/test/SocketAddressTestHelper.cpp | 2 +- folly/test/SocketAddressTestHelper.h | 2 +- folly/test/StringTest.cpp | 4 +- folly/test/SubprocessTest.cpp | 2 +- folly/test/SynchronizedTestLib-inl.h | 4 +- folly/test/SynchronizedTestLib.h | 4 +- folly/test/TestUtils.h | 4 +- folly/test/ThreadCachedIntTest.cpp | 2 +- folly/test/ThreadLocalTest.cpp | 3 +- folly/test/TraitsTest.cpp | 12 +- folly/test/TryTest.cpp | 2 +- folly/test/UtilityTest.cpp | 2 +- folly/test/VarintTest.cpp | 3 +- folly/test/small_vector_test.cpp | 4 +- folly/test/sorted_vector_test.cpp | 2 +- folly/test/stl_tests/StlVectorTest.cpp | 2 +- 406 files changed, 873 insertions(+), 832 deletions(-) diff --git a/folly/Array.h b/folly/Array.h index 40778564..8b2e7c05 100644 --- a/folly/Array.h +++ b/folly/Array.h @@ -47,7 +47,7 @@ struct return_type_helper { template using return_type = std:: array::type, sizeof...(TList)>; -} // !array_detail +} // namespace array_detail template constexpr array_detail::return_type make_array(TList&&... t) { @@ -56,4 +56,4 @@ constexpr array_detail::return_type make_array(TList&&... t) { return {{static_cast(std::forward(t))...}}; } -} // !folly +} // namespace folly diff --git a/folly/Assume.cpp b/folly/Assume.cpp index a986f5c3..bf148dfd 100644 --- a/folly/Assume.cpp +++ b/folly/Assume.cpp @@ -26,6 +26,6 @@ void assume_check(bool cond) { CHECK(cond) << "compiler-hint assumption fails at runtime"; } -} +} // namespace detail -} +} // namespace folly diff --git a/folly/Assume.h b/folly/Assume.h index 47f4e9ab..36470fba 100644 --- a/folly/Assume.h +++ b/folly/Assume.h @@ -26,7 +26,7 @@ namespace detail { extern void assume_check(bool cond); -} +} // namespace detail /** * Inform the compiler that the argument can be assumed true. It is diff --git a/folly/AtomicStruct.h b/folly/AtomicStruct.h index 58345f68..e3297604 100644 --- a/folly/AtomicStruct.h +++ b/folly/AtomicStruct.h @@ -27,7 +27,7 @@ namespace folly { namespace detail { template struct AtomicStructIntPick {}; -} +} // namespace detail /// AtomicStruct work like C++ atomics, but can be used on any POD /// type <= 8 bytes. diff --git a/folly/AtomicUnorderedMap.h b/folly/AtomicUnorderedMap.h index 21cf55e0..ca867fc1 100644 --- a/folly/AtomicUnorderedMap.h +++ b/folly/AtomicUnorderedMap.h @@ -519,5 +519,4 @@ struct MutableData { explicit MutableData(const T& init) : data(init) {} }; - -} +} // namespace folly diff --git a/folly/CachelinePadded.h b/folly/CachelinePadded.h index faaa1eeb..233d4bd7 100644 --- a/folly/CachelinePadded.h +++ b/folly/CachelinePadded.h @@ -74,4 +74,4 @@ class CachelinePadded { T inner_; char paddingPost_[paddingSize()]; }; -} +} // namespace folly diff --git a/folly/Chrono.h b/folly/Chrono.h index 852a74b7..53cf480f 100644 --- a/folly/Chrono.h +++ b/folly/Chrono.h @@ -74,7 +74,7 @@ template constexpr To round_impl(Duration const& d, To const& t0) { return round_impl(d, t0, t0 + To{1}); } -} +} // namespace detail // mimic: std::chrono::ceil, C++17 // from: http://en.cppreference.com/w/cpp/chrono/duration/ceil, CC-BY-SA @@ -148,7 +148,7 @@ constexpr std::chrono::time_point round( std::chrono::time_point const& tp) { return std::chrono::time_point{round(tp.time_since_epoch())}; } -} -} +} // namespace chrono +} // namespace folly #endif diff --git a/folly/ClockGettimeWrappers.cpp b/folly/ClockGettimeWrappers.cpp index 96f572ff..9aae08d2 100644 --- a/folly/ClockGettimeWrappers.cpp +++ b/folly/ClockGettimeWrappers.cpp @@ -82,8 +82,8 @@ struct VdsoInitializer { }; static const VdsoInitializer vdso_initializer; -} +} // namespace #endif -} -} +} // namespace chrono +} // namespace folly diff --git a/folly/ClockGettimeWrappers.h b/folly/ClockGettimeWrappers.h index 5786110d..f5f1d15f 100644 --- a/folly/ClockGettimeWrappers.h +++ b/folly/ClockGettimeWrappers.h @@ -25,5 +25,5 @@ namespace chrono { extern int (*clock_gettime)(clockid_t, timespec* ts); extern int64_t (*clock_gettime_ns)(clockid_t); -} -} +} // namespace chrono +} // namespace folly diff --git a/folly/ConcurrentSkipList-inl.h b/folly/ConcurrentSkipList-inl.h index 090a732e..881d0535 100644 --- a/folly/ConcurrentSkipList-inl.h +++ b/folly/ConcurrentSkipList-inl.h @@ -337,4 +337,5 @@ class NodeRecycler(args)...)); } -} +} // namespace folly diff --git a/folly/Conv.h b/folly/Conv.h index 351fd4f9..5a9e0069 100644 --- a/folly/Conv.h +++ b/folly/Conv.h @@ -133,7 +133,7 @@ inline void enforceWhitespace(StringPiece sp) { throw makeConversionError(err, sp); } } -} +} // namespace detail /** * The identity conversion function. @@ -283,7 +283,7 @@ unsafeTelescope128(char * buffer, size_t room, unsigned __int128 x) { return p; } -} +} // namespace detail #endif /** diff --git a/folly/Demangle.h b/folly/Demangle.h index 0a9cf968..75061b5c 100644 --- a/folly/Demangle.h +++ b/folly/Demangle.h @@ -62,4 +62,4 @@ inline size_t demangle(const std::type_info& type, char* buf, size_t bufSize) { // glibc doesn't have strlcpy size_t strlcpy(char* dest, const char* const src, size_t size); -} +} // namespace folly diff --git a/folly/DynamicConverter.h b/folly/DynamicConverter.h index e63bf842..55c9b2e5 100644 --- a/folly/DynamicConverter.h +++ b/folly/DynamicConverter.h @@ -30,9 +30,11 @@ #include namespace folly { - template T convertTo(const dynamic&); - template dynamic toDynamic(const T&); -} +template +T convertTo(const dynamic&); +template +dynamic toDynamic(const T&); +} // namespace folly /** * convertTo returns a well-typed representation of the input dynamic. diff --git a/folly/ExceptionWrapper-inl.h b/folly/ExceptionWrapper-inl.h index 7a965525..790b24ca 100644 --- a/folly/ExceptionWrapper-inl.h +++ b/folly/ExceptionWrapper-inl.h @@ -335,7 +335,7 @@ Ex&& dont_slice(Ex&& ex) { "be sliced when storing in exception_wrapper."); return std::forward(ex); } -} +} // namespace exception_wrapper_detail template < class Ex, diff --git a/folly/ExceptionWrapper.cpp b/folly/ExceptionWrapper.cpp index 7cda0b76..f2fa0164 100644 --- a/folly/ExceptionWrapper.cpp +++ b/folly/ExceptionWrapper.cpp @@ -58,7 +58,7 @@ std::exception const* get_std_exception_(std::exception_ptr eptr) noexcept { return nullptr; } } -} +} // namespace exception_wrapper exception_wrapper::from_exception_ptr( std::exception_ptr const& ptr) noexcept { diff --git a/folly/Executor.cpp b/folly/Executor.cpp index cae75c96..44d1da4a 100644 --- a/folly/Executor.cpp +++ b/folly/Executor.cpp @@ -36,4 +36,4 @@ void Executor::keepAliveRelease() { LOG(FATAL) << __func__ << "() should not be called for folly::Executor types " << "which do not override getKeepAliveToken()"; } -} +} // namespace folly diff --git a/folly/Expected.h b/folly/Expected.h index 57098e28..c2d4e42d 100644 --- a/folly/Expected.h +++ b/folly/Expected.h @@ -633,7 +633,7 @@ struct ExpectedHelper { } FOLLY_POP_WARNING }; -} +} // namespace expected_detail_ExpectedHelper /* using override */ using expected_detail_ExpectedHelper::ExpectedHelper; struct UnexpectedTag {}; diff --git a/folly/FBVector.h b/folly/FBVector.h index dec58fc0..428eba62 100644 --- a/folly/FBVector.h +++ b/folly/FBVector.h @@ -45,9 +45,9 @@ // forward declaration namespace folly { - template > - class fbvector; -} +template > +class fbvector; +} // namespace folly //============================================================================= // unrolling diff --git a/folly/FixedString.h b/folly/FixedString.h index d91ce1a0..cec00226 100644 --- a/folly/FixedString.h +++ b/folly/FixedString.h @@ -3010,7 +3010,7 @@ inline namespace { // "const std::size_t&" is so that folly::npos has the same address in every // translation unit. This is to avoid potential violations of the ODR. constexpr const std::size_t& npos = detail::fixedstring::FixedStringBase::npos; -} +} // namespace #if defined(__GNUC__) #pragma GCC diagnostic push @@ -3063,8 +3063,8 @@ FOLLY_DEFINE_FIXED_STRING_UDL(64) FOLLY_DEFINE_FIXED_STRING_UDL(128) #undef FOLLY_DEFINE_FIXED_STRING_UDL -} -} +} // namespace string_literals +} // namespace literals // TODO: // // numeric conversions: @@ -3099,4 +3099,4 @@ FOLLY_DEFINE_FIXED_STRING_UDL(128) // constexpr FixedString to_fixed_string_ll() noexcept // template // constexpr FixedString to_fixed_string_ull() noexcept; -} +} // namespace folly diff --git a/folly/Format.h b/folly/Format.h index 6ed3c6f1..3837d107 100644 --- a/folly/Format.h +++ b/folly/Format.h @@ -46,7 +46,7 @@ class FormatValue; // meta-attribute to identify formatters in this sea of template weirdness namespace detail { class FormatterTag {}; -}; +} // namespace detail /** * Formatter class. @@ -322,7 +322,7 @@ struct DefaultValueWrapper { const Container& container; const Value& defaultValue; }; -} // namespace +} // namespace detail template detail::DefaultValueWrapper defaulted( diff --git a/folly/FormatArg.cpp b/folly/FormatArg.cpp index 1e19aa5f..fd33a048 100644 --- a/folly/FormatArg.cpp +++ b/folly/FormatArg.cpp @@ -24,4 +24,4 @@ namespace folly { [[noreturn]] void throwBadFormatArg(std::string const& msg) { throw BadFormatArg(msg); } -} +} // namespace folly diff --git a/folly/FormatTraits.h b/folly/FormatTraits.h index 145c256d..4b80112e 100644 --- a/folly/FormatTraits.h +++ b/folly/FormatTraits.h @@ -60,4 +60,5 @@ struct IndexableTraitsAssoc : public FormatTraitsBase { } }; -}} // namespaces +} // namespace detail +} // namespace folly diff --git a/folly/Function.h b/folly/Function.h index 8cff8d8b..4bb7e6be 100644 --- a/folly/Function.h +++ b/folly/Function.h @@ -753,8 +753,8 @@ struct IsCallableAsImpl< template struct IsCallableAs : IsCallableAsImpl {}; -} -} +} // namespace function +} // namespace detail /** * @class FunctionRef diff --git a/folly/Functional.h b/folly/Functional.h index fa512896..e239e1ac 100644 --- a/folly/Functional.h +++ b/folly/Functional.h @@ -151,4 +151,4 @@ rvalue_reference_wrapper rref(T&& value) noexcept { } template rvalue_reference_wrapper rref(T&) noexcept = delete; -} +} // namespace folly diff --git a/folly/Indestructible.h b/folly/Indestructible.h index ad1d21cb..56ece823 100644 --- a/folly/Indestructible.h +++ b/folly/Indestructible.h @@ -119,4 +119,4 @@ class Indestructible final { Storage storage_{}; bool erased_{false}; }; -} +} // namespace folly diff --git a/folly/IndexedMemPool.h b/folly/IndexedMemPool.h index 899a99e1..82ae6295 100644 --- a/folly/IndexedMemPool.h +++ b/folly/IndexedMemPool.h @@ -38,7 +38,7 @@ namespace folly { namespace detail { template struct IndexedMemPoolRecycler; -} +} // namespace detail template < typename T, @@ -532,7 +532,7 @@ struct IndexedMemPoolRecycler { } }; -} +} // namespace detail } // namespace folly diff --git a/folly/Lazy.h b/folly/Lazy.h index a4fcfd35..ff115f3f 100644 --- a/folly/Lazy.h +++ b/folly/Lazy.h @@ -118,7 +118,7 @@ struct Lazy { Func func_; }; -} +} // namespace detail ////////////////////////////////////////////////////////////////////// @@ -132,4 +132,4 @@ lazy(Func&& fun) { ////////////////////////////////////////////////////////////////////// -} +} // namespace folly diff --git a/folly/LifoSem.cpp b/folly/LifoSem.cpp index 6a5279fe..d3fa5065 100644 --- a/folly/LifoSem.cpp +++ b/folly/LifoSem.cpp @@ -37,4 +37,4 @@ ShutdownSemError::ShutdownSemError(const std::string& msg) ShutdownSemError::~ShutdownSemError() noexcept { } -} +} // namespace folly diff --git a/folly/LockTraitsBoost.h b/folly/LockTraitsBoost.h index a4888155..79b8af11 100644 --- a/folly/LockTraitsBoost.h +++ b/folly/LockTraitsBoost.h @@ -37,7 +37,7 @@ boost::chrono::duration> toBoostDuration( const std::chrono::duration>& d) { return boost::chrono::duration>(d.count()); } -} +} // namespace detail /** * LockTraits specialization for boost::shared_mutex diff --git a/folly/MapUtil.h b/folly/MapUtil.h index 15dd4b18..b1fbfadc 100644 --- a/folly/MapUtil.h +++ b/folly/MapUtil.h @@ -207,7 +207,7 @@ auto extract_default(const KeysDefault&... keysDefault) -> typename DefaultType::type const& { return std::get(std::tie(keysDefault...)); } -} +} // namespace detail /** * Given a map of maps and a path of keys, return a pointer to the nested value, diff --git a/folly/Math.h b/folly/Math.h index 6d4eee53..dc69ee95 100644 --- a/folly/Math.h +++ b/folly/Math.h @@ -104,7 +104,7 @@ using IdivResultType = typename std::enable_if< !std::is_same::value && !std::is_same::value, decltype(N{1} / D{1})>::type; -} +} // namespace detail #if defined(__arm__) && !FOLLY_AARCH64 constexpr auto kIntegerDivisionGivesRemainder = false; diff --git a/folly/Memory.h b/folly/Memory.h index c1766277..c6c3ea21 100644 --- a/folly/Memory.h +++ b/folly/Memory.h @@ -146,7 +146,7 @@ namespace detail { inline void SysFree(void* p) { ::free(p); } -} +} // namespace detail using SysBufferDeleter = static_function_deleter; using SysBufferUniquePtr = std::unique_ptr; diff --git a/folly/MicroLock.cpp b/folly/MicroLock.cpp index ac587ca0..e42bd6dd 100644 --- a/folly/MicroLock.cpp +++ b/folly/MicroLock.cpp @@ -65,4 +65,4 @@ retry: goto retry; } } -} +} // namespace folly diff --git a/folly/MicroLock.h b/folly/MicroLock.h index c358814d..eb2795f4 100644 --- a/folly/MicroLock.h +++ b/folly/MicroLock.h @@ -223,4 +223,4 @@ void MicroLockBase::lock(unsigned slot) { } typedef MicroLockBase<> MicroLock; -} +} // namespace folly diff --git a/folly/MicroSpinLock.h b/folly/MicroSpinLock.h index d0c9ac23..b36998a7 100644 --- a/folly/MicroSpinLock.h +++ b/folly/MicroSpinLock.h @@ -155,4 +155,4 @@ typedef std::lock_guard MSLGuard; ////////////////////////////////////////////////////////////////////// -} +} // namespace folly diff --git a/folly/MoveWrapper.h b/folly/MoveWrapper.h index 3f8cf030..7d208e26 100644 --- a/folly/MoveWrapper.h +++ b/folly/MoveWrapper.h @@ -74,4 +74,4 @@ MoveWrapper makeMoveWrapper(T&& t) { return MoveWrapper(std::forward(t)); } -} // namespace +} // namespace folly diff --git a/folly/Optional.h b/folly/Optional.h index 2bb2d658..31e1f4fd 100644 --- a/folly/Optional.h +++ b/folly/Optional.h @@ -625,6 +625,6 @@ template struct coroutine_traits, Args...> { using promise_type = folly::detail::OptionalPromise; }; -} // experimental +} // namespace experimental FOLLY_NAMESPACE_STD_END #endif // FOLLY_HAS_COROUTINES diff --git a/folly/PackedSyncPtr.h b/folly/PackedSyncPtr.h index 10902400..a49b0270 100644 --- a/folly/PackedSyncPtr.h +++ b/folly/PackedSyncPtr.h @@ -150,4 +150,4 @@ std::ostream& operator<<(std::ostream& os, const PackedSyncPtr& ptr) { os << "PackedSyncPtr(" << ptr.get() << ", " << ptr.extra() << ")"; return os; } -} +} // namespace folly diff --git a/folly/PicoSpinLock.h b/folly/PicoSpinLock.h index 070f1fbe..5c63583d 100644 --- a/folly/PicoSpinLock.h +++ b/folly/PicoSpinLock.h @@ -284,4 +284,4 @@ struct PicoSpinLock { } }; -} +} // namespace folly diff --git a/folly/Portability.h b/folly/Portability.h index 060085c3..be5960d2 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -63,7 +63,7 @@ using max_basic_alignment = max_alignment< char32_t, wchar_t, std::nullptr_t>; -} // namespace detail +} // namespace portability_detail constexpr size_t max_align_v = portability_detail::max_basic_alignment::value; @@ -184,7 +184,7 @@ namespace folly { constexpr bool kIsArchAmd64 = FOLLY_X64 == 1; constexpr bool kIsArchAArch64 = FOLLY_AARCH64 == 1; constexpr bool kIsArchPPC64 = FOLLY_PPC64 == 1; -} +} // namespace folly namespace folly { @@ -199,7 +199,7 @@ constexpr bool kIsSanitizeThread = true; #else constexpr bool kIsSanitizeThread = false; #endif -} +} // namespace folly // packing is very ugly in msvc #ifdef _MSC_VER @@ -313,7 +313,7 @@ constexpr auto kIsDebug = false; #else constexpr auto kIsDebug = true; #endif -} +} // namespace folly // Endianness namespace folly { @@ -328,7 +328,7 @@ constexpr auto kIsLittleEndian = true; constexpr auto kIsLittleEndian = __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__; #endif constexpr auto kIsBigEndian = !kIsLittleEndian; -} +} // namespace folly #ifndef FOLLY_SSE # if defined(__SSE4_2__) @@ -406,7 +406,7 @@ constexpr auto kMscVer = _MSC_VER; constexpr auto kIsWindows = false; constexpr auto kMscVer = 0; #endif -} +} // namespace folly // Define FOLLY_USE_CPP14_CONSTEXPR to be true if the compiler's C++14 // constexpr support is "good enough". diff --git a/folly/ProducerConsumerQueue.h b/folly/ProducerConsumerQueue.h index 8d2e47f0..16de57d3 100644 --- a/folly/ProducerConsumerQueue.h +++ b/folly/ProducerConsumerQueue.h @@ -183,4 +183,4 @@ struct ProducerConsumerQueue { char pad1_[CacheLocality::kFalseSharingRange - sizeof(writeIndex_)]; }; -} +} // namespace folly diff --git a/folly/Random.cpp b/folly/Random.cpp index f643fb52..5f94f00c 100644 --- a/folly/Random.cpp +++ b/folly/Random.cpp @@ -150,4 +150,4 @@ ThreadLocalPRNG::ThreadLocalPRNG() { uint32_t ThreadLocalPRNG::getImpl(LocalInstancePRNG* local) { return local->rng(); } -} +} // namespace folly diff --git a/folly/Random.h b/folly/Random.h index dbb16bf5..e74d64b1 100644 --- a/folly/Random.h +++ b/folly/Random.h @@ -294,6 +294,6 @@ inline uint32_t randomNumberSeed() { return Random::rand32(); } -} +} // namespace folly #include diff --git a/folly/Range.h b/folly/Range.h index 3d916594..6a8161d2 100644 --- a/folly/Range.h +++ b/folly/Range.h @@ -1370,8 +1370,8 @@ constexpr Range operator"" _sp( size_t len) noexcept { return Range(str, len); } -} // inline namespace string_piece_literals -} // inline namespace literals +} // namespace string_piece_literals +} // namespace literals } // namespace folly diff --git a/folly/SafeAssert.cpp b/folly/SafeAssert.cpp index 37174c79..62f3bc44 100644 --- a/folly/SafeAssert.cpp +++ b/folly/SafeAssert.cpp @@ -49,4 +49,5 @@ void assertionFailure(const char* expr, const char* msg, const char* file, abort(); } -}} // namespaces +} // namespace detail +} // namespace folly diff --git a/folly/SafeAssert.h b/folly/SafeAssert.h index 27293c9c..182b1580 100644 --- a/folly/SafeAssert.h +++ b/folly/SafeAssert.h @@ -46,4 +46,5 @@ namespace folly { namespace detail { const char* file, unsigned int line, const char* function); -}} // namespace folly +} // namespace detail +} // namespace folly diff --git a/folly/SharedMutex.cpp b/folly/SharedMutex.cpp index d8b49887..eba2ea43 100644 --- a/folly/SharedMutex.cpp +++ b/folly/SharedMutex.cpp @@ -20,4 +20,4 @@ namespace folly { // Explicitly instantiate SharedMutex here: template class SharedMutexImpl; template class SharedMutexImpl; -} +} // namespace folly diff --git a/folly/Singleton-inl.h b/folly/Singleton-inl.h index e5b21dd5..745147f0 100644 --- a/folly/Singleton-inl.h +++ b/folly/Singleton-inl.h @@ -296,6 +296,6 @@ void SingletonHolder::createInstance() { vault_.creationOrder_.wlock()->push_back(type()); } -} +} // namespace detail -} +} // namespace folly diff --git a/folly/Singleton.cpp b/folly/Singleton.cpp index 7d3eeac6..7114d53d 100644 --- a/folly/Singleton.cpp +++ b/folly/Singleton.cpp @@ -60,7 +60,7 @@ namespace detail { << type.name() << ">\n"; std::abort(); } -} +} // namespace detail namespace { @@ -88,7 +88,7 @@ FatalHelper fatalHelper; FatalHelper __attribute__ ((__init_priority__ (101))) fatalHelper; #endif -} +} // namespace SingletonVault::~SingletonVault() { destroyInstances(); } @@ -266,4 +266,4 @@ void SingletonVault::scheduleDestroyInstances() { static SingletonVaultDestructor singletonVaultDestructor; } -} +} // namespace folly diff --git a/folly/Singleton.h b/folly/Singleton.h index 028cf7f1..40e9dad6 100644 --- a/folly/Singleton.h +++ b/folly/Singleton.h @@ -328,7 +328,7 @@ struct SingletonHolder : public SingletonHolderBase { SingletonHolder(SingletonHolder&&) = delete; }; -} +} // namespace detail class SingletonVault { public: @@ -734,6 +734,6 @@ class LeakySingleton { entry.state = State::Living; } }; -} +} // namespace folly #include diff --git a/folly/SingletonStackTrace.cpp b/folly/SingletonStackTrace.cpp index f5d5f97b..4f49409b 100644 --- a/folly/SingletonStackTrace.cpp +++ b/folly/SingletonStackTrace.cpp @@ -56,6 +56,6 @@ SetStackTraceGetter setStackTraceGetter; #else SetStackTraceGetter __attribute__((__init_priority__(101))) setStackTraceGetter; #endif -} -} +} // namespace +} // namespace folly #endif diff --git a/folly/SingletonThreadLocal.h b/folly/SingletonThreadLocal.h index d14878bf..c4d31efd 100644 --- a/folly/SingletonThreadLocal.h +++ b/folly/SingletonThreadLocal.h @@ -92,4 +92,4 @@ class SingletonThreadLocal { SingletonT singleton_; }; -} +} // namespace folly diff --git a/folly/SocketAddress.h b/folly/SocketAddress.h index 929fb694..21c35a05 100644 --- a/folly/SocketAddress.h +++ b/folly/SocketAddress.h @@ -613,7 +613,7 @@ class SocketAddress { size_t hash_value(const SocketAddress& address); std::ostream& operator<<(std::ostream& os, const SocketAddress& addr); -} +} // namespace folly namespace std { @@ -624,4 +624,4 @@ struct hash { return addr.hash(); } }; -} +} // namespace std diff --git a/folly/SpinLock.h b/folly/SpinLock.h index b87e58a6..3df5d4e1 100644 --- a/folly/SpinLock.h +++ b/folly/SpinLock.h @@ -74,4 +74,4 @@ class SpinLockGuardImpl : private boost::noncopyable { typedef SpinLockGuardImpl SpinLockGuard; -} +} // namespace folly diff --git a/folly/String-inl.h b/folly/String-inl.h index 2ec534bf..f6b5ba99 100644 --- a/folly/String-inl.h +++ b/folly/String-inl.h @@ -355,7 +355,7 @@ bool splitFixed( return false; } -} +} // namespace detail ////////////////////////////////////////////////////////////////////// diff --git a/folly/ThreadCachedInt.h b/folly/ThreadCachedInt.h index 58816e37..9b7c3136 100644 --- a/folly/ThreadCachedInt.h +++ b/folly/ThreadCachedInt.h @@ -172,4 +172,4 @@ class ThreadCachedInt : boost::noncopyable { }; }; -} +} // namespace folly diff --git a/folly/TokenBucket.h b/folly/TokenBucket.h index 905b0f9f..2abbfe37 100644 --- a/folly/TokenBucket.h +++ b/folly/TokenBucket.h @@ -385,4 +385,4 @@ class ParameterizedTokenBucket { using TokenBucket = ParameterizedTokenBucket<>; using DynamicTokenBucket = ParameterizedDynamicTokenBucket<>; -} +} // namespace folly diff --git a/folly/Traits.h b/folly/Traits.h index 45781cf5..d1ab157a 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -290,7 +290,7 @@ struct is_trivially_copyable : std::is_trivial {}; template using is_trivially_copyable = std::is_trivially_copyable; #endif -} +} // namespace traits_detail struct Ignore { template @@ -311,7 +311,7 @@ struct IsEqualityComparable decltype(std::declval() == std::declval()), bool > {}; -} +} // namespace traits_detail_IsEqualityComparable /* using override */ using traits_detail_IsEqualityComparable:: IsEqualityComparable; @@ -325,7 +325,7 @@ struct IsLessThanComparable decltype(std::declval() < std::declval()), bool > {}; -} +} // namespace traits_detail_IsLessThanComparable /* using override */ using traits_detail_IsLessThanComparable:: IsLessThanComparable; @@ -353,7 +353,7 @@ struct IsNothrowSwappable noexcept(swap(std::declval(), std::declval())) > {}; #endif -} +} // namespace traits_detail_IsNothrowSwappable /* using override */ using traits_detail_IsNothrowSwappable::IsNothrowSwappable; diff --git a/folly/UncaughtExceptions.h b/folly/UncaughtExceptions.h index 0c2a6336..0b90f620 100644 --- a/folly/UncaughtExceptions.h +++ b/folly/UncaughtExceptions.h @@ -26,7 +26,7 @@ namespace __cxxabiv1 { struct __cxa_eh_globals; // declared in cxxabi.h from libstdc++-v3 extern "C" __cxa_eh_globals* __cxa_get_globals() noexcept; -} +} // namespace __cxxabiv1 #elif defined(_MSC_VER) && (_MSC_VER >= 1400) && \ (_MSC_VER < 1900) // MSVC++ 8.0 or greater #define FOLLY_EXCEPTION_COUNT_USE_GETPTD diff --git a/folly/Unicode.cpp b/folly/Unicode.cpp index 811e65c7..b13f4ae9 100644 --- a/folly/Unicode.cpp +++ b/folly/Unicode.cpp @@ -148,4 +148,4 @@ char32_t utf8ToCodePoint( ////////////////////////////////////////////////////////////////////// -} +} // namespace folly diff --git a/folly/Unicode.h b/folly/Unicode.h index c16d87d2..eaeb05f4 100644 --- a/folly/Unicode.h +++ b/folly/Unicode.h @@ -41,4 +41,4 @@ char32_t utf8ToCodePoint( ////////////////////////////////////////////////////////////////////// -} +} // namespace folly diff --git a/folly/Unit.h b/folly/Unit.h index dfcce1d3..52f38fcf 100644 --- a/folly/Unit.h +++ b/folly/Unit.h @@ -59,4 +59,4 @@ struct Unit { constexpr Unit unit {}; -} +} // namespace folly diff --git a/folly/Utility.h b/folly/Utility.h index 86b338ae..bb196080 100644 --- a/folly/Utility.h +++ b/folly/Utility.h @@ -142,7 +142,7 @@ struct make_seq<0> { template using apply = S0; }; -} +} // namespace utility_detail #if __cpp_lib_integer_sequence || _MSC_VER diff --git a/folly/compression/Compression.cpp b/folly/compression/Compression.cpp index 05ea019c..6f288b5c 100644 --- a/folly/compression/Compression.cpp +++ b/folly/compression/Compression.cpp @@ -1322,7 +1322,7 @@ void zstdFreeCStream(ZSTD_CStream* zcs) { void zstdFreeDStream(ZSTD_DStream* zds) { ZSTD_freeDStream(zds); } -} +} // namespace /** * ZSTD compression diff --git a/folly/compression/test/CompressionTest.cpp b/folly/compression/test/CompressionTest.cpp index 9c846048..4bbf5027 100644 --- a/folly/compression/test/CompressionTest.cpp +++ b/folly/compression/test/CompressionTest.cpp @@ -1125,7 +1125,7 @@ class CustomCodec : public Codec { std::string prefix_; std::unique_ptr codec_; }; -} +} // namespace TEST_P(AutomaticCodecTest, CustomCodec) { const uint64_t length = 42; diff --git a/folly/concurrency/ConcurrentHashMap.h b/folly/concurrency/ConcurrentHashMap.h index 65816b6d..4d8bd6e2 100644 --- a/folly/concurrency/ConcurrentHashMap.h +++ b/folly/concurrency/ConcurrentHashMap.h @@ -485,4 +485,4 @@ class ConcurrentHashMap { size_t max_size_{0}; }; -} // namespace +} // namespace folly diff --git a/folly/concurrency/CoreCachedSharedPtr.h b/folly/concurrency/CoreCachedSharedPtr.h index df7e325e..21ee2928 100644 --- a/folly/concurrency/CoreCachedSharedPtr.h +++ b/folly/concurrency/CoreCachedSharedPtr.h @@ -146,4 +146,4 @@ class AtomicCoreCachedSharedPtr { std::atomic slots_{nullptr}; }; -} // namespace +} // namespace folly diff --git a/folly/container/Foreach.h b/folly/container/Foreach.h index f24854de..ba744e8f 100644 --- a/folly/container/Foreach.h +++ b/folly/container/Foreach.h @@ -298,7 +298,8 @@ downTo(T& iter, const U& begin) { return true; } -} } +} // namespace detail +} // namespace folly /* * Look at the Ranges-v3 views and you'll probably find an easier way to build diff --git a/folly/container/Iterator.h b/folly/container/Iterator.h index c0b7b12e..1c316950 100644 --- a/folly/container/Iterator.h +++ b/folly/container/Iterator.h @@ -107,7 +107,7 @@ decltype(auto) unwrap_emplace_arg( folly::rvalue_reference_wrapper arg) noexcept { return std::move(arg).get(); } -} +} // namespace detail /** * Getter function for unpacking a single emplace argument. @@ -492,4 +492,4 @@ template back_emplace_iterator back_emplacer(Container& c) { return back_emplace_iterator(c); } -} +} // namespace folly diff --git a/folly/container/Merge.h b/folly/container/Merge.h index 1979ae71..2e0a5087 100644 --- a/folly/container/Merge.h +++ b/folly/container/Merge.h @@ -80,4 +80,4 @@ OutputIt merge(InputIt1 first1, InputIt1 last1, return std::copy(first2, last2, d_first); } -} +} // namespace folly diff --git a/folly/container/SparseByteSet.h b/folly/container/SparseByteSet.h index f6393b0a..2848f6af 100644 --- a/folly/container/SparseByteSet.h +++ b/folly/container/SparseByteSet.h @@ -85,4 +85,4 @@ class SparseByteSet { uint8_t dense_[kCapacity]; }; -} +} // namespace folly diff --git a/folly/container/test/IteratorTest.cpp b/folly/container/test/IteratorTest.cpp index 15822e6f..b388fa5d 100644 --- a/folly/container/test/IteratorTest.cpp +++ b/folly/container/test/IteratorTest.cpp @@ -143,7 +143,7 @@ void emplace_test(Container& q, Iterator it) { EXPECT_EQ(gMoveOpCnt, 0); EXPECT_EQ(gConvertOpCnt, 0); } -} +} // namespace using namespace folly; diff --git a/folly/container/test/SparseByteSetBenchmark.cpp b/folly/container/test/SparseByteSetBenchmark.cpp index b5e80900..a053253e 100644 --- a/folly/container/test/SparseByteSetBenchmark.cpp +++ b/folly/container/test/SparseByteSetBenchmark.cpp @@ -148,7 +148,7 @@ void setup_rand_bench() { } } -} +} // namespace int main(int argc, char** argv) { gflags::ParseCommandLineFlags(&argc, &argv, true); diff --git a/folly/container/test/SparseByteSetTest.cpp b/folly/container/test/SparseByteSetTest.cpp index b0227946..0e2a36ef 100644 --- a/folly/container/test/SparseByteSetTest.cpp +++ b/folly/container/test/SparseByteSetTest.cpp @@ -34,7 +34,7 @@ class SparseByteSetTest : public testing::Test { SparseByteSet s; }; -} +} // namespace TEST_F(SparseByteSetTest, empty) { for (auto c = lims::min(); c < lims::max(); ++c) { diff --git a/folly/detail/AtomicHashUtils.h b/folly/detail/AtomicHashUtils.h index 49331bf3..7fb84056 100644 --- a/folly/detail/AtomicHashUtils.h +++ b/folly/detail/AtomicHashUtils.h @@ -37,4 +37,5 @@ void atomic_hash_spin_wait(Cond condition) { } } -}} // namespace folly::detail +} // namespace detail +} // namespace folly diff --git a/folly/detail/AtomicUnorderedMapUtils.h b/folly/detail/AtomicUnorderedMapUtils.h index 7977a607..ef467961 100644 --- a/folly/detail/AtomicUnorderedMapUtils.h +++ b/folly/detail/AtomicUnorderedMapUtils.h @@ -74,4 +74,5 @@ struct GivesZeroFilledMemory : public std::false_type {}; template <> struct GivesZeroFilledMemory : public std::true_type{}; -}} +} // namespace detail +} // namespace folly diff --git a/folly/detail/AtomicUtils.h b/folly/detail/AtomicUtils.h index 65d68cf6..ff6a85ea 100644 --- a/folly/detail/AtomicUtils.h +++ b/folly/detail/AtomicUtils.h @@ -32,5 +32,5 @@ inline std::memory_order default_failure_memory_order( return successMode; } } -} -} // namespace +} // namespace detail +} // namespace folly diff --git a/folly/detail/FileUtilDetail.h b/folly/detail/FileUtilDetail.h index dc0fa2b3..d45cae86 100644 --- a/folly/detail/FileUtilDetail.h +++ b/folly/detail/FileUtilDetail.h @@ -105,4 +105,5 @@ ssize_t wrapvFull(F f, int fd, iovec* iov, int count, Offset... offset) { return totalBytes; } -}} // namespaces +} // namespace fileutil_detail +} // namespace folly diff --git a/folly/detail/Futex.h b/folly/detail/Futex.h index b01d967a..a87b8299 100644 --- a/folly/detail/Futex.h +++ b/folly/detail/Futex.h @@ -164,4 +164,5 @@ FutexResult Futex::futexWaitImpl( std::chrono::time_point* absSteadyTime, uint32_t waitMask); -}} +} // namespace detail +} // namespace folly diff --git a/folly/detail/IPAddressSource.h b/folly/detail/IPAddressSource.h index f9e374ee..4a29d030 100644 --- a/folly/detail/IPAddressSource.h +++ b/folly/detail/IPAddressSource.h @@ -273,5 +273,5 @@ inline void fastIpv6AppendToString(const in6_addr& in6Addr, std::string& out) { char str[sizeof("2001:0db8:0000:0000:0000:ff00:0042:8329")]; out.append(str, fastIpv6ToBufferUnsafe(in6Addr, str)); } -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/MPMCPipelineDetail.h b/folly/detail/MPMCPipelineDetail.h index c436c5f6..a96f81bb 100644 --- a/folly/detail/MPMCPipelineDetail.h +++ b/folly/detail/MPMCPipelineDetail.h @@ -117,4 +117,5 @@ struct AmplificationProduct> { AmplificationProduct>::value; }; -}} // namespaces +} // namespace detail +} // namespace folly diff --git a/folly/detail/MemoryIdler.cpp b/folly/detail/MemoryIdler.cpp index 3eb4bad6..8cf1fb36 100644 --- a/folly/detail/MemoryIdler.cpp +++ b/folly/detail/MemoryIdler.cpp @@ -167,4 +167,5 @@ void MemoryIdler::unmapUnusedStack(size_t /* retain */) {} #endif -}} +} // namespace detail +} // namespace folly diff --git a/folly/detail/MemoryIdler.h b/folly/detail/MemoryIdler.h index 13fe453e..1a8fe3ae 100644 --- a/folly/detail/MemoryIdler.h +++ b/folly/detail/MemoryIdler.h @@ -33,7 +33,7 @@ template <> struct IsTriviallyCopyable : std::true_type {}; -} +} // namespace folly namespace folly { namespace detail { @@ -150,4 +150,5 @@ struct MemoryIdler { } }; -}} // namespace folly::detail +} // namespace detail +} // namespace folly diff --git a/folly/detail/RangeCommon.cpp b/folly/detail/RangeCommon.cpp index e8949d3f..87467b62 100644 --- a/folly/detail/RangeCommon.cpp +++ b/folly/detail/RangeCommon.cpp @@ -53,5 +53,5 @@ size_t qfind_first_byte_of_byteset( } return std::string::npos; } -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/RangeCommon.h b/folly/detail/RangeCommon.h index ca8cc833..6a7e8074 100644 --- a/folly/detail/RangeCommon.h +++ b/folly/detail/RangeCommon.h @@ -104,5 +104,5 @@ inline size_t qfind_first_byte_of_nosse( } return qfind_first_byte_of_std(haystack, needles); } -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/RangeSse42.cpp b/folly/detail/RangeSse42.cpp index 651949fb..0d82df36 100644 --- a/folly/detail/RangeSse42.cpp +++ b/folly/detail/RangeSse42.cpp @@ -33,8 +33,8 @@ size_t qfind_first_byte_of_sse42( const StringPieceLite needles) { return qfind_first_byte_of_nosse(haystack, needles); } -} -} +} // namespace detail +} // namespace folly #else #include #include diff --git a/folly/detail/RangeSse42.h b/folly/detail/RangeSse42.h index 8e89d0f0..0a5901fc 100644 --- a/folly/detail/RangeSse42.h +++ b/folly/detail/RangeSse42.h @@ -27,5 +27,5 @@ namespace detail { size_t qfind_first_byte_of_sse42( const StringPieceLite haystack, const StringPieceLite needles); -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/Sleeper.h b/folly/detail/Sleeper.h index 2d1f2487..ad8127c2 100644 --- a/folly/detail/Sleeper.h +++ b/folly/detail/Sleeper.h @@ -32,33 +32,33 @@ namespace folly { namespace detail { - /* - * A helper object for the contended case. Starts off with eager - * spinning, and falls back to sleeping for small quantums. - */ - class Sleeper { - static const uint32_t kMaxActiveSpin = 4000; +/* + * A helper object for the contended case. Starts off with eager + * spinning, and falls back to sleeping for small quantums. + */ +class Sleeper { + static const uint32_t kMaxActiveSpin = 4000; - uint32_t spinCount; + uint32_t spinCount; - public: - Sleeper() : spinCount(0) {} + public: + Sleeper() : spinCount(0) {} - void wait() { - if (spinCount < kMaxActiveSpin) { - ++spinCount; - asm_volatile_pause(); - } else { - /* - * Always sleep 0.5ms, assuming this will make the kernel put - * us down for whatever its minimum timer resolution is (in - * linux this varies by kernel version from 1ms to 10ms). - */ - struct timespec ts = { 0, 500000 }; - nanosleep(&ts, nullptr); - } + void wait() { + if (spinCount < kMaxActiveSpin) { + ++spinCount; + asm_volatile_pause(); + } else { + /* + * Always sleep 0.5ms, assuming this will make the kernel put + * us down for whatever its minimum timer resolution is (in + * linux this varies by kernel version from 1ms to 10ms). + */ + struct timespec ts = {0, 500000}; + nanosleep(&ts, nullptr); } - }; + } +}; -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/SocketFastOpen.cpp b/folly/detail/SocketFastOpen.cpp index a6385496..3f833447 100644 --- a/folly/detail/SocketFastOpen.cpp +++ b/folly/detail/SocketFastOpen.cpp @@ -121,5 +121,5 @@ bool tfo_succeeded(int /* sockfd */) { } #endif -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/SocketFastOpen.h b/folly/detail/SocketFastOpen.h index 732dc4bd..ed6289f4 100644 --- a/folly/detail/SocketFastOpen.h +++ b/folly/detail/SocketFastOpen.h @@ -44,5 +44,5 @@ int tfo_enable(int sockfd, size_t max_queue_size); * Check if TFO succeeded in being used. */ bool tfo_succeeded(int sockfd); -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/StaticSingletonManager.cpp b/folly/detail/StaticSingletonManager.cpp index a75734ba..3d7ab93c 100644 --- a/folly/detail/StaticSingletonManager.cpp +++ b/folly/detail/StaticSingletonManager.cpp @@ -23,5 +23,5 @@ StaticSingletonManager& StaticSingletonManager::instance() { static StaticSingletonManager* instance = new StaticSingletonManager(); return *instance; } -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/StaticSingletonManager.h b/folly/detail/StaticSingletonManager.h index a6088c12..f5c540b1 100644 --- a/folly/detail/StaticSingletonManager.h +++ b/folly/detail/StaticSingletonManager.h @@ -84,5 +84,5 @@ template inline T* createGlobal() { return createGlobal([]() { return new T(); }); } -} -} +} // namespace detail +} // namespace folly diff --git a/folly/detail/ThreadLocalDetail.cpp b/folly/detail/ThreadLocalDetail.cpp index 4c036461..4d652451 100644 --- a/folly/detail/ThreadLocalDetail.cpp +++ b/folly/detail/ThreadLocalDetail.cpp @@ -305,7 +305,7 @@ class AtForkList { #endif } }; -} +} // namespace void StaticMetaBase::initAtFork() { AtForkList::instance(); @@ -322,4 +322,5 @@ void StaticMetaBase::registerAtFork( FOLLY_STATIC_CTOR_PRIORITY_MAX PthreadKeyUnregister PthreadKeyUnregister::instance_; -}} +} // namespace threadlocal_detail +} // namespace folly diff --git a/folly/detail/UncaughtExceptionCounter.h b/folly/detail/UncaughtExceptionCounter.h index 2e8a7ed6..4170c215 100644 --- a/folly/detail/UncaughtExceptionCounter.h +++ b/folly/detail/UncaughtExceptionCounter.h @@ -47,4 +47,5 @@ class UncaughtExceptionCounter { int exceptionCount_; }; -}} // namespaces +} // namespace detail +} // namespace folly diff --git a/folly/dynamic-inl.h b/folly/dynamic-inl.h index 325060f0..7b187d7c 100644 --- a/folly/dynamic-inl.h +++ b/folly/dynamic-inl.h @@ -36,7 +36,7 @@ struct hash<::folly::dynamic> { } }; -} +} // namespace std ////////////////////////////////////////////////////////////////////// @@ -97,35 +97,38 @@ struct TypeError : std::runtime_error { namespace detail { - // This helper is used in destroy() to be able to run destructors on - // types like "int64_t" without a compiler error. - struct Destroy { - template static void destroy(T* t) { t->~T(); } - }; - - /* - * Helper for implementing numeric conversions in operators on - * numbers. Just promotes to double when one of the arguments is - * double, or throws if either is not a numeric type. - */ - template