gtk: fix 32-bit build
authorPeter Wu <peter@lekensteyn.nl>
Wed, 31 Aug 2016 09:11:56 +0000 (11:11 +0200)
committerPeter Wu <peter@lekensteyn.nl>
Thu, 1 Sep 2016 08:20:52 +0000 (08:20 +0000)
32-bit glib before 2.31.2 expand GUINT_TO_POINTER(x) as (gpointer)x.
add explicit cast since curr_layer_num is 8 bits. Fixes
v1.99.10rc0-179-g1d7bcb2.

Storing a 64-bit integer into a 32-bit pointer makes the compiler
complain. Add explicit cast. Fixes v1.99.1rc0-76-ged0b19b.

Change-Id: I75fdf17882a0f5ddce7d3b3e74b1bf80ff6cd4ae
Reviewed-on: https://code.wireshark.org/review/17417
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
ui/gtk/decode_as_dlg.c
ui/gtk/packet_panes.c

index 382b38676aeaf4851625ae0d185b45189a2ed45e..c38f686cd164593214763bf9dca961d351fa7617 100644 (file)
@@ -1224,7 +1224,7 @@ decode_add_simple_page (decode_as_t *entry)
     if (entry->num_items == 1)
     {
         g_object_set_data(G_OBJECT(page), E_PAGE_VALUE, entry->values[0].build_values[0](&cfile.edt->pi));
-        g_object_set_data(G_OBJECT(page), E_PAGE_CURR_LAYER_NUM, GUINT_TO_POINTER(cfile.edt->pi.curr_layer_num));
+        g_object_set_data(G_OBJECT(page), E_PAGE_CURR_LAYER_NUM, GUINT_TO_POINTER((guint)cfile.edt->pi.curr_layer_num));
 
         /* Always enabled */
         entry->values->label_func(&cfile.edt->pi, prompt);
index 6ee8fea51a5675650144a9740e6721ddf7005de2..a46f4ee7b97bdde4277a59776034e0c6d7eda25d 100644 (file)
@@ -987,7 +987,7 @@ packet_hex_print(GtkWidget *bv, const guint8 *pd, frame_data *fd,
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_START_KEY, GINT_TO_POINTER(bstart));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_END_KEY, GINT_TO_POINTER(bend));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_MASK_LO_KEY, GINT_TO_POINTER((guint32) bmask));
-    g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_MASK_HI_KEY, GINT_TO_POINTER(bmask >> 32));
+    g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_MASK_HI_KEY, GINT_TO_POINTER((guint32)(bmask >> 32)));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_MASKLE_KEY, GINT_TO_POINTER(bmask_le));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_APP_START_KEY, GINT_TO_POINTER(astart));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_APP_END_KEY, GINT_TO_POINTER(aend));
@@ -1031,7 +1031,7 @@ packet_hex_editor_print(GtkWidget *bv, const guint8 *pd, frame_data *fd, int off
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_START_KEY, GINT_TO_POINTER(bstart));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_END_KEY, GINT_TO_POINTER(bend));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_MASK_LO_KEY, GINT_TO_POINTER((guint32) bmask));
-    g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_MASK_HI_KEY, GINT_TO_POINTER(bmask >> 32));
+    g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_MASK_HI_KEY, GINT_TO_POINTER((guint32)(bmask >> 32)));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_MASKLE_KEY, GINT_TO_POINTER(bmask_le));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_APP_START_KEY, GINT_TO_POINTER(astart));
     g_object_set_data(G_OBJECT(bv), E_BYTE_VIEW_APP_END_KEY, GINT_TO_POINTER(aend));