From 4daac59941dc8d4a8f2278a3150d4f350fc73cd6 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 5 Sep 2015 22:36:20 +0200 Subject: [PATCH] notebook: Don't needlessly cast in macros That way we disable typechecks done by the compiler and won't notice when we pass the wrong values to the macro. And that's bad. --- gtk/gtknotebook.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 8046bf3ee3..3cade7fd34 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -238,12 +238,12 @@ enum { CHILD_PROP_DETACHABLE }; -#define GTK_NOTEBOOK_PAGE(_glist_) ((GtkNotebookPage *)((GList *)(_glist_))->data) +#define GTK_NOTEBOOK_PAGE(_glist_) ((GtkNotebookPage *)(_glist_)->data) /* some useful defines for calculating coords */ -#define PAGE_MIDDLE_X(_page_) (((GtkNotebookPage *) (_page_))->allocation.x + ((GtkNotebookPage *) (_page_))->allocation.width / 2) -#define PAGE_MIDDLE_Y(_page_) (((GtkNotebookPage *) (_page_))->allocation.y + ((GtkNotebookPage *) (_page_))->allocation.height / 2) -#define NOTEBOOK_IS_TAB_LABEL_PARENT(_notebook_,_page_) (gtk_widget_get_parent (((GtkNotebookPage *) (_page_))->tab_label) == ((GtkWidget *) (_notebook_))) +#define PAGE_MIDDLE_X(_page_) ((_page_)->allocation.x + (_page_)->allocation.width / 2) +#define PAGE_MIDDLE_Y(_page_) ((_page_)->allocation.y + (_page_)->allocation.height / 2) +#define NOTEBOOK_IS_TAB_LABEL_PARENT(_notebook_,_page_) (gtk_widget_get_parent ((_page_)->tab_label) == (GTK_WIDGET (_notebook_))) struct _GtkNotebookPage {