Wireshark-dev: [Wireshark-dev] [PATCH] Fix compilation failures on x86_64-unknown-linux-gnu
From: David Howells <dhowells@xxxxxxxxxx>
Date: Thu, 24 May 2007 13:47:13 +0100
Fix compilation failures when building wireshark-0.99.6-SVN-21916 on an x86_64-unknown-linux-gnu target with gcc version 4.1.2 20070403 (Red Hat 4.1.2-8). The failures fall into two categories: (1) Casts between pointers and 32-bit integers without an intermediary cast via 'long' or 'unsigned long'. This results in a compiler warning complaining about casts between a pointer and an integer of a different size. (2) Passing values to "%lld" or similar printf-style format options that the compiler thinks are a different size. Such values need to be cast to 'long long' or 'unsigned long long'. David
diff -uNrp wireshark-0.99.6-SVN-21916.orig/epan/dissectors/packet-ansi_801.c wireshark-0.99.6-SVN-21916/epan/dissectors/packet-ansi_801.c --- wireshark-0.99.6-SVN-21916.orig/epan/dissectors/packet-ansi_801.c 2007-05-24 08:36:14.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/epan/dissectors/packet-ansi_801.c 2007-05-24 12:53:33.000000000 +0100 @@ -1063,14 +1063,14 @@ pr_loc_response(tvbuff_t *tvb, proto_tre proto_tree_add_text(tree, tvb, offset, new_offset - offset, "CLOCK_BIAS: (%llu)", - temp_int); + (unsigned long long) temp_int); offset = new_offset; temp_int = ansi_801_tvb_get_bits(tvb, &new_offset, &bit_offset, 16); proto_tree_add_text(tree, tvb, offset, new_offset - offset, "CLOCK_DRIFT: (%llu)", - temp_int); + (unsigned long long) temp_int); offset = new_offset; bit_mask = 0x80 >> (8 - bit_offset); @@ -1148,14 +1148,14 @@ pr_loc_response(tvbuff_t *tvb, proto_tre proto_tree_add_text(tree, tvb, offset, new_offset - offset, "HEIGHT: (%llu)", - temp_int); + (unsigned long long) temp_int); offset = new_offset; temp_int = ansi_801_tvb_get_bits(tvb, &new_offset, &bit_offset, 5); proto_tree_add_text(tree, tvb, offset, new_offset - offset, "LOC_UNCRTNTY_V: (%llu)", - temp_int); + (unsigned long long) temp_int); offset = new_offset; bit_mask = 0x80 >> (8 - bit_offset); @@ -1233,7 +1233,7 @@ for_pr_gps_sat_health(tvbuff_t *tvb, pro proto_tree_add_text(tree, tvb, offset, 1, "BAD_SV_PRN_NUM: (%llu)", - temp_int); + (unsigned long long) temp_int); offset = new_offset; } diff -uNrp wireshark-0.99.6-SVN-21916.orig/epan/dissectors/packet-ieee80211.c wireshark-0.99.6-SVN-21916/epan/dissectors/packet-ieee80211.c --- wireshark-0.99.6-SVN-21916.orig/epan/dissectors/packet-ieee80211.c 2007-05-24 08:36:11.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/epan/dissectors/packet-ieee80211.c 2007-05-24 12:56:23.000000000 +0100 @@ -4525,7 +4525,7 @@ add_tagged_field (packet_info * pinfo, p proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number); start_time = tvb_get_letoh64 (tvb, offset); - proto_tree_add_uint64_format(sub_tree, hf_tag_measure_request_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", start_time); + proto_tree_add_uint64_format(sub_tree, hf_tag_measure_request_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", (unsigned long long) start_time); offset += 8; duration = tvb_get_letohs (tvb, offset); @@ -4737,7 +4737,7 @@ add_tagged_field (packet_info * pinfo, p offset++; start_time = tvb_get_letoh64 (tvb, offset); - proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", start_time); + proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", (unsigned long long) start_time); offset += 8; duration = tvb_get_letohs (tvb, offset); @@ -4753,7 +4753,7 @@ add_tagged_field (packet_info * pinfo, p offset++; start_time = tvb_get_letoh64 (tvb, offset); - proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", start_time); + proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", (unsigned long long) start_time); offset += 8; duration = tvb_get_letohs (tvb, offset); @@ -4793,7 +4793,7 @@ add_tagged_field (packet_info * pinfo, p offset++; start_time = tvb_get_letoh64 (tvb, offset); - proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", start_time); + proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", (unsigned long long) start_time); offset += 8; duration = tvb_get_letohs (tvb, offset); @@ -4824,7 +4824,7 @@ add_tagged_field (packet_info * pinfo, p offset++; start_time = tvb_get_letoh64 (tvb, offset); - proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", start_time); + proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016llX", (unsigned long long) start_time); offset += 8; duration = tvb_get_letohs (tvb, offset); diff -uNrp wireshark-0.99.6-SVN-21916.orig/epan/emem.c wireshark-0.99.6-SVN-21916/epan/emem.c --- wireshark-0.99.6-SVN-21916.orig/epan/emem.c 2007-05-24 08:36:16.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/epan/emem.c 2007-05-24 13:04:42.000000000 +0100 @@ -1536,7 +1536,7 @@ emem_tree_print_nodes(emem_tree_node_t* printf(" "); } - printf("NODE:%08x parent:%08x left:0x%08x right:%08x key:%d data:0x%08x\n",(int)node,(int)node->parent,(int)node->left,(int)node->right,node->key32,(int)node->data); + printf("NODE:%08x parent:%08x left:0x%08x right:%08x key:%d data:0x%08x\n",(int)(long)node,(int)(long)node->parent,(int)(long)node->left,(int)(long)node->right,node->key32,(int)(long)node->data); if(node->left) emem_tree_print_nodes(node->left, level+1); if(node->right) @@ -1548,7 +1548,7 @@ emem_print_tree(emem_tree_t* emem_tree) if (!emem_tree) return; - printf("EMEM tree type:%d name:%s tree:0x%08x\n",emem_tree->type,emem_tree->name,(int)emem_tree->tree); + printf("EMEM tree type:%d name:%s tree:0x%08x\n",emem_tree->type,emem_tree->name,(int)(long)emem_tree->tree); if(emem_tree->tree) emem_tree_print_nodes(emem_tree->tree, 0); } diff -uNrp wireshark-0.99.6-SVN-21916.orig/epan/packet.c wireshark-0.99.6-SVN-21916/epan/packet.c --- wireshark-0.99.6-SVN-21916.orig/epan/packet.c 2007-05-24 08:36:16.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/epan/packet.c 2007-05-24 13:07:38.000000000 +0100 @@ -1757,7 +1757,7 @@ dissector_dump_decodes_display(const gch ftenum_t selector_type _U_, gpointer key, gpointer value, gpointer user_data _U_) { - guint32 selector = (guint32) key; + guint32 selector = (guint32)(unsigned long) key; dissector_table_t sub_dissectors = find_dissector_table(table_name); dtbl_entry_t *dtbl_entry; dissector_handle_t handle; diff -uNrp wireshark-0.99.6-SVN-21916.orig/epan/proto.c wireshark-0.99.6-SVN-21916/epan/proto.c --- wireshark-0.99.6-SVN-21916.orig/epan/proto.c 2007-05-24 08:36:16.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/epan/proto.c 2007-05-24 13:08:17.000000000 +0100 @@ -509,7 +509,7 @@ static void free_GPtrArray_value(gpointer key _U_, gpointer value, gpointer user_data _U_) { GPtrArray *ptrs = value; - gint hfid = (gint)key; + gint hfid = (gint)(long)key; header_field_info *hfinfo; @@ -5769,13 +5769,13 @@ proto_tree_add_bits_ret_val(proto_tree * return proto_tree_add_uint64_format(tree, hf_index, tvb, offset, length, value, "%s: %llu", str, - value); + (unsigned long long) value); break; case BASE_HEX: return proto_tree_add_uint64_format(tree, hf_index, tvb, offset, length, value, "%s: 0x%llx", str, - value); + (unsigned long long) value); break; default: DISSECTOR_ASSERT_NOT_REACHED(); diff -uNrp wireshark-0.99.6-SVN-21916.orig/epan/stream.c wireshark-0.99.6-SVN-21916/epan/stream.c --- wireshark-0.99.6-SVN-21916.orig/epan/stream.c 2007-05-24 08:36:16.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/epan/stream.c 2007-05-24 13:09:13.000000000 +0100 @@ -106,7 +106,7 @@ guint stream_hash_func(gconstpointer k) const stream_key_t *key = (const stream_key_t *)k; /* is_circuit is redundant to the circuit/conversation pointer */ - return ((guint)key->circ.circuit) ^ key->p2p_dir; + return ((guint)(unsigned long)key->circ.circuit) ^ key->p2p_dir; } /* compare func */ @@ -278,7 +278,7 @@ typedef struct fragment_key { guint fragment_hash_func(gconstpointer k) { const fragment_key_t *key = (const fragment_key_t *)k; - return ((guint)key->stream) + ((guint)key -> framenum) + ((guint)key->offset); + return ((guint)(unsigned long)key->stream) + ((guint)key -> framenum) + ((guint)key->offset); } /* compare func */ diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/ansi_a_stat.c wireshark-0.99.6-SVN-21916/gtk/ansi_a_stat.c --- wireshark-0.99.6-SVN-21916.orig/gtk/ansi_a_stat.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/ansi_a_stat.c 2007-05-24 13:19:33.000000000 +0100 @@ -136,7 +136,7 @@ ansi_a_stat_draw( while (ansi_a_bsmap_strings[i].strptr) { - j = gtk_clist_find_row_from_data(GTK_CLIST(dlg_bsmap.table), (gpointer) i); + j = gtk_clist_find_row_from_data(GTK_CLIST(dlg_bsmap.table), (gpointer)(long) i); strp = g_strdup_printf("%d", stat_p->bsmap_message_type[ansi_a_bsmap_strings[i].value]); @@ -155,7 +155,7 @@ ansi_a_stat_draw( while (ansi_a_dtap_strings[i].strptr) { - j = gtk_clist_find_row_from_data(GTK_CLIST(dlg_dtap.table), (gpointer) i); + j = gtk_clist_find_row_from_data(GTK_CLIST(dlg_dtap.table), (gpointer)(long) i); strp = g_strdup_printf("%d", stat_p->dtap_message_type[ansi_a_dtap_strings[i].value]); @@ -393,7 +393,7 @@ ansi_a_stat_gtk_bsmap_cb( dlg_bsmap.entries[2] = g_strdup("0"); gtk_clist_insert(GTK_CLIST(dlg_bsmap.table), i, dlg_bsmap.entries); - gtk_clist_set_row_data(GTK_CLIST(dlg_bsmap.table), i, (gpointer) i); + gtk_clist_set_row_data(GTK_CLIST(dlg_bsmap.table), i, (gpointer)(long) i); i++; } @@ -440,7 +440,7 @@ ansi_a_stat_gtk_dtap_cb( dlg_dtap.entries[2] = g_strdup("0"); gtk_clist_insert(GTK_CLIST(dlg_dtap.table), i, dlg_dtap.entries); - gtk_clist_set_row_data(GTK_CLIST(dlg_dtap.table), i, (gpointer) i); + gtk_clist_set_row_data(GTK_CLIST(dlg_dtap.table), i, (gpointer)(long) i); i++; } diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/ansi_map_stat.c wireshark-0.99.6-SVN-21916/gtk/ansi_map_stat.c --- wireshark-0.99.6-SVN-21916.orig/gtk/ansi_map_stat.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/ansi_map_stat.c 2007-05-24 13:19:49.000000000 +0100 @@ -145,7 +145,7 @@ ansi_map_stat_draw( while (ansi_map_opr_code_strings[i].strptr) { - j = gtk_clist_find_row_from_data(GTK_CLIST(dlg.table), (gpointer) i); + j = gtk_clist_find_row_from_data(GTK_CLIST(dlg.table), (gpointer)(long) i); strp = g_strdup_printf("%d", stat_p->message_type[ansi_map_opr_code_strings[i].value]); @@ -397,7 +397,7 @@ ansi_map_stat_gtk_cb( dlg.entries[4] = g_strdup("0"); gtk_clist_insert(GTK_CLIST(dlg.table), i, dlg.entries); - gtk_clist_set_row_data(GTK_CLIST(dlg.table), i, (gpointer) i); + gtk_clist_set_row_data(GTK_CLIST(dlg.table), i, (gpointer)(long) i); i++; } diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/column_prefs.c wireshark-0.99.6-SVN-21916/gtk/column_prefs.c --- wireshark-0.99.6-SVN-21916.orig/gtk/column_prefs.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/column_prefs.c 2007-05-24 13:12:29.000000000 +0100 @@ -547,7 +547,7 @@ column_menu_changed_cb(GtkWidget *w _U_, sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(column_l)); if (gtk_tree_selection_get_selected(sel, &model, &iter)) { - cur_fmt = (gint) data; + cur_fmt = (gint)(long) data; gtk_tree_model_get(model, &iter, 2, &clp, -1); cfmt = (fmt_data *) clp->data; diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/conversations_table.c wireshark-0.99.6-SVN-21916/gtk/conversations_table.c --- wireshark-0.99.6-SVN-21916.orig/gtk/conversations_table.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/conversations_table.c 2007-05-24 13:13:10.000000000 +0100 @@ -1038,7 +1038,7 @@ draw_ct_table_address(conversations_tabl guint32 pt; int rownum; - rownum=gtk_clist_find_row_from_data(ct->table, (gpointer)conversation_idx); + rownum=gtk_clist_find_row_from_data(ct->table, (gpointer)(long)conversation_idx); if(!ct->resolve_names) entry=address_to_str(&ct->conversations[conversation_idx].src_address); @@ -1115,7 +1115,7 @@ draw_ct_table_data(conversations_table * for(i=0;i<ct->num_conversations;i++){ char str[16]; - j=gtk_clist_find_row_from_data(ct->table, (gpointer)i); + j=gtk_clist_find_row_from_data(ct->table, (gpointer)(unsigned long)i); g_snprintf(str, 16, "%" PRIu64, ct->conversations[i].tx_frames+ct->conversations[i].rx_frames); gtk_clist_set_text(ct->table, j, 4, str); @@ -1684,7 +1684,7 @@ add_conversation_table_data(conversation entries[9]=rxbytes; gtk_clist_insert(ct->table, conversation_idx, entries); - gtk_clist_set_row_data(ct->table, conversation_idx, (gpointer) conversation_idx); + gtk_clist_set_row_data(ct->table, conversation_idx, (gpointer)(long) conversation_idx); draw_ct_table_address(ct, conversation_idx); } diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/dcerpc_stat.c wireshark-0.99.6-SVN-21916/gtk/dcerpc_stat.c --- wireshark-0.99.6-SVN-21916.orig/gtk/dcerpc_stat.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/dcerpc_stat.c 2007-05-24 13:20:08.000000000 +0100 @@ -379,7 +379,7 @@ dcerpcstat_start_button_clicked(GtkWidge static void dcerpcstat_version_select(GtkWidget *item _U_, gpointer key) { - int vers=(int)key; + int vers=(long)key; dcerpc_version=vers; } @@ -401,7 +401,7 @@ dcerpcstat_find_vers(gpointer *key, gpoi g_snprintf(vs, 5, "%u",k->ver); menu_item=gtk_menu_item_new_with_label(vs); SIGNAL_CONNECT(menu_item, "activate", dcerpcstat_version_select, - ((int)k->ver)); + ((long)k->ver)); gtk_widget_show(menu_item); gtk_menu_append(GTK_MENU(vers_menu), menu_item); diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/expert_comp_table.c wireshark-0.99.6-SVN-21916/gtk/expert_comp_table.c --- wireshark-0.99.6-SVN-21916.orig/gtk/expert_comp_table.c 2007-05-24 08:29:47.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/expert_comp_table.c 2007-05-24 13:14:10.000000000 +0100 @@ -246,7 +246,7 @@ error_select_filter_cb(GtkWidget *widget gtk_tree_model_get (model, &iter, PROTOCOL_COLUMN, &expert_data.protocol, -1); gtk_tree_model_get (model, &iter, SUMMARY_COLUMN, &expert_data.summary, -1); - if (strcmp((char *)expert_data.group, "Packet:")==0) { + if (strcmp((char *)(unsigned long)expert_data.group, "Packet:")==0) { simple_dialog(ESD_TYPE_ERROR, ESD_BTN_OK, "You cannot filter or search for packet number. Click on a valid item header."); return; } diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/expert_dlg.c wireshark-0.99.6-SVN-21916/gtk/expert_dlg.c --- wireshark-0.99.6-SVN-21916.orig/gtk/expert_dlg.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/expert_dlg.c 2007-05-24 13:20:35.000000000 +0100 @@ -516,7 +516,7 @@ expert_dlg_init(const char *optarg, void for(i=0; expert_severity_om_vals[i].strptr != NULL;i++){ menu_item=gtk_menu_item_new_with_label(expert_severity_om_vals[i].strptr); OBJECT_SET_DATA(menu_item, "tapdata", etd); - SIGNAL_CONNECT(menu_item, "activate", expert_dlg_severity_cb, i); + SIGNAL_CONNECT(menu_item, "activate", expert_dlg_severity_cb, (long) i); gtk_menu_append(GTK_MENU(menu), menu_item); if(expert_severity_om_vals[i].value == (guint) etd->severity_report_level) { gtk_menu_set_active(GTK_MENU(menu), i); diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/gsm_a_stat.c wireshark-0.99.6-SVN-21916/gtk/gsm_a_stat.c --- wireshark-0.99.6-SVN-21916.orig/gtk/gsm_a_stat.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/gsm_a_stat.c 2007-05-24 13:21:05.000000000 +0100 @@ -178,7 +178,7 @@ gsm_a_stat_draw_aux( while (msg_strings[i].strptr) { - j = gtk_clist_find_row_from_data(GTK_CLIST(dlg_p->table), (gpointer) i); + j = gtk_clist_find_row_from_data(GTK_CLIST(dlg_p->table), (gpointer)(long) i); strp = g_strdup_printf("%d", message_count[msg_strings[i].value]); gtk_clist_set_text(GTK_CLIST(dlg_p->table), j, 2, strp); @@ -480,7 +480,7 @@ gsm_a_stat_gtk_bssmap_cb( dlg_bssmap.entries[2] = g_strdup("0"); gtk_clist_insert(GTK_CLIST(dlg_bssmap.table), i, dlg_bssmap.entries); - gtk_clist_set_row_data(GTK_CLIST(dlg_bssmap.table), i, (gpointer) i); + gtk_clist_set_row_data(GTK_CLIST(dlg_bssmap.table), i, (gpointer)(long) i); i++; } @@ -531,7 +531,7 @@ gsm_a_stat_gtk_dtap_cb( dlg_dtap_p->entries[2] = g_strdup("0"); gtk_clist_insert(GTK_CLIST(dlg_dtap_p->table), i, dlg_dtap_p->entries); - gtk_clist_set_row_data(GTK_CLIST(dlg_dtap_p->table), i, (gpointer) i); + gtk_clist_set_row_data(GTK_CLIST(dlg_dtap_p->table), i, (gpointer)(long) i); i++; } diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/gsm_map_stat.c wireshark-0.99.6-SVN-21916/gtk/gsm_map_stat.c --- wireshark-0.99.6-SVN-21916.orig/gtk/gsm_map_stat.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/gsm_map_stat.c 2007-05-24 13:21:22.000000000 +0100 @@ -159,7 +159,7 @@ gsm_map_stat_draw( while (gsm_map_opr_code_strings[i].strptr) { - j = gtk_clist_find_row_from_data(GTK_CLIST(dlg.table), (gpointer) i); + j = gtk_clist_find_row_from_data(GTK_CLIST(dlg.table), (gpointer)(long) i); strp = g_strdup_printf("%d", stat_p->opr_code[i]); gtk_clist_set_text(GTK_CLIST(dlg.table), j, 2, strp); @@ -436,7 +436,7 @@ gsm_map_stat_gtk_cb( } gtk_clist_insert(GTK_CLIST(dlg.table), i, dlg.entries); - gtk_clist_set_row_data(GTK_CLIST(dlg.table), i, (gpointer) i); + gtk_clist_set_row_data(GTK_CLIST(dlg.table), i, (gpointer)(long) i); i++; } diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/gsm_map_summary.c wireshark-0.99.6-SVN-21916/gtk/gsm_map_summary.c --- wireshark-0.99.6-SVN-21916.orig/gtk/gsm_map_summary.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/gsm_map_summary.c 2007-05-24 13:21:36.000000000 +0100 @@ -111,7 +111,7 @@ gsm_map_stat_gtk_sum_cb(GtkWidget *w _U_ add_string_to_box(string_buff, file_box); /* length */ - g_snprintf(string_buff, SUM_STR_MAX, "Length: %lld", summary.file_length); + g_snprintf(string_buff, SUM_STR_MAX, "Length: %lld", (long long) summary.file_length); add_string_to_box(string_buff, file_box); /* format */ diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/hostlist_table.c wireshark-0.99.6-SVN-21916/gtk/hostlist_table.c --- wireshark-0.99.6-SVN-21916.orig/gtk/hostlist_table.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/hostlist_table.c 2007-05-24 13:16:37.000000000 +0100 @@ -487,7 +487,7 @@ draw_hostlist_table_address(hostlist_tab guint32 pt; int rownum; - rownum=gtk_clist_find_row_from_data(hl->table, (gpointer)hostlist_idx); + rownum=gtk_clist_find_row_from_data(hl->table, (gpointer)(long)hostlist_idx); if (!hl->resolve_names) entry=address_to_str(&hl->hosts[hostlist_idx].address); @@ -544,7 +544,7 @@ draw_hostlist_table_data(hostlist_table for(i=0;i<hl->num_hosts;i++){ char str[16]; - j=gtk_clist_find_row_from_data(hl->table, (gpointer)i); + j=gtk_clist_find_row_from_data(hl->table, (gpointer)(unsigned long)i); g_snprintf(str, 16, "%" PRIu64, hl->hosts[i].tx_frames+hl->hosts[i].rx_frames); gtk_clist_set_text(hl->table, j, 2, str); @@ -1068,7 +1068,7 @@ add_hostlist_table_data(hostlist_table * entries[7]=rxbytes; gtk_clist_insert(hl->table, talker_idx, entries); - gtk_clist_set_row_data(hl->table, talker_idx, (gpointer) talker_idx); + gtk_clist_set_row_data(hl->table, talker_idx, (gpointer)(long) talker_idx); draw_hostlist_table_address(hl, talker_idx); } diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/io_stat.c wireshark-0.99.6-SVN-21916/gtk/io_stat.c --- wireshark-0.99.6-SVN-21916.orig/gtk/io_stat.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/io_stat.c 2007-05-24 13:22:14.000000000 +0100 @@ -1264,7 +1264,7 @@ tick_interval_select(GtkWidget *item, gp io_stat_t *io; io=(io_stat_t *)key; - val=(int)OBJECT_GET_DATA(item, "tick_interval"); + val=(long)OBJECT_GET_DATA(item, "tick_interval"); io->interval=val; cf_retap_packets(&cfile, FALSE); @@ -1278,7 +1278,7 @@ pixels_per_tick_select(GtkWidget *item, io_stat_t *io; io=(io_stat_t *)key; - val=(int)OBJECT_GET_DATA(item, "pixels_per_tick"); + val=(long)OBJECT_GET_DATA(item, "pixels_per_tick"); io->pixels_per_tick=val; io_stat_redraw(io); } @@ -1290,7 +1290,7 @@ plot_style_select(GtkWidget *item, gpoin io_stat_graph_t *ppt; ppt=(io_stat_graph_t *)key; - val=(int)OBJECT_GET_DATA(item, "plot_style"); + val=(long)OBJECT_GET_DATA(item, "plot_style"); ppt->plot_style=val; @@ -1326,7 +1326,7 @@ yscale_select(GtkWidget *item, gpointer io_stat_t *io; io=(io_stat_t *)key; - val=(int)OBJECT_GET_DATA(item, "yscale_max"); + val=(long)OBJECT_GET_DATA(item, "yscale_max"); io->max_y_units=val; io_stat_redraw(io); @@ -1391,7 +1391,7 @@ count_type_select(GtkWidget *item, gpoin io_stat_t *io; io=(io_stat_t *)key; - val=(int)OBJECT_GET_DATA(item, "count_type"); + val=(long)OBJECT_GET_DATA(item, "count_type"); io->count_type=val; diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/main.c wireshark-0.99.6-SVN-21916/gtk/main.c --- wireshark-0.99.6-SVN-21916.orig/gtk/main.c 2007-05-24 08:29:47.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/main.c 2007-05-24 13:17:28.000000000 +0100 @@ -1430,11 +1430,11 @@ set_display_filename(capture_file *cf) /* convert file size */ if (cf->f_datalen/1024/1024 > 10) { - size_str = g_strdup_printf("%lld MB", cf->f_datalen/1024/1024); + size_str = g_strdup_printf("%lld MB", (long long) cf->f_datalen/1024/1024); } else if (cf->f_datalen/1024 > 10) { - size_str = g_strdup_printf("%lld KB", cf->f_datalen/1024); + size_str = g_strdup_printf("%lld KB", (long long) cf->f_datalen/1024); } else { - size_str = g_strdup_printf("%lld Bytes", cf->f_datalen); + size_str = g_strdup_printf("%lld Bytes", (long long) cf->f_datalen); } /* statusbar */ @@ -1707,17 +1707,17 @@ main_cf_cb_live_capture_update_continue( capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %lld MB", get_interface_descriptive_name(capture_opts->iface), capture_opts->save_file, - cf->f_datalen/1024/1024); + (long long) cf->f_datalen/1024/1024); } else if (cf->f_datalen/1024 > 10) { capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %lld KB", get_interface_descriptive_name(capture_opts->iface), capture_opts->save_file, - cf->f_datalen/1024); + (long long) cf->f_datalen/1024); } else { capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %lld Bytes", get_interface_descriptive_name(capture_opts->iface), capture_opts->save_file, - cf->f_datalen); + (long long) cf->f_datalen); } statusbar_push_file_msg(capture_msg); diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/mtp3_summary.c wireshark-0.99.6-SVN-21916/gtk/mtp3_summary.c --- wireshark-0.99.6-SVN-21916.orig/gtk/mtp3_summary.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/mtp3_summary.c 2007-05-24 13:22:31.000000000 +0100 @@ -276,7 +276,7 @@ mtp3_sum_gtk_sum_cb(GtkWidget *w _U_, gp add_string_to_box(string_buff, file_box); /* length */ - g_snprintf(string_buff, SUM_STR_MAX, "Length: %lld", summary.file_length); + g_snprintf(string_buff, SUM_STR_MAX, "Length: %lld", (long long) summary.file_length); add_string_to_box(string_buff, file_box); /* format */ diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/rpc_stat.c wireshark-0.99.6-SVN-21916/gtk/rpc_stat.c --- wireshark-0.99.6-SVN-21916.orig/gtk/rpc_stat.c 2007-05-24 08:29:47.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/rpc_stat.c 2007-05-24 13:23:05.000000000 +0100 @@ -341,7 +341,7 @@ rpcstat_start_button_clicked(GtkWidget * static void rpcstat_version_select(GtkWidget *item _U_, gpointer key) { - int vers=(int)key; + int vers=(long)key; rpc_version=vers; } @@ -370,7 +370,7 @@ rpcstat_program_select(GtkWidget *item _ g_snprintf(vs, 5, "%d",i); menu_item=gtk_menu_item_new_with_label(vs); SIGNAL_CONNECT(menu_item, "activate", rpcstat_version_select, - i); + (long) i); gtk_widget_show(menu_item); gtk_menu_append(GTK_MENU(vers_menu), menu_item); @@ -471,7 +471,7 @@ gtk_rpcstat_cb(GtkWidget *w _U_, gpointe g_snprintf(vs, 5, "%d",i); menu_item=gtk_menu_item_new_with_label(vs); SIGNAL_CONNECT(menu_item, "activate", rpcstat_version_select, - i); + (long) i); gtk_widget_show(menu_item); gtk_menu_append(GTK_MENU(vers_menu), menu_item); diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/rtp_analysis.c wireshark-0.99.6-SVN-21916/gtk/rtp_analysis.c --- wireshark-0.99.6-SVN-21916.orig/gtk/rtp_analysis.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/rtp_analysis.c 2007-05-24 13:23:24.000000000 +0100 @@ -1943,7 +1943,7 @@ static void yscale_select(GtkWidget *ite user_data_t *user_data; user_data=(user_data_t *)key; - val=(int)OBJECT_GET_DATA(item, "yscale_max"); + val=(long)OBJECT_GET_DATA(item, "yscale_max"); user_data->dlg.dialog_graph.max_y_units=val; dialog_graph_redraw(user_data); @@ -1956,7 +1956,7 @@ static void pixels_per_tick_select(GtkWi user_data_t *user_data; user_data=(user_data_t *)key; - val=(int)OBJECT_GET_DATA(item, "pixels_per_tick"); + val=(long)OBJECT_GET_DATA(item, "pixels_per_tick"); user_data->dlg.dialog_graph.pixels_per_tick=val; dialog_graph_redraw(user_data); } @@ -1968,7 +1968,7 @@ static void tick_interval_select(GtkWidg user_data_t *user_data; user_data=(user_data_t *)key; - val=(int)OBJECT_GET_DATA(item, "tick_interval"); + val=(long)OBJECT_GET_DATA(item, "tick_interval"); user_data->dlg.dialog_graph.interval=val; cf_retap_packets(&cfile, FALSE); diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/scsi_stat.c wireshark-0.99.6-SVN-21916/gtk/scsi_stat.c --- wireshark-0.99.6-SVN-21916.orig/gtk/scsi_stat.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/scsi_stat.c 2007-05-24 13:23:38.000000000 +0100 @@ -111,7 +111,7 @@ dlg_destroy_cb(void) static void scsistat_program_select(GtkWidget *item _U_, gpointer key) { - int k=(int)key; + int k=(long)key; scsi_program=k; } diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/service_response_time_table.c wireshark-0.99.6-SVN-21916/gtk/service_response_time_table.c --- wireshark-0.99.6-SVN-21916.orig/gtk/service_response_time_table.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/service_response_time_table.c 2007-05-24 13:17:55.000000000 +0100 @@ -479,7 +479,7 @@ add_srt_table_data(srt_stat_table *rst, */ if (rp->stats.num==0){ row=gtk_clist_append(rst->table, rst->procedures[index].entries); - gtk_clist_set_row_data(rst->table, row, (gpointer) index); + gtk_clist_set_row_data(rst->table, row, (gpointer)(long) index); } /* calculate time delta between request and reply */ @@ -508,7 +508,7 @@ draw_srt_table_data(srt_stat_table *rst) td=td*100000+(int)rst->procedures[i].stats.tot.nsecs/10000; td/=rst->procedures[i].stats.num; - j=gtk_clist_find_row_from_data(rst->table, (gpointer)i); + j=gtk_clist_find_row_from_data(rst->table, (gpointer)(long)i); strp=g_strdup_printf("%d", rst->procedures[i].stats.num); gtk_clist_set_text(rst->table, j, 2, strp); g_free(rst->procedures[i].entries[2]); diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/ssl-dlg.c wireshark-0.99.6-SVN-21916/gtk/ssl-dlg.c --- wireshark-0.99.6-SVN-21916.orig/gtk/ssl-dlg.c 2007-05-24 08:29:47.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/ssl-dlg.c 2007-05-24 13:18:10.000000000 +0100 @@ -151,7 +151,7 @@ ssl_queue_packet_data(void *tapdata, pac SslDataInfo* appl_data; gint total_len; guchar *p; - int proto_ssl = (int) ssl; + int proto_ssl = (long) ssl; SslPacketInfo* pi = p_get_proto_data(pinfo->fd, proto_ssl); /* skip packet without decrypted data payload*/ diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/summary_dlg.c wireshark-0.99.6-SVN-21916/gtk/summary_dlg.c --- wireshark-0.99.6-SVN-21916.orig/gtk/summary_dlg.c 2007-05-24 08:29:47.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/summary_dlg.c 2007-05-24 13:18:30.000000000 +0100 @@ -144,7 +144,7 @@ summary_open_cb(GtkWidget *w _U_, gpoint add_string_to_table(table, &row, "Name:", string_buff); /* length */ - g_snprintf(string_buff, SUM_STR_MAX, "%lld bytes", summary.file_length); + g_snprintf(string_buff, SUM_STR_MAX, "%lld bytes", (long long) summary.file_length); add_string_to_table(table, &row, "Length:", string_buff); /* format */ diff -uNrp wireshark-0.99.6-SVN-21916.orig/gtk/tcp_graph.c wireshark-0.99.6-SVN-21916/gtk/tcp_graph.c --- wireshark-0.99.6-SVN-21916.orig/gtk/tcp_graph.c 2007-05-24 08:29:48.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/gtk/tcp_graph.c 2007-05-24 13:23:58.000000000 +0100 @@ -1162,7 +1162,7 @@ static void callback_zoom_step (GtkWidge GtkSpinButton *widget_this, *widget_other; double old_this; - direction = (int)OBJECT_GET_DATA(spin, "direction"); + direction = (long)OBJECT_GET_DATA(spin, "direction"); value = gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (spin)); if (direction) { @@ -1201,7 +1201,7 @@ static void callback_zoom_step (GtkWidge static void callback_zoom_flags (GtkWidget *toggle, gpointer data) { struct graph *g = (struct graph * )data; - int flag = (int)OBJECT_GET_DATA(toggle, "flag"); + int flag = (long)OBJECT_GET_DATA(toggle, "flag"); if (GTK_TOGGLE_BUTTON (toggle)->active) g->zoom.flags |= flag; @@ -1363,7 +1363,7 @@ static void callback_mag_zoom (GtkWidget g->magnify.flags &= ~MAGZOOMS_IGNORE; return; } - direction = (int)OBJECT_GET_DATA(spin, "direction"); + direction = (long)OBJECT_GET_DATA(spin, "direction"); value = gtk_spin_button_get_value_as_float (GTK_SPIN_BUTTON (spin)); if (direction) { @@ -1406,7 +1406,7 @@ static void callback_mag_zoom (GtkWidget static void callback_mag_flags (GtkWidget *toggle, gpointer data) { struct graph *g = (struct graph * )data; - int flag = (int)OBJECT_GET_DATA(toggle, "flag"); + int flag = (long)OBJECT_GET_DATA(toggle, "flag"); if (GTK_TOGGLE_BUTTON (toggle)->active) g->magnify.flags |= flag; @@ -1566,7 +1566,7 @@ static void callback_graph_type (GtkWidg int old_type, new_type; struct graph *g = (struct graph * )data; - new_type = (int)OBJECT_GET_DATA(toggle,"new-graph-type"); + new_type = (long)OBJECT_GET_DATA(toggle,"new-graph-type"); if (!GTK_TOGGLE_BUTTON (toggle)->active) return; diff -uNrp wireshark-0.99.6-SVN-21916.orig/plugins/h223/packet-h223.c wireshark-0.99.6-SVN-21916/plugins/h223/packet-h223.c --- wireshark-0.99.6-SVN-21916.orig/plugins/h223/packet-h223.c 2007-05-24 08:30:23.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/plugins/h223/packet-h223.c 2007-05-24 13:11:33.000000000 +0100 @@ -189,7 +189,7 @@ static gint circuit_chain_equal(gconstpo static guint circuit_chain_hash (gconstpointer v) { const circuit_chain_key *key = (const circuit_chain_key *)v; - guint hash_val = ((guint32)(key->call))^(((guint32)key->vc) << 16); + guint hash_val = ((guint32)(unsigned long)(key->call))^(((guint32)key->vc) << 16); return hash_val; } diff -uNrp wireshark-0.99.6-SVN-21916.orig/wiretap/catapult_dct2000.c wireshark-0.99.6-SVN-21916/wiretap/catapult_dct2000.c --- wireshark-0.99.6-SVN-21916.orig/wiretap/catapult_dct2000.c 2007-05-24 08:36:29.000000000 +0100 +++ wireshark-0.99.6-SVN-21916/wiretap/catapult_dct2000.c 2007-05-24 12:50:27.000000000 +0100 @@ -494,7 +494,7 @@ catapult_dct2000_seek_read(wtap *wth, gi /* If get here, must have failed */ *err = errno; *err_info = g_strdup_printf("catapult dct2000: seek_read failed to read/parse " - "line at position %lld", seek_off); + "line at position %lld", (long long) seek_off); return FALSE; } @@ -1373,7 +1373,7 @@ gint wth_equal(gconstpointer v, gconstpo /***********************************************/ guint wth_hash_func(gconstpointer v) { - return (guint)v; + return (guint)(unsigned long)v; }
- Follow-Ups:
- Re: [Wireshark-dev] [PATCH] Fix compilation failures on x86_64-unknown-linux-gnu
- From: Sebastien Tandel
- Re: [Wireshark-dev] [PATCH] Fix compilation failures on x86_64-unknown-linux-gnu
- Prev by Date: [Wireshark-dev] Different tshark output between P4 and Itanium for NFS trace
- Next by Date: Re: [Wireshark-dev] Help to build Wireshark
- Previous by thread: Re: [Wireshark-dev] Different tshark output between P4 and Itanium for NFS trace
- Next by thread: Re: [Wireshark-dev] [PATCH] Fix compilation failures on x86_64-unknown-linux-gnu
- Index(es):