Fix -Wabsolute-value in TAP Compare stat (Found by Clang 3.5)

tap-comparestat.c:321:55: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
tap-comparestat.c:321:55: note: remove the call to 'abs' since unsigned values cannot be negative
tap-comparestat.c:347:56: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
tap-comparestat.c:347:56: note: remove the call to 'abs' since unsigned values cannot be negative

Change-Id: Ice950228d844373abcbd0cdc8ea05079b8b933d0
Reviewed-on: https://code.wireshark.org/review/676
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Alexis La Goutte 2014-03-15 11:01:03 +01:00 committed by Anders Broman
parent 813bc10e8f
commit 5af1e3a958
1 changed files with 2 additions and 2 deletions

View File

@ -318,7 +318,7 @@ call_foreach_merge_settings(gpointer key _U_, gpointer value, gpointer arg)
}
if(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;
}
@ -344,7 +344,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;
}