ASSERT(foo-- <= 0);
yay for debug builds :P
Sometimes when I'm working on a project I do things like this:
Although it's impossible for integer 'foo' to just skip a value(ie. in a loop) I always check to see if it's equal to or less then <number here> even if it's impossible for foo to be anything lower then that number. I feel much safer when I do it like this.Code:while( true ){ ... ... // just in case :D if( foo-- <= 0 ){ } }
Sounds familiar? Or do you do something like this?
Last edited by .::SCHiM::.; 12-18-2011 at 09:08 AM.
I'm SCHiM
Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.
Polymorphic engine
Interprocess callback class
SIN
Infinite-precision arithmetic
Hooking dynamic linkage
(sloppy)Kernel mode Disassembler!!!
Semi debugger
ASSERT(foo-- <= 0);
yay for debug builds :P
Ah we-a blaze the fyah, make it bun dem!
We never know.. we never know.. Yep same crap happens to me aswell.
Light travels faster than sound. That's why most people seem bright until you hear them speak.
Perhaps we should start the first religion for programmers we all know that foo can't skip a step in a loop and yet there is something...
I'm SCHiM
Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.
Polymorphic engine
Interprocess callback class
SIN
Infinite-precision arithmetic
Hooking dynamic linkage
(sloppy)Kernel mode Disassembler!!!
Semi debugger