tidy: apply clang-tidy to some files

Mostly the ones created in this PR + Mod.h / Mod.cpp / ModDetails.h
This commit is contained in:
flow
2022-04-19 20:19:51 -03:00
committed by flow
parent d7f6b36990
commit ba50765c30
6 changed files with 38 additions and 37 deletions

View File

@ -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");

View File

@ -1,8 +1,8 @@
#include <QTemporaryDir>
#include <QTest>
#include "TestUtil.h"
#include "Packwiz.h"
#include "TestUtil.h"
class PackwizTest : public QObject {
Q_OBJECT