clang-tidy (amb el fuck de que no feien bona parella el clang de macos i el tidy de llvm)

This commit is contained in:
2026-03-23 12:03:07 +01:00
parent 3ca744ee46
commit a1d17ccf99
72 changed files with 487 additions and 484 deletions

View File

@@ -57,7 +57,7 @@ void MenuRenderer::render(const ServiceMenu* menu_state) {
// Dibuja la sombra
if (param.service_menu.drop_shadow) {
SDL_FRect shadow_rect = {rect_.x + 5, rect_.y + 5, rect_.w, rect_.h};
SDL_FRect shadow_rect = {.x = rect_.x + 5, .y = rect_.y + 5, .w = rect_.w, .h = rect_.h};
SDL_SetRenderDrawColor(Screen::get()->getRenderer(), 0, 0, 0, 64);
SDL_RenderFillRect(Screen::get()->getRenderer(), &shadow_rect);
}
@@ -203,7 +203,7 @@ auto MenuRenderer::calculateNewRect(const ServiceMenu* menu_state) -> SDL_FRect
lower_height_ = ((!display_options.empty() ? display_options.size() - 1 : 0) * (options_height_ + options_padding_)) + options_height_ + (lower_padding_ * 2);
height_ = std::min(upper_height_ + lower_height_, max_menu_height_);
SDL_FRect new_rect = {0, 0, (float)width_, (float)height_};
SDL_FRect new_rect = {.x = 0, .y = 0, .w = static_cast<float>(width_), .h = static_cast<float>(height_)};
// La posición x, y se establecerá en `updatePosition`
return new_rect;
@@ -286,8 +286,8 @@ void MenuRenderer::updateResizeAnimation(float delta_time) {
updatePosition();
} else {
float progress = easeOut(resize_animation_.elapsed / duration);
rect_.w = resize_animation_.start_width + (resize_animation_.target_width - resize_animation_.start_width) * progress;
rect_.h = resize_animation_.start_height + (resize_animation_.target_height - resize_animation_.start_height) * progress;
rect_.w = resize_animation_.start_width + ((resize_animation_.target_width - resize_animation_.start_width) * progress);
rect_.h = resize_animation_.start_height + ((resize_animation_.target_height - resize_animation_.start_height) * progress);
updatePosition();
}
options_y_ = rect_.y + upper_height_ + lower_padding_;
@@ -296,8 +296,8 @@ void MenuRenderer::updateResizeAnimation(float delta_time) {
void MenuRenderer::updatePosition() {
switch (position_mode_) {
case PositionMode::CENTERED:
rect_.x = anchor_x_ - rect_.w / 2.0F;
rect_.y = anchor_y_ - rect_.h / 2.0F;
rect_.x = anchor_x_ - (rect_.w / 2.0F);
rect_.y = anchor_y_ - (rect_.h / 2.0F);
break;
case PositionMode::FIXED:
rect_.x = anchor_x_;
@@ -310,7 +310,7 @@ void MenuRenderer::updatePosition() {
// Resto de métodos (sin cambios significativos)
void MenuRenderer::precalculateMenuWidths(const std::vector<std::unique_ptr<MenuOption>>& all_options, const ServiceMenu* menu_state) {
void MenuRenderer::precalculateMenuWidths(const std::vector<std::unique_ptr<MenuOption>>& all_options, const ServiceMenu* menu_state) { // NOLINT(readability-named-parameter)
for (int& w : group_menu_widths_) {
w = ServiceMenu::MIN_WIDTH;
}
@@ -341,7 +341,7 @@ void MenuRenderer::precalculateMenuWidths(const std::vector<std::unique_ptr<Menu
if (menu_state->getCurrentGroupAlignment() == ServiceMenu::GroupAlignment::LEFT) {
total_width += ServiceMenu::MIN_GAP_OPTION_VALUE + max_value_width;
}
group_menu_widths_[group] = std::min(std::max((int)ServiceMenu::MIN_WIDTH, (int)total_width), static_cast<int>(max_menu_width_));
group_menu_widths_[group] = std::min(std::max(static_cast<int>(ServiceMenu::MIN_WIDTH), static_cast<int>(total_width)), static_cast<int>(max_menu_width_));
}
}