Skip to content

Commit

Permalink
Merge pull request #116 from myk002/myk_fix_signedness
Browse files Browse the repository at this point in the history
fix signedness comparison errors
  • Loading branch information
myk002 authored Dec 25, 2024
2 parents a915e5a + 0bde74b commit b842fbd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
repos:
# shared across repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -19,11 +19,11 @@ repos:
args: ['--fix=lf']
- id: trailing-whitespace
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.2
rev: 0.30.0
hooks:
- id: check-github-workflows
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.13
rev: v1.5.5
hooks:
- id: forbid-tabs
- id: remove-tabs
Expand Down
12 changes: 9 additions & 3 deletions GUI.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#ifndef LINUX_BUILD
# define NOMINMAX
#endif

#include <assert.h>
#include <algorithm>
#include <vector>

#include "common.h"
Expand Down Expand Up @@ -333,10 +338,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 b842fbd

Please sign in to comment.