Some minor code cleanup.

This commit is contained in:
Leon Styhre 2022-01-29 18:16:30 +01:00
parent 336ff3ea7c
commit 0ca2b62edf
5 changed files with 32 additions and 32 deletions

View file

@ -756,9 +756,9 @@ SystemData* CollectionSystemsManager::getSystemToView(SystemData* sys)
FileData* CollectionSystemsManager::updateCollectionFolderMetadata(SystemData* sys)
{
FileData* rootFolder = sys->getRootFolder();
FileFilterIndex* idx = rootFolder->getSystem()->getIndex();
std::string desc = "This collection is empty";
FileData* rootFolder {sys->getRootFolder()};
FileFilterIndex* idx {rootFolder->getSystem()->getIndex()};
std::string desc {"This collection is empty"};
std::vector<FileData*> gamesList;
std::vector<FileData*> gamesListRandom;
@ -772,7 +772,7 @@ FileData* CollectionSystemsManager::updateCollectionFolderMetadata(SystemData* s
gamesList = rootFolder->getChildrenListToDisplay();
}
unsigned int gameCount = static_cast<unsigned int>(gamesList.size());
unsigned int gameCount {static_cast<unsigned int>(gamesList.size())};
// If there is more than 1 game in the collection, then randomize the example game names.
if (gameCount > 1) {
@ -785,7 +785,7 @@ FileData* CollectionSystemsManager::updateCollectionFolderMetadata(SystemData* s
std::uniform_int_distribution<int> uniform_dist(0, gameCount - 1 - i);
target = uniform_dist(engine);
gamesListRandom.push_back(gamesList[target]);
std::vector<FileData*>::iterator it = (gamesList.begin() + target);
std::vector<FileData*>::iterator it {(gamesList.begin() + target)};
gamesList.erase(it);
if (gamesList.size() == 0)
break;

View file

@ -134,7 +134,7 @@ public:
const bool isEditing() const { return mIsEditingCustom; }
const std::string& getEditingCollection() const { return mEditingCollection; }
inline static std::string myCollectionsName = "collections";
static inline std::string myCollectionsName = "collections";
private:
CollectionSystemsManager() noexcept;

View file

@ -118,26 +118,26 @@ public:
// Font Awesome symbols.
#if defined(_MSC_VER) // MSVC compiler.
inline static const std::string CONTROLLER_CHAR {Utils::String::wideStringToString(L"\uf11b")};
inline static const std::string CROSSEDCIRCLE_CHAR {
static inline const std::string CONTROLLER_CHAR {Utils::String::wideStringToString(L"\uf11b")};
static inline const std::string CROSSEDCIRCLE_CHAR {
Utils::String::wideStringToString(L"\uf05e")};
inline static const std::string EXCLAMATION_CHAR {Utils::String::wideStringToString(L"\uf06a")};
inline static const std::string FAVORITE_CHAR {Utils::String::wideStringToString(L"\uf005")};
inline static const std::string FILTER_CHAR {Utils::String::wideStringToString(L"\uf0b0")};
inline static const std::string FOLDER_CHAR {Utils::String::wideStringToString(L"\uf07C")};
inline static const std::string GEAR_CHAR {Utils::String::wideStringToString(L"\uf013")};
inline static const std::string KEYBOARD_CHAR {Utils::String::wideStringToString(L"\uf11c")};
inline static const std::string TICKMARK_CHAR {Utils::String::wideStringToString(L"\uf14A")};
static inline const std::string EXCLAMATION_CHAR {Utils::String::wideStringToString(L"\uf06a")};
static inline const std::string FAVORITE_CHAR {Utils::String::wideStringToString(L"\uf005")};
static inline const std::string FILTER_CHAR {Utils::String::wideStringToString(L"\uf0b0")};
static inline const std::string FOLDER_CHAR {Utils::String::wideStringToString(L"\uf07C")};
static inline const std::string GEAR_CHAR {Utils::String::wideStringToString(L"\uf013")};
static inline const std::string KEYBOARD_CHAR {Utils::String::wideStringToString(L"\uf11c")};
static inline const std::string TICKMARK_CHAR {Utils::String::wideStringToString(L"\uf14A")};
#else
inline static const std::string CONTROLLER_CHAR {"\uf11b"};
inline static const std::string CROSSEDCIRCLE_CHAR {"\uf05e"};
inline static const std::string EXCLAMATION_CHAR {"\uf06a"};
inline static const std::string FAVORITE_CHAR {"\uf005"};
inline static const std::string FILTER_CHAR {"\uf0b0"};
inline static const std::string FOLDER_CHAR {"\uf07C"};
inline static const std::string GEAR_CHAR {"\uf013"};
inline static const std::string KEYBOARD_CHAR {"\uf11c"};
inline static const std::string TICKMARK_CHAR {"\uf14a"};
static inline const std::string CONTROLLER_CHAR {"\uf11b"};
static inline const std::string CROSSEDCIRCLE_CHAR {"\uf05e"};
static inline const std::string EXCLAMATION_CHAR {"\uf06a"};
static inline const std::string FAVORITE_CHAR {"\uf005"};
static inline const std::string FILTER_CHAR {"\uf0b0"};
static inline const std::string FOLDER_CHAR {"\uf07C"};
static inline const std::string GEAR_CHAR {"\uf013"};
static inline const std::string KEYBOARD_CHAR {"\uf11c"};
static inline const std::string TICKMARK_CHAR {"\uf14a"};
#endif
private:

View file

@ -41,8 +41,8 @@ public:
bool getHasAudioDevice() { return sHasAudioDevice; }
inline static SDL_AudioDeviceID sAudioDevice = 0;
inline static SDL_AudioSpec sAudioFormat;
static inline SDL_AudioDeviceID sAudioDevice {0};
static inline SDL_AudioSpec sAudioFormat;
private:
AudioManager() noexcept;
@ -50,10 +50,10 @@ private:
static void mixAudio(void* unused, Uint8* stream, int len);
static void mixAudio2(void* unused, Uint8* stream, int len);
inline static SDL_AudioStream* sConversionStream;
inline static std::vector<std::shared_ptr<Sound>> sSoundVector;
inline static std::atomic<bool> sMuteStream = false;
inline static bool sHasAudioDevice = true;
static inline SDL_AudioStream* sConversionStream;
static inline std::vector<std::shared_ptr<Sound>> sSoundVector;
static inline std::atomic<bool> sMuteStream = false;
static inline bool sHasAudioDevice = true;
};
#endif // ES_CORE_AUDIO_MANAGER_H

View file

@ -57,8 +57,8 @@ private:
{LogWarning, "Warn"},
{LogInfo, "Info"},
{LogDebug, "Debug"}};
inline static std::ofstream sFile;
inline static LogLevel sReportingLevel = LogInfo;
static inline std::ofstream sFile;
static inline LogLevel sReportingLevel = LogInfo;
LogLevel mMessageLevel;
};