From e5bd2217460a868893677492e558cc44d99ebd2b Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 18 Apr 2019 17:24:10 +0000 Subject: [PATCH] auto/const/constexpr bullshit git-svn-id: https://svn.eduke32.com/eduke32@7587 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/build.h | 28 ++++----- source/build/src/clip.cpp | 10 ++-- source/build/src/engine.cpp | 103 ++++++++++++++++----------------- source/build/src/engine_priv.h | 2 +- source/build/src/polymost.cpp | 12 ++-- 5 files changed, 78 insertions(+), 77 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index 0ff85d2ae..92a11cbac 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -210,7 +210,7 @@ void yax_update(int32_t resetstat); int32_t yax_getneighborsect(int32_t x, int32_t y, int32_t sectnum, int32_t cf); void yax_getclosestpointonwall(int32_t dawall, int32_t *closestx, int32_t *closesty); -static FORCE_INLINE int32_t yax_waltosecmask(int32_t walclipmask) +static FORCE_INLINE CONSTEXPR int32_t yax_waltosecmask(int32_t const walclipmask) { // blocking: walstat&1 --> secstat&512 // hitscan: walstat&64 --> secstat&2048 @@ -1186,18 +1186,18 @@ int32_t krand(void); int32_t ksqrt(uint32_t num); int32_t LUNATIC_FASTCALL getangle(int32_t xvect, int32_t yvect); -static FORCE_INLINE uint32_t uhypsq(int32_t dx, int32_t dy) +static FORCE_INLINE CONSTEXPR uint32_t uhypsq(int32_t const dx, int32_t const dy) { return (uint32_t)dx*dx + (uint32_t)dy*dy; } -static FORCE_INLINE int32_t logapproach(int32_t val, int32_t targetval) +static FORCE_INLINE int32_t logapproach(int32_t const val, int32_t const targetval) { - int32_t dif = targetval - val; + int32_t const dif = targetval - val; return (dif>>1) ? val + (dif>>1) : targetval; } -void rotatepoint(vec2_t pivot, vec2_t p, int16_t daang, vec2_t *p2) ATTRIBUTE((nonnull(4))); +void rotatepoint(vec2_t const pivot, vec2_t p, int16_t const daang, vec2_t * const p2) ATTRIBUTE((nonnull(4))); int32_t lastwall(int16_t point); int32_t nextsectorneighborz(int16_t sectnum, int32_t refz, int16_t topbottom, int16_t direction); @@ -1223,12 +1223,12 @@ static FORCE_INLINE void getzsofslope(int16_t sectnum, int32_t dax, int32_t day, // Is a red wall in a safe fashion, i.e. only if consistency invariant // ".nextsector >= 0 iff .nextwall >= 0" holds. -static FORCE_INLINE int32_t redwallp(const uwalltype *wal) +static FORCE_INLINE CONSTEXPR int32_t redwallp(const uwalltype *wal) { return (wal->nextwall >= 0 && wal->nextsector >= 0); } -static FORCE_INLINE int32_t E_SpriteIsValid(const int32_t i) +static FORCE_INLINE CONSTEXPR int32_t E_SpriteIsValid(const int32_t i) { return ((unsigned)i < MAXSPRITES && sprite[i].statnum != MAXSTATUS); } @@ -1280,10 +1280,12 @@ struct OutputFileCounter { }; // PLAG: line utility functions -typedef struct s_equation { - float a, b, c; -} _equation; -int32_t wallvisible(int32_t x, int32_t y, int16_t wallnum); +typedef struct s_equation +{ + float a, b, c; +} _equation; + +int32_t wallvisible(int32_t const x, int32_t const y, int16_t const wallnum); #define STATUS2DSIZ 144 #define STATUS2DSIZ2 26 @@ -1410,7 +1412,7 @@ typedef struct EXTERN int32_t mdinited; EXTERN tile2model_t tile2model[MAXTILES+EXTRATILES]; -static FORCE_INLINE int32_t md_tilehasmodel(int32_t tilenume,int32_t pal) +static FORCE_INLINE int32_t md_tilehasmodel(int32_t const tilenume, int32_t const pal) { return mdinited ? tile2model[Ptile2tile(tilenume,pal)].modelid : -1; } @@ -1476,7 +1478,7 @@ extern const int32_t engine_v8; int32_t Mulscale(int32_t a, int32_t b, int32_t sh); #endif -static inline bool inside_p(int32_t const x, int32_t const y, int const sectnum) { return (sectnum >= 0 && inside(x, y, sectnum) == 1); } +static FORCE_INLINE CONSTEXPR bool inside_p(int32_t const x, int32_t const y, int const sectnum) { return (sectnum >= 0 && inside(x, y, sectnum) == 1); } #define SET_AND_RETURN(Lval, Rval) \ do \ diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index dc47ae598..28588c2e6 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -1039,10 +1039,10 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int auto const sec = (usectortype *)§or[dasect]; int const startwall = sec->wallptr; int const endwall = startwall + sec->wallnum; + auto wal = (uwalltype *)&wall[startwall]; - for (native_t j=startwall; jpoint2]; if ((wal->x < clipMin.x && wal2->x < clipMin.x) || (wal->x > clipMax.x && wal2->x > clipMax.x) || @@ -1174,7 +1174,7 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int #endif for (int j=headspritesect[dasect]; j>=0; j=nextspritesect[j]) { - const uspritetype *const spr = (uspritetype *)&sprite[j]; + auto const spr = (uspritetype *)&sprite[j]; const int32_t cstat = spr->cstat; if ((cstat&dasprclipmask) == 0) @@ -2030,7 +2030,7 @@ static int32_t hitscan_trysector(const vec3_t *sv, const usectortype *sec, hitda else { const int32_t curidx=(int32_t)tmp[0]; - const uspritetype *const curspr=(uspritetype *)tmp[1]; + auto const curspr=(uspritetype *)tmp[1]; const int32_t thislastsec = tmp[2]; if (!thislastsec) @@ -2214,7 +2214,7 @@ restart_grand: #endif for (z=headspritesect[dasector]; z>=0; z=nextspritesect[z]) { - const uspritetype *const spr = (uspritetype *)&sprite[z]; + auto const spr = (uspritetype *)&sprite[z]; const int32_t cstat = spr->cstat; #ifdef USE_OPENGL if (!hitallsprites) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 3ccf5c144..a15c4124c 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -1473,7 +1473,7 @@ char apptitle[256] = "Build Engine"; // 1=break out of sprite collecting; int32_t renderAddTsprite(int16_t z, int16_t sectnum) { - uspritetype *spr = (uspritetype *)&sprite[z]; + auto const spr = (uspritetype *)&sprite[z]; #ifdef YAX_ENABLE if (g_nodraw==0) { @@ -1658,7 +1658,7 @@ static void classicScanSector(int16_t startsectnum) #endif for (bssize_t i=headspritesect[sectnum]; i>=0; i=nextspritesect[i]) { - const uspritetype *const spr = (uspritetype *)&sprite[i]; + auto const spr = (uspritetype *)&sprite[i]; if (((spr->cstat & 0x8000) && !showinvisibility) || spr->xrepeat == 0 || spr->yrepeat == 0) continue; @@ -1684,9 +1684,9 @@ static void classicScanSector(int16_t startsectnum) for (bssize_t w=startwall; wnextsector; - const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; const int32_t x1 = wal->x-globalposx, y1 = wal->y-globalposy; const int32_t x2 = wal2->x-globalposx, y2 = wal2->y-globalposy; @@ -2074,8 +2074,8 @@ int32_t wallfront(int32_t l1, int32_t l2) // static inline int32_t spritewallfront(const uspritetype *s, int32_t w) { - const uwalltype *const wal = (uwalltype *)&wall[w]; - const uwalltype *wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal = (uwalltype *)&wall[w]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; const vec2_t v = { wal->x, wal->y }; return dmulscale32(wal2->x - v.x, s->y - v.y, -(s->x - v.x), wal2->y - v.y) >= 0; @@ -2482,7 +2482,7 @@ static int32_t wallmost(int16_t *mostbuf, int32_t w, int32_t sectnum, char dasta if (wi == sector[sectnum].wallptr) return owallmost(mostbuf,w,z); - const uwalltype *const wal = (uwalltype *)&wall[wi]; + auto const wal = (uwalltype *)&wall[wi]; const int32_t x1 = wal->x, x2 = wall[wal->point2].x-x1; const int32_t y1 = wal->y, y2 = wall[wal->point2].y-y1; @@ -2704,7 +2704,7 @@ static int32_t setup_globals_cf1(const usectortype *sec, int32_t pal, int32_t zd static void ceilscan(int32_t x1, int32_t x2, int32_t sectnum) { int32_t x, y1, y2; - const usectortype *const sec = (usectortype *)§or[sectnum]; + auto const sec = (usectortype *)§or[sectnum]; if (setup_globals_cf1(sec, sec->ceilingpal, sec->ceilingz-globalposz, sec->ceilingpicnum, sec->ceilingshade, sec->ceilingstat, @@ -2802,7 +2802,7 @@ static void ceilscan(int32_t x1, int32_t x2, int32_t sectnum) static void florscan(int32_t x1, int32_t x2, int32_t sectnum) { int32_t x, y1, y2; - const usectortype *const sec = (usectortype *)§or[sectnum]; + auto const sec = (usectortype *)§or[sectnum]; if (setup_globals_cf1(sec, sec->floorpal, globalposz-sec->floorz, sec->floorpicnum, sec->floorshade, sec->floorstat, @@ -3424,7 +3424,7 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) // Er, yes, they're not global anymore: int32_t globalx, globaly, globalz, globalzx; - const usectortype *const sec = (usectortype *)§or[sectnum]; + auto const sec = (usectortype *)§or[sectnum]; const uwalltype *wal; if (dastat == 0) @@ -3603,13 +3603,13 @@ static void grouscan(int32_t dax1, int32_t dax2, int32_t sectnum, char dastat) // static void parascan(char dastat, int32_t bunch) { - usectortype *sec; int32_t j, k, l, m, n, x, z, wallnum, nextsectnum, globalhorizbak; int16_t *topptr, *botptr; int32_t logtilesizy, tsizy; - int32_t sectnum = thesector[bunchfirst[bunch]]; sec = (usectortype *)§or[sectnum]; + int32_t sectnum = thesector[bunchfirst[bunch]]; + auto const sec = (usectortype *)§or[sectnum]; globalhorizbak = globalhoriz; globvis = globalpisibility; @@ -3908,7 +3908,7 @@ static void classicDrawBunches(int32_t bunch) int32_t z = bunchfirst[bunch]; const int32_t sectnum = thesector[z]; - const usectortype *const sec = (usectortype *)§or[sectnum]; + auto const sec = (usectortype *)§or[sectnum]; uint8_t andwstat1 = 0xff, andwstat2 = 0xff; @@ -4035,10 +4035,10 @@ static void classicDrawBunches(int32_t bunch) } const int32_t wallnum = thewall[z]; - const uwalltype *const wal = (uwalltype *)&wall[wallnum]; + auto const wal = (uwalltype *)&wall[wallnum]; const int32_t nextsectnum = wal->nextsector; - const usectortype *const nextsec = nextsectnum>=0 ? (usectortype *)§or[nextsectnum] : NULL; + auto const nextsec = nextsectnum>=0 ? (usectortype *)§or[nextsectnum] : NULL; int32_t gotswall = 0; @@ -4209,7 +4209,7 @@ static void classicDrawBunches(int32_t bunch) searchstat = 0; searchit = 1; } - const uwalltype *twal = (wal->cstat&2) ? (uwalltype *)&wall[wal->nextwall] : wal; + auto const twal = (wal->cstat&2) ? (uwalltype *)&wall[wal->nextwall] : wal; setup_globals_wall1(twal, twal->picnum); setup_globals_wall2(wal, sec->visibility, nextsec->floorz, sec->ceilingz); @@ -4784,7 +4784,7 @@ static FORCE_INLINE int32_t mulscale_triple30(int32_t a, int32_t b, int32_t c) static void classicDrawSprite(int32_t snum) { - uspritetype *const tspr = tspriteptr[snum]; + auto const tspr = tspriteptr[snum]; const int32_t sectnum = tspr->sectnum; if (sectnum < 0 || bad_tspr(tspr)) @@ -4803,7 +4803,7 @@ static void classicDrawSprite(int32_t snum) const int32_t spritenum = tspr->owner; const float alpha = spriteext[spritenum].alpha; - const usectortype *const sec = (usectortype *)§or[sectnum]; + auto const sec = (usectortype *)§or[sectnum]; int32_t cstat=tspr->cstat, tilenum; @@ -5875,10 +5875,10 @@ static void renderDrawMaskedWall(int16_t damaskwallcnt) //============================================================================= //POLYMOST ENDS int32_t z = maskwall[damaskwallcnt]; - uwalltype *wal = (uwalltype *)&wall[thewall[z]]; + auto wal = (uwalltype *)&wall[thewall[z]]; int32_t sectnum = thesector[z]; - usectortype *sec = (usectortype *)§or[sectnum]; - usectortype *nsec = (usectortype *)§or[wal->nextsector]; + auto sec = (usectortype *)§or[sectnum]; + auto nsec = (usectortype *)§or[wal->nextsector]; int32_t z1 = max(nsec->ceilingz,sec->ceilingz); int32_t z2 = min(nsec->floorz,sec->floorz); @@ -7966,7 +7966,7 @@ void initspritelists(void) } -void set_globalang(fix16_t ang) +void set_globalang(fix16_t const ang) { globalang = fix16_to_int(ang)&2047; qglobalang = ang & 0x7FFFFFF; @@ -8284,7 +8284,7 @@ int32_t renderDrawRoomsQ16(int32_t daposx, int32_t daposy, int32_t daposz, // _maskleaf maskleaves[MAXWALLSB]; // returns equation of a line given two points -static inline _equation equation(float x1, float y1, float x2, float y2) +static inline _equation equation(float const x1, float const y1, float const x2, float const y2) { _equation ret; const float f = x2-x1; @@ -8306,17 +8306,14 @@ static inline _equation equation(float x1, float y1, float x2, float y2) return ret; } -int32_t wallvisible(int32_t x, int32_t y, int16_t wallnum) +int32_t wallvisible(int32_t const x, int32_t const y, int16_t const wallnum) { // 1 if wall is in front of player 0 otherwise - uwalltype *w1 = (uwalltype *)&wall[wallnum]; - uwalltype *w2 = (uwalltype *)&wall[w1->point2]; + auto w1 = (uwalltype *)&wall[wallnum]; + auto w2 = (uwalltype *)&wall[w1->point2]; - int32_t a1 = getangle(w1->x - x, w1->y - y); - int32_t a2 = getangle(w2->x - x, w2->y - y); - - //if ((wallnum == 23) || (wallnum == 9)) - // OSD_Printf("Wall %d : %d - sector %d - x %d - y %d.\n", wallnum, (a2 + (2048 - a1)) & 2047, globalcursectnum, globalposx, globalposy); + int32_t const a1 = getangle(w1->x - x, w1->y - y); + int32_t const a2 = getangle(w2->x - x, w2->y - y); return (((a2 + (2048 - a1)) & 2047) <= 1024); } @@ -8497,7 +8494,7 @@ killsprite: { for (bssize_t k=i; kz; if ((s->cstat&48) != 32) @@ -8597,7 +8594,7 @@ killsprite: ) { vec2f_t spr; - const uspritetype *tspr = tspriteptr[i]; + auto const tspr = tspriteptr[i]; spr.x = (float)tspr->x; spr.y = (float)tspr->y; @@ -8936,7 +8933,7 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang) for (s=sortnum-1; s>=0; s--) { - uspritetype * const spr = (uspritetype * )&sprite[tsprite[s].owner]; + auto const spr = (uspritetype * )&sprite[tsprite[s].owner]; if ((spr->cstat&48) == 32) { const int32_t xspan = tilesiz[spr->picnum].x; @@ -9835,8 +9832,8 @@ int32_t saveboard(const char *filename, const vec3_t *dapos, int16_t daang, int1 if (numsprites > 0) { - uspritetype *const tspri = (uspritetype *)Xmalloc(sizeof(spritetype) * numsprites); - uspritetype *spri = tspri; + auto const tspri = (uspritetype *)Xmalloc(sizeof(spritetype) * numsprites); + auto spri = tspri; for (j=0; jwallnum,wal=(uwalltype *)&wall[sec->wallptr]; cnt>0; cnt--,wal++) { - const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; const int32_t x31 = wal->x-x1, x34 = wal->x-wal2->x; const int32_t y31 = wal->y-y1, y34 = wal->y-wal2->y; @@ -10695,7 +10692,7 @@ void neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, for (z=startwall,wal=(uwalltype *)&wall[startwall]; z<=endwall; z++,wal++) { - const uwalltype *const wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; const int32_t nextsector = wal->nextsector; const int32_t x1=wal->x, y1=wal->y, x2=wal2->x, y2=wal2->y; @@ -10740,7 +10737,7 @@ void neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, for (z=headspritesect[dasector]; z>=0; z=nextspritesect[z]) { - const uspritetype *const spr = (uspritetype *)&sprite[z]; + auto const spr = (uspritetype *)&sprite[z]; if (blacklist_sprite_func && blacklist_sprite_func(z)) continue; @@ -10964,7 +10961,7 @@ void bfirst_search_try(int16_t * const list, uint8_t * const bitmap, int32_t * c * NOTE: The redundant bound checks are expected to be optimized away in the * inlined code. */ -static inline bool inside_exclude_p(int32_t const x, int32_t const y, int const sectnum, const uint8_t *excludesectbitmap) +static FORCE_INLINE CONSTEXPR bool inside_exclude_p(int32_t const x, int32_t const y, int const sectnum, const uint8_t *excludesectbitmap) { return (sectnum>=0 && !bitmap_test(excludesectbitmap, sectnum) && inside_p(x, y, sectnum)); } @@ -11045,7 +11042,7 @@ void updatesectorexclude(int32_t const x, int32_t const y, int16_t * const sectn if (*sectnum >= 0 && *sectnum < numsectors) { - const uwalltype *wal = (uwalltype *)&wall[sector[*sectnum].wallptr]; + auto wal = (uwalltype *)&wall[sector[*sectnum].wallptr]; int wallsleft = sector[*sectnum].wallnum; do @@ -11148,7 +11145,7 @@ void updatesectorz(int32_t const x, int32_t const y, int32_t const z, int16_t * // // rotatepoint // -void rotatepoint(vec2_t const pivot, vec2_t p, int16_t daang, vec2_t *p2) +void rotatepoint(vec2_t const pivot, vec2_t p, int16_t const daang, vec2_t * const p2) { int const dacos = sintable[(daang+2560)&2047]; int const dasin = sintable[(daang+2048)&2047]; @@ -11741,8 +11738,8 @@ int32_t getceilzofslopeptr(const usectortype *sec, int32_t dax, int32_t day) if (!(sec->ceilingstat&2)) return sec->ceilingz; - uwalltype const *wal = (uwalltype *)&wall[sec->wallptr]; - uwalltype const *wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal = (uwalltype *)&wall[sec->wallptr]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; vec2_t const w = *(vec2_t const *)wal; vec2_t const d = { wal2->x - w.x, wal2->y - w.y }; @@ -11759,8 +11756,8 @@ int32_t getflorzofslopeptr(const usectortype *sec, int32_t dax, int32_t day) if (!(sec->floorstat&2)) return sec->floorz; - uwalltype const *wal = (uwalltype *)&wall[sec->wallptr]; - uwalltype const *wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal = (uwalltype *)&wall[sec->wallptr]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; vec2_t const w = *(vec2_t const *)wal; vec2_t const d = { wal2->x - w.x, wal2->y - w.y }; @@ -11779,8 +11776,8 @@ void getzsofslopeptr(const usectortype *sec, int32_t dax, int32_t day, int32_t * if (((sec->ceilingstat|sec->floorstat)&2) != 2) return; - uwalltype const *wal = (uwalltype *)&wall[sec->wallptr]; - uwalltype const *wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal = (uwalltype *)&wall[sec->wallptr]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; vec2_t const d = { wal2->x - wal->x, wal2->y - wal->y }; @@ -11800,7 +11797,7 @@ void getzsofslopeptr(const usectortype *sec, int32_t dax, int32_t day, int32_t * // void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z) { - const uwalltype *const wal = (uwalltype *)&wall[sector[dasect].wallptr]; + auto const wal = (uwalltype *)&wall[sector[dasect].wallptr]; const int32_t dax = wall[wal->point2].x-wal->x; const int32_t day = wall[wal->point2].y-wal->y; @@ -11821,7 +11818,7 @@ void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z) // void alignflorslope(int16_t dasect, int32_t x, int32_t y, int32_t z) { - const uwalltype *const wal = (uwalltype *)&wall[sector[dasect].wallptr]; + auto const wal = (uwalltype *)&wall[sector[dasect].wallptr]; const int32_t dax = wall[wal->point2].x-wal->x; const int32_t day = wall[wal->point2].y-wal->y; diff --git a/source/build/src/engine_priv.h b/source/build/src/engine_priv.h index 87ad4d55c..49fcee374 100644 --- a/source/build/src/engine_priv.h +++ b/source/build/src/engine_priv.h @@ -268,7 +268,7 @@ extern void get_floorspr_points(uspritetype const * spr, int32_t px, int32_t py, // int32_t wallmost(int16_t *mostbuf, int32_t w, int32_t sectnum, char dastat); int32_t wallfront(int32_t l1, int32_t l2); -void set_globalang(fix16_t ang); +void set_globalang(fix16_t const ang); int32_t animateoffs(int tilenum); #define DO_TILE_ANIM(Picnum, Fakevar) do { \ diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index ec478ff6c..6faafbe3b 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -4064,9 +4064,10 @@ static void polymost_drawalls(int32_t const bunch) { int32_t const wallnum = thewall[z]; - uwalltype * const wal = (uwalltype *)&wall[wallnum], *wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal = (uwalltype *)&wall[wallnum]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; int32_t const nextsectnum = wal->nextsector; - usectortype * const nextsec = nextsectnum>=0 ? (usectortype *)§or[nextsectnum] : NULL; + auto const nextsec = nextsectnum>=0 ? (usectortype *)§or[nextsectnum] : NULL; //Offset&Rotate 3D coordinates to screen 3D space vec2f_t walpos = { (float)(wal->x-globalposx), (float)(wal->y-globalposy) }; @@ -5488,15 +5489,16 @@ void polymost_drawrooms() void polymost_drawmaskwall(int32_t damaskwallcnt) { int const z = maskwall[damaskwallcnt]; - uwalltype const * const wal = (uwalltype *)&wall[thewall[z]], *wal2 = (uwalltype *)&wall[wal->point2]; + auto const wal = (uwalltype *)&wall[thewall[z]]; + auto const wal2 = (uwalltype *)&wall[wal->point2]; int32_t const sectnum = thesector[z]; - usectortype const * const sec = (usectortype *)§or[sectnum]; + auto const sec = (usectortype *)§or[sectnum]; // if (wal->nextsector < 0) return; // Without MASKWALL_BAD_ACCESS fix: // wal->nextsector is -1, WGR2 SVN Lochwood Hollow (Til' Death L1) (or trueror1.map) - usectortype const * const nsec = (usectortype *)§or[wal->nextsector]; + auto const nsec = (usectortype *)§or[wal->nextsector]; globalpicnum = wal->overpicnum; if ((uint32_t)globalpicnum >= MAXTILES)