clang-tidy

This commit is contained in:
2025-08-10 14:13:11 +02:00
parent 0204a8896a
commit c727cb6541
21 changed files with 255 additions and 209 deletions

View File

@@ -315,14 +315,14 @@ auto Input::handleEvent(const SDL_Event &event) -> std::string {
case SDL_EVENT_GAMEPAD_REMOVED:
return removeGamepad(event.gdevice.which);
}
return std::string();
return {};
}
auto Input::addGamepad(int device_index) -> std::string {
SDL_Gamepad *pad = SDL_OpenGamepad(device_index);
if (pad == nullptr) {
std::cerr << "Error al abrir el gamepad: " << SDL_GetError() << std::endl;
return std::string();
return {};
}
auto gamepad = std::make_shared<Gamepad>(pad);
@@ -344,10 +344,9 @@ auto Input::removeGamepad(SDL_JoystickID id) -> std::string {
std::cout << "Gamepad disconnected (" << name << ")" << std::endl;
gamepads_.erase(it);
return name + " DISCONNECTED";
} else {
std::cerr << "No se encontró el gamepad con ID " << id << std::endl;
return {};
}
std::cerr << "No se encontró el gamepad con ID " << id << std::endl;
return {};
}
void Input::printConnectedGamepads() const {