diff options
author | flow <thiagodonato300@gmail.com> | 2022-04-19 20:19:51 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-05-23 14:42:28 -0300 |
commit | ba50765c306d2907e411bc0ed9a10d990cf42fd3 (patch) | |
tree | 035ff639e9e48652e46bebffa6945ceb35ba1f11 /launcher/modplatform/packwiz | |
parent | d7f6b3699074b268fd554bd1eb9da68f1e533355 (diff) | |
download | PrismLauncher-ba50765c306d2907e411bc0ed9a10d990cf42fd3.tar.gz PrismLauncher-ba50765c306d2907e411bc0ed9a10d990cf42fd3.tar.bz2 PrismLauncher-ba50765c306d2907e411bc0ed9a10d990cf42fd3.zip |
tidy: apply clang-tidy to some files
Mostly the ones created in this PR + Mod.h / Mod.cpp / ModDetails.h
Diffstat (limited to 'launcher/modplatform/packwiz')
-rw-r--r-- | launcher/modplatform/packwiz/Packwiz.cpp | 9 | ||||
-rw-r--r-- | launcher/modplatform/packwiz/Packwiz_test.cpp | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/launcher/modplatform/packwiz/Packwiz.cpp b/launcher/modplatform/packwiz/Packwiz.cpp index 8fd74a3e..978be462 100644 --- a/launcher/modplatform/packwiz/Packwiz.cpp +++ b/launcher/modplatform/packwiz/Packwiz.cpp @@ -6,13 +6,13 @@ #include "toml.h" -#include "modplatform/ModIndex.h" #include "minecraft/mod/Mod.h" +#include "modplatform/ModIndex.h" namespace Packwiz { // Helpers -static inline QString indexFileName(QString const& mod_name) +static inline auto indexFileName(QString const& mod_name) -> QString { if(mod_name.endsWith(".toml")) return mod_name; @@ -161,8 +161,9 @@ auto V1::getIndexForMod(QDir& index_dir, QString& index_file_name) -> Mod return {}; } - toml_table_t* table; + toml_table_t* table = nullptr; + // NOLINTNEXTLINE(modernize-avoid-c-arrays) char errbuf[200]; table = toml_parse(index_file.readAll().data(), errbuf, sizeof(errbuf)); @@ -201,7 +202,7 @@ auto V1::getIndexForMod(QDir& index_dir, QString& index_file_name) -> Mod return {}; } - toml_table_t* mod_provider_table; + toml_table_t* mod_provider_table = nullptr; if ((mod_provider_table = toml_table_in(update_table, ProviderCaps::providerName(Provider::FLAME)))) { mod.provider = Provider::FLAME; mod.file_id = intEntry(mod_provider_table, "file-id"); diff --git a/launcher/modplatform/packwiz/Packwiz_test.cpp b/launcher/modplatform/packwiz/Packwiz_test.cpp index 2e61c167..08de332d 100644 --- a/launcher/modplatform/packwiz/Packwiz_test.cpp +++ b/launcher/modplatform/packwiz/Packwiz_test.cpp @@ -1,8 +1,8 @@ #include <QTemporaryDir> #include <QTest> -#include "TestUtil.h" #include "Packwiz.h" +#include "TestUtil.h" class PackwizTest : public QObject { Q_OBJECT |