aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2014-03-15 10:55:01 +0100
committerAnders Broman <a.broman58@gmail.com>2014-03-15 11:41:35 +0000
commit813bc10e8fdf5df2dc876b6e1da90d9e1de70802 (patch)
tree625277ce7fdeb5fa76d9cb4233fe4bdbbf5553d3 /ui
parent35648dec43c05f4b3a2845d9957106852d2c8f28 (diff)
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 <a.broman58@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/compare_stat.c6
1 files changed, 3 insertions, 3 deletions
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;
}