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

gEDA-cvs: CVS update: x_dialog.nw



  User: danmc   
  Date: 05/02/13 15:55:56

  Modified:    .        x_dialog.nw
  Log:
  Use (shudder) GINT_TO_POINTER and GPOINTER_TO_INT in 2 spots to get rid
  
  of some more compiler warnings.  Add some extra comments here too about
  
  noting that it really is int-sized data we're passing around and that
  
  we're not ultimately trying to store a pointer in an int and then 
  
  dereference it.
  
  
  
  
  Revision  Changes    Path
  1.30      +7 -3      eda/geda/devel/gschem/noweb/x_dialog.nw
  
  http://geda.seul.org/cgi-bin/viewcvs.cgi/eda/geda/devel//./x_dialog.nw.diff?r1=1.29&r2=1.30
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: x_dialog.nw
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/gschem/noweb/x_dialog.nw,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -b -r1.29 -r1.30
  --- x_dialog.nw	12 Feb 2005 01:20:39 -0000	1.29
  +++ x_dialog.nw	13 Feb 2005 20:55:55 -0000	1.30
  @@ -3339,7 +3339,11 @@
   {
     int index;
   
  -  index = (int) data;
  +  /* 
  +   * here we really are passing an int sized piece of data, the index rather
  +   * than a pointer and we shouldn't have issues as long as sizeof(void *) >= sizeof(int)
  +   */
  +  index = GPOINTER_TO_INT( data );
   
     /* hate to use this here... but I have to... */
     global_window_current->edit_color = index;
  @@ -3476,12 +3480,12 @@
         gtk_signal_connect (GTK_OBJECT (menuitem), 
                             "activate", 
                             (GtkSignalFunc) color_set,
  -                          (int *) index);
  +                          GINT_TO_POINTER( index ));
   
         /* I have no idea if doing the above cast is valid, */
         /* since index isn't a pointer, it's just being */
         /* treated as one, it's then cast to an int in */
  -      /* color_set */
  +      /* color_set.  This should be ok as long as sizeof(void *) >= sizeof(int) */
   
         gtk_widget_show (menuitem);
       }