Cast away the constness of the geom_name argument to
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 1 Jan 2005 23:25:49 +0000 (23:25 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 1 Jan 2005 23:25:49 +0000 (23:25 +0000)
"window_new_with_geom()" - there's no way to tell the compiler that
we're not going to be modifying it, but we aren't.

The right way to check whether a pointer is null and get a Boolean is to
test it against null, not to cast it to a Boolean type - as Boolean
types in C89/C90, at least, are just integral types, that cast might
just throw away the upper 32 bits; that probably yields the results you
want, but the compiler might well justifiably warn about that on an LP64
platform.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12918 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/ui_util.c

index d350ab7dd12a691c8efcd9570e1fb8cfd7e90774..0bb9d3513aca251b9ae320c71d76135ab94446a0 100644 (file)
@@ -167,7 +167,7 @@ window_new_with_geom(GtkWindowType type, const gchar *title, const gchar *geom_n
   window_geometry_t geom;
   GtkWidget *win = window_new(type, title);
 
-  OBJECT_SET_DATA(win, WINDOW_GEOM_KEY, geom_name);
+  OBJECT_SET_DATA(win, WINDOW_GEOM_KEY, (gpointer)geom_name);
 
   /* do we have a previously saved size and position of this window? */
   if(geom_name) {
@@ -984,7 +984,7 @@ simple_list_new(gint cols, gchar **titles) {
         G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
     plugins_list = tree_view_new(GTK_TREE_MODEL(store));
     g_object_unref(G_OBJECT(store));
-    gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(plugins_list), (gboolean) titles);
+    gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(plugins_list), (titles != NULL));
     for(i=0; i<cols; i++) {
         renderer = gtk_cell_renderer_text_new();
         column = gtk_tree_view_column_new_with_attributes(titles ? titles[i] : "", renderer,