winmm: Sign-compare warning fix (Resend)

James Mckenzie jjmckenzie51 at
Fri Dec 12 10:07:53 CST 2008

Peter Rosin <peda at> at: Dec 12, 2008 4:27 AM wrote about: RE: winmm: Sign-compare warning fix (Resend)
>> But how would you then fix the sign-compare violation, or 
>> would you just let this one go?
>If you want it to be more compact:
>  unsigned int i;
>  ...
>  for (i = sizeof(foo) / sizeof(foo[0]) - 1; ~i; --i)
>Tested? No.
>Readable? Don't ask me... :-)
I understood it, but is not the goal to avoid the use of C++ constructs in WINE code?

The real question is why convert a for loop to a while loop?  My guess is to avoid a possible empty or zero length foo.  Of course, there should be a check before this for an empty or misformed foo[0] avoiding a divide by zero error.

James McKenzie

More information about the wine-devel mailing list