From ff727e916f58cd18fb8e2c1d57e4d416134234a1 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 22 May 2023 14:58:29 -0400 Subject: [PATCH] work around a build issue with a compiler One compiler was issuing an error diagnostic for cmap_to_glyph() macro (see below). This just works around that by using cmap_a_to_glyph() which does not suffer the same fate. mkmaze.c static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, .........................................^ %CC-E-NEEDCONSTEXPR, In the initializer for water_pos.glyph, "In_mines(...)" is not constant, but occurs in a context that requires a constant expression. at line number 1448 in file mkmaze.c static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, .........................................^ %CC-E-NEEDCONSTEXPR, In the initializer for water_pos.glyph, "In_hell(...)" is not constant, but occurs in a context that requires a constant expression. at line number 1448 in file mkmaze.c static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, .........................................^ %CC-E-NEEDCONSTEXPR, In the initializer for water_pos.glyph, "gd" is not constant, but occurs in a context that requires a constant expression. at line number 1448 in file mkmaze.c static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, .........................................^ %CC-E-NEEDCONSTEXPR, In the initializer for water_pos.glyph, "on_level(...)" is not constant, but occurs in a context that requires a constant expression. at line number 1448 in file mkmaze.c static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, .........................................^ %CC-E-NEEDCONSTEXPR, In the initializer for water_pos.glyph, "(&u.uz)->dnum" is not constant, but occurs in a context that requires a constant expression. at line number 1448 in file mkmaze.c static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, .........................................^ %CC-E-NEEDCONSTEXPR, In the initializer for water_pos.glyph, "gd.dungeon_topology.d_sokoban_dnum" is not constant, but occurs in a context that requires a const ant expression. at line number 1448 in file mkmaze.c static const struct rm air_pos = { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, .......................................^ %CC-E-NEEDCONSTEXPR, In the initializer for air_pos.glyph, "In_mines(...)" is not constant, but occurs in a context that requires a constant expression. at line number 1450 in file mkmaze.c static const struct rm air_pos = { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, .......................................^ %CC-E-NEEDCONSTEXPR, In the initializer for air_pos.glyph, "In_hell(...)" is not constant, but occurs in a context that requires a constant expression. at line number 1450 in file mkmaze.c static const struct rm air_pos = { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, .......................................^ %CC-E-NEEDCONSTEXPR, In the initializer for air_pos.glyph, "gd" is not constant, but occurs in a context that requires a constant expression. at line number 1450 in file mkmaze.c static const struct rm air_pos = { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, .......................................^ %CC-E-NEEDCONSTEXPR, In the initializer for air_pos.glyph, "on_level(...)" is not constant, but occurs in a context that requires a constant expression. at line number 1450 in file mkmaze.c static const struct rm air_pos = { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, .......................................^ %CC-E-NEEDCONSTEXPR, In the initializer for air_pos.glyph, "(&u.uz)->dnum" is no t constant, but occurs in a context that requires a constant expression. at line number 1450 in file mkmaze.c static const struct rm air_pos = { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, .......................................^ %CC-E-NEEDCONSTEXPR, In the initializer for air_pos.glyph, "gd.dungeon_topology. d_sokoban_dnum" is not constant, but occurs in a context that requires a constant expression. at line number 1450 in file mkmaze.c --- src/mkmaze.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mkmaze.c b/src/mkmaze.c index c423e0ff6..9045b9458 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -1445,9 +1445,9 @@ static void mv_bubble(struct bubble *, coordxy, coordxy, boolean); void movebubbles(void) { - static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0, + static const struct rm water_pos = { cmap_a_to_glyph(S_water), WATER, 0, 0, 0, 0, 0, 0, 0, 0 }; - static const struct rm air_pos = { cmap_to_glyph(S_cloud), AIR, 0, 0, 0, + static const struct rm air_pos = { cmap_a_to_glyph(S_cloud), AIR, 0, 0, 0, 1, 0, 0, 0, 0 }; static boolean up = FALSE; struct bubble *b;