Re:The Beauty of Bresenham's Algorithm
by tsahyt on Wednesday August 08, 2012 @03:41AM
(#4354399)
There's no casting involved in while(1). 1 is "true" in C, in fact, any integer != 0 is "true".
I just did a quick check and gcc -S produces the same ASM output for both of them, which doesn't include any comparisons whatsoever, just a jmp. So both of them are really compiled to an actual infinite loop.
I just did a quick check and gcc -S produces the same ASM output for both of them, which doesn't include any comparisons whatsoever, just a jmp. So both of them are really compiled to an actual infinite loop.