Skip to content

Commit

Permalink
Clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
felix642 committed Dec 26, 2024
1 parent fb583c0 commit 9c8b94b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/fheroes2/castle/buildinginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ bool BuildingInfo::DialogBuyBuilding( bool buttons ) const

fheroes2::ButtonGroup buttonGroup( dialogRoi, Dialog::OK | Dialog::CANCEL );
fheroes2::ButtonBase & buttonOkay = buttonGroup.button( 0 );
fheroes2::ButtonBase & buttonCancel = buttonGroup.button( 1 );
const fheroes2::ButtonBase & buttonCancel = buttonGroup.button( 1 );

if ( BuildingStatus::ALLOW_BUILD != castle.CheckBuyBuilding( _buildingType ) ) {
buttonOkay.disable();
Expand Down
2 changes: 1 addition & 1 deletion src/fheroes2/castle/castle_town.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ int Castle::DialogBuyHero( const Heroes * hero ) const

fheroes2::ButtonGroup buttonGroup( dialogRoi, Dialog::OK | Dialog::CANCEL );
fheroes2::ButtonBase & buttonOkay = buttonGroup.button( 0 );
fheroes2::ButtonBase & buttonCancel = buttonGroup.button( 1 );
const fheroes2::ButtonBase & buttonCancel = buttonGroup.button( 1 );

if ( !AllowBuyHero() ) {
buttonOkay.disable();
Expand Down
2 changes: 0 additions & 2 deletions src/fheroes2/dialog/dialog_buyboat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@
#include "agg_image.h"
#include "cursor.h"
#include "dialog.h" // IWYU pragma: associated
#include "game_hotkeys.h"
#include "icn.h"
#include "image.h"
#include "localevent.h"
#include "math_base.h"
#include "payment.h"
#include "resource.h"
#include "screen.h"
#include "settings.h"
#include "translations.h"
#include "ui_button.h"
#include "ui_text.h"
Expand Down
4 changes: 2 additions & 2 deletions src/fheroes2/gui/ui_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ namespace fheroes2
switch ( buttonTypes ) {
case Dialog::YES | Dialog::NO: {
const int32_t horizontalFreeSpace = area.width - AGG::GetICN( buttonYesIcnID, 0 ).width() - AGG::GetICN( buttonNoIcnID, 0 ).width();
const int32_t padding = static_cast<int32_t>( 0.25f * horizontalFreeSpace );
const int32_t padding = static_cast<int32_t>( 0.25F * static_cast<float>( horizontalFreeSpace ) );

offset.x = area.x + padding;
offset.y = area.y + area.height - AGG::GetICN( buttonYesIcnID, 0 ).height();
Expand All @@ -440,7 +440,7 @@ namespace fheroes2

case Dialog::OK | Dialog::CANCEL: {
const int32_t horizontalFreeSpace = area.width - AGG::GetICN( buttonOkayIcnID, 0 ).width() - AGG::GetICN( buttonCancelIcnID, 0 ).width();
const int32_t padding = static_cast<int32_t>( 0.25f * horizontalFreeSpace );
const int32_t padding = static_cast<int32_t>( 0.25F * static_cast<float>( horizontalFreeSpace ) );

offset.x = area.x + padding;
offset.y = area.y + area.height - AGG::GetICN( buttonOkayIcnID, 0 ).height();
Expand Down

0 comments on commit 9c8b94b

Please sign in to comment.