(Wayland) Fix serious warnings - input struct pointer was being passed

to function that requires gfx struct pointer
This commit is contained in:
twinaphex 2020-08-31 19:56:03 +02:00
parent fe81f0ad4e
commit a82bff2055
4 changed files with 16 additions and 9 deletions

View File

@ -736,13 +736,15 @@ static void gfx_ctx_wl_input_driver(void *data,
* on Wayland, so just implement the input driver here. */
if (!input_wl_init(&wl->input, joypad_name))
{
*input = NULL;
*input_data = NULL;
wl->input.gfx = NULL;
*input = NULL;
*input_data = NULL;
}
else
{
*input = &input_wayland;
*input_data = &wl->input;
wl->input.gfx = wl;
*input = &input_wayland;
*input_data = &wl->input;
input_driver_init_joypads();
}
}

View File

@ -549,13 +549,15 @@ static void gfx_ctx_wl_input_driver(void *data,
* on Wayland, so just implement the input driver here. */
if (!input_wl_init(&wl->input, joypad_name))
{
*input = NULL;
*input_data = NULL;
wl->input.gfx = NULL;
*input = NULL;
*input_data = NULL;
}
else
{
*input = &input_wayland;
*input_data = &wl->input;
wl->input.gfx = wl;
*input = &input_wayland;
*input_data = &wl->input;
input_driver_init_joypads();
}
}

View File

@ -83,10 +83,13 @@ typedef struct output_info
struct wl_list link; /* wl->all_outputs */
} output_info_t;
typedef struct gfx_ctx_wayland_data gfx_ctx_wayland_data_t;
typedef struct input_ctx_wayland_data
{
struct wl_display *dpy;
const input_device_driver_t *joypad;
gfx_ctx_wayland_data_t *gfx;
int fd;

View File

@ -88,7 +88,7 @@ static void input_wl_poll(void *data)
for (id = 0; id < MAX_TOUCHES; id++)
{
if (wayland_context_gettouchpos(wl, id, &touch_x, &touch_y))
if (wayland_context_gettouchpos(wl->gfx, id, &touch_x, &touch_y))
wl->touches[id].active = true;
else
wl->touches[id].active = false;