winmm: Sign-compare warning fix (Resend)
Michael Stefaniuc
mstefani at redhat.com
Thu Dec 11 18:58:04 CST 2008
Andrew Talbot wrote:
> What is wrong with this patch, please?
If I may venture a guess: You have replaced a nice and concise for loop
into and ugly 4 line while loop.
bye
michael
> ---
> Changelog:
> winmm: Sign-compare warning fix.
>
> diff --git a/dlls/winmm/lolvldrv.c b/dlls/winmm/lolvldrv.c
> index 794c117..946d0d0 100644
> --- a/dlls/winmm/lolvldrv.c
> +++ b/dlls/winmm/lolvldrv.c
> @@ -737,7 +737,7 @@ static BOOL MMDRV_ExitPerType(LPWINE_MM_DRIVER lpDrv, UINT type)
> */
> void MMDRV_Exit(void)
> {
> - int i;
> + unsigned int i;
> TRACE("()\n");
>
> for (i = 0; i < sizeof(MM_MLDrvs) / sizeof(MM_MLDrvs[0]); i++)
> @@ -753,8 +753,11 @@ void MMDRV_Exit(void)
> }
>
> /* unload driver, in reverse order of loading */
> - for (i = sizeof(MMDrvs) / sizeof(MMDrvs[0]) - 1; i >= 0; i--)
> + i = sizeof(MMDrvs) / sizeof(MMDrvs[0]);
> + while (i > 0)
> {
> + --i;
> +
> MMDRV_ExitPerType(&MMDrvs[i], MMDRV_AUX);
> MMDRV_ExitPerType(&MMDrvs[i], MMDRV_MIXER);
> MMDRV_ExitPerType(&MMDrvs[i], MMDRV_MIDIIN);
>
>
--
Michael Stefaniuc Tel.: +49-711-96437-199
Consulting Communications Engineer Fax.: +49-711-96437-111
--------------------------------------------------------------------
Reg. Adresse: Red Hat GmbH, Otto-Hahn-Strasse 20, 85609 Dornach bei Muenchen
Handelsregister: Amtsgericht Muenchen HRB 153243
Geschäftsführer: Brendan Lane, Charlie Peters, Michael Cunningham,
Werner Knoblich
More information about the wine-devel
mailing list