Changeset 219

Show
Ignore:
Timestamp:
03/16/08 14:10:26 (4 months ago)
Author:
mattn
Message:

* cleanup - use GINT_TO_POINTER and GPOINTER_TO_INT

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/branches/ZeroRadiant/plugins/surface_ufoai/surfaceflagsdialog_ufoai.cpp

    r213 r219  
    213213void on_surface_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) 
    214214{ 
    215         int flag = *(int*)user_data
     215        int flag = GPOINTER_TO_INT(user_data)
    216216        change_surfaceflag(GTK_WIDGET (togglebutton), flag, (GTK_TOGGLE_BUTTON (togglebutton)->active)); 
    217217} 
     
    220220void on_content_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) 
    221221{ 
    222         int flag = *(int*)user_data
     222        int flag = GPOINTER_TO_INT(user_data)
    223223        change_contentflag(GTK_WIDGET (togglebutton), flag, (GTK_TOGGLE_BUTTON (togglebutton)->active)); 
    224224} 
     
    339339        "stepon", 
    340340        "" 
    341 }; 
    342  
    343 static const int flagBitMasks[] = { 
    344         1<<0, 
    345         1<<1, 
    346         1<<2, 
    347         1<<3, 
    348         1<<4, 
    349         1<<5, 
    350         1<<6, 
    351         1<<7, 
    352         1<<8, 
    353         1<<9, 
    354         1<<10, 
    355         1<<11, 
    356         1<<12, 
    357         1<<13, 
    358         1<<14, 
    359         1<<15, 
    360         1<<16, 
    361         1<<17, 
    362         1<<18, 
    363         1<<19, 
    364         1<<20, 
    365         1<<21, 
    366         1<<22, 
    367         1<<23, 
    368         1<<24, 
    369         1<<25, 
    370         1<<26, 
    371         1<<27, 
    372         1<<28, 
    373         1<<29, 
    374         1<<30, 
    375         1<<31, 
    376341}; 
    377342 
     
    423388                x = i % 4; 
    424389                surface_buttons[i] = gtk_toggle_button_new_with_label (surfaceFlags[i]); 
    425                 gtk_signal_connect(GTK_OBJECT (surface_buttons[i]), "toggled", GTK_SIGNAL_FUNC(on_surface_button_toggled), &flagBitMasks[i]); 
     390                gtk_signal_connect(GTK_OBJECT (surface_buttons[i]), "toggled", GTK_SIGNAL_FUNC(on_surface_button_toggled), GINT_TO_POINTER(1 << i)); 
    426391                gtk_widget_show(surface_buttons[i]); 
    427392                gtk_table_attach(GTK_TABLE (table4), surface_buttons[i], 0 + x, 1 + x, (0 + y), (1 + y), 
     
    481446                x = i % 4; 
    482447                content_buttons[i] = gtk_toggle_button_new_with_label(contentFlags[i]); 
    483                 gtk_signal_connect(GTK_OBJECT (content_buttons[i]), "toggled", GTK_SIGNAL_FUNC (on_content_button_toggled), &flagBitMasks[i]); 
     448                gtk_signal_connect(GTK_OBJECT (content_buttons[i]), "toggled", GTK_SIGNAL_FUNC (on_content_button_toggled), GINT_TO_POINTER(1 << i)); 
    484449                gtk_widget_show(content_buttons[i]); 
    485450                gtk_table_attach(GTK_TABLE (table3), content_buttons[i], 0 + x, 1 + x, (0 + y), (1 + y),