redundant test: constant expression is non-zero - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: redundant test: constant expression is non-zero (
/showthread.php?tid=188733)
redundant test: constant expression is non-zero -
ziomal432 - 08.11.2010
Код:
#define abs(%0) ((%0 < 0) ? (-(%0)) : (%0))
new variable = abs(-5);
gives
Код:
warning 206: redundant test: constant expression is non-zero
why? This warning shows with every number.
P.S. please don't give me codes like this.
Код:
if(var < 0) return -var; else return var;
I need to do this with condition operator.