[PATCH] comctl32/datetime: Avoid a clang warning.
Huw Davies
huw at codeweavers.com
Fri Mar 23 06:43:36 CDT 2018
On Fri, Mar 23, 2018 at 11:35:52AM +0000, Huw Davies wrote:
> On Wed, Mar 21, 2018 at 05:32:40PM +0800, Zhiyi Zhang wrote:
> >
> > Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
> > ---
> > dlls/comctl32/datetime.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> >
>
> > diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
> > index 6231070240..99a1856bfe 100644
> > --- a/dlls/comctl32/datetime.c
> > +++ b/dlls/comctl32/datetime.c
> > @@ -1477,6 +1477,7 @@ static BOOL DATETIME_GetIdealSize(DATETIME_INFO *infoPtr, SIZE *size)
> > /* Get text font width */
> > for (i = 0; i < infoPtr->nrFields; i++)
> > {
> > + width = 0;
> > DATETIME_ReturnFieldWidth(infoPtr, hdc, i, &width);
> > size->cx += width;
> > }
> >
>
> Either DATETIME_ReturnFieldWidth() should zero-init *width, or it
> should return a BOOL to indicate success which should be checked
> by the callers.
Actually, if you don't need the error return, the function could
simply return the width.
Huw.
More information about the wine-devel
mailing list