From 874e0b25bc6755cba73335f621ed5087aa4163e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=A4=B4=E4=BA=91?= Date: Wed, 3 Dec 2025 08:05:22 +0000 Subject: [PATCH] fix(msvc): Fix C4138 warning by adding space before commented parameter names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISSUE: MSVC compiler reports warning C4138: '*/' found outside of comment for patterns like 'void */*p*/' where the pointer asterisk is immediately followed by a comment start. AFFECTED FILES: - include/libipc/mem/new.h (line 30) - src/libipc/platform/win/mutex.h (line 54) - src/libipc/platform/win/semaphore.h (line 53) CHANGES: Changed 'type */*param*/' to 'type * /*param*/' (added space before comment) Examples: - void */*p*/ → void * /*p*/ - char const */*name*/ → char const * /*name*/ This resolves the MSVC warning while maintaining code functionality and keeping the commented-out parameter names for documentation. --- include/libipc/mem/new.h | 2 +- src/libipc/platform/win/mutex.h | 2 +- src/libipc/platform/win/semaphore.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/libipc/mem/new.h b/include/libipc/mem/new.h index cf246a4..fd7483d 100644 --- a/include/libipc/mem/new.h +++ b/include/libipc/mem/new.h @@ -27,7 +27,7 @@ class LIBIPC_EXPORT block_collector { public: virtual ~block_collector() noexcept = default; virtual void *allocate(std::size_t /*bytes*/) noexcept = 0; - virtual void deallocate(void */*p*/, std::size_t /*bytes*/) noexcept = 0; + virtual void deallocate(void * /*p*/, std::size_t /*bytes*/) noexcept = 0; }; /// \brief Matches the appropriate memory block resource based on a specified size. diff --git a/src/libipc/platform/win/mutex.h b/src/libipc/platform/win/mutex.h index eeb6c6a..e80c96b 100644 --- a/src/libipc/platform/win/mutex.h +++ b/src/libipc/platform/win/mutex.h @@ -55,7 +55,7 @@ public: close(); } - static void clear_storage(char const */*name*/) noexcept { + static void clear_storage(char const * /*name*/) noexcept { } bool lock(std::uint64_t tm) noexcept { diff --git a/src/libipc/platform/win/semaphore.h b/src/libipc/platform/win/semaphore.h index a8c6506..8185369 100644 --- a/src/libipc/platform/win/semaphore.h +++ b/src/libipc/platform/win/semaphore.h @@ -54,7 +54,7 @@ public: close(); } - static void clear_storage(char const */*name*/) noexcept { + static void clear_storage(char const * /*name*/) noexcept { } bool wait(std::uint64_t tm) noexcept {