broadway: Fix gcc 12 complaining

This commit is contained in:
Benjamin Otte 2022-05-14 16:53:22 +02:00
parent 61bb9bb935
commit 926eb161f8
2 changed files with 15 additions and 18 deletions

View File

@ -354,6 +354,7 @@ typedef struct {
typedef union { typedef union {
BroadwayReplyBase base; BroadwayReplyBase base;
BroadwayReplySync sync;
BroadwayReplyEvent event; BroadwayReplyEvent event;
BroadwayReplyQueryMouse query_mouse; BroadwayReplyQueryMouse query_mouse;
BroadwayReplyNewSurface new_surface; BroadwayReplyNewSurface new_surface;

View File

@ -219,11 +219,7 @@ static void
client_handle_request (BroadwayClient *client, client_handle_request (BroadwayClient *client,
BroadwayRequest *request) BroadwayRequest *request)
{ {
BroadwayReplyNewSurface reply_new_surface; BroadwayReply reply;
BroadwayReplySync reply_sync;
BroadwayReplyQueryMouse reply_query_mouse;
BroadwayReplyGrabPointer reply_grab_pointer;
BroadwayReplyUngrabPointer reply_ungrab_pointer;
guint32 before_serial, now_serial; guint32 before_serial, now_serial;
guint32 global_id; guint32 global_id;
int fd; int fd;
@ -233,7 +229,7 @@ client_handle_request (BroadwayClient *client,
switch (request->base.type) switch (request->base.type)
{ {
case BROADWAY_REQUEST_NEW_SURFACE: case BROADWAY_REQUEST_NEW_SURFACE:
reply_new_surface.id = reply.new_surface.id =
broadway_server_new_surface (server, client->id, broadway_server_new_surface (server, client->id,
request->new_surface.x, request->new_surface.x,
request->new_surface.y, request->new_surface.y,
@ -241,9 +237,9 @@ client_handle_request (BroadwayClient *client,
request->new_surface.height); request->new_surface.height);
client->surfaces = client->surfaces =
g_list_prepend (client->surfaces, g_list_prepend (client->surfaces,
GUINT_TO_POINTER (reply_new_surface.id)); GUINT_TO_POINTER (reply.new_surface.id));
send_reply (client, request, (BroadwayReply *)&reply_new_surface, sizeof (reply_new_surface), send_reply (client, request, &reply, sizeof (reply.new_surface),
BROADWAY_REPLY_NEW_SURFACE); BROADWAY_REPLY_NEW_SURFACE);
break; break;
case BROADWAY_REQUEST_FLUSH: case BROADWAY_REQUEST_FLUSH:
@ -251,7 +247,7 @@ client_handle_request (BroadwayClient *client,
break; break;
case BROADWAY_REQUEST_SYNC: case BROADWAY_REQUEST_SYNC:
broadway_server_flush (server); broadway_server_flush (server);
send_reply (client, request, (BroadwayReply *)&reply_sync, sizeof (reply_sync), send_reply (client, request, &reply, sizeof (reply.sync),
BROADWAY_REPLY_SYNC); BROADWAY_REPLY_SYNC);
break; break;
case BROADWAY_REQUEST_ROUNDTRIP: case BROADWAY_REQUEST_ROUNDTRIP:
@ -261,11 +257,11 @@ client_handle_request (BroadwayClient *client,
break; break;
case BROADWAY_REQUEST_QUERY_MOUSE: case BROADWAY_REQUEST_QUERY_MOUSE:
broadway_server_query_mouse (server, broadway_server_query_mouse (server,
&reply_query_mouse.surface, &reply.query_mouse.surface,
&reply_query_mouse.root_x, &reply.query_mouse.root_x,
&reply_query_mouse.root_y, &reply.query_mouse.root_y,
&reply_query_mouse.mask); &reply.query_mouse.mask);
send_reply (client, request, (BroadwayReply *)&reply_query_mouse, sizeof (reply_query_mouse), send_reply (client, request, &reply, sizeof (reply.query_mouse),
BROADWAY_REPLY_QUERY_MOUSE); BROADWAY_REPLY_QUERY_MOUSE);
break; break;
case BROADWAY_REQUEST_DESTROY_SURFACE: case BROADWAY_REQUEST_DESTROY_SURFACE:
@ -361,21 +357,21 @@ client_handle_request (BroadwayClient *client,
request->move_resize.height); request->move_resize.height);
break; break;
case BROADWAY_REQUEST_GRAB_POINTER: case BROADWAY_REQUEST_GRAB_POINTER:
reply_grab_pointer.status = reply.grab_pointer.status =
broadway_server_grab_pointer (server, broadway_server_grab_pointer (server,
client->id, client->id,
request->grab_pointer.id, request->grab_pointer.id,
request->grab_pointer.owner_events, request->grab_pointer.owner_events,
request->grab_pointer.event_mask, request->grab_pointer.event_mask,
request->grab_pointer.time_); request->grab_pointer.time_);
send_reply (client, request, (BroadwayReply *)&reply_grab_pointer, sizeof (reply_grab_pointer), send_reply (client, request, &reply, sizeof (reply.grab_pointer),
BROADWAY_REPLY_GRAB_POINTER); BROADWAY_REPLY_GRAB_POINTER);
break; break;
case BROADWAY_REQUEST_UNGRAB_POINTER: case BROADWAY_REQUEST_UNGRAB_POINTER:
reply_ungrab_pointer.status = reply.ungrab_pointer.status =
broadway_server_ungrab_pointer (server, broadway_server_ungrab_pointer (server,
request->ungrab_pointer.time_); request->ungrab_pointer.time_);
send_reply (client, request, (BroadwayReply *)&reply_ungrab_pointer, sizeof (reply_ungrab_pointer), send_reply (client, request, &reply, sizeof (reply.ungrab_pointer),
BROADWAY_REPLY_UNGRAB_POINTER); BROADWAY_REPLY_UNGRAB_POINTER);
break; break;
case BROADWAY_REQUEST_FOCUS_SURFACE: case BROADWAY_REQUEST_FOCUS_SURFACE: