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:
2025-12-18 20:16:46 +01:00
parent fdfb84170f
commit 7f6af6dd00
42 changed files with 178 additions and 178 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ std::shared_ptr<Shape> ShapeLoader::load(const std::string& filename) {
// Normalize path: "ship.shp" → "shapes/ship.shp"
// "logo/letra_j.shp" → "shapes/logo/letra_j.shp"
std::string normalized = filename;
if (normalized.find("shapes/") != 0) {
if (!normalized.starts_with("shapes/")) {
// Doesn't start with "shapes/", so add it
normalized = "shapes/" + normalized;
}
@@ -75,7 +75,7 @@ std::string ShapeLoader::resolve_path(const std::string& filename) {
}
// Si ja conté el prefix base_path, usar-lo directament
if (filename.find(base_path_) == 0) {
if (filename.starts_with(base_path_)) {
return filename;
}