From c99c2e4fe34d5f5afab87c17c8b0ec21527df48f Mon Sep 17 00:00:00 2001
From: apio <blobs.trading@gmail.com>
Date: Tue, 15 Aug 2023 10:28:11 +0200
Subject: [PATCH] libos+libui+wind: Use uppercase for static struct IDs to
 avoid confusion with fields

---
 libos/include/os/IPC.h        | 6 +++---
 libui/include/ui/ipc/Client.h | 2 +-
 libui/include/ui/ipc/Server.h | 6 +++---
 wind/IPC.cpp                  | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libos/include/os/IPC.h b/libos/include/os/IPC.h
index 7e937bb0..260d9c3f 100644
--- a/libos/include/os/IPC.h
+++ b/libos/include/os/IPC.h
@@ -54,7 +54,7 @@ namespace os
          */
         template <typename Client, typename T> Result<void> send_async(Client& client, const T& message)
         {
-            u8 id = T::id;
+            u8 id = T::ID;
             TRY(client.send_typed(id));
             TRY(client.send_typed(message));
             return {};
@@ -90,7 +90,7 @@ namespace os
         Result<ResponseType> send_sync(os::LocalClient& client, const T& message,
                                        decltype(handle_ipc_client_event) handler = handle_ipc_client_event)
         {
-            u8 id = T::id;
+            u8 id = T::ID;
             TRY(client.send_typed(id));
             TRY(client.send_typed(message));
 
@@ -115,7 +115,7 @@ namespace os
                     }
                 }
 
-                if (response_id != ResponseType::id)
+                if (response_id != ResponseType::ID)
                 {
                     TRY(handler(client, response_id));
                     max_other_messages--;
diff --git a/libui/include/ui/ipc/Client.h b/libui/include/ui/ipc/Client.h
index 7ebaf919..3320c796 100644
--- a/libui/include/ui/ipc/Client.h
+++ b/libui/include/ui/ipc/Client.h
@@ -20,7 +20,7 @@ namespace ui
 
     struct CreateWindowResponse
     {
-        static constexpr u8 id = CREATE_WINDOW_RESPONSE_ID;
+        static constexpr u8 ID = CREATE_WINDOW_RESPONSE_ID;
 
         int window;
         IPC_STRING(shm_path);
diff --git a/libui/include/ui/ipc/Server.h b/libui/include/ui/ipc/Server.h
index da73b759..5cde93e9 100644
--- a/libui/include/ui/ipc/Server.h
+++ b/libui/include/ui/ipc/Server.h
@@ -26,14 +26,14 @@ namespace ui
     struct CreateWindowRequest
     {
         using ResponseType = CreateWindowResponse;
-        static constexpr u8 id = CREATE_WINDOW_ID;
+        static constexpr u8 ID = CREATE_WINDOW_ID;
 
         ui::Rect rect;
     };
 
     struct SetWindowTitleRequest
     {
-        static constexpr u8 id = SET_WINDOW_TITLE_ID;
+        static constexpr u8 ID = SET_WINDOW_TITLE_ID;
 
         int window;
         IPC_STRING(title);
@@ -41,7 +41,7 @@ namespace ui
 
     struct InvalidateRequest
     {
-        static constexpr u8 id = INVALIDATE_ID;
+        static constexpr u8 ID = INVALIDATE_ID;
 
         int window;
     };
diff --git a/wind/IPC.cpp b/wind/IPC.cpp
index ba265a1f..77392736 100644
--- a/wind/IPC.cpp
+++ b/wind/IPC.cpp
@@ -64,7 +64,7 @@ static Result<u32*> create_shm_region(const char* path, int* outfd, ui::Rect rec
             if (rc.error() == EAGAIN)                                                                                  \
             {                                                                                                          \
                 client.rpc_in_progress = true;                                                                         \
-                client.rpc_id = decltype(request)::id;                                                                 \
+                client.rpc_id = decltype(request)::ID;                                                                 \
                 return {};                                                                                             \
             }                                                                                                          \
             else                                                                                                       \