- SW: Fix all GCC warning: suggest parentheses around assignment used as truth value [-Wparentheses] warnings.

Regex to match such conditions: `while (\([\w]+\s?=\s?.+\.Next\(\)\))`.
This commit is contained in:
Mitchell Richters 2022-01-01 20:49:31 +11:00
parent 17de3a08e8
commit 45057ff8a0
5 changed files with 19 additions and 19 deletions

View file

@ -317,7 +317,7 @@ void SW_FloorPortalHack(DSWActor* actor, int z, int match)
int newz = actor->sector()->ceilingz - ((pix_diff / 128) + 1) * Z(128);
SWStatIterator it(STAT_FAF);
while (actor = it.Next())
while ((actor = it.Next()))
{
if (actor->spr.lotag == match)
{
@ -350,7 +350,7 @@ void SW_CeilingPortalHack(DSWActor* actor, int z, int match)
int newz = actor->sector()->floorz + ((pix_diff / 128) + 1) * Z(128);
SWStatIterator it(STAT_FAF);
while (actor = it.Next())
while ((actor = it.Next()))
{
if (actor->spr.lotag == match)
{

View file

@ -4000,7 +4000,7 @@ void DoPlayerWarpToUnderwater(PLAYER* pp)
// search for DIVE_AREA "over" sprite for reference point
SWStatIterator it(STAT_DIVE_AREA);
while (over_act = it.Next())
while ((over_act = it.Next()))
{
if ((over_act->sector()->extra & SECTFX_DIVE_AREA) &&
over_act->sector()->hasU() &&
@ -4016,7 +4016,7 @@ void DoPlayerWarpToUnderwater(PLAYER* pp)
// search for UNDERWATER "under" sprite for reference point
it.Reset(STAT_UNDERWATER);
while (under_act = it.Next())
while ((under_act = it.Next()))
{
if ((under_act->sector()->extra & SECTFX_UNDERWATER) &&
under_act->sector()->hasU() &&
@ -4070,7 +4070,7 @@ void DoPlayerWarpToSurface(PLAYER* pp)
// search for UNDERWATER "under" sprite for reference point
SWStatIterator it(STAT_UNDERWATER);
while (under_act = it.Next())
while ((under_act = it.Next()))
{
if ((under_act->sector()->extra & SECTFX_UNDERWATER) &&
under_act->sector()->hasU() &&
@ -4086,7 +4086,7 @@ void DoPlayerWarpToSurface(PLAYER* pp)
// search for DIVE_AREA "over" sprite for reference point
it.Reset(STAT_DIVE_AREA);
while (over_act = it.Next())
while ((over_act = it.Next()))
{
if ((over_act->sector()->extra & SECTFX_DIVE_AREA) &&
over_act->sector()->hasU() &&

View file

@ -170,7 +170,7 @@ void QuakeViewChange(PLAYER* pp, int *z_diff, int *x_diff, int *y_diff, short *a
// find the closest quake - should be a strength value
DSWActor* actor = nullptr;
SWStatIterator it(STAT_QUAKE_ON);
while (actor = it.Next())
while ((actor = it.Next()))
{
dist = FindDistance3D(pp->pos - actor->spr.pos);

View file

@ -668,7 +668,7 @@ bool FindCeilingView(int match, int* x, int* y, int z, sectortype** sect)
// Search Stat List For closest ceiling view sprite
// Get the match, xoff, yoff from this point
SWStatIterator it(STAT_FAF);
while (actor = it.Next())
while ((actor = it.Next()))
{
if (actor->spr.hitag == VIEW_THRU_CEILING && actor->spr.lotag == match)
{
@ -679,7 +679,7 @@ bool FindCeilingView(int match, int* x, int* y, int z, sectortype** sect)
}
it.Reset(STAT_FAF);
while (actor = it.Next())
while ((actor = it.Next()))
{
if (actor->spr.lotag == match)
{
@ -729,7 +729,7 @@ bool FindFloorView(int match, int* x, int* y, int z, sectortype** sect)
// Search Stat List For closest ceiling view sprite
// Get the match, xoff, yoff from this point
SWStatIterator it(STAT_FAF);
while (actor = it.Next())
while ((actor = it.Next()))
{
if (actor->spr.hitag == VIEW_THRU_FLOOR && actor->spr.lotag == match)
{
@ -741,7 +741,7 @@ bool FindFloorView(int match, int* x, int* y, int z, sectortype** sect)
it.Reset(STAT_FAF);
while (actor = it.Next())
while ((actor = it.Next()))
{
if (actor->spr.lotag == match)
{

View file

@ -16783,7 +16783,7 @@ bool WarpToUnderwater(sectortype** psectu, int *x, int *y, int *z)
// search for DIVE_AREA "over" sprite for reference point
SWStatIterator it(STAT_DIVE_AREA);
while (overActor = it.Next())
while ((overActor = it.Next()))
{
if ((overActor->sector()->extra & SECTFX_DIVE_AREA) &&
overActor->sector()->hasU() &&
@ -16799,7 +16799,7 @@ bool WarpToUnderwater(sectortype** psectu, int *x, int *y, int *z)
// search for UNDERWATER "under" sprite for reference point
it.Reset(STAT_UNDERWATER);
while (underActor = it.Next())
while ((underActor = it.Next()))
{
if ((underActor->sector()->extra & SECTFX_UNDERWATER) &&
underActor->sector()->hasU() &&
@ -16852,7 +16852,7 @@ bool WarpToSurface(sectortype** psectu, int *x, int *y, int *z)
// search for UNDERWATER "under" sprite for reference point
SWStatIterator it(STAT_UNDERWATER);
while (underActor = it.Next())
while ((underActor = it.Next()))
{
if ((underActor->sector()->extra & SECTFX_UNDERWATER) &&
underActor->sector()->hasU() &&
@ -16868,7 +16868,7 @@ bool WarpToSurface(sectortype** psectu, int *x, int *y, int *z)
// search for DIVE_AREA "over" sprite for reference point
it.Reset(STAT_DIVE_AREA);
while (overActor = it.Next())
while ((overActor = it.Next()))
{
if ((overActor->sector()->extra & SECTFX_DIVE_AREA) &&
overActor->sector()->hasU() &&
@ -16918,7 +16918,7 @@ bool SpriteWarpToUnderwater(DSWActor* actor)
// search for DIVE_AREA "over" sprite for reference point
SWStatIterator it(STAT_DIVE_AREA);
while (overActor = it.Next())
while ((overActor = it.Next()))
{
if ((overActor->sector()->extra & SECTFX_DIVE_AREA) &&
overActor->sector()->hasU() &&
@ -16934,7 +16934,7 @@ bool SpriteWarpToUnderwater(DSWActor* actor)
// search for UNDERWATER "under" sprite for reference point
it.Reset(STAT_UNDERWATER);
while (underActor = it.Next())
while ((underActor = it.Next()))
{
if ((underActor->sector()->extra & SECTFX_UNDERWATER) &&
underActor->sector()->hasU() &&
@ -16988,7 +16988,7 @@ bool SpriteWarpToSurface(DSWActor* actor)
// search for UNDERWATER "under" sprite for reference point
SWStatIterator it(STAT_UNDERWATER);
while (underActor = it.Next())
while ((underActor = it.Next()))
{
if ((underActor->sector()->extra & SECTFX_UNDERWATER) &&
underActor->sector()->hasU() &&
@ -17008,7 +17008,7 @@ bool SpriteWarpToSurface(DSWActor* actor)
// search for DIVE_AREA "over" sprite for reference point
it.Reset(STAT_DIVE_AREA);
while (overActor = it.Next())
while ((overActor = it.Next()))
{
if ((overActor->sector()->extra & SECTFX_DIVE_AREA) &&
overActor->sector()->hasU() &&