Also I doubt everyone would agree that the one exit condition is more clear. For example, if I know that if e->inuse is 0 it will continue with the next round. Arguably it's more difficult to understand that from the single combined expression—because it isn't so: if !e->inuse but e == ent->client->chase_target, the original will loop but yours will exit.
Though I'm guessing ent->client->chase_target->inuse is probably never 0.
No, the continue statement will jump to the test part also for `do' loops:
"The continue statement is related to break, but less often used; it causes the next iteration of the enclosing for, while, or do loop to begin. In the while and do, this means that the test part is executed immediately"
-- "The C programming language (Second Edition)"
The best reason not to re-write for style reasons is you break it.
I'd say I prefer the original.
do {
...
} while (p);
guarantees that p is false after the loop and this makes it easier to reason about the program. With breaks, however, the loop could be "lying" so to speak.This approach also works fine for c++ and c# code (probably also java too), which I like as it keeps my projects nice and consistent and I can jump between codebases and feel at home.
The only thing that I don't like about it is the if() statements not being contained in {}'ies. That always makes me nervous.
The first example makes it very clear that condition A means do it again and condition B means exit this loop while condition C establishes the boundaries of the loop.