mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[winpr] add WINPR_C_ARRAY_INIT
since C23 allows c++ style initializing replace direct use with this macro
This commit is contained in:
@@ -230,7 +230,7 @@ void* UwacClipboardDataGet(UwacSeat* seat, const char* mime, size_t* size)
|
||||
size_t alloc = 0;
|
||||
size_t pos = 0;
|
||||
char* data = NULL;
|
||||
int pipefd[2] = { 0 };
|
||||
int pipefd[2] = WINPR_C_ARRAY_INIT;
|
||||
|
||||
if (!seat || !mime || !size || !seat->offer)
|
||||
return NULL;
|
||||
|
||||
@@ -54,7 +54,7 @@ static const char* event_names[] = {
|
||||
static bool uwac_default_error_handler(UwacDisplay* display, UwacReturnCode code, const char* msg,
|
||||
...)
|
||||
{
|
||||
va_list args = { 0 };
|
||||
va_list args = WINPR_C_ARRAY_INIT;
|
||||
va_start(args, msg);
|
||||
(void)vfprintf(stderr, "%s", args);
|
||||
va_end(args);
|
||||
@@ -402,7 +402,7 @@ UwacDisplay* UwacOpenDisplay(const char* name, UwacReturnCode* err)
|
||||
|
||||
if (ret->display == NULL)
|
||||
{
|
||||
char buffer[256] = { 0 };
|
||||
char buffer[256] = WINPR_C_ARRAY_INIT;
|
||||
(void)fprintf(stderr, "failed to connect to Wayland display %s: %s\n", name,
|
||||
uwac_strerror(errno, buffer, sizeof(buffer)));
|
||||
*err = UWAC_ERROR_UNABLE_TO_CONNECT;
|
||||
|
||||
@@ -77,7 +77,7 @@ static struct wl_buffer* create_pointer_buffer(UwacSeat* seat, const void* src,
|
||||
|
||||
if (munmap(data, size) < 0)
|
||||
{
|
||||
char buffer[256] = { 0 };
|
||||
char buffer[256] = WINPR_C_ARRAY_INIT;
|
||||
(void)fprintf(stderr, "%s: munmap(%p, %zu) failed with [%d] %s\n", __func__, data, size,
|
||||
errno, uwac_strerror(errno, buffer, sizeof(buffer)));
|
||||
}
|
||||
@@ -278,7 +278,7 @@ static void keyboard_handle_enter(void* data, struct wl_keyboard* keyboard, uint
|
||||
static void keyboard_handle_leave(void* data, struct wl_keyboard* keyboard, uint32_t serial,
|
||||
struct wl_surface* surface)
|
||||
{
|
||||
struct itimerspec its = { 0 };
|
||||
struct itimerspec its = WINPR_C_ARRAY_INIT;
|
||||
uint32_t* pressedKey = NULL;
|
||||
size_t i = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user