Re: problem compiling GTK 1.1.1



Thanks for the responses sofar. One solution is 
to modify the right hand side, which is a pain.

A cleaner solution is to modify the macros so
they will be accepted by a ANSI C compiler
(or: gcc -pedantic -Wall).

Example for the GPOINTER_TO_INT:

  #define GPOINTER_TO_INT(p) ((gint)(p))

should be changed to:

  #define GPOINTER_TO_INT(p) (*(gint *)&(p))



Any volunteers for the following?

#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))

-Winfred


rcor@cm01.ess wrote:
> 
> Hi,
> 
> > I have been compiling GTK 1.0.5 and earlier without
> > problems, but run into the following when compiling
> > 1.1.1.
> > 
> > For gtkclist:
> > -------------------------------------------------------------------
> > "gtkclist.c", line 1919: error(1133): expression must be a modifiable lvalue
> >         GPOINTER_TO_INT (list->data) = row2; 
> >         ^
> 
> I suffered the same kind of problem under AIX 3.2.5.  My guess is that
> gcc (which I'm not using) allows casts on the left hand side of an
> assignment:
> 
>     char *s;
>     int i;
> 
>     s = (char *)i;   /* normal */
>     (int)s = i;      /* gcc? */
> 
> This is a pain to correct because you have to go and look up the type of
> row2 (in your example above) and insert the appropriate cast on the
> right hand side instead:
> 
>     list->data = (list_data_type_here)row2;
> 
> I stepped back to 1.0.5 since it was my first usage of GTK I didn't need
> the latest and greatest, just something.
> 
> Hope this is of some help.
> 
> 
> Ralph.


____________________________________________________________________
Get free e-mail and a permanent address at http://www.netaddress.com/?N=1



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]