From a7f4301fbee780f3644658b9dfe6784a23708d44 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 31 Mar 2024 10:27:26 +0000 Subject: [PATCH 1/6] Revert "[GitHub Actions] Remove build test" This reverts commit caa2ce036a9f6461ccdb7ef8306edbd126dd4081. The explanation is wrong; CI was failing due to a regression in its configuration introduced in 07d0ddde157ebb403a70a79f3104be1670ff2abf. GitHub does not provide any "ubuntu-23.10" runners. The list of runners provided by GitHub is here: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories --- .github/workflows/build.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1d2f55d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,10 @@ +name: test +on: [ push, pull_request ] + +jobs: + test: + runs-on: ubuntu-23.10 + steps: + - uses: actions/checkout@v4 + - run: sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev + - run: make MAINT=1 From 2c1efd10cc759251d64ee30a5ce5b746b0e4d890 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 31 Mar 2024 20:29:42 +0000 Subject: [PATCH 2/6] [GitHub Actions] Fix the runner label See previous commit's commit message for details. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d2f55d..a9ac166 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ on: [ push, pull_request ] jobs: test: - runs-on: ubuntu-23.10 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - run: sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev From c38cea9fa0a19d93c35196c2dfe2cf5d0ad958f3 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 31 Mar 2024 20:31:00 +0000 Subject: [PATCH 3/6] [GitHub Actions] Update Apt cache before installing dependencies --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9ac166..cc4b655 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,5 +6,5 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - run: sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev + - run: sudo apt-get update && sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev - run: make MAINT=1 From 7916a39c15ca1a6a0c4b45909493e7333ff66c5c Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 31 Mar 2024 20:34:44 +0000 Subject: [PATCH 4/6] [SDL/internal] Remove unused HorzLineEdge parameter of FixUpLineJoiningGlitch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: sdl/console.cpp: In function ‘void FixUpLineJoiningGlitch(SDL_Surface*, Uint8*, bool)’: sdl/console.cpp:239:59: error: unused parameter ‘HorzLineEdge’ [-Werror=unused-parameter] 239 | static void FixUpLineJoiningGlitch(SDL_Surface *s, Uint8 *HorzLineEdge, bool useRightEdge) | ~~~~~~~^~~~~~~~~~~~ --- sdl/console.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdl/console.cpp b/sdl/console.cpp index 7b05b73..77baba0 100644 --- a/sdl/console.cpp +++ b/sdl/console.cpp @@ -236,7 +236,7 @@ static bool GlyphIsEmpty[256] = {}; static Uint8 *SingleHorzLineEdge = NULL; static Uint8 *DoubleHorzLineEdge = NULL; -static void FixUpLineJoiningGlitch(SDL_Surface *s, Uint8 *HorzLineEdge, bool useRightEdge) +static void FixUpLineJoiningGlitch(SDL_Surface *s, bool useRightEdge) { Uint64 diff[2] = {}; // initialize all element to zero for (int d=0; d<=1; d++) @@ -339,27 +339,27 @@ static SDL_Texture*& GetGlyph(SDL_Renderer *ren, TTF_Font* font, BYTE chr) if (wcschr(L"┤╢╖┐┬┼╥╫", str[0]) != NULL) { GetGlyph(ren, font, 0xC4); // ─ // make sure SingleHorzLineEdge is initialized - FixUpLineJoiningGlitch(s, SingleHorzLineEdge, false); + FixUpLineJoiningGlitch(s, false); FixUpGlyphVerticallyTop(s); } if (wcschr(L"╡╕╣╗╦╬╤╪", str[0]) != NULL) { GetGlyph(ren, font, 0xCD); // ═ // make sure DoubleHorzLineEdge is initialized - FixUpLineJoiningGlitch(s, DoubleHorzLineEdge, false); + FixUpLineJoiningGlitch(s, false); FixUpGlyphVerticallyTop(s); } else if (wcschr(L"├╟╓┌", str[0]) != NULL) { GetGlyph(ren, font, 0xC4); // ─ // make sure SingleHorzLineEdge is initialized - FixUpLineJoiningGlitch(s, SingleHorzLineEdge, true); + FixUpLineJoiningGlitch(s, true); FixUpGlyphVerticallyTop(s); } else if (wcschr(L"╞╔╠╒", str[0]) != NULL) { GetGlyph(ren, font, 0xCD); // ═ // make sure DoubleHorzLineEdge is initialized - FixUpLineJoiningGlitch(s, DoubleHorzLineEdge, true); + FixUpLineJoiningGlitch(s, true); FixUpGlyphVerticallyTop(s); } #endif From ac537fc4da7baad486c41bca94c7f3ee465ff2b8 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 31 Mar 2024 20:35:39 +0000 Subject: [PATCH 5/6] [SDL/internal] Remove unused "black" local in RenderCharacterAt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: sdl/console.cpp: In function ‘void RenderCharacterAt(SDL_Renderer*, TTF_Font*, Uint, Uint)’: sdl/console.cpp:390:19: error: unused variable ‘black’ [-Werror=unused-variable] 390 | SDL_Color black = {0, 0, 0, 0xFF}; | ^~~~~ --- sdl/console.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/sdl/console.cpp b/sdl/console.cpp index 77baba0..fca2881 100644 --- a/sdl/console.cpp +++ b/sdl/console.cpp @@ -387,7 +387,6 @@ static void RenderCharacterAt(SDL_Renderer *ren, TTF_Font* font, Uint x, Uint y) Uint bgScreen = tile.color >> 4; SDL_Color fg = ScreenColors[fgScreen]; SDL_Color bg = ScreenColors[bgScreen]; - SDL_Color black = {0, 0, 0, 0xFF}; SDL_Rect rect = { (int)x * TileWidth, (int)y * TileHeight, TileWidth, TileHeight }; SDL_SetRenderDrawColor(ren, bg.r, bg.g, bg.b, 0xFF); if (bgScreen != 0) From 5b10371d083808cc2ba231529a8bfaf1f6172c20 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Sun, 31 Mar 2024 20:36:24 +0000 Subject: [PATCH 6/6] [SDL/internal] Add curly-braces to one-line if statements in ClearGlyphs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: sdl/console.cpp: In function ‘void ClearGlyphs()’: sdl/console.cpp:418:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 418 | if (SingleHorzLineEdge) delete [] SingleHorzLineEdge; SingleHorzLineEdge = NULL; | ^~ sdl/console.cpp:418:63: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 418 | if (SingleHorzLineEdge) delete [] SingleHorzLineEdge; SingleHorzLineEdge = NULL; | ^~~~~~~~~~~~~~~~~~ sdl/console.cpp:419:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 419 | if (DoubleHorzLineEdge) delete [] DoubleHorzLineEdge; DoubleHorzLineEdge = NULL; | ^~ sdl/console.cpp:419:63: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 419 | if (DoubleHorzLineEdge) delete [] DoubleHorzLineEdge; DoubleHorzLineEdge = NULL; | ^~~~~~~~~~~~~~~~~~ --- sdl/console.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdl/console.cpp b/sdl/console.cpp index fca2881..1cdd1e9 100644 --- a/sdl/console.cpp +++ b/sdl/console.cpp @@ -414,8 +414,8 @@ static void ClearGlyphs() { memset(Glyphs, 0, sizeof(Glyphs)); memset(GlyphIsEmpty, 0, sizeof(GlyphIsEmpty)); - if (SingleHorzLineEdge) delete [] SingleHorzLineEdge; SingleHorzLineEdge = NULL; - if (DoubleHorzLineEdge) delete [] DoubleHorzLineEdge; DoubleHorzLineEdge = NULL; + if (SingleHorzLineEdge) { delete [] SingleHorzLineEdge; SingleHorzLineEdge = NULL; } + if (DoubleHorzLineEdge) { delete [] DoubleHorzLineEdge; DoubleHorzLineEdge = NULL; } } static void DestroyGlyphs() {