From 881a9cac4e8f32cc2b7c2061adedb1f4c35e6ce5 Mon Sep 17 00:00:00 2001 From: Michael Werle Date: Wed, 17 Aug 2022 10:20:11 +0900 Subject: [PATCH] cleanup: fix compiler warnings in recently edited files. Replace NULL -> nullptr Remove spurious semicolon Signed-off-by: Michael WERLE --- core/settings/qPrefDisplay.h | 2 +- desktop-widgets/mapwidget.cpp | 6 +++--- qt-models/maplocationmodel.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/settings/qPrefDisplay.h b/core/settings/qPrefDisplay.h index a00241386..91311cd01 100644 --- a/core/settings/qPrefDisplay.h +++ b/core/settings/qPrefDisplay.h @@ -42,7 +42,7 @@ public: static double font_size() { return prefs.font_size; } static double mobile_scale() { return prefs.mobile_scale; } static bool display_invalid_dives() { return prefs.display_invalid_dives; } - static QString lastDir() { return st_lastDir; ; } + static QString lastDir() { return st_lastDir; } static bool show_developer() { return prefs.show_developer; } static QString theme() { return st_theme; } static QPointF tooltip_position() { return st_tooltip_position; } diff --git a/desktop-widgets/mapwidget.cpp b/desktop-widgets/mapwidget.cpp index 254ffe903..a4ca93fd9 100644 --- a/desktop-widgets/mapwidget.cpp +++ b/desktop-widgets/mapwidget.cpp @@ -19,7 +19,7 @@ static bool isReady = false; #define CHECK_IS_READY_RETURN_VOID() \ if (!isReady) return -MapWidget *MapWidget::m_instance = NULL; +MapWidget *MapWidget::m_instance = nullptr; MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent) { @@ -128,12 +128,12 @@ void MapWidget::divesChanged(const QVector &, DiveField field) // the reference is cleared. Sad. MapWidget::~MapWidget() { - m_instance = NULL; + m_instance = nullptr; } MapWidget *MapWidget::instance() { - if (m_instance == NULL) + if (m_instance == nullptr) m_instance = new MapWidget(); return m_instance; } diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp index ab1764f69..3ea24280a 100644 --- a/qt-models/maplocationmodel.cpp +++ b/qt-models/maplocationmodel.cpp @@ -222,7 +222,7 @@ MapLocation *MapLocationModel::getMapLocation(const struct dive_site *ds) if (ds == location->divesite) return location; } - return NULL; + return nullptr; } void MapLocationModel::diveSiteChanged(struct dive_site *ds, int field)