From 04fa50a33203bac372da9dbfee5d3bc832e4eb96 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sat, 20 Jul 2024 21:49:30 +0000 Subject: [PATCH] Fix needing -fpermissive FossilOrigin-Name: bd82b5a5b17fdeacf6b3133104b958a1597e5e16379280cf0bcfef7e7fef1468 --- src/Makefile | 1 - src/clientextras.cxx | 4 ++-- src/clients2c.cxx | 3 ++- src/console.cxx | 2 +- src/entities.cxx | 3 ++- src/monster.cxx | 2 +- src/renderextras.cxx | 2 +- src/server.cxx | 10 +++++----- src/world.cxx | 5 +++-- src/worldlight.cxx | 4 ++-- src/worldocull.cxx | 2 +- 11 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Makefile b/src/Makefile index f78d0fa..5602351 100644 --- a/src/Makefile +++ b/src/Makefile @@ -42,7 +42,6 @@ CPPFLAGS += -I../enet/include \ ${GLU_CFLAGS} \ ${X11_CFLAGS} \ ${ZLIB_CFLAGS} -CXXFLAGS += -fpermissive LIBS += -L../enet -lenet \ ${SDL_LIBS} \ ${GL_LIBS} \ diff --git a/src/clientextras.cxx b/src/clientextras.cxx index 0f39e91..c83a258 100644 --- a/src/clientextras.cxx +++ b/src/clientextras.cxx @@ -18,14 +18,14 @@ renderclient(dynent *d, bool team, char *mdlname, bool hellpig, float scale) int n = 3; float speed = 100.0f; float mz = d->o.z - d->eyeheight + 1.55f * scale; - int basetime = -((int)d & 0xFFF); + int basetime = -((intptr_t)d & 0xFFF); if (d->state == CS_DEAD) { int r; if (hellpig) { n = 2; r = range[3]; } else { - n = (int)d % 3; + n = (intptr_t)d % 3; r = range[n]; }; basetime = d->lastaction; diff --git a/src/clients2c.cxx b/src/clients2c.cxx index 7deb385..e929e5e 100644 --- a/src/clients2c.cxx +++ b/src/clients2c.cxx @@ -273,7 +273,8 @@ localservertoclient( setspawn(i, true); if (i >= (uint)ents.length()) break; - vec v = {ents[i].x, ents[i].y, ents[i].z}; + vec v = {(float)ents[i].x, (float)ents[i].y, + (float)ents[i].z}; playsound(S_ITEMSPAWN, &v); break; }; diff --git a/src/console.cxx b/src/console.cxx index 56de91a..6fe8ebf 100644 --- a/src/console.cxx +++ b/src/console.cxx @@ -247,7 +247,7 @@ keypress(int code, bool isdown, int cooked) default: resetcomplete(); if (cooked) { - char add[] = {cooked, 0}; + char add[] = {(char)cooked, 0}; strcat_s(commandbuf, add); }; }; diff --git a/src/entities.cxx b/src/entities.cxx index 90aee93..fcb3758 100644 --- a/src/entities.cxx +++ b/src/entities.cxx @@ -317,7 +317,8 @@ checkitems() continue; if (OUTBORD(e.x, e.y)) continue; - vec v = {e.x, e.y, S(e.x, e.y)->floor + player1->eyeheight}; + vec v = {(float)e.x, (float)e.y, + (float)S(e.x, e.y)->floor + player1->eyeheight}; vdist(dist, t, player1->o, v); if (dist < (e.type == TELEPORT ? 4 : 2.5)) pickup(i, player1); diff --git a/src/monster.cxx b/src/monster.cxx index 303bd02..8a0623a 100644 --- a/src/monster.cxx +++ b/src/monster.cxx @@ -378,7 +378,7 @@ monsterthink() continue; if (OUTBORD(e.x, e.y)) continue; - vec v = {e.x, e.y, S(e.x, e.y)->floor}; + vec v = {(float)e.x, (float)e.y, (float)S(e.x, e.y)->floor}; loopv(monsters) if (monsters[i]->state == CS_DEAD) { if (lastmillis - monsters[i]->lastaction < 2000) { diff --git a/src/renderextras.cxx b/src/renderextras.cxx index 95c369e..4cc67a7 100644 --- a/src/renderextras.cxx +++ b/src/renderextras.cxx @@ -184,7 +184,7 @@ renderents() // show sparkly thingies for map entities in edit mode entity &e = ents[i]; if (e.type == NOTUSED) continue; - vec v = {e.x, e.y, e.z}; + vec v = {(float)e.x, (float)e.y, (float)e.z}; particle_splash(2, 2, 40, v); }; int e = closestent(); diff --git a/src/server.cxx b/src/server.cxx index f907413..1f270e6 100644 --- a/src/server.cxx +++ b/src/server.cxx @@ -460,18 +460,18 @@ serverslice(int seconds, } case ENET_EVENT_TYPE_RECEIVE: brec += event.packet->dataLength; - process(event.packet, (int)event.peer->data); + process(event.packet, (intptr_t)event.peer->data); if (event.packet->referenceCount == 0) enet_packet_destroy(event.packet); break; case ENET_EVENT_TYPE_DISCONNECT: - if ((int)event.peer->data < 0) + if ((intptr_t)event.peer->data < 0) break; printf("disconnected client (%s)\n", - clients[(int)event.peer->data].hostname); - clients[(int)event.peer->data].type = ST_EMPTY; - send2(true, -1, SV_CDIS, (int)event.peer->data); + clients[(intptr_t)event.peer->data].hostname); + clients[(intptr_t)event.peer->data].type = ST_EMPTY; + send2(true, -1, SV_CDIS, (intptr_t)event.peer->data); event.peer->data = (void *)-1; break; }; diff --git a/src/world.cxx b/src/world.cxx index 55baf6e..e45a106 100644 --- a/src/world.cxx +++ b/src/world.cxx @@ -256,7 +256,7 @@ closestent() // used for delent and edit mode ent display entity &e = ents[i]; if (e.type == NOTUSED) continue; - vec v = {e.x, e.y, e.z}; + vec v = {(float)e.x, (float)e.y, (float)e.z}; vdist(dist, t, player1->o, v); if (dist < bdist) { best = i; @@ -316,7 +316,8 @@ entity * newentity(int x, int y, int z, char *what, int v1, int v2, int v3, int v4) { int type = findtype(what); - persistent_entity e = {x, y, z, v1, type, v2, v3, v4}; + persistent_entity e = {(short)x, (short)y, (short)z, (short)v1, + (uchar)type, (uchar)v2, (uchar)v3, (uchar)v4}; switch (type) { case LIGHT: if (v1 > 32) diff --git a/src/worldlight.cxx b/src/worldlight.cxx index 20869d1..1b39c1f 100644 --- a/src/worldlight.cxx +++ b/src/worldlight.cxx @@ -226,8 +226,8 @@ dodynlight(vec &vold, vec &v, int reach, int strength, dynent *owner) dlights.add(blockcopy(b)); // backup area before rendering in dynlight - persistent_entity l = { - (int)v.x, (int)v.y, (int)v.z, reach, LIGHT, strength, 0, 0}; + persistent_entity l = {(short)v.x, (short)v.y, (short)v.z, (short)reach, + LIGHT, (uchar)strength, 0, 0}; calclightsource(l); postlightarea(b); }; diff --git a/src/worldocull.cxx b/src/worldocull.cxx index 047b76f..27a94c2 100644 --- a/src/worldocull.cxx +++ b/src/worldocull.cxx @@ -154,7 +154,7 @@ isoccluded(float vx, float vy, float cx, float cy, h = ca(cy + csize - vy, -(cx + csize - vx)) + 2; l = ca(cy - vy, -(cx - vx)) + 2; }; // F - } else // BG + } else // BG { if (cy <= vy) { if (cy + csize < vy) {