style: aplicar checks modernize-* (215 fixes)
Cambios aplicados:
- [[nodiscard]] añadido a funciones que retornan valores
- .starts_with() en lugar de .find() == 0
- Inicializadores designados {.x=0, .y=0}
- auto en castings obvios
- = default para constructores triviales
- Funciones deleted movidas a public
- std::numbers::pi_v<float> (C++20)
Checks excluidos:
- use-trailing-return-type: Estilo controversial
- avoid-c-arrays: Arrays C aceptables en ciertos contextos
This commit is contained in:
@@ -395,7 +395,7 @@ static void loadAudioConfigFromYaml(const fkyaml::node& yaml) {
|
||||
|
||||
if (aud.contains("volume")) {
|
||||
try {
|
||||
float val = aud["volume"].get_value<float>();
|
||||
auto val = aud["volume"].get_value<float>();
|
||||
audio.volume = (val >= 0.0F && val <= 1.0F) ? val : Defaults::Audio::VOLUME;
|
||||
} catch (...) {
|
||||
audio.volume = Defaults::Audio::VOLUME;
|
||||
@@ -415,7 +415,7 @@ static void loadAudioConfigFromYaml(const fkyaml::node& yaml) {
|
||||
|
||||
if (mus.contains("volume")) {
|
||||
try {
|
||||
float val = mus["volume"].get_value<float>();
|
||||
auto val = mus["volume"].get_value<float>();
|
||||
audio.music.volume = (val >= 0.0F && val <= 1.0F) ? val : Defaults::Music::VOLUME;
|
||||
} catch (...) {
|
||||
audio.music.volume = Defaults::Music::VOLUME;
|
||||
@@ -436,7 +436,7 @@ static void loadAudioConfigFromYaml(const fkyaml::node& yaml) {
|
||||
|
||||
if (snd.contains("volume")) {
|
||||
try {
|
||||
float val = snd["volume"].get_value<float>();
|
||||
auto val = snd["volume"].get_value<float>();
|
||||
audio.sound.volume = (val >= 0.0F && val <= 1.0F) ? val : Defaults::Sound::VOLUME;
|
||||
} catch (...) {
|
||||
audio.sound.volume = Defaults::Sound::VOLUME;
|
||||
|
||||
Reference in New Issue
Block a user