Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix signedness comparison errors #116

Merged
merged 4 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading