[PATCH] comctl32/datetime: Avoid a clang warning.

Huw Davies huw at codeweavers.com
Fri Mar 23 06:44:59 CDT 2018


On Fri, Mar 23, 2018 at 02:42:50PM +0300, Nikolay Sivov wrote:
> On 3/23/2018 2:35 PM, 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.
> 
> Another option is to return width as a return value. Having error status
> return seems like an overkill to me.

Yes, I just realised that too :)



More information about the wine-devel mailing list