On 2012-06-07 17:53, Marc Chametzky wrote:
Marc, are you sure ? It means that the assignment gets evaluated as a
boolean expression??
Yes... you've got "port == DPORT" with two equal signs. That's not an
assignment. That is going to evaluate to see whether it's true or false.
Since DPORT = 0 by default, then it's evaluating "port == 0" which is
true, thus its value is 1.
So, you've got a statement which is:
1;
Essentially, it's a no-op.
With DPORT = 0, it doesn't make any difference, save for a compiler
warning. If you were to set DPORT to some other number, though, the
assignment wouldn't take place as would otherwise be expected.
The assignment never took place, as it should have, since there was no assignment.
If you changed DPORT to something else, you'd just get a
if (port == 0) 0;
which is just as meaningless as the result of DPORT was set to 0, which gave
if (port == 0) 1;
Johnny