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

Re: [patch] compile error fixes



George writes:
 > > 
 > >    dialog = (drgeoGtkStyleDialog *)
 > >      gtk_object_get_data (GTK_OBJECT(widget), "drgeo_style");
 > > -  dialog->setColor ((drgeoColorType)data);
 > > +  dialog->setColor (*(drgeoColorType*)data);
 > >  }
 > >  static void
 > >  style_size_button_cb (GtkWidget * widget, gpointer data)
 > > @@ -499,7 +499,7 @@
 > > 
 > >    dialog = (drgeoGtkStyleDialog *)
 > >      gtk_object_get_data (GTK_OBJECT(widget), "drgeo_style");
 > > -  dialog->setSize ((drgeoLineType)data);
 > > +  dialog->setSize (*(drgeoLineType*)data);
 > >  }
 > 
 > That would result in a segfault!  You're casting a void pointer which doesn't
 > contain a pointer but an integer (not a pointer to an integer).
 > 
 > This should use GINT_TO_POINTER and GPOINTER_TO_INT which are macros for
 > storing integers inside pointers.
 > 
 > George

Good lesson George, I shouls look more deeply.

Btw, Laurent, it's look like there is duplicate code between
drgeo_dialog.* and drgeo_gtkmacro.* Lot of code in drgeo_dialog.* is
not of any use, I will remove it.  

This make think that the selected object do not blink in when changing
their style. I will have a look.


Hilaire