From 1fa81ac5dc9259b7368e0487e0424c76bc87053e Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Tue, 21 Jun 2022 14:42:59 +0200 Subject: Fix a few clang-tidy/GCC warnings --- lib/database.cpp | 10 +++++----- lib/events/accountdataevents.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/database.cpp b/lib/database.cpp index 193ff54e..ed7bd794 100644 --- a/lib/database.cpp +++ b/lib/database.cpp @@ -28,10 +28,10 @@ Database::Database(const QString& matrixId, const QString& deviceId, QObject* pa database().open(); switch(version()) { - case 0: migrateTo1(); - case 1: migrateTo2(); - case 2: migrateTo3(); - case 3: migrateTo4(); + case 0: migrateTo1(); [[fallthrough]]; + case 1: migrateTo2(); [[fallthrough]]; + case 2: migrateTo3(); [[fallthrough]]; + case 3: migrateTo4(); } } @@ -39,7 +39,7 @@ int Database::version() { auto query = execute(QStringLiteral("PRAGMA user_version;")); if (query.next()) { - bool ok; + bool ok = false; int value = query.value(0).toInt(&ok); qCDebug(DATABASE) << "Database version" << value; if (ok) diff --git a/lib/events/accountdataevents.h b/lib/events/accountdataevents.h index ec2f64e3..24c3353c 100644 --- a/lib/events/accountdataevents.h +++ b/lib/events/accountdataevents.h @@ -32,7 +32,7 @@ struct JsonObjectConverter { if (orderJv.isDouble()) rec.order = fromJson(orderJv); if (orderJv.isString()) { - bool ok; + bool ok = false; rec.order = orderJv.toString().toFloat(&ok); if (!ok) rec.order = none; -- cgit v1.2.3