From 406e4287eb96e10ddfd22163f0e863e353470c68 Mon Sep 17 00:00:00 2001 From: Jeremie Guichard Date: Wed, 8 Mar 2017 13:41:41 +0700 Subject: Change calls to rint into lrint avoiding conversion warnings Using gcc option "-Wfloat-conversion" is useful to catch potential conversion errors (where lrint should be used). rint returns double and still raises the same warning, this is why this change updates all rint calls to lrint. In few places, where input type is a float, corresponding lrinf is used. Signed-off-by: Jeremie Guichard --- core/gpslocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/gpslocation.cpp') diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index d3f91ebaf..782d37226 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -157,8 +157,8 @@ void GpsLocation::newPosition(QGeoPositionInfo pos) gpsTracker gt; gt.when = pos.timestamp().toTime_t(); gt.when += gettimezoneoffset(gt.when); - gt.latitude.udeg = rint(pos.coordinate().latitude() * 1000000); - gt.longitude.udeg = rint(pos.coordinate().longitude() * 1000000); + gt.latitude.udeg = lrint(pos.coordinate().latitude() * 1000000); + gt.longitude.udeg = lrint(pos.coordinate().longitude() * 1000000); addFixToStorage(gt); } } -- cgit v1.2.3-70-g09d2