Re: dlls/winex11.drv/dib.c: initialize two warnings (RESEND)

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: dlls/winex11.drv/dib.c: initialize two warnings (RESEND)

by Alexandre Julliard :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gerald Pfeifer <gerald@...> writes:

> I verified that I still need this patch originally sent on May 31st
> to address to compiler warings with current versions of GCC 4.5.0.
>
> This seems to be the only invocation of DIB_GetBitmapInfo which
> requires this kind of extra initialization.

I expect you can avoid that by restructuring the code a little.

--
Alexandre Julliard
julliard@...



Parent Message unknown Re: dlls/winex11.drv/dib.c: initialize two warnings (RESEND)

by Alexandre Julliard :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gerald Pfeifer <gerald@...> writes:

> I looked into this in more detail, and now remember why I couldn't
> do this.
>
> From X11DRV_GetDIBits() we invoke DIB_GetBitmapInfo() with these
> two variables being passed by addresses which in turns forwards to
> DIB_GetBitmapInfoEx().  And there we have a default case of
>
>     ERR("(%d): unknown/wrong size for header\n", header->biSize );
>     return -1;
>
> where indeed height and width are not initialized, so GCC 4.5 is right.

No, because the error case causes the caller function to return without
using them. The idea was to reorder the code so that gcc can figure this
out, as it does already in the other cases.

--
Alexandre Julliard
julliard@...