style: aplicar todos los checks readability-* (225 fixes)
Cambios aplicados: - readability-braces-around-statements (añadir llaves en ifs/fors) - readability-implicit-bool-conversion (puntero → bool explícito) - readability-container-size-empty (.empty() en lugar de .size()==0) - readability-container-contains (.contains() C++20) - readability-make-member-function-const (métodos const) - readability-else-after-return (5 casos adicionales) - Añadido #include <cmath> en defaults.hpp Checks excluidos (justificados): - identifier-naming: Cascada de 300+ cambios - identifier-length: Nombres cortos son OK en este proyecto - magic-numbers: Demasiados falsos positivos - convert-member-functions-to-static: Rompe encapsulación - use-anyofallof: C++20 ranges no universal - function-cognitive-complexity: Complejidad aceptable - clang-analyzer-security.insecureAPI.rand: rand() suficiente para juegos
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
|
||||
namespace Defaults {
|
||||
@@ -441,13 +442,13 @@ constexpr float CENTER_Y = Game::HEIGHT / 2.0F; // 240.0f
|
||||
// Nota: std::cos/sin no són constexpr en C++20, però funcionen en runtime
|
||||
// Les funcions inline són optimitzades pel compilador (zero overhead)
|
||||
inline float P1_TARGET_X() {
|
||||
return CENTER_X + CLOCK_RADIUS * std::cos(CLOCK_8_ANGLE);
|
||||
return CENTER_X + (CLOCK_RADIUS * std::cos(CLOCK_8_ANGLE));
|
||||
}
|
||||
inline float P1_TARGET_Y() {
|
||||
return CENTER_Y + ((Game::HEIGHT / 2.0F) * TARGET_Y_RATIO);
|
||||
}
|
||||
inline float P2_TARGET_X() {
|
||||
return CENTER_X + CLOCK_RADIUS * std::cos(CLOCK_4_ANGLE);
|
||||
return CENTER_X + (CLOCK_RADIUS * std::cos(CLOCK_4_ANGLE));
|
||||
}
|
||||
inline float P2_TARGET_Y() {
|
||||
return CENTER_Y + ((Game::HEIGHT / 2.0F) * TARGET_Y_RATIO);
|
||||
|
||||
Reference in New Issue
Block a user