SA-MP Forums Archive
Definition warnings. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Definition warnings. (/showthread.php?tid=498033)



Definition warnings. - kristo - 01.03.2014

This is my definition that I created today.

pawn Код:
#define GetTireSize(%0,%1) (%1 > 1) ? (reartiresize[%0 - 400]) : (fronttiresize[%0 - 400])
It doesn't matter how and where I use it, i'm getting those warnings:

Quote:

C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\gamemodes\imperial.pwn(14486) : warning 206: redundant test: constant expression is non-zero
C:\Users\Kristo\Dropbox\Server (2)\IMPO\Server\gamemodes\imperial.pwn(14487) : warning 205: redundant code: constant expression is zero

I know what they mean but I have no idea, how to fix it as everything seems legit.


Re: Definition warnings. - kristo - 02.03.2014

asdf


Re: Definition warnings. - ACI - 02.03.2014

Where a conditional expression was expected, a constant expression with a non-zero value was found, e.g. if (1). The test is redundant, because the conditional code is always executed. To create an endless loop, use for ( ;; ) instead of while (1)