diff options
| author | Dan Engelbrecht <[email protected]> | 2026-04-13 19:17:09 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-04-13 19:17:09 +0200 |
| commit | 3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7 (patch) | |
| tree | 8d24babc8cd3d097800af0bd960c7ba1d72927d7 /src/zencore | |
| parent | use mimalloc by default (#952) (diff) | |
| download | zen-3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7.tar.xz zen-3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7.zip | |
fix utf characters in source code (#953)
Diffstat (limited to 'src/zencore')
| -rw-r--r-- | src/zencore/compactbinarypackage.cpp | 2 | ||||
| -rw-r--r-- | src/zencore/crashhandler.cpp | 2 | ||||
| -rw-r--r-- | src/zencore/filesystem.cpp | 6 | ||||
| -rw-r--r-- | src/zencore/include/zencore/logging/broadcastsink.h | 4 | ||||
| -rw-r--r-- | src/zencore/include/zencore/mpscqueue.h | 2 | ||||
| -rw-r--r-- | src/zencore/include/zencore/process.h | 6 | ||||
| -rw-r--r-- | src/zencore/include/zencore/testutils.h | 22 | ||||
| -rw-r--r-- | src/zencore/include/zencore/zencore.h | 2 | ||||
| -rw-r--r-- | src/zencore/logging.cpp | 2 | ||||
| -rw-r--r-- | src/zencore/logging/ansicolorsink.cpp | 2 | ||||
| -rw-r--r-- | src/zencore/logging/registry.cpp | 4 | ||||
| -rw-r--r-- | src/zencore/process.cpp | 6 | ||||
| -rw-r--r-- | src/zencore/sentryintegration.cpp | 2 | ||||
| -rw-r--r-- | src/zencore/testing.cpp | 2 |
14 files changed, 32 insertions, 32 deletions
diff --git a/src/zencore/compactbinarypackage.cpp b/src/zencore/compactbinarypackage.cpp index cd268745c..87b58baf7 100644 --- a/src/zencore/compactbinarypackage.cpp +++ b/src/zencore/compactbinarypackage.cpp @@ -1410,7 +1410,7 @@ TEST_CASE("cbpackage.legacy.hashresolution") CbPackage LoadedPkg; CHECK(legacy::TryLoadCbPackage(LoadedPkg, Buffer, &UniqueBuffer::Alloc)); - // The hash-only path requires a mapper — without one it should fail + // The hash-only path requires a mapper - without one it should fail CbWriter HashOnlyCb; HashOnlyCb.AddHash(ObjectAttach.GetHash()); HashOnlyCb.AddNull(); diff --git a/src/zencore/crashhandler.cpp b/src/zencore/crashhandler.cpp index 31b8e6ce2..14904a4b2 100644 --- a/src/zencore/crashhandler.cpp +++ b/src/zencore/crashhandler.cpp @@ -56,7 +56,7 @@ CrashExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) HANDLE Process = GetCurrentProcess(); HANDLE Thread = GetCurrentThread(); - // SymInitialize is safe to call if already initialized — it returns FALSE + // SymInitialize is safe to call if already initialized - it returns FALSE // but existing state remains valid for SymFromAddr calls SymInitialize(Process, NULL, TRUE); diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp index 518146648..70d0f32b3 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -3329,12 +3329,12 @@ MakeSafeAbsolutePathInPlace(std::filesystem::path& Path) { if (PathString.starts_with(UncPrefix)) { - // UNC path: \\server\share → \\?\UNC\server\share + // UNC path: \\server\share -> \\?\UNC\server\share PathString.replace(0, UncPrefix.size(), LongPathUncPrefix); } else { - // Local path: C:\foo → \\?\C:\foo + // Local path: C:\foo -> \\?\C:\foo PathString.insert(0, LongPathPrefix); } Path = PathString; @@ -4153,7 +4153,7 @@ TEST_CASE("filesystem.MakeSafeAbsolutePath") TEST_CASE("ExpandEnvironmentVariables") { - // No variables — pass-through + // No variables - pass-through CHECK_EQ(ExpandEnvironmentVariables("plain/path"), "plain/path"); CHECK_EQ(ExpandEnvironmentVariables(""), ""); diff --git a/src/zencore/include/zencore/logging/broadcastsink.h b/src/zencore/include/zencore/logging/broadcastsink.h index c2709d87c..474662888 100644 --- a/src/zencore/include/zencore/logging/broadcastsink.h +++ b/src/zencore/include/zencore/logging/broadcastsink.h @@ -17,7 +17,7 @@ namespace zen::logging { /// sink is immediately visible to all of them. This is the recommended way /// to manage "default" sinks that should be active on most loggers. /// -/// Each child sink owns its own Formatter — BroadcastSink::SetFormatter() is +/// Each child sink owns its own Formatter - BroadcastSink::SetFormatter() is /// intentionally a no-op so that per-sink formatting is not accidentally /// overwritten by registry-wide formatter changes. class BroadcastSink : public Sink @@ -63,7 +63,7 @@ public: } } - /// No-op — child sinks manage their own formatters. + /// No-op - child sinks manage their own formatters. void SetFormatter(std::unique_ptr<Formatter> /*InFormatter*/) override {} void AddSink(SinkPtr InSink) diff --git a/src/zencore/include/zencore/mpscqueue.h b/src/zencore/include/zencore/mpscqueue.h index d97c433fd..38a0bc14f 100644 --- a/src/zencore/include/zencore/mpscqueue.h +++ b/src/zencore/include/zencore/mpscqueue.h @@ -11,7 +11,7 @@ using std::hardware_constructive_interference_size; using std::hardware_destructive_interference_size; #else -// 64 bytes on x86-64 │ L1_CACHE_BYTES │ L1_CACHE_SHIFT │ __cacheline_aligned │ ... +// 64 bytes on x86-64 | L1_CACHE_BYTES | L1_CACHE_SHIFT | __cacheline_aligned | ... constexpr std::size_t hardware_constructive_interference_size = 64; constexpr std::size_t hardware_destructive_interference_size = 64; #endif diff --git a/src/zencore/include/zencore/process.h b/src/zencore/include/zencore/process.h index 19804795b..fd24a6d7d 100644 --- a/src/zencore/include/zencore/process.h +++ b/src/zencore/include/zencore/process.h @@ -34,7 +34,7 @@ public: /// Throws std::system_error on failure. explicit ProcessHandle(int Pid); - /// Construct from an existing native process handle. Takes ownership — + /// Construct from an existing native process handle. Takes ownership - /// the caller must not close the handle afterwards. Windows only. #if ZEN_PLATFORM_WINDOWS explicit ProcessHandle(void* NativeHandle); @@ -56,7 +56,7 @@ public: /// Same as Initialize(int) but reports errors via @p OutEc instead of throwing. void Initialize(int Pid, std::error_code& OutEc); - /// Initialize from an existing native process handle. Takes ownership — + /// Initialize from an existing native process handle. Takes ownership - /// the caller must not close the handle afterwards. Windows only. #if ZEN_PLATFORM_WINDOWS void Initialize(void* ProcessHandle); @@ -195,7 +195,7 @@ struct CreateProcOptions StdoutPipeHandles* StderrPipe = nullptr; // Optional separate pipe for stderr. When null, stderr shares StdoutPipe. /// Additional environment variables for the child process. These are merged - /// with the parent's environment — existing variables are inherited, and + /// with the parent's environment - existing variables are inherited, and /// entries here override or add to them. std::vector<std::pair<std::string, std::string>> Environment; diff --git a/src/zencore/include/zencore/testutils.h b/src/zencore/include/zencore/testutils.h index 2a789d18f..68461deb2 100644 --- a/src/zencore/include/zencore/testutils.h +++ b/src/zencore/include/zencore/testutils.h @@ -62,24 +62,24 @@ struct TrueType namespace utf8test { // 2-byte UTF-8 (Latin extended) - static constexpr const char kLatin[] = u8"café_résumé"; - static constexpr const wchar_t kLatinW[] = L"café_résumé"; + static constexpr const char kLatin[] = u8"caf\xC3\xA9_r\xC3\xA9sum\xC3\xA9"; + static constexpr const wchar_t kLatinW[] = L"caf\u00E9_r\u00E9sum\u00E9"; // 2-byte UTF-8 (Cyrillic) - static constexpr const char kCyrillic[] = u8"данные"; - static constexpr const wchar_t kCyrillicW[] = L"данные"; + static constexpr const char kCyrillic[] = u8"\xD0\xB4\xD0\xB0\xD0\xBD\xD0\xBD\xD1\x8B\xD0\xB5"; + static constexpr const wchar_t kCyrillicW[] = L"\u0434\u0430\u043D\u043D\u044B\u0435"; // 3-byte UTF-8 (CJK) - static constexpr const char kCJK[] = u8"日本語"; - static constexpr const wchar_t kCJKW[] = L"日本語"; + static constexpr const char kCJK[] = u8"\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"; + static constexpr const wchar_t kCJKW[] = L"\u65E5\u672C\u8A9E"; // Mixed scripts - static constexpr const char kMixed[] = u8"zen_éд日"; - static constexpr const wchar_t kMixedW[] = L"zen_éд日"; + static constexpr const char kMixed[] = u8"zen_\xC3\xA9\xD0\xB4\xE6\x97\xA5"; + static constexpr const wchar_t kMixedW[] = L"zen_\u00E9\u0434\u65E5"; - // 4-byte UTF-8 (supplementary plane) — string tests only, NOT filesystem - static constexpr const char kEmoji[] = u8"📦"; - static constexpr const wchar_t kEmojiW[] = L"📦"; + // 4-byte UTF-8 (supplementary plane) - string tests only, NOT filesystem + static constexpr const char kEmoji[] = u8"\xF0\x9F\x93\xA6"; + static constexpr const wchar_t kEmojiW[] = L"\U0001F4E6"; // BMP-only test strings suitable for filesystem use static constexpr const char* kFilenameSafe[] = {kLatin, kCyrillic, kCJK, kMixed}; diff --git a/src/zencore/include/zencore/zencore.h b/src/zencore/include/zencore/zencore.h index a31950b0b..57c7e20fa 100644 --- a/src/zencore/include/zencore/zencore.h +++ b/src/zencore/include/zencore/zencore.h @@ -94,7 +94,7 @@ protected: // With no extra args: ZEN_ASSERT_MSG_("expr") -> "expr" // With a message arg: ZEN_ASSERT_MSG_("expr", "msg") -> "expr" ": " "msg" // With fmt-style args: ZEN_ASSERT_MSG_("expr", "msg", args...) -> "expr" ": " "msg" -// The extra fmt args are silently discarded here — use ZEN_ASSERT_FORMAT for those. +// The extra fmt args are silently discarded here - use ZEN_ASSERT_FORMAT for those. #define ZEN_ASSERT_MSG_SELECT_(_1, _2, N, ...) N #define ZEN_ASSERT_MSG_1_(expr) expr #define ZEN_ASSERT_MSG_2_(expr, msg, ...) expr ": " msg diff --git a/src/zencore/logging.cpp b/src/zencore/logging.cpp index ca34b7d0e..aa95db950 100644 --- a/src/zencore/logging.cpp +++ b/src/zencore/logging.cpp @@ -26,7 +26,7 @@ namespace { // Bootstrap logger: a minimal stdout logger that exists for the entire lifetime // of the process. TheDefaultLogger points here before InitializeLogging() runs // (and is restored here after ShutdownLogging()) so that log macros always have -// a usable target — no null checks or lazy init required on the common path. +// a usable target - no null checks or lazy init required on the common path. zen::Ref<zen::logging::Logger> s_BootstrapLogger = [] { zen::logging::SinkPtr Sink(new zen::logging::AnsiColorStdoutSink()); return zen::Ref<zen::logging::Logger>(new zen::logging::Logger("", Sink)); diff --git a/src/zencore/logging/ansicolorsink.cpp b/src/zencore/logging/ansicolorsink.cpp index 1a8201876..fb127bede 100644 --- a/src/zencore/logging/ansicolorsink.cpp +++ b/src/zencore/logging/ansicolorsink.cpp @@ -205,7 +205,7 @@ IsColorTerminal() // Windows console supports ANSI color by default in modern versions return true; #else - // Unknown terminal — be conservative + // Unknown terminal - be conservative return false; #endif } diff --git a/src/zencore/logging/registry.cpp b/src/zencore/logging/registry.cpp index 383a5d8ba..0f552aced 100644 --- a/src/zencore/logging/registry.cpp +++ b/src/zencore/logging/registry.cpp @@ -137,7 +137,7 @@ struct Registry::Impl { if (Pattern.find_first_of("*?") == std::string::npos) { - // Exact match — fast path via map lookup. + // Exact match - fast path via map lookup. auto It = m_Loggers.find(Pattern); if (It != m_Loggers.end()) { @@ -146,7 +146,7 @@ struct Registry::Impl } else { - // Wildcard pattern — iterate all loggers. + // Wildcard pattern - iterate all loggers. for (auto& [Name, CurLogger] : m_Loggers) { if (MatchLoggerPattern(Pattern, Name)) diff --git a/src/zencore/process.cpp b/src/zencore/process.cpp index aa41c82ff..66062df4d 100644 --- a/src/zencore/process.cpp +++ b/src/zencore/process.cpp @@ -507,7 +507,7 @@ ProcessHandle::Kill() std::error_code Ec; if (!Wait(5000, Ec)) { - // Graceful shutdown timed out — force-kill + // Graceful shutdown timed out - force-kill kill(pid_t(m_Pid), SIGKILL); Wait(1000, Ec); } @@ -1755,7 +1755,7 @@ GetProcessCommandLine(int Pid, std::error_code& OutEc) ++p; // skip null terminator of argv[0] } - // Build result: remaining entries joined by spaces (inter-arg nulls → spaces) + // Build result: remaining entries joined by spaces (inter-arg nulls -> spaces) std::string Result; Result.reserve(static_cast<size_t>(End - p)); for (const char* q = p; q < End; ++q) @@ -2093,7 +2093,7 @@ GetProcessMetrics(const ProcessHandle& Handle, ProcessMetrics& OutMetrics) { Buf[Len] = '\0'; - // Skip past "pid (name) " — find last ')' to handle names containing spaces or parens + // Skip past "pid (name) " - find last ')' to handle names containing spaces or parens const char* P = strrchr(Buf, ')'); if (P) { diff --git a/src/zencore/sentryintegration.cpp b/src/zencore/sentryintegration.cpp index 8491bef64..7e3f33191 100644 --- a/src/zencore/sentryintegration.cpp +++ b/src/zencore/sentryintegration.cpp @@ -250,7 +250,7 @@ SentryIntegration::Initialize(const Config& Conf, const std::string& CommandLine if (SentryOptions == nullptr) { - // OOM — skip sentry entirely rather than crashing on the subsequent set calls + // OOM - skip sentry entirely rather than crashing on the subsequent set calls m_SentryErrorCode = -1; m_IsInitialized = true; return; diff --git a/src/zencore/testing.cpp b/src/zencore/testing.cpp index 9f88a3365..67285dcf1 100644 --- a/src/zencore/testing.cpp +++ b/src/zencore/testing.cpp @@ -39,7 +39,7 @@ PrintCrashCallstack([[maybe_unused]] const char* SignalName) // Use write() + backtrace_symbols_fd() which are async-signal-safe write(STDERR_FILENO, "\n*** Caught ", 12); write(STDERR_FILENO, SignalName, strlen(SignalName)); - write(STDERR_FILENO, " — callstack:\n", 15); + write(STDERR_FILENO, " - callstack:\n", 15); void* Frames[64]; int FrameCount = backtrace(Frames, 64); |