From 5927cf0e177d1804bcc0d9f95aa3fe1c4d0f6201 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sat, 28 Jul 2018 12:35:02 -0400 Subject: Use const where applicable --- src/core/file_sys/control_metadata.h | 2 +- src/core/loader/deconstructed_rom_directory.cpp | 2 +- src/yuzu/configuration/configure_gamelist.cpp | 8 ++++---- src/yuzu/game_list.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/file_sys/control_metadata.h b/src/core/file_sys/control_metadata.h index 9fc02612a..6582cc240 100644 --- a/src/core/file_sys/control_metadata.h +++ b/src/core/file_sys/control_metadata.h @@ -62,7 +62,7 @@ enum class Language : u8 { Chinese = 14, }; -static std::array LANGUAGE_NAMES = { +static constexpr std::array LANGUAGE_NAMES = { "AmericanEnglish", "BritishEnglish", "Japanese", "French", "German", "LatinAmericanSpanish", "Spanish", "Italian", "Dutch", diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index cc88a44b6..4a028250b 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp @@ -25,7 +25,7 @@ AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys // Icon FileSys::VirtualFile icon_file = nullptr; for (const auto& language : FileSys::LANGUAGE_NAMES) { - icon_file = dir->GetFile("icon_" + language + ".dat"); + icon_file = dir->GetFile("icon_" + std::string(language) + ".dat"); if (icon_file != nullptr) { icon_data = icon_file->ReadAllBytes(); break; diff --git a/src/yuzu/configuration/configure_gamelist.cpp b/src/yuzu/configuration/configure_gamelist.cpp index 072b3f96f..c81e716f9 100644 --- a/src/yuzu/configuration/configure_gamelist.cpp +++ b/src/yuzu/configuration/configure_gamelist.cpp @@ -12,9 +12,9 @@ ConfigureGameList::ConfigureGameList(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGameList) { ui->setupUi(this); - static std::vector> default_icon_sizes{ - std::make_pair(0, "None"), std::make_pair(24, "Small"), - std::make_pair(48, "Standard"), std::make_pair(96, "Large"), + static const std::vector> default_icon_sizes{ + std::make_pair(0, "None"), std::make_pair(32, "Small"), + std::make_pair(64, "Standard"), std::make_pair(128, "Large"), std::make_pair(256, "Full Size"), }; @@ -25,7 +25,7 @@ ConfigureGameList::ConfigureGameList(QWidget* parent) size.first); } - static std::vector row_text_names{ + static const std::vector row_text_names{ "Filename", "Filetype", "Title ID", diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 893c5f693..481d91be5 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -466,7 +466,7 @@ void GameListWorker::AddFstEntriesToGameList(const std::string& dir_path, unsign FileSys::VirtualFile icon_file = nullptr; for (const auto& language : FileSys::LANGUAGE_NAMES) { - icon_file = control_dir->GetFile("icon_" + language + ".dat"); + icon_file = control_dir->GetFile("icon_" + std::string(language) + ".dat"); if (icon_file != nullptr) { icon = icon_file->ReadAllBytes(); break; -- cgit v1.2.3