summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/configuredivecomputerthreads.cpp2
-rw-r--r--core/gpslocation.cpp8
-rw-r--r--core/qthelper.cpp6
3 files changed, 8 insertions, 8 deletions
diff --git a/core/configuredivecomputerthreads.cpp b/core/configuredivecomputerthreads.cpp
index 9dd83a6ea..a2b54e0c7 100644
--- a/core/configuredivecomputerthreads.cpp
+++ b/core/configuredivecomputerthreads.cpp
@@ -1566,7 +1566,7 @@ void DeviceThread::event_cb(dc_device_t *device, dc_event_type_t event, const vo
switch (event) {
case DC_EVENT_PROGRESS:
- dt->progressCB(100.0 * (double)progress->current / (double)progress->maximum);
+ dt->progressCB(lrint(100.0 * (double)progress->current / (double)progress->maximum));
break;
default:
emit dt->error("Unexpected event recived");
diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp
index 782d37226..ead072772 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 = lrint(pos.coordinate().latitude() * 1000000);
- gt.longitude.udeg = lrint(pos.coordinate().longitude() * 1000000);
+ gt.latitude.udeg = (int)(pos.coordinate().latitude() * 1000000);
+ gt.longitude.udeg = (int)(pos.coordinate().longitude() * 1000000);
addFixToStorage(gt);
}
}
@@ -612,8 +612,8 @@ void GpsLocation::downloadFromServer()
struct gpsTracker gt;
gt.when = timestamp.toMSecsSinceEpoch() / 1000;
- gt.latitude.udeg = latitude.toDouble() * 1000000;
- gt.longitude.udeg = longitude.toDouble() * 1000000;
+ gt.latitude.udeg = (int)(latitude.toDouble() * 1000000);
+ gt.longitude.udeg = (int)(longitude.toDouble() * 1000000);
gt.name = name;
// add this GPS fix to the QMap and the settings (remove existing fix at the same timestamp first)
if (m_trackers.keys().contains(gt.when)) {
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index d6de2ebf9..943ad00b6 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -775,7 +775,7 @@ int parseDurationToSeconds(const QString &text)
hours = "0";
minutes = numOnly;
}
- secs = hours.toDouble() * 3600 + minutes.toDouble() * 60 + seconds.toDouble();
+ secs = lrint(hours.toDouble() * 3600 + minutes.toDouble() * 60 + seconds.toDouble());
return secs;
}
@@ -788,7 +788,7 @@ int parseLengthToMm(const QString &text)
return 0;
double number = numOnly.toDouble();
if (text.contains(QObject::tr("m"), Qt::CaseInsensitive)) {
- mm = number * 1000;
+ mm = lrint(number * 1000);
} else if (text.contains(QObject::tr("ft"), Qt::CaseInsensitive)) {
mm = feet_to_mm(number);
} else {
@@ -797,7 +797,7 @@ int parseLengthToMm(const QString &text)
mm = feet_to_mm(number);
break;
case units::METERS:
- mm = number * 1000;
+ mm = lrint(number * 1000);
break;
default:
mm = 0;