Re: ANSI C fixes for GTK 1.1.1
- From: Owen Taylor <otaylor redhat com>
- To: gtk-list redhat com
- Subject: Re: ANSI C fixes for GTK 1.1.1
- Date: 17 Aug 1998 13:12:09 -0400
Tim Janik <timj@gtk.org> writes:
> > diff -rc orig/gtk+-1.1.1/gtk/gtkctree.h gtk+-1.1.1/gtk/gtkctree.h
> > *** orig/gtk+-1.1.1/gtk/gtkctree.h Wed Aug 5 04:19:01 1998
> > --- gtk+-1.1.1/gtk/gtkctree.h Mon Aug 17 09:39:06 1998
> > ***************
> > *** 38,47 ****
> > #define GTK_IS_CTREE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CTREE))
> > #define GTK_IS_CTREE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CTREE))
> >
> > #define GTK_CTREE_ROW(_node_) ((GtkCTreeRow *)(((GList *)(_node_))->data))
> > #define GTK_CTREE_NODE(_node_) ((GtkCTreeNode *)((_node_)))
> > ! #define GTK_CTREE_NODE_NEXT(_nnode_) ((GtkCTreeNode *)(((GList *)(_nnode_))->next))
> > ! #define GTK_CTREE_NODE_PREV(_pnode_) ((GtkCTreeNode *)(((GList *)(_pnode_))->prev))
> > #define GTK_CTREE_TREE(_ctree_, _glist_) \
> > ((GtkCellTree *) &(((GtkCTreeRow *)((_glist_)->data))->cell[(_ctree_)->tree_col]))
> >
> > --- 38,49 ----
> > #define GTK_IS_CTREE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_CTREE))
> > #define GTK_IS_CTREE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_CTREE))
> >
> > + #define LGTK_CTREE_ROW(_node_) (*(GtkCTreeRow **)(&((GList *)(_node_))->data))
> > #define GTK_CTREE_ROW(_node_) ((GtkCTreeRow *)(((GList *)(_node_))->data))
> > + #define LGTK_CTREE_NODE(_node_) (*(GtkCTreeNode **)(&(_node_)))
> > #define GTK_CTREE_NODE(_node_) ((GtkCTreeNode *)((_node_)))
> > ! #define GTK_CTREE_NODE_NEXT(_nnode_) (*(GtkCTreeNode **)(&((GList *)(_nnode_))->next))
> > ! #define GTK_CTREE_NODE_PREV(_pnode_) (*(GtkCTreeNode **)(&((GList *)(_pnode_))->prev))
> > #define GTK_CTREE_TREE(_ctree_, _glist_) \
> > ((GtkCellTree *) &(((GtkCTreeRow *)((_glist_)->data))->cell[(_ctree_)->tree_col]))
>
> this one gives me:
> invalid lvalue for unary operator `&'.
How about just doing things like:
#define GTK_CTREE_SET_ROW(_node, val) (((GList *)(_node_))->data = (val))
I think it is much cleaner than reinterpret casts, and guaranteed
portable.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]