From a88e34b21b07f70123926fcb5c505d6afdf99807 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 24 Dec 2018 18:54:34 +0100 Subject: style/quality only No functional changes. - add `override' everywhere where missing - almost pass clang's `-Wweak-vtables' - avoid some float/double conversions - remove unused private members - make signedness conversions explicit - put stuff in right namespaces to aid analysis --- migration/migration.cpp | 13 ++++++++----- migration/migration.hpp | 10 ++-------- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'migration') diff --git a/migration/migration.cpp b/migration/migration.cpp index 45965bee..59ceee1a 100644 --- a/migration/migration.cpp +++ b/migration/migration.cpp @@ -24,9 +24,7 @@ using namespace options::globals; // individual migrations are run in the UI thread. they can be interactive if necessary. -namespace migrations { - -namespace detail { +namespace migrations::detail { static std::vector migration_list; static std::vector migration_thunks; @@ -180,9 +178,14 @@ std::vector migrator::run() return done; } -} +} // ns migrations::detail + +namespace migrations { + +migration::migration() = default; +migration::~migration() = default; -} // ns +} // ns migrations std::vector run_migrations() { diff --git a/migration/migration.hpp b/migration/migration.hpp index 42c8bead..4eaa959f 100644 --- a/migration/migration.hpp +++ b/migration/migration.hpp @@ -71,25 +71,19 @@ namespace detail { #define OPENTRACK_MIGRATION(type) \ MIGRATE_EXPANDED1(type, MIGRATE_EXPAND1(__COUNTER__)) -#ifdef Q_CREATOR_RUN -# pragma clang diagnostic ignored "-Wweak-vtables" -#endif - struct migration { - migration() = default; + migration(); migration(const migration&) = delete; migration& operator=(const migration&) = delete; - inline virtual ~migration(); + virtual ~migration(); virtual QString unique_date() const = 0; virtual QString name() const = 0; virtual bool should_run() const = 0; virtual void run() = 0; }; -inline migration::~migration() {} - } // ns migrations OTR_MIGRATION_EXPORT std::vector run_migrations(); -- cgit v1.2.3