Skip to content

Commit

Permalink
fix signedness comparison errors
Browse files Browse the repository at this point in the history
  • Loading branch information
myk002 committed Dec 25, 2024
1 parent a915e5a commit 51aba0d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,10 +333,11 @@ void draw_report_border(const ALLEGRO_FONT *font, float x, float y, int flags, c

void draw_announcements(const ALLEGRO_FONT *font, float x, float y, int flags, std::vector<df::report *> &announcements)
{
int maxAnnouncements = std::min(10, (int)announcements.size());
for (int i = announcements.size() - 1; i >= (announcements.size() - maxAnnouncements) && announcements[i]->duration > 0; i--)
const int numAnnouncements = (int)announcements.size();
const int maxAnnouncements = std::min(10, numAnnouncements);
for (int i = numAnnouncements - 1; i >= (numAnnouncements - maxAnnouncements) && announcements[i]->duration > 0; i--)
{
int offset = ((announcements.size() - 1) - i) * al_get_font_line_height(font);
int offset = ((numAnnouncements - 1) - i) * al_get_font_line_height(font);
draw_report_border(font, x, y - offset, flags, announcements[i]);
}
}
Expand Down

0 comments on commit 51aba0d

Please sign in to comment.