[gtk+] notebook: Don't needlessly cast in macros
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] notebook: Don't needlessly cast in macros
- Date: Mon, 7 Sep 2015 12:34:36 +0000 (UTC)
commit 4daac59941dc8d4a8f2278a3150d4f350fc73cd6
Author: Benjamin Otte <otte redhat com>
Date: Sat Sep 5 22:36:20 2015 +0200
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 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 8046bf3..3cade7f 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
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]