From David Howells :

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'.

svn path=/trunk/; revision=21975
This commit is contained in:
Sebastien Tandel 2007-05-29 02:43:18 +00:00
parent d3d3f9bc68
commit 76729e5d0f
29 changed files with 72 additions and 72 deletions

View File

@ -1063,14 +1063,14 @@ pr_loc_response(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset)
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_tree *tree, guint len, guint32 offset)
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, proto_tree *tree, guint len, guint32 offset
proto_tree_add_text(tree, tvb, offset, 1,
"BAD_SV_PRN_NUM: (%llu)",
temp_int);
(unsigned long long) temp_int);
offset = new_offset;
}

View File

@ -4525,7 +4525,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of
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, proto_tree * tree, tvbuff_t * tvb, int of
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, proto_tree * tree, tvbuff_t * tvb, int of
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, proto_tree * tree, tvbuff_t * tvb, int of
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, proto_tree * tree, tvbuff_t * tvb, int of
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);

View File

@ -1536,7 +1536,7 @@ emem_tree_print_nodes(emem_tree_node_t* node, int level)
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);
}

View File

@ -1757,7 +1757,7 @@ dissector_dump_decodes_display(const gchar *table_name,
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;

View File

@ -510,7 +510,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;
@ -5770,13 +5770,13 @@ proto_tree_add_bits_ret_val(proto_tree *tree, int hf_index, tvbuff_t *tvb, gint
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();

View File

@ -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 */

View File

@ -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++;
}

View File

@ -146,7 +146,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]);
@ -403,7 +403,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++;
}

View File

@ -547,7 +547,7 @@ column_menu_changed_cb(GtkWidget *w _U_, gpointer data) {
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;

View File

@ -1038,7 +1038,7 @@ draw_ct_table_address(conversations_table *ct, int conversation_idx)
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 *ct)
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(conversations_table *ct, const address *src, const a
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);
}

View File

@ -379,7 +379,7 @@ dcerpcstat_start_button_clicked(GtkWidget *item _U_, gpointer data _U_)
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, gpointer *value _U_, gpointer *user_data _U_
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);

View File

@ -246,7 +246,7 @@ error_select_filter_cb(GtkWidget *widget _U_, gpointer callback_data, guint call
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;
}

View File

@ -516,7 +516,7 @@ expert_dlg_init(const char *optarg, void* userdata _U_)
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);

View File

@ -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++;
}

View File

@ -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++;
}

View File

@ -111,7 +111,7 @@ gsm_map_stat_gtk_sum_cb(GtkWidget *w _U_, gpointer d _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 */

View File

@ -487,7 +487,7 @@ draw_hostlist_table_address(hostlist_table *hl, int hostlist_idx)
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 *hl)
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 *hl, const address *addr, guint32 port, g
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);
}

View File

@ -1264,7 +1264,7 @@ tick_interval_select(GtkWidget *item, gpointer key)
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, gpointer key)
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, gpointer key)
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 key)
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, gpointer key)
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;

View File

@ -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_file *cf)
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);

View File

@ -276,7 +276,7 @@ mtp3_sum_gtk_sum_cb(GtkWidget *w _U_, gpointer d _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 */

View File

@ -341,7 +341,7 @@ rpcstat_start_button_clicked(GtkWidget *item _U_, gpointer data _U_)
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 _U_, gpointer key)
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_, gpointer d _U_)
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);

View File

@ -1943,7 +1943,7 @@ static void yscale_select(GtkWidget *item, gpointer key)
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(GtkWidget *item, gpointer key)
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(GtkWidget *item, gpointer key)
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);

View File

@ -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;
}

View File

@ -479,7 +479,7 @@ add_srt_table_data(srt_stat_table *rst, int index, const nstime_t *req_time, pac
*/
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]);

View File

@ -151,7 +151,7 @@ ssl_queue_packet_data(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_
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*/

View File

@ -144,7 +144,7 @@ summary_open_cb(GtkWidget *w _U_, gpointer d _U_)
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 */

View File

@ -1162,7 +1162,7 @@ static void callback_zoom_step (GtkWidget *spin, gpointer data)
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 (GtkWidget *spin, gpointer data)
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 *spin, gpointer data)
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 *spin, gpointer data)
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 (GtkWidget *toggle, gpointer data)
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;

View File

@ -189,7 +189,7 @@ static gint circuit_chain_equal(gconstpointer v, gconstpointer w)
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;
}

View File

@ -494,7 +494,7 @@ catapult_dct2000_seek_read(wtap *wth, gint64 seek_off,
/* 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, gconstpointer v2)
/***********************************************/
guint wth_hash_func(gconstpointer v)
{
return (guint)v;
return (guint)(unsigned long)v;
}