for loop fixes
Andreas Mohr
a.mohr at mailto.de
Sun Mar 4 10:00:10 CST 2001
On Sat, Mar 03, 2001 at 07:17:41PM -0800, Francois Gouget wrote:
> On Sat, 3 Mar 2001, Andreas Mohr wrote:
> [...]
> > - changed all terminating ";" of isolated for loops to " ;" to indicate the
> > loop's isolation.
>
> IMHO, for such loops the following would be much clearer:
>
> <init_expression>;
> while (<test_condition>) {
> <update_expression>;
> }
>
> (ok, you can also put '{' on the next line)
Right.
> > Please do the same for these for loops in the future.
>
> ???
Well, I just meant that they should always use " ;" instead of ";".
But your proposal is probably much better.
> > Somebody might want to write a Wine coding guidelines article...
>
> $ wg . -E 'for *\(' | grep -E '\) *; *$'` | wc -l
> 96
>
> (wg is my recursive source grep script)
>
> Maybe we should ask people to put the for and the instruction it
> applies to on separate lines. Combined with the suggestion above this
> would make it easier to check for this kind of bug.
Correct.
> > P.S.: I just *knew* that at least one other for loop in Wine would be wrong,
> > too ;-)
>
> Yep, I should have done that myself (if you find a generic bug,
> always check for other similar bugs).
I always do that when someone spots a generic bug :-)
Andreas Mohr
More information about the wine-devel
mailing list