diff options
author | Guy Harris <guy@alum.mit.edu> | 2007-05-29 06:56:07 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2007-05-29 06:56:07 +0000 |
commit | d2ac4f7133b977b267c0b121aa2bdcb9507e0422 (patch) | |
tree | 7e4f2588b513edda09dc228f9704dc099692792d /gtk | |
parent | 2a5ff70caab499848de0c327052d564a831ba559 (diff) | |
download | wireshark-d2ac4f7133b977b267c0b121aa2bdcb9507e0422.tar.gz |
Check for G_GINT64_MODIFIER in Wireshark as we do in Wiretap.
In all the places where a cast to "long long" or "unsigned long long"
was done, use G_GINT64_MODIFIER and get rid of the cast, as
1) there's no guarantee that "%ll" works
and
2) there's no guarantee that "long long" works
(the latter definitely does *NOT* work with MSVC++; the former doesn't
work with regular printf in MSVC++, but it might work with the GLib
printf-based functions).
svn path=/trunk/; revision=21978
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gsm_map_summary.c | 2 | ||||
-rw-r--r-- | gtk/main.c | 18 | ||||
-rw-r--r-- | gtk/mtp3_summary.c | 2 | ||||
-rw-r--r-- | gtk/summary_dlg.c | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/gtk/gsm_map_summary.c b/gtk/gsm_map_summary.c index 764483a7c6..8a7f984752 100644 --- a/gtk/gsm_map_summary.c +++ b/gtk/gsm_map_summary.c @@ -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", (long long) summary.file_length); + g_snprintf(string_buff, SUM_STR_MAX, "Length: %" G_GINT64_MODIFIER "d", summary.file_length); add_string_to_box(string_buff, file_box); /* format */ diff --git a/gtk/main.c b/gtk/main.c index 8d82b933a4..6029b48933 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -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", (long long) cf->f_datalen/1024/1024); + size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d MB", cf->f_datalen/1024/1024); } else if (cf->f_datalen/1024 > 10) { - size_str = g_strdup_printf("%lld KB", (long long) cf->f_datalen/1024); + size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d KB", cf->f_datalen/1024); } else { - size_str = g_strdup_printf("%lld Bytes", (long long) cf->f_datalen); + size_str = g_strdup_printf("%" G_GINT64_MODIFIER "d Bytes", cf->f_datalen); } /* statusbar */ @@ -1704,20 +1704,20 @@ main_cf_cb_live_capture_update_continue(capture_file *cf) } #endif if (cf->f_datalen/1024/1024 > 10) { - capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %lld MB", + capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d MB", get_interface_descriptive_name(capture_opts->iface), capture_opts->save_file, - (long long) cf->f_datalen/1024/1024); + 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", + capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d KB", get_interface_descriptive_name(capture_opts->iface), capture_opts->save_file, - (long long) cf->f_datalen/1024); + cf->f_datalen/1024); } else { - capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %lld Bytes", + capture_msg = g_strdup_printf(" %s: <live capture in progress> File: %s %" G_GINT64_MODIFIER "d Bytes", get_interface_descriptive_name(capture_opts->iface), capture_opts->save_file, - (long long) cf->f_datalen); + cf->f_datalen); } statusbar_push_file_msg(capture_msg); diff --git a/gtk/mtp3_summary.c b/gtk/mtp3_summary.c index 23909bf93e..0c4995cf78 100644 --- a/gtk/mtp3_summary.c +++ b/gtk/mtp3_summary.c @@ -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", (long long) summary.file_length); + g_snprintf(string_buff, SUM_STR_MAX, "Length: %" G_GINT64_MODIFIER "d", summary.file_length); add_string_to_box(string_buff, file_box); /* format */ diff --git a/gtk/summary_dlg.c b/gtk/summary_dlg.c index 1a765a8aba..a466254e7c 100644 --- a/gtk/summary_dlg.c +++ b/gtk/summary_dlg.c @@ -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", (long long) summary.file_length); + g_snprintf(string_buff, SUM_STR_MAX, "%" G_GINT64_MODIFIER "d bytes", summary.file_length); add_string_to_table(table, &row, "Length:", string_buff); /* format */ |