From 6bd7c25ec3d471298b619eced36a3fb6f49f305e Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Thu, 20 Mar 2025 23:02:06 +0000 Subject: [PATCH] Fix -Wgnu-folding-constant FossilOrigin-Name: e79356d2a66c0537866b4ff23389bc8b8755ac324310c769e670d4247456d604 --- src/clientextras.m | 2 +- src/editing.m | 2 +- src/renderextras.m | 2 +- src/rendergl.m | 9 +++++---- src/renderparticles.m | 2 +- src/weapon.m | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/clientextras.m b/src/clientextras.m index aa9087a..224579a 100644 --- a/src/clientextras.m +++ b/src/clientextras.m @@ -122,7 +122,7 @@ renderscore(DynamicEntity *d) menumanual(0, scoreLines.count - 1, line); } -static const int maxTeams = 4; +#define maxTeams 4 static OFString *teamName[maxTeams]; static int teamScore[maxTeams]; static size_t teamsUsed; diff --git a/src/editing.m b/src/editing.m index dd7d691..9cb0a31 100644 --- a/src/editing.m +++ b/src/editing.m @@ -529,7 +529,7 @@ setvdelta(int delta) addmsg(1, 6, SV_EDITD, sel.x, sel.y, sel.xs, sel.ys, delta); } -const int MAXARCHVERT = 50; +#define MAXARCHVERT 50 int archverts[MAXARCHVERT][MAXARCHVERT]; bool archvinit = false; diff --git a/src/renderextras.m b/src/renderextras.m index 84b03ed..32198d7 100644 --- a/src/renderextras.m +++ b/src/renderextras.m @@ -81,7 +81,7 @@ blendbox(int x1, int y1, int x2, int y2, bool border) glDepthMask(GL_TRUE); } -const int MAXSPHERES = 50; +#define MAXSPHERES 50 struct sphere { OFVector3D o; float size, max; diff --git a/src/rendergl.m b/src/rendergl.m index 81f3ef6..2c0da2c 100644 --- a/src/rendergl.m +++ b/src/rendergl.m @@ -161,7 +161,7 @@ installtex(int tnum, OFIRI *IRI, int *xs, int *ys, bool clamp) // each texture slot can have multople texture frames, of which currently only // the first is used additional frames can be used for various shaders -static const int MAXTEX = 1000; +#define MAXTEX 1000 static int texx[MAXTEX]; // ( loaded texture ) -> ( name, size ) static int texy[MAXTEX]; static OFString *texname[MAXTEX]; @@ -169,9 +169,10 @@ static int curtex = 0; static const int FIRSTTEX = 1000; // opengl id = loaded id + FIRSTTEX // std 1+, sky 14+, mdls 20+ -static const int MAXFRAMES = 2; // increase to allow more complex shader defs -static int mapping[256] - [MAXFRAMES]; // ( cube texture, frame ) -> ( opengl id, name ) +// increase to allow more complex shader defs +#define MAXFRAMES 2 +// ( cube texture, frame ) -> ( opengl id, name ) +static int mapping[256][MAXFRAMES]; static OFString *mapname[256][MAXFRAMES]; void diff --git a/src/renderparticles.m b/src/renderparticles.m index c8622fa..3ffa706 100644 --- a/src/renderparticles.m +++ b/src/renderparticles.m @@ -4,7 +4,7 @@ #import "DynamicEntity.h" -const int MAXPARTICLES = 10500; +#define MAXPARTICLES 10500 const int NUMPARTCUTOFF = 20; struct particle { OFVector3D o, d; diff --git a/src/weapon.m b/src/weapon.m index a2c5e0b..5f194e4 100644 --- a/src/weapon.m +++ b/src/weapon.m @@ -7,7 +7,7 @@ #import "Projectile.h" static const int MONSTERDAMAGEFACTOR = 4; -static const int SGRAYS = 20; +#define SGRAYS 20 static const float SGSPREAD = 2; static OFVector3D sg[SGRAYS]; @@ -132,7 +132,7 @@ playerincrosshair() return nil; } -static const size_t MAXPROJ = 100; +#define MAXPROJ 100 static Projectile *projs[MAXPROJ]; void