diff options
author | dmasloff <dmasloff@yandex-team.com> | 2024-09-05 20:05:47 +0300 |
---|---|---|
committer | dmasloff <dmasloff@yandex-team.com> | 2024-09-05 20:17:10 +0300 |
commit | 74184a40c15dc0649a769d9754d0ce7efb44db04 (patch) | |
tree | 433c12d17fec8928522e31fede6afb88e0b8f41c /util/system | |
parent | db4754b956955532cb1ad5fd119d5d199b790a0e (diff) | |
download | ydb-74184a40c15dc0649a769d9754d0ce7efb44db04.tar.gz |
FixNamespaceComments in /util
FixNamespaceComments in /util
bb9152570d7c258798644ead5a59f604de05ef3b
Diffstat (limited to 'util/system')
79 files changed, 98 insertions, 98 deletions
diff --git a/util/system/atexit.cpp b/util/system/atexit.cpp index 09fa7d8381..9d81ce2373 100644 --- a/util/system/atexit.cpp +++ b/util/system/atexit.cpp @@ -110,7 +110,7 @@ namespace { return atExit; } } -} +} // namespace void ManualRunAtExitFinalizers() { OnExit(); diff --git a/util/system/atexit_ut.cpp b/util/system/atexit_ut.cpp index 190f6dd0c3..2d340bd364 100644 --- a/util/system/atexit_ut.cpp +++ b/util/system/atexit_ut.cpp @@ -99,4 +99,4 @@ Y_UNIT_TEST_SUITE(TestAtExit) { Singleton<T2>(); } -} +} // Y_UNIT_TEST_SUITE(TestAtExit) diff --git a/util/system/backtrace.cpp b/util/system/backtrace.cpp index 8cc93cd3ce..7e3ca7ffcd 100644 --- a/util/system/backtrace.cpp +++ b/util/system/backtrace.cpp @@ -95,8 +95,8 @@ namespace { return 0; } - } -} + } // namespace NGCCBacktrace +} // namespace size_t BackTrace(void** p, size_t len) { return NGCCBacktrace::BackTrace(p, len); @@ -216,7 +216,7 @@ namespace { TSymFromAddrFunc SymFromAddrFunc; BOOL InitOk; }; -} +} // namespace TResolvedSymbol ResolveSymbol(void* sym, char* buf, size_t len) { return Singleton<TWinSymbolResolverImpl>()->Resolve(sym, buf, len); diff --git a/util/system/byteorder.h b/util/system/byteorder.h index d408b2a1a4..4f1b105118 100644 --- a/util/system/byteorder.h +++ b/util/system/byteorder.h @@ -91,7 +91,7 @@ namespace NSwapBytes { DEF_SB(64) #undef DEF_SB -} +} // namespace NSwapBytes template <class T> inline T SwapBytes(T val) noexcept { diff --git a/util/system/compat_ut.cpp b/util/system/compat_ut.cpp index dbd9289c17..55932e388a 100644 --- a/util/system/compat_ut.cpp +++ b/util/system/compat_ut.cpp @@ -9,4 +9,4 @@ Y_UNIT_TEST_SUITE(TCompatTest) { Y_UNIT_TEST(TestGetprogname) { getprogname(); // just check it links } -} +} // Y_UNIT_TEST_SUITE(TCompatTest) diff --git a/util/system/compiler_ut.cpp b/util/system/compiler_ut.cpp index f93b1c0850..3ee0f251d4 100644 --- a/util/system/compiler_ut.cpp +++ b/util/system/compiler_ut.cpp @@ -69,4 +69,4 @@ Y_UNIT_TEST_SUITE(TCompilerTest) { Y_PRAGMA_DIAGNOSTIC_POP } -} +} // Y_UNIT_TEST_SUITE(TCompilerTest) diff --git a/util/system/condvar.cpp b/util/system/condvar.cpp index 9bc8fdd060..67df8a585b 100644 --- a/util/system/condvar.cpp +++ b/util/system/condvar.cpp @@ -70,7 +70,7 @@ namespace { TWaitEvents Events_; TLock Lock_; }; -} +} // namespace #if defined(_win_) class TCondVar::TImpl: public TCondVarImpl { diff --git a/util/system/context.cpp b/util/system/context.cpp index 3a67593813..8285aa48de 100644 --- a/util/system/context.cpp +++ b/util/system/context.cpp @@ -20,7 +20,7 @@ namespace __cxxabiv1 { }; extern "C" __cxa_eh_globals* __cxa_get_globals(); -} +} // namespace __cxxabiv1 #endif #endif @@ -132,7 +132,7 @@ namespace { Run(*(argPtr - 1)); } #endif -} +} // namespace #if defined(USE_SANITIZER_CONTEXT) diff --git a/util/system/context_ut.cpp b/util/system/context_ut.cpp index 45cb0249f7..461bef2cca 100644 --- a/util/system/context_ut.cpp +++ b/util/system/context_ut.cpp @@ -68,4 +68,4 @@ Y_UNIT_TEST_SUITE(TestContext) { UNIT_ASSERT(throwed); UNIT_ASSERT(!hasUncaught); } -} +} // Y_UNIT_TEST_SUITE(TestContext) diff --git a/util/system/cpu_id.cpp b/util/system/cpu_id.cpp index ad7299ddbc..e115ced360 100644 --- a/util/system/cpu_id.cpp +++ b/util/system/cpu_id.cpp @@ -83,7 +83,7 @@ namespace { }; static_assert(sizeof(TX86CpuInfo) == 16, "please, fix me"); -} +} // namespace // https://en.wikipedia.org/wiki/CPUID bool NX86::HaveRDTSCP() noexcept { diff --git a/util/system/cpu_id.h b/util/system/cpu_id.h index 3c49e728a7..a9d8dea69e 100644 --- a/util/system/cpu_id.h +++ b/util/system/cpu_id.h @@ -152,6 +152,6 @@ namespace NX86 { #undef Y_LOOKUP_CPU_ID_IMPL -} +} // namespace NX86 const char* CpuBrand(ui32 store[12]) noexcept; diff --git a/util/system/cpu_id_ut.cpp b/util/system/cpu_id_ut.cpp index 6faed95aba..fd15bad635 100644 --- a/util/system/cpu_id_ut.cpp +++ b/util/system/cpu_id_ut.cpp @@ -88,7 +88,7 @@ Y_UNIT_TEST_SUITE(TestCpuId) { Y_CPU_ID_ENUMERATE(Y_DEF_NAME) #undef Y_DEF_NAME } -} +} // Y_UNIT_TEST_SUITE(TestCpuId) #if defined(_x86_64_) #if defined(__GNUC__) diff --git a/util/system/daemon.h b/util/system/daemon.h index b00793b9c9..19c52e5433 100644 --- a/util/system/daemon.h +++ b/util/system/daemon.h @@ -24,4 +24,4 @@ namespace NDaemonMaker { bool MakeMeDaemon(ECloseDescriptors cd = closeAll, EStdIoDescriptors iod = openDevNull, EChDir chd = chdirRoot, EParent parent = callExitFromParent); void CloseFrom(int fd); -} +} // namespace NDaemonMaker diff --git a/util/system/daemon_ut.cpp b/util/system/daemon_ut.cpp index f93b9a9645..862d8f55b4 100644 --- a/util/system/daemon_ut.cpp +++ b/util/system/daemon_ut.cpp @@ -91,4 +91,4 @@ Y_UNIT_TEST_SUITE(TDaemonTest) { delete[] pages; } #endif -} +} // Y_UNIT_TEST_SUITE(TDaemonTest) diff --git a/util/system/datetime.cpp b/util/system/datetime.cpp index 449d850baf..10cf0a5a84 100644 --- a/util/system/datetime.cpp +++ b/util/system/datetime.cpp @@ -99,7 +99,7 @@ namespace NPrivate { bool HaveRdtscpImpl() { return NX86::HaveRDTSCP(); } -} +} // namespace NPrivate #endif #ifdef Y_HAS_CLOCK_GETTIME diff --git a/util/system/datetime.h b/util/system/datetime.h index 724ffff394..35c77570b6 100644 --- a/util/system/datetime.h +++ b/util/system/datetime.h @@ -37,7 +37,7 @@ void NanoSleep(ui64 ns) noexcept; #if defined(_x86_) namespace NPrivate { bool HaveRdtscpImpl(); -} +} // namespace NPrivate #endif // GetCycleCount guarantees to return synchronous values on different cores diff --git a/util/system/direct_io.cpp b/util/system/direct_io.cpp index 1b6c39f42c..e3b825193f 100644 --- a/util/system/direct_io.cpp +++ b/util/system/direct_io.cpp @@ -44,7 +44,7 @@ namespace { size_t Alignment; }; -} +} // namespace TDirectIOBufferedFile::TDirectIOBufferedFile(const TString& path, EOpenMode oMode, size_t buflen /*= 1 << 17*/) : File(path, oMode) diff --git a/util/system/direct_io_ut.cpp b/util/system/direct_io_ut.cpp index 839c3de7ca..43377b6f02 100644 --- a/util/system/direct_io_ut.cpp +++ b/util/system/direct_io_ut.cpp @@ -86,7 +86,7 @@ Y_UNIT_TEST_SUITE(TDirectIoTestSuite) { TestHugeFile(5 * 1024 * 1024 * 1024ULL + 1111); } } -} +} // Y_UNIT_TEST_SUITE(TDirectIoTestSuite) Y_UNIT_TEST_SUITE(TDirectIoErrorHandling) { Y_UNIT_TEST(Constructor) { @@ -112,4 +112,4 @@ Y_UNIT_TEST_SUITE(TDirectIoErrorHandling) { UNIT_ASSERT_EXCEPTION(file.Finish(), TFileError); NFs::Remove(FileName_); } -} +} // Y_UNIT_TEST_SUITE(TDirectIoErrorHandling) diff --git a/util/system/env_ut.cpp b/util/system/env_ut.cpp index 6023ce2afd..acc799d556 100644 --- a/util/system/env_ut.cpp +++ b/util/system/env_ut.cpp @@ -56,4 +56,4 @@ Y_UNIT_TEST_SUITE(EnvTest) { UNIT_ASSERT_EXCEPTION(SetEnv("", "value"), yexception); UNIT_ASSERT_EXCEPTION(SetEnv("A=B", "C=D"), yexception); } -} +} // Y_UNIT_TEST_SUITE(EnvTest) diff --git a/util/system/error.cpp b/util/system/error.cpp index c7f22acd32..164921af9e 100644 --- a/util/system/error.cpp +++ b/util/system/error.cpp @@ -49,7 +49,7 @@ namespace { char data[1024]; }; -} +} // namespace #endif const char* LastSystemErrorText(int code) { diff --git a/util/system/event_ut.cpp b/util/system/event_ut.cpp index 448f1e1350..4a4f33a137 100644 --- a/util/system/event_ut.cpp +++ b/util/system/event_ut.cpp @@ -75,7 +75,7 @@ namespace { } }; -} +} // namespace Y_UNIT_TEST_SUITE(EventTest) { Y_UNIT_TEST(WaitAndSignalTest) { @@ -124,4 +124,4 @@ Y_UNIT_TEST_SUITE(EventTest) { } queue.Stop(); } -} +} // Y_UNIT_TEST_SUITE(EventTest) diff --git a/util/system/execpath.cpp b/util/system/execpath.cpp index 9e1b5cec93..f53eb1eba5 100644 --- a/util/system/execpath.cpp +++ b/util/system/execpath.cpp @@ -178,7 +178,7 @@ namespace { TString ExecPath; TString PersistentExecPath; }; -} +} // namespace const TString& GetExecPath() { return TExecPathsHolder::Instance()->ExecPath; diff --git a/util/system/execpath_ut.cpp b/util/system/execpath_ut.cpp index f8ca86d9cf..6c90cbfe1b 100644 --- a/util/system/execpath_ut.cpp +++ b/util/system/execpath_ut.cpp @@ -18,4 +18,4 @@ Y_UNIT_TEST_SUITE(TExecPathTest) { throw; } } -} +} // Y_UNIT_TEST_SUITE(TExecPathTest) diff --git a/util/system/fasttime.cpp b/util/system/fasttime.cpp index 22b9e9f466..9bb70be5f3 100644 --- a/util/system/fasttime.cpp +++ b/util/system/fasttime.cpp @@ -231,7 +231,7 @@ namespace { TLinePredictor<16, TTime, TTime> P_; TTime Next_; }; -} +} // namespace ui64 InterpolatedMicroSeconds() { return FastTlsSingleton<TTimePredictor>()->Get(); diff --git a/util/system/file_lock.cpp b/util/system/file_lock.cpp index 45d91282c5..0d9b296453 100644 --- a/util/system/file_lock.cpp +++ b/util/system/file_lock.cpp @@ -17,7 +17,7 @@ namespace { } Y_UNREACHABLE(); } -} +} // namespace TFileLock::TFileLock(const TString& filename, const EFileLockType type) : TFile(filename, OpenAlways | RdOnly) diff --git a/util/system/file_ut.cpp b/util/system/file_ut.cpp index 2ee455411c..959633f579 100644 --- a/util/system/file_ut.cpp +++ b/util/system/file_ut.cpp @@ -427,7 +427,7 @@ Y_UNIT_TEST_SUITE(TTestFileHandle) { Y_ENSURE(TStringBuf(buf, 2) == "12"); } } -} +} // Y_UNIT_TEST_SUITE(TTestFileHandle) Y_UNIT_TEST_SUITE(TTestDecodeOpenMode) { Y_UNIT_TEST(It) { @@ -437,4 +437,4 @@ Y_UNIT_TEST_SUITE(TTestDecodeOpenMode) { UNIT_ASSERT_VALUES_EQUAL("WrOnly|ForAppend", DecodeOpenMode(WrOnly | ForAppend)); UNIT_ASSERT_VALUES_EQUAL("RdWr|CreateAlways|CreateNew|ForAppend|Transient|CloseOnExec|Temp|Sync|Direct|DirectAligned|Seq|NoReuse|NoReadAhead|AX|AR|AW|AWOther|0xF8888000", DecodeOpenMode(0xFFFFFFFF)); } -} +} // Y_UNIT_TEST_SUITE(TTestDecodeOpenMode) diff --git a/util/system/filemap.cpp b/util/system/filemap.cpp index 92b6e9902a..948572e81b 100644 --- a/util/system/filemap.cpp +++ b/util/system/filemap.cpp @@ -65,7 +65,7 @@ namespace { const size_t GRANULARITY_; const size_t PAGE_SIZE_; }; -} +} // namespace #define GRANULARITY (TSysInfo::Instance().GRANULARITY_) #define PAGE_SIZE (TSysInfo::Instance().PAGE_SIZE_) diff --git a/util/system/filemap.h b/util/system/filemap.h index 933d169adb..25a7911715 100644 --- a/util/system/filemap.h +++ b/util/system/filemap.h @@ -17,7 +17,7 @@ namespace NPrivate { // NB: use TFileMap::Precharge() and TFileMappedArray::Prechage() void Precharge(const void* data, size_t dataSize, size_t offset, size_t size); -} +} // namespace NPrivate struct TMemoryMapCommon { struct TMapResult { diff --git a/util/system/filemap_ut.cpp b/util/system/filemap_ut.cpp index cfa13b8b4f..58a37ecbf9 100644 --- a/util/system/filemap_ut.cpp +++ b/util/system/filemap_ut.cpp @@ -356,4 +356,4 @@ Y_UNIT_TEST_SUITE(TFileMapTest) { } NFs::Remove(FileName_); } -} +} // Y_UNIT_TEST_SUITE(TFileMapTest) diff --git a/util/system/flock_ut.cpp b/util/system/flock_ut.cpp index b5f6cb5328..21737e35be 100644 --- a/util/system/flock_ut.cpp +++ b/util/system/flock_ut.cpp @@ -54,4 +54,4 @@ Y_UNIT_TEST_SUITE(TFileLockTest) { UNIT_ASSERT(guard3.WasAcquired()); } } -} +} // Y_UNIT_TEST_SUITE(TFileLockTest) diff --git a/util/system/fs.h b/util/system/fs.h index f4ab746aa3..71078af78e 100644 --- a/util/system/fs.h +++ b/util/system/fs.h @@ -159,6 +159,6 @@ namespace NFs { Y_ENSURE_EX(Exists(path), TFileError{} << "Path " << path << " does not exists (checked from cwd:" << NFs::CurrentWorkingDirectory() << ")"); return path; } -} +} // namespace NFs Y_DECLARE_OPERATORS_FOR_FLAGS(NFs::EFilePermissions); diff --git a/util/system/fs_win.cpp b/util/system/fs_win.cpp index 7f75d1e8b2..ff8a254782 100644 --- a/util/system/fs_win.cpp +++ b/util/system/fs_win.cpp @@ -255,4 +255,4 @@ bool GetObjectId(const char* path, GUID* id) { } */ -} +} // namespace NFsPrivate diff --git a/util/system/fs_win.h b/util/system/fs_win.h index b91f869106..e46f7a2fda 100644 --- a/util/system/fs_win.h +++ b/util/system/fs_win.h @@ -28,4 +28,4 @@ namespace NFsPrivate { bool WinSetCurrentWorkingDirectory(const TString& path); bool WinMakeDirectory(const TString& path); -} +} // namespace NFsPrivate diff --git a/util/system/fs_win_ut.cpp b/util/system/fs_win_ut.cpp index 46a8c5f2b0..5317344cef 100644 --- a/util/system/fs_win_ut.cpp +++ b/util/system/fs_win_ut.cpp @@ -68,4 +68,4 @@ Y_UNIT_TEST_SUITE(TFsWinTest) { NFsPrivate::WinRemove(dir1); UNIT_ASSERT(!NFsPrivate::WinExists(dir1)); } -} +} // Y_UNIT_TEST_SUITE(TFsWinTest) diff --git a/util/system/fstat_ut.cpp b/util/system/fstat_ut.cpp index 0438063179..8cdd8d169a 100644 --- a/util/system/fstat_ut.cpp +++ b/util/system/fstat_ut.cpp @@ -225,4 +225,4 @@ Y_UNIT_TEST_SUITE(TestFileStat) { UNIT_ASSERT(!stat.IsNull()); } #endif -} +} // Y_UNIT_TEST_SUITE(TestFileStat) diff --git a/util/system/hi_lo.h b/util/system/hi_lo.h index f86870534f..07bcd4c57b 100644 --- a/util/system/hi_lo.h +++ b/util/system/hi_lo.h @@ -106,7 +106,7 @@ namespace NHiLoPrivate { return MakeIntRef<TRepr>(CharPtrOf(std::forward<T>(value)) + offset); } -} +} // namespace NHiLoPrivate /** * Return manipulator object that allows to get and set lower or higher bits of the value. diff --git a/util/system/hi_lo_ut.cpp b/util/system/hi_lo_ut.cpp index 850c12327d..d36b17e69a 100644 --- a/util/system/hi_lo_ut.cpp +++ b/util/system/hi_lo_ut.cpp @@ -66,4 +66,4 @@ Y_UNIT_TEST_SUITE(HiLo) { UNIT_ASSERT_VALUES_EQUAL(Lo32(x).Get(), 0x55667788); UNIT_ASSERT_VALUES_EQUAL(Hi32(x).Get(), 0x11223344); } -} +} // Y_UNIT_TEST_SUITE(HiLo) diff --git a/util/system/hostname.cpp b/util/system/hostname.cpp index e377910d5c..cf9343f3eb 100644 --- a/util/system/hostname.cpp +++ b/util/system/hostname.cpp @@ -81,7 +81,7 @@ namespace { TString FQDNHostName; }; -} +} // namespace const TString& HostName() { return (Singleton<THostNameHolder>())->HostName; diff --git a/util/system/hostname_ut.cpp b/util/system/hostname_ut.cpp index 7e0da106b6..6f043e964f 100644 --- a/util/system/hostname_ut.cpp +++ b/util/system/hostname_ut.cpp @@ -22,4 +22,4 @@ Y_UNIT_TEST_SUITE(THostNameTest) { throw; } } -} +} // Y_UNIT_TEST_SUITE(THostNameTest) diff --git a/util/system/hp_timer.cpp b/util/system/hp_timer.cpp index e4c3f21e6b..e80eb13f35 100644 --- a/util/system/hp_timer.cpp +++ b/util/system/hp_timer.cpp @@ -91,7 +91,7 @@ namespace { const double Rate; const ui64 CyclesPerSecond; }; -} +} // namespace double NHPTimer::GetSeconds(const STime& a) noexcept { return TFreq::Instance().GetSeconds(a); diff --git a/util/system/hp_timer.h b/util/system/hp_timer.h index 0a4c252ec2..0a1aee48fb 100644 --- a/util/system/hp_timer.h +++ b/util/system/hp_timer.h @@ -14,7 +14,7 @@ namespace NHPTimer { double GetClockRate() noexcept; // same as GetClockRate, but in integer ui64 GetCyclesPerSecond() noexcept; -} +} // namespace NHPTimer struct THPTimer { THPTimer() noexcept { diff --git a/util/system/info.h b/util/system/info.h index 9e6fa2fb3d..f30d71a188 100644 --- a/util/system/info.h +++ b/util/system/info.h @@ -11,4 +11,4 @@ namespace NSystemInfo { size_t GetPageSize() noexcept; size_t TotalMemorySize(); size_t MaxOpenFiles(); -} +} // namespace NSystemInfo diff --git a/util/system/interrupt_signals_ut.cpp b/util/system/interrupt_signals_ut.cpp index 2a7f0bddd7..d5f0279413 100644 --- a/util/system/interrupt_signals_ut.cpp +++ b/util/system/interrupt_signals_ut.cpp @@ -43,4 +43,4 @@ Y_UNIT_TEST_SUITE(TTestInterruptSignals) { UNIT_ASSERT_VALUES_EQUAL(HandledSigNum.load(), signum); } } -} +} // Y_UNIT_TEST_SUITE(TTestInterruptSignals) diff --git a/util/system/madvise.cpp b/util/system/madvise.cpp index ad24ac0f1d..3f045f24cf 100644 --- a/util/system/madvise.cpp +++ b/util/system/madvise.cpp @@ -40,7 +40,7 @@ namespace { } #endif } -} +} // namespace void MadviseSequentialAccess(const void* begin, size_t size) { #if !defined(_win_) diff --git a/util/system/mem_info.cpp b/util/system/mem_info.cpp index 75f2c1c493..4357d12f11 100644 --- a/util/system/mem_info.cpp +++ b/util/system/mem_info.cpp @@ -212,4 +212,4 @@ namespace NMemInfo { #endif return result; } -} +} // namespace NMemInfo diff --git a/util/system/mem_info.h b/util/system/mem_info.h index f303d49197..c44b86e208 100644 --- a/util/system/mem_info.h +++ b/util/system/mem_info.h @@ -15,4 +15,4 @@ namespace NMemInfo { }; TMemInfo GetMemInfo(pid_t = 0); -} +} // namespace NMemInfo diff --git a/util/system/mincore_ut.cpp b/util/system/mincore_ut.cpp index ae4a10c517..27c342d57f 100644 --- a/util/system/mincore_ut.cpp +++ b/util/system/mincore_ut.cpp @@ -36,4 +36,4 @@ Y_UNIT_TEST_SUITE(MincoreSuite) { } #endif } -} +} // Y_UNIT_TEST_SUITE(MincoreSuite) diff --git a/util/system/mktemp_ut.cpp b/util/system/mktemp_ut.cpp index 19bcf70852..38eab941c7 100644 --- a/util/system/mktemp_ut.cpp +++ b/util/system/mktemp_ut.cpp @@ -38,4 +38,4 @@ Y_UNIT_TEST_SUITE(MakeTempFileSuite) { UNIT_ASSERT(TFsPath{tempFilePath}.Exists()); } } -} +} // Y_UNIT_TEST_SUITE(MakeTempFileSuite) diff --git a/util/system/nice_ut.cpp b/util/system/nice_ut.cpp index ae0051f285..ae0d9c04ae 100644 --- a/util/system/nice_ut.cpp +++ b/util/system/nice_ut.cpp @@ -39,4 +39,4 @@ Y_UNIT_TEST_SUITE(NiceTest) { UNIT_ASSERT_VALUES_EQUAL(GetPriority(), prio + 3); } #endif -} +} // Y_UNIT_TEST_SUITE(NiceTest) diff --git a/util/system/pipe_ut.cpp b/util/system/pipe_ut.cpp index 6d53432de8..d6b61e10ce 100644 --- a/util/system/pipe_ut.cpp +++ b/util/system/pipe_ut.cpp @@ -12,4 +12,4 @@ Y_UNIT_TEST_SUITE(TPipeTest) { UNIT_ASSERT(1 == r.Read(&c, 1)); UNIT_ASSERT_VALUES_EQUAL('a', c); } -} +} // Y_UNIT_TEST_SUITE(TPipeTest) diff --git a/util/system/progname.cpp b/util/system/progname.cpp index 2c29119320..a7eaa82b4b 100644 --- a/util/system/progname.cpp +++ b/util/system/progname.cpp @@ -15,7 +15,7 @@ namespace { TString ProgName; }; -} +} // namespace const TString& GetProgramName() { return Singleton<TProgramNameHolder>()->ProgName; diff --git a/util/system/progname_ut.cpp b/util/system/progname_ut.cpp index 11f3d9308b..e644108157 100644 --- a/util/system/progname_ut.cpp +++ b/util/system/progname_ut.cpp @@ -15,4 +15,4 @@ Y_UNIT_TEST_SUITE(TProgramNameTest) { throw; } } -} +} // Y_UNIT_TEST_SUITE(TProgramNameTest) diff --git a/util/system/rusage_ut.cpp b/util/system/rusage_ut.cpp index 0d4e0fe54b..1dc4c5b687 100644 --- a/util/system/rusage_ut.cpp +++ b/util/system/rusage_ut.cpp @@ -8,4 +8,4 @@ Y_UNIT_TEST_SUITE(TRusageTest) { // just check it returns something r.Fill(); } -} +} // Y_UNIT_TEST_SUITE(TRusageTest) diff --git a/util/system/sanitizers.cpp b/util/system/sanitizers.cpp index 3e710b39c7..5796c59151 100644 --- a/util/system/sanitizers.cpp +++ b/util/system/sanitizers.cpp @@ -20,7 +20,7 @@ namespace { } void __tsan_set_fiber_name(void*, const char*) { } -} +} // namespace #endif #endif diff --git a/util/system/sanitizers.h b/util/system/sanitizers.h index 47d3e8627c..e7f4450d38 100644 --- a/util/system/sanitizers.h +++ b/util/system/sanitizers.h @@ -196,4 +196,4 @@ namespace NSan { Y_UNUSED(a); #endif } -} +} // namespace NSan diff --git a/util/system/sem.cpp b/util/system/sem.cpp index 96affec792..984e9d14c0 100644 --- a/util/system/sem.cpp +++ b/util/system/sem.cpp @@ -210,7 +210,7 @@ namespace { Y_PRAGMA_DIAGNOSTIC_POP #endif #endif -} +} // namespace class TSemaphore::TImpl: public TSemaphoreImpl { public: diff --git a/util/system/shellcommand.cpp b/util/system/shellcommand.cpp index 6742f46c64..e4bfb165bc 100644 --- a/util/system/shellcommand.cpp +++ b/util/system/shellcommand.cpp @@ -104,7 +104,7 @@ namespace { return std::string(str.begin(), str.end()); } #endif -} +} // namespace // temporary measure to avoid rewriting all poll calls on win TPipeHandle #if defined(_win_) diff --git a/util/system/shellcommand_ut.cpp b/util/system/shellcommand_ut.cpp index 13a5fad75f..416ae22c10 100644 --- a/util/system/shellcommand_ut.cpp +++ b/util/system/shellcommand_ut.cpp @@ -67,7 +67,7 @@ Y_UNIT_TEST_SUITE(TShellQuoteTest) { ShellQuoteArgSp(cmd, "-DVal=Blah"); UNIT_ASSERT_STRINGS_EQUAL(cmd, "\"/pr f/krev/prev.exe\" \"-DVal=\\\"W Quotes\\\"\" \"-DVal=W Space\" \"-DVal=Blah\""); } -} +} // Y_UNIT_TEST_SUITE(TShellQuoteTest) Y_UNIT_TEST_SUITE(TShellCommandTest) { Y_UNIT_TEST(TestNoQuotes) { @@ -489,4 +489,4 @@ Y_UNIT_TEST_SUITE(TShellCommandTest) { UNIT_ASSERT_VALUES_EQUAL(firstLine, text); } -} +} // Y_UNIT_TEST_SUITE(TShellCommandTest) diff --git a/util/system/shmat.cpp b/util/system/shmat.cpp index 13fd4c236c..3ae199d429 100644 --- a/util/system/shmat.cpp +++ b/util/system/shmat.cpp @@ -86,7 +86,7 @@ namespace { return syscall(__NR_ipc, IPCOP_shmdt, 0, 0, 0, addr); } #endif -} +} // namespace #endif TSharedMemory::TSharedMemory() diff --git a/util/system/shmat_ut.cpp b/util/system/shmat_ut.cpp index 9d92243ae7..c38c2b8873 100644 --- a/util/system/shmat_ut.cpp +++ b/util/system/shmat_ut.cpp @@ -14,4 +14,4 @@ Y_UNIT_TEST_SUITE(TTestSharedMemory) { UNIT_ASSERT_VALUES_EQUAL(*(ui32*)m2.GetPtr(), 123); } -} +} // Y_UNIT_TEST_SUITE(TTestSharedMemory) diff --git a/util/system/spin_wait.cpp b/util/system/spin_wait.cpp index fed173f307..bb13e3fd98 100644 --- a/util/system/spin_wait.cpp +++ b/util/system/spin_wait.cpp @@ -19,7 +19,7 @@ namespace { // arbitrary values constexpr unsigned MIN_SLEEP_TIME = 500; constexpr unsigned MAX_SPIN_COUNT = 0x7FF; -} +} // namespace TSpinWait::TSpinWait() noexcept : T(MIN_SLEEP_TIME) diff --git a/util/system/spinlock_ut.cpp b/util/system/spinlock_ut.cpp index e8639a6404..5b482cbcf1 100644 --- a/util/system/spinlock_ut.cpp +++ b/util/system/spinlock_ut.cpp @@ -34,4 +34,4 @@ Y_UNIT_TEST_SUITE(TSpinLock) { Y_UNIT_TEST(TAdaptiveLock_IsLocked) { TestLock<TAdaptiveLock>(); } -} +} // Y_UNIT_TEST_SUITE(TSpinLock) diff --git a/util/system/src_location_ut.cpp b/util/system/src_location_ut.cpp index 5b86cb86ef..955a6e15d2 100644 --- a/util/system/src_location_ut.cpp +++ b/util/system/src_location_ut.cpp @@ -15,4 +15,4 @@ Y_UNIT_TEST_SUITE(TestLocation) { static constexpr TSourceLocation location = __LOCATION__; static_assert(location.Line >= 0, "__LOCATION__ can be used at compile time expressions"); } -} +} // Y_UNIT_TEST_SUITE(TestLocation) diff --git a/util/system/src_root.h b/util/system/src_root.h index d595de7d8f..f0bf9185e6 100644 --- a/util/system/src_root.h +++ b/util/system/src_root.h @@ -70,6 +70,6 @@ namespace NPrivate { constexpr Y_FORCE_INLINE TStaticBuf StripRoot(const TStaticBuf& f) noexcept { return StripRoot(f, RootPrefixLength(f)); } -} +} // namespace NPrivate #define __SOURCE_FILE_IMPL__ ::NPrivate::StripRoot(STATIC_BUF(__FILE__), std::integral_constant<unsigned, ::NPrivate::RootPrefixLength(STATIC_BUF(__FILE__))>::value) diff --git a/util/system/src_root_ut.cpp b/util/system/src_root_ut.cpp index e9a675eb9a..3d4a33c350 100644 --- a/util/system/src_root_ut.cpp +++ b/util/system/src_root_ut.cpp @@ -24,4 +24,4 @@ Y_UNIT_TEST_SUITE(TestSourceRoot) { static_assert(!::NPrivate::IsProperPrefix(STATIC_BUF(""), STATIC_BUF("")), R"(IsProperPrefix("", "") failed)"); static_assert(::NPrivate::IsProperPrefix(STATIC_BUF("dir"), STATIC_BUF("dir/file")), R"(IsProperPrefix("dir", "dir/file") failed)"); } -} +} // Y_UNIT_TEST_SUITE(TestSourceRoot) diff --git a/util/system/tempfile_ut.cpp b/util/system/tempfile_ut.cpp index e4a0923d0b..a749b05469 100644 --- a/util/system/tempfile_ut.cpp +++ b/util/system/tempfile_ut.cpp @@ -115,7 +115,7 @@ Y_UNIT_TEST_SUITE(TTempFileHandle) { Y_UNIT_TEST(NonExistingDirectory) { UNIT_ASSERT_EXCEPTION(TTempFileHandle::InDir("nonexsistingdirname"), TSystemError); } -} +} // Y_UNIT_TEST_SUITE(TTempFileHandle) Y_UNIT_TEST_SUITE(MakeTempName) { Y_UNIT_TEST(Default) { @@ -148,4 +148,4 @@ Y_UNIT_TEST_SUITE(MakeTempName) { } UNIT_ASSERT(!NFs::Exists(path)); } -} +} // Y_UNIT_TEST_SUITE(MakeTempName) diff --git a/util/system/thread.cpp b/util/system/thread.cpp index a845fd4236..cdde02fa3e 100644 --- a/util/system/thread.cpp +++ b/util/system/thread.cpp @@ -268,7 +268,7 @@ namespace { return t.Get(); } -} +} // namespace class TThread::TImpl: public TThreadBase { public: @@ -382,7 +382,7 @@ namespace { static void* ThreadProcWrapper(void* param) { return reinterpret_cast<T*>(param)->ThreadProc(); } -} +} // namespace ISimpleThread::ISimpleThread(size_t stackSize) : TThread(TParams(ThreadProcWrapper<ISimpleThread>, reinterpret_cast<void*>(this), stackSize)) @@ -463,7 +463,7 @@ namespace { TSetThreadDescription SetThreadDescription; TGetThreadDescription GetThreadDescription; }; -} +} // namespace #endif // _win_ void TThread::SetCurrentThreadName(const char* name) { diff --git a/util/system/thread_ut.cpp b/util/system/thread_ut.cpp index 24eeee5016..e1b88c1d73 100644 --- a/util/system/thread_ut.cpp +++ b/util/system/thread_ut.cpp @@ -226,4 +226,4 @@ Y_UNIT_TEST_SUITE(TSysThreadTest) { UNIT_ASSERT_VALUES_EQUAL(thread.Join(), nullptr); UNIT_ASSERT(flag); } -} +} // Y_UNIT_TEST_SUITE(TSysThreadTest) diff --git a/util/system/tls.cpp b/util/system/tls.cpp index 5979576a4a..74cd4b6fc7 100644 --- a/util/system/tls.cpp +++ b/util/system/tls.cpp @@ -115,7 +115,7 @@ namespace { virtual ~TGenericTlsBase() = default; }; -} +} // namespace #if defined(_unix_) namespace { @@ -158,7 +158,7 @@ namespace { }; using TKeyDescriptor = TMasterTls::TPerThreadStorage::TKey; -} +} // namespace class TKey::TImpl: public TKeyDescriptor { public: @@ -211,7 +211,7 @@ namespace { TMutex Lock_; THashMap<TThread::TId, TPTSRef> Datas_; }; -} +} // namespace class TKey::TImpl { public: diff --git a/util/system/tls.h b/util/system/tls.h index 1771663e88..ede9fef511 100644 --- a/util/system/tls.h +++ b/util/system/tls.h @@ -149,7 +149,7 @@ namespace NPrivate { void FillWithTrash(void* ptr, size_t len); -} +} // namespace NPrivate namespace NTls { using TDtor = void (*)(void*); @@ -289,7 +289,7 @@ namespace NTls { THolder<TConstructor> Constructor_; TKey Key_; }; -} +} // namespace NTls template <class T> static inline T& TlsRef(NTls::TValue<T>& v) noexcept { diff --git a/util/system/tls_ut.cpp b/util/system/tls_ut.cpp index e84d34b42a..5022d5ef1a 100644 --- a/util/system/tls_ut.cpp +++ b/util/system/tls_ut.cpp @@ -55,4 +55,4 @@ Y_UNIT_TEST_SUITE(TTestTLS) { UNIT_ASSERT_VALUES_EQUAL(x.Get()[i].Get(), 0); } } -} +} // Y_UNIT_TEST_SUITE(TTestTLS) diff --git a/util/system/type_name_ut.cpp b/util/system/type_name_ut.cpp index c9b2a1e775..269668c5b7 100644 --- a/util/system/type_name_ut.cpp +++ b/util/system/type_name_ut.cpp @@ -15,7 +15,7 @@ Y_UNIT_TEST_SUITE(TDemangleTest) { CppDemangle(""); CppDemangle("Sfsdf$dfsdfTTSFSDF23234::SDFS:FSDFSDF#$%"); } -} +} // Y_UNIT_TEST_SUITE(TDemangleTest) namespace NUtil::NTypeNameTest { @@ -51,7 +51,7 @@ namespace NUtil::NTypeNameTest { return TypeName(*this); } }; -} +} // namespace NUtil::NTypeNameTest using namespace NUtil::NTypeNameTest; @@ -181,4 +181,4 @@ Y_UNIT_TEST_SUITE(TypeName) { UNIT_ASSERT_VALUES_EQUAL(TypeName(cvPtr), "char const volatile*"); #endif } -} +} // Y_UNIT_TEST_SUITE(TypeName) diff --git a/util/system/types_ut.cpp b/util/system/types_ut.cpp index 19e40cef46..f3289fc80d 100644 --- a/util/system/types_ut.cpp +++ b/util/system/types_ut.cpp @@ -20,4 +20,4 @@ Y_UNIT_TEST_SUITE(TestTypes) { sscanf("159", "%" SCNx64, &val64); UNIT_ASSERT(val64 == 345); } -} +} // Y_UNIT_TEST_SUITE(TestTypes) diff --git a/util/system/unaligned_mem_ut.cpp b/util/system/unaligned_mem_ut.cpp index 9de3f3e931..52f734a779 100644 --- a/util/system/unaligned_mem_ut.cpp +++ b/util/system/unaligned_mem_ut.cpp @@ -26,7 +26,7 @@ namespace { __uint128_t x; }; -} +} // namespace #endif Y_UNIT_TEST_SUITE(UnalignedMem) { @@ -93,4 +93,4 @@ Y_UNIT_TEST_SUITE(UnalignedMem) { UNIT_ASSERT(val == TUInt128::Max()); } #endif -} +} // Y_UNIT_TEST_SUITE(UnalignedMem) diff --git a/util/system/user_ut.cpp b/util/system/user_ut.cpp index 4f8a5ce2ef..0a42167fe3 100644 --- a/util/system/user_ut.cpp +++ b/util/system/user_ut.cpp @@ -6,4 +6,4 @@ Y_UNIT_TEST_SUITE(TestUser) { Y_UNIT_TEST(TestNotEmpty) { UNIT_ASSERT(GetUsername()); } -} +} // Y_UNIT_TEST_SUITE(TestUser) diff --git a/util/system/valgrind.h b/util/system/valgrind.h index 2ec4ed927c..a8c87ef380 100644 --- a/util/system/valgrind.h +++ b/util/system/valgrind.h @@ -45,4 +45,4 @@ namespace NValgrind { return plain; #endif } -} +} // namespace NValgrind diff --git a/util/system/yassert.cpp b/util/system/yassert.cpp index 0f586648b7..73ab2980d3 100644 --- a/util/system/yassert.cpp +++ b/util/system/yassert.cpp @@ -33,10 +33,10 @@ extern "C" { namespace { struct TPanicLockHolder: public TAdaptiveLock { }; -} +} // namespace namespace NPrivate { [[noreturn]] Y_NO_INLINE void InternalPanicImpl(int line, const char* function, const char* expr, int, int, int, const TStringBuf file, const char* errorMessage, size_t errorMessageSize) noexcept; -} +} // namespace NPrivate void ::NPrivate::Panic(const TStaticBuf& file, int line, const char* function, const char* expr, const char* format, ...) noexcept { try { @@ -91,4 +91,4 @@ namespace NPrivate { } catch (...) { abort(); } -} +} // namespace NPrivate diff --git a/util/system/yassert.h b/util/system/yassert.h index 4e2e72e22f..201f9605c2 100644 --- a/util/system/yassert.h +++ b/util/system/yassert.h @@ -74,7 +74,7 @@ inline void YaDebugBreak() { namespace NPrivate { /// method should not be used directly [[noreturn]] void Panic(const TStaticBuf& file, int line, const char* function, const char* expr, const char* format, ...) noexcept Y_PRINTF_FORMAT(5, 6); -} +} // namespace NPrivate /// Assert that does not depend on NDEBUG macro and outputs message like printf #define Y_ABORT_UNLESS(expr, ...) \ @@ -90,7 +90,7 @@ namespace NPrivate { #define Y_ABORT(...) Y_ABORT_UNLESS(false, __VA_ARGS__) #ifndef NDEBUG - /// Assert that depend on NDEBUG macro and outputs message like printf + /// Assert that depend on NDEBUG macro and outputs message like printf #define Y_DEBUG_ABORT_UNLESS Y_ABORT_UNLESS #else #define Y_DEBUG_ABORT_UNLESS(expr, ...) \ diff --git a/util/system/yassert_ut.cpp b/util/system/yassert_ut.cpp index 701da9bf6c..106eda691b 100644 --- a/util/system/yassert_ut.cpp +++ b/util/system/yassert_ut.cpp @@ -38,4 +38,4 @@ Y_UNIT_TEST_SUITE(YassertTest) { []() { Y_ABORT_UNLESS([]() {throw yexception{} << "check"; return false; }(), "hi %s", "there"); }(), yexception); } -} +} // Y_UNIT_TEST_SUITE(YassertTest) |