summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/planner.c2
-rw-r--r--core/plannernotes.c4
-rw-r--r--desktop-widgets/divelogexportdialog.cpp2
-rw-r--r--desktop-widgets/preferences/abstractpreferenceswidget.cpp4
-rw-r--r--desktop-widgets/preferences/abstractpreferenceswidget.h6
-rw-r--r--subsurface-desktop-main.cpp8
6 files changed, 13 insertions, 13 deletions
diff --git a/core/planner.c b/core/planner.c
index 8fb03015b..8ace46e35 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -610,7 +610,7 @@ bool enough_gas(int current_cylinder)
if (!cyl->start.mbar)
return true;
if (cyl->type.size.mliter)
- return (float)(cyl->end.mbar - prefs.reserve_gas) * cyl->type.size.mliter / 1000.0 > (float) cyl->deco_gas_used.mliter;
+ return (cyl->end.mbar - prefs.reserve_gas) / 1000.0 * cyl->type.size.mliter > cyl->deco_gas_used.mliter;
else
return true;
}
diff --git a/core/plannernotes.c b/core/plannernotes.c
index 2e38aaff9..1773705b4 100644
--- a/core/plannernotes.c
+++ b/core/plannernotes.c
@@ -401,8 +401,8 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d
translate("gettextFromC", "Warning:"),
translate("gettextFromC", "this is more gas than available in the specified cylinder!"));
else
- if ((float) cyl->end.mbar * cyl->type.size.mliter / 1000.0 / gas_compressibility_factor(&cyl->gasmix, cyl->end.mbar / 1000.0)
- < (float) cyl->deco_gas_used.mliter)
+ if (cyl->end.mbar / 1000.0 * cyl->type.size.mliter / gas_compressibility_factor(&cyl->gasmix, cyl->end.mbar / 1000.0)
+ < cyl->deco_gas_used.mliter)
snprintf(warning, sizeof(warning), "<br>&nbsp;&mdash; <span style='color: red;'>%s </span> %s",
translate("gettextFromC", "Warning:"),
translate("gettextFromC", "not enough reserve for gas sharing on ascent!"));
diff --git a/desktop-widgets/divelogexportdialog.cpp b/desktop-widgets/divelogexportdialog.cpp
index cb1745483..2af8d1b80 100644
--- a/desktop-widgets/divelogexportdialog.cpp
+++ b/desktop-widgets/divelogexportdialog.cpp
@@ -310,7 +310,7 @@ void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_o
int i;
int qty_cyl;
int qty_weight;
- float total_weight;
+ double total_weight;
if (need_pagebreak)
put_format(&buf, "\\vfill\\eject\n");
diff --git a/desktop-widgets/preferences/abstractpreferenceswidget.cpp b/desktop-widgets/preferences/abstractpreferenceswidget.cpp
index 1b2aeaae5..88228ee98 100644
--- a/desktop-widgets/preferences/abstractpreferenceswidget.cpp
+++ b/desktop-widgets/preferences/abstractpreferenceswidget.cpp
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
#include "abstractpreferenceswidget.h"
-AbstractPreferencesWidget::AbstractPreferencesWidget(const QString& name, const QIcon& icon, float positionHeight)
+AbstractPreferencesWidget::AbstractPreferencesWidget(const QString& name, const QIcon& icon, double positionHeight)
: QWidget(), _icon(icon), _name(name), _positionHeight(positionHeight)
{
}
@@ -16,7 +16,7 @@ QString AbstractPreferencesWidget::name() const
return _name;
}
-float AbstractPreferencesWidget::positionHeight() const
+double AbstractPreferencesWidget::positionHeight() const
{
return _positionHeight;
}
diff --git a/desktop-widgets/preferences/abstractpreferenceswidget.h b/desktop-widgets/preferences/abstractpreferenceswidget.h
index 7e303d182..7466fda16 100644
--- a/desktop-widgets/preferences/abstractpreferenceswidget.h
+++ b/desktop-widgets/preferences/abstractpreferenceswidget.h
@@ -8,10 +8,10 @@
class AbstractPreferencesWidget : public QWidget {
Q_OBJECT
public:
- AbstractPreferencesWidget(const QString& name, const QIcon& icon, float positionHeight);
+ AbstractPreferencesWidget(const QString& name, const QIcon& icon, double positionHeight);
QIcon icon() const;
QString name() const;
- float positionHeight() const;
+ double positionHeight() const;
/* gets the values from the preferences and should set the correct values in
* the interface */
@@ -26,6 +26,6 @@ signals:
private:
QIcon _icon;
QString _name;
- float _positionHeight;
+ double _positionHeight;
};
#endif
diff --git a/subsurface-desktop-main.cpp b/subsurface-desktop-main.cpp
index 5b8424487..c439179c8 100644
--- a/subsurface-desktop-main.cpp
+++ b/subsurface-desktop-main.cpp
@@ -152,7 +152,6 @@ void validateGL()
QOffscreenSurface surface;
QOpenGLFunctions *func;
const char *verChar;
- float verFloat;
surface.setFormat(ctx.format());
surface.create();
@@ -182,9 +181,10 @@ void validateGL()
"before running Subsurface!\n").toUtf8().data();
return;
}
- if (sscanf(verChar, "%f", &verFloat) == 1) {
- verMajor = (GLint)verFloat;
- verMinor = (GLint)roundf((verFloat - verMajor) * 10.f);
+ int min, maj;
+ if (sscanf(verChar, "%d.%d", &maj, &min) == 2) {
+ verMajor = (GLint)maj;
+ verMinor = (GLint)min;
}
}
// attempt to detect version using the newer API