From 51aba0d5b37a0434a97aa9008cfd6912389c898e Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 24 Dec 2024 22:25:51 -0800 Subject: [PATCH 1/4] fix signedness comparison errors --- GUI.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/GUI.cpp b/GUI.cpp index 5ebb6383..4fd3d1e5 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -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 &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]); } } From 92e4b2c4be7408bbb7a56d90c5b866c3014bc8e4 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 24 Dec 2024 23:33:54 -0800 Subject: [PATCH 2/4] update pre-commit versions --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7a3042c..aec2bc74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 From 599ee8fdc33a75901d058f4b05327ff691f00c83 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Tue, 24 Dec 2024 23:47:28 -0800 Subject: [PATCH 3/4] include header for std::min on windows --- GUI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/GUI.cpp b/GUI.cpp index 4fd3d1e5..cb7c3fd5 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -1,4 +1,5 @@ #include +#include #include #include "common.h" From 0bde74bd2ea47544f12b04f02f43afea78e3c5f8 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Wed, 25 Dec 2024 00:09:56 -0800 Subject: [PATCH 4/4] get windows to accept std::min --- GUI.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GUI.cpp b/GUI.cpp index cb7c3fd5..d2e369fd 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -1,3 +1,7 @@ +#ifndef LINUX_BUILD +# define NOMINMAX +#endif + #include #include #include