[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

@@ -70,7 +70,7 @@ int main(int argc, char* argv[])
for (int i = 0;; i++)
{
_TCHAR name[128] = { 0 };
_TCHAR name[128] = WINPR_C_ARRAY_INIT;
if (get_screen_info(i, name, ARRAYSIZE(name), &width, &height, &bpp) != 0)
{
if ((width * height * bpp) == 0)
@@ -143,7 +143,7 @@ int main(int argc, char* argv[])
for (int i = 0;; i++)
{
_TCHAR name[128] = { 0 };
_TCHAR name[128] = WINPR_C_ARRAY_INIT;
if (get_screen_info(i, name, ARRAYSIZE(name), &width, &height, &bpp) != 0)
{
if ((width * height * bpp) == 0)

View File

@@ -107,7 +107,7 @@ int wf_dxgi_getDuplication(wfInfo* wfi)
{
HRESULT status;
UINT dTop, i = 0;
DXGI_OUTPUT_DESC desc = { 0 };
DXGI_OUTPUT_DESC desc = WINPR_C_ARRAY_INIT;
IDXGIOutput* pOutput;
IDXGIDevice* DxgiDevice = NULL;
IDXGIAdapter* DxgiAdapter = NULL;

View File

@@ -65,7 +65,7 @@ BOOL wf_peer_unicode_keyboard_event(rdpInput* input, UINT16 flags, UINT16 code)
BOOL wf_peer_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
INPUT mouse_event = { 0 };
INPUT mouse_event = WINPR_C_ARRAY_INIT;
float width, height;
WINPR_UNUSED(input);
@@ -143,7 +143,7 @@ BOOL wf_peer_extended_mouse_event(rdpInput* input, UINT16 flags, UINT16 x, UINT1
{
if ((flags & PTR_XFLAGS_BUTTON1) || (flags & PTR_XFLAGS_BUTTON2))
{
INPUT mouse_event = { 0 };
INPUT mouse_event = WINPR_C_ARRAY_INIT;
mouse_event.type = INPUT_MOUSE;
if (flags & PTR_FLAGS_MOVE)

View File

@@ -47,7 +47,7 @@ static cbCallback cbEvent = NULL;
int get_screen_info(int id, _TCHAR* name, size_t length, int* width, int* height, int* bpp)
{
DISPLAY_DEVICE dd = { 0 };
DISPLAY_DEVICE dd = WINPR_C_ARRAY_INIT;
dd.cb = sizeof(DISPLAY_DEVICE);
@@ -107,7 +107,7 @@ static DWORD WINAPI wf_server_main_loop(LPVOID lpParam)
while (wfi->force_all_disconnect == FALSE)
{
DWORD status;
HANDLE handles[MAXIMUM_WAIT_OBJECTS] = { 0 };
HANDLE handles[MAXIMUM_WAIT_OBJECTS] = WINPR_C_ARRAY_INIT;
DWORD count = instance->GetEventHandles(instance, handles, ARRAYSIZE(handles));
if (count == 0)

View File

@@ -201,7 +201,7 @@ static DWORD WINAPI wf_peer_socket_listener(LPVOID lpParam)
while (1)
{
DWORD status;
HANDLE handles[MAXIMUM_WAIT_OBJECTS] = { 0 };
HANDLE handles[MAXIMUM_WAIT_OBJECTS] = WINPR_C_ARRAY_INIT;
DWORD count = client->GetEventHandles(client, handles, ARRAYSIZE(handles));
if (count == 0)