Skip to content

Commit a563b65

Browse files
Fix compiler warnings (#8098)
1 parent c62a19e commit a563b65

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Source/control.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,6 @@ void PrintFloatingInfo(const Surface &out)
523523

524524
int spriteH = GetHoverSpriteHeight();
525525
int anchorY = floatingInfoBox.position.y;
526-
int boxH = floatingInfoBox.size.height;
527-
int yAbove = anchorY - spriteH - boxH - vPadding;
528-
int yBelow = anchorY + verticalSpacing / 2 + vPadding;
529526

530527
// Prevent the floating info box from going off-screen vertically
531528
floatingInfoBox.position.y = ClampAboveOrBelow(anchorY, spriteH, floatingInfoBox.size.height, vPadding, verticalSpacing);

Source/panels/partypanel.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ PartySpriteOffset GetClassSpriteOffset(HeroClass hClass)
120120
case HeroClass::Barbarian:
121121
hClass = HeroClass::Warrior;
122122
break;
123+
default:
124+
break;
123125
}
124126

125127
return ClassSpriteOffsets[static_cast<size_t>(hClass)];
@@ -230,7 +232,7 @@ void DrawPartyMemberInfoPanel(const Surface &out)
230232
playerPortraitSprite,
231233
portraitPos);
232234

233-
if ((player.getId() + 1) < (*PlayerTags).numSprites()) {
235+
if ((player.getId() + 1U) < (*PlayerTags).numSprites()) {
234236
// Draw the player tag
235237
int tagWidth = (*PlayerTags)[player.getId() + 1].width();
236238
RenderClxSprite(
@@ -292,9 +294,9 @@ void DrawPartyMemberInfoPanel(const Surface &out)
292294

293295
bool DidRightClickPartyPortrait()
294296
{
295-
for (int i = 0; i < sizeof(PortraitFrameRects) / sizeof(PortraitFrameRects[0]); i++) {
297+
for (size_t i = 0; i < sizeof(PortraitFrameRects) / sizeof(PortraitFrameRects[0]); i++) {
296298
if (PortraitFrameRects[i].contains(MousePosition)) {
297-
RightClickedPortraitIndex = i;
299+
RightClickedPortraitIndex = static_cast<int>(i);
298300
InspectingFromPartyPanel = true;
299301
return true;
300302
}

Source/player.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,6 @@ ClxSprite GetPlayerPortraitSprite(Player &player)
20572057
szCel = "as";
20582058

20592059
player_graphic graphic = player_graphic::Stand;
2060-
int spriteIndex = 0;
20612060
if (player._pHitPoints <= 0) {
20622061
if (animWeaponId == PlayerWeaponGraphic::Unarmed) {
20632062
szCel = "dt";

0 commit comments

Comments
 (0)