Fix clang warning: using floating point absolute value function 'fabsf'

when argument is of integer type

/retroshare-gui/src/gui/statistics/BWGraph.cpp:83: warning: using
floating point absolute value function 'fabsf' when argument is of
integer type [-Wabsolute-value]
        if(!lst.empty() && fabsf(lst.back().first - ms) >
_update_period_msecs*1.2 )
This commit is contained in:
Phenom 2017-07-15 18:42:19 +02:00 committed by csoler
parent a0ac6b7ca0
commit 6ee65bc98a

View File

@ -80,7 +80,7 @@ void BWGraphSource::update()
{ {
std::list<std::pair<qint64,float> >& lst(_points[it->first]) ; std::list<std::pair<qint64,float> >& lst(_points[it->first]) ;
if(!lst.empty() && fabsf(lst.back().first - ms) > _update_period_msecs*1.2 ) if(!lst.empty() && fabsf((float)(lst.back().first - ms)) > _update_period_msecs*1.2 )
{ {
lst.push_back(std::make_pair(lst.back().first,0)) ; lst.push_back(std::make_pair(lst.back().first,0)) ;
lst.push_back(std::make_pair( ms,0)) ; lst.push_back(std::make_pair( ms,0)) ;