From 813bc10e8fdf5df2dc876b6e1da90d9e1de70802 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Sat, 15 Mar 2014 10:55:01 +0100 Subject: Fix -Wabsolute-value in GTK Compare stat (Found by Clang 3.5) compare_stat.c:235:34: error: taking the absolute value of unsigned type 'guint32' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value] compare_stat.c:235:34: note: remove the call to 'abs' since unsigned values cannot be negative compare_stat.c:406:55: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] compare_stat.c:406:55: note: remove the call to 'abs' since unsigned values cannot be negative compare_stat.c:432:56: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] compare_stat.c:432:56: note: remove the call to 'abs' since unsigned values cannot be negative Change-Id: I03cc3136df3faf42c25986f52f015b8d87ce5774 Reviewed-on: https://code.wireshark.org/review/675 Reviewed-by: Anders Broman --- ui/gtk/compare_stat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ui') diff --git a/ui/gtk/compare_stat.c b/ui/gtk/compare_stat.c index df485c78dd..3b70075b3a 100644 --- a/ui/gtk/compare_stat.c +++ b/ui/gtk/compare_stat.c @@ -232,7 +232,7 @@ comparestat_packet(void *arg, packet_info *pinfo, epan_dissect_t *edt _U_, const nstime_set_zero(&fInfo->fg->predecessor_time); g_hash_table_insert(cs->packet_set, GINT_TO_POINTER(pinfo->fd->num), fInfo); - if(cf_get_packet_count(&cfile)==abs(fInfo->num)){ + if((guint32)cf_get_packet_count(&cfile)==fInfo->num){ nstime_set_unset(&cs->current_time); return 1; } else { @@ -403,7 +403,7 @@ call_foreach_merge_settings(gpointer key _U_, gpointer value, gpointer arg) } if(fInfoTemp && fmod(fInfoTemp->zebra_time.nsecs, 2)){ /*first file*/ - cs->stop_packet_nr_first=cs->start_packet_nr_first+abs(cs->second_file_amount-(cs->start_packet_nr_second-cs->first_file_amount)); + cs->stop_packet_nr_first=cs->start_packet_nr_first+(cs->second_file_amount-(cs->start_packet_nr_second-cs->first_file_amount)); if(cs->stop_packet_nr_first>(tot_packet_amount-cs->second_file_amount)){ cs->stop_packet_nr_first=tot_packet_amount-cs->second_file_amount; } @@ -429,7 +429,7 @@ call_foreach_merge_settings(gpointer key _U_, gpointer value, gpointer arg) } } /* set second stop location */ - cs->stop_packet_nr_second=cs->start_packet_nr_second+abs(cs->stop_packet_nr_first-cs->start_packet_nr_first); + cs->stop_packet_nr_second=cs->start_packet_nr_second+(cs->stop_packet_nr_first-cs->start_packet_nr_first); if(cs->stop_packet_nr_second>tot_packet_amount){ cs->stop_packet_nr_second=tot_packet_amount; } -- cgit v1.2.3