[winpr] add WINPR_C_ARRAY_INIT

since C23 allows c++ style initializing replace direct use with this
macro
This commit is contained in:
Armin Novak
2026-02-24 20:18:25 +01:00
parent a5609b929e
commit 48267edf2f
434 changed files with 2204 additions and 2195 deletions

View File

@@ -86,8 +86,8 @@ static UINT ainput_on_data_received(IWTSVirtualChannelCallback* pChannelCallback
static UINT ainput_send_input_event(AInputClientContext* context, UINT64 flags, INT32 x, INT32 y)
{
BYTE buffer[32] = { 0 };
wStream sbuffer = { 0 };
BYTE buffer[32] = WINPR_C_ARRAY_INIT;
wStream sbuffer = WINPR_C_ARRAY_INIT;
wStream* s = Stream_StaticInit(&sbuffer, buffer, sizeof(buffer));
WINPR_ASSERT(s);
@@ -105,7 +105,7 @@ static UINT ainput_send_input_event(AInputClientContext* context, UINT64 flags,
}
{
char ebuffer[128] = { 0 };
char ebuffer[128] = WINPR_C_ARRAY_INIT;
WLog_VRB(TAG, "sending timestamp=0x%08" PRIx64 ", flags=%s, %" PRId32 "x%" PRId32, time,
ainput_flags_to_string(flags, ebuffer, sizeof(ebuffer)), x, y);
}

View File

@@ -28,7 +28,7 @@
WINPR_ATTR_NODISCARD
static inline const char* ainput_flags_to_string(UINT64 flags, char* buffer, size_t size)
{
char number[32] = { 0 };
char number[32] = WINPR_C_ARRAY_INIT;
if (flags & AINPUT_FLAGS_HAVE_REL)
winpr_str_append("AINPUT_FLAGS_HAVE_REL", buffer, size, "|");

View File

@@ -194,7 +194,7 @@ static UINT ainput_server_recv_mouse_event(ainput_server* ainput, wStream* s)
UINT64 time = 0;
INT32 x = 0;
INT32 y = 0;
char buffer[128] = { 0 };
char buffer[128] = WINPR_C_ARRAY_INIT;
WINPR_ASSERT(ainput);
WINPR_ASSERT(s);
@@ -237,7 +237,7 @@ static HANDLE ainput_server_get_channel_handle(ainput_server* ainput)
static DWORD WINAPI ainput_server_thread_func(LPVOID arg)
{
DWORD nCount = 0;
HANDLE events[2] = { 0 };
HANDLE events[2] = WINPR_C_ARRAY_INIT;
ainput_server* ainput = (ainput_server*)arg;
UINT error = CHANNEL_RC_OK;
DWORD status = 0;