From 0656a2f284ee3b65dd919794b840c424bc286f50 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 7 Jul 2022 21:12:34 +0300 Subject: [PATCH 21/21] gtk: Fix GdkEvent cast alignment increase error Seen when compiling with clang on x32. See osdn #44920 Signed-off-by: Marko Lindqvist --- client/gui-gtk-2.0/gui_main.c | 11 ++++++----- client/gui-gtk-3.0/gui_main.c | 8 ++++---- client/gui-gtk-3.22/gui_main.c | 8 ++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/client/gui-gtk-2.0/gui_main.c b/client/gui-gtk-2.0/gui_main.c index 29da7526a4..fbe628e1ef 100644 --- a/client/gui-gtk-2.0/gui_main.c +++ b/client/gui-gtk-2.0/gui_main.c @@ -352,7 +352,7 @@ gboolean map_canvas_focus(void) This function ensures an entry widget (like the inputline) always gets first dibs at handling a keyboard event. **************************************************************************/ -static gboolean toplevel_handler(GtkWidget *w, GdkEventKey *ev, gpointer data) +static gboolean toplevel_handler(GtkWidget *w, GdkEvent *ev, gpointer data) { GtkWidget *focus; @@ -362,7 +362,7 @@ static gboolean toplevel_handler(GtkWidget *w, GdkEventKey *ev, gpointer data) || (GTK_IS_TEXT_VIEW(focus) && gtk_text_view_get_editable(GTK_TEXT_VIEW(focus)))) { /* Propagate event to currently focused entry widget. */ - if (gtk_widget_event(focus, (GdkEvent *) ev)) { + if (gtk_widget_event(focus, ev)) { /* Do not propagate event to our children. */ return TRUE; } @@ -735,11 +735,12 @@ static void tearoff_destroy(GtkWidget *w, gpointer data) } /************************************************************************** - propagates a keypress in a tearoff back to the toplevel window. + Propagates a keypress in a tearoff back to the toplevel window. **************************************************************************/ -static gboolean propagate_keypress(GtkWidget *w, GdkEventKey *ev) +static gboolean propagate_keypress(GtkWidget *w, GdkEvent *ev) { - gtk_widget_event(toplevel, (GdkEvent *)ev); + gtk_widget_event(toplevel, ev); + return FALSE; } diff --git a/client/gui-gtk-3.0/gui_main.c b/client/gui-gtk-3.0/gui_main.c index 28318d10f3..d294cf0d0c 100644 --- a/client/gui-gtk-3.0/gui_main.c +++ b/client/gui-gtk-3.0/gui_main.c @@ -381,7 +381,7 @@ gboolean map_canvas_focus(void) This function ensures an entry widget (like the inputline) always gets first dibs at handling a keyboard event. **************************************************************************/ -static gboolean toplevel_handler(GtkWidget *w, GdkEventKey *ev, gpointer data) +static gboolean toplevel_handler(GtkWidget *w, GdkEvent *ev, gpointer data) { GtkWidget *focus; @@ -391,7 +391,7 @@ static gboolean toplevel_handler(GtkWidget *w, GdkEventKey *ev, gpointer data) || (GTK_IS_TEXT_VIEW(focus) && gtk_text_view_get_editable(GTK_TEXT_VIEW(focus)))) { /* Propagate event to currently focused entry widget. */ - if (gtk_widget_event(focus, (GdkEvent *) ev)) { + if (gtk_widget_event(focus, ev)) { /* Do not propagate event to our children. */ return TRUE; } @@ -783,9 +783,9 @@ static void tearoff_destroy(GtkWidget *w, gpointer data) /************************************************************************** Propagates a keypress in a tearoff back to the toplevel window. **************************************************************************/ -static gboolean propagate_keypress(GtkWidget *w, GdkEventKey *ev) +static gboolean propagate_keypress(GtkWidget *w, GdkEvent *ev) { - gtk_widget_event(toplevel, (GdkEvent *)ev); + gtk_widget_event(toplevel, ev); return FALSE; } diff --git a/client/gui-gtk-3.22/gui_main.c b/client/gui-gtk-3.22/gui_main.c index 6fd0fb44b2..4ba40c9cca 100644 --- a/client/gui-gtk-3.22/gui_main.c +++ b/client/gui-gtk-3.22/gui_main.c @@ -360,7 +360,7 @@ gboolean map_canvas_focus(void) This function ensures an entry widget (like the inputline) always gets first dibs at handling a keyboard event. **************************************************************************/ -static gboolean toplevel_handler(GtkWidget *w, GdkEventKey *ev, gpointer data) +static gboolean toplevel_handler(GtkWidget *w, GdkEvent *ev, gpointer data) { GtkWidget *focus; @@ -370,7 +370,7 @@ static gboolean toplevel_handler(GtkWidget *w, GdkEventKey *ev, gpointer data) || (GTK_IS_TEXT_VIEW(focus) && gtk_text_view_get_editable(GTK_TEXT_VIEW(focus)))) { /* Propagate event to currently focused entry widget. */ - if (gtk_widget_event(focus, (GdkEvent *) ev)) { + if (gtk_widget_event(focus, ev)) { /* Do not propagate event to our children. */ return TRUE; } @@ -769,9 +769,9 @@ static void tearoff_destroy(GtkWidget *w, gpointer data) /************************************************************************** Propagates a keypress in a tearoff back to the toplevel window. **************************************************************************/ -static gboolean propagate_keypress(GtkWidget *w, GdkEventKey *ev) +static gboolean propagate_keypress(GtkWidget *w, GdkEvent *ev) { - gtk_widget_event(toplevel, (GdkEvent *)ev); + gtk_widget_event(toplevel, ev); return FALSE; } -- 2.35.1