riched20: Use SetRect instead of open coding it.

Michael Stefaniuc mstefani at redhat.com
Mon Apr 18 07:37:13 CDT 2016


On 04/18/2016 01:31 PM, Huw Davies wrote:
> On 18 Apr 2016, at 09:11, Michael Stefaniuc <mstefani at redhat.de> wrote:
>> --- a/dlls/riched20/paint.c
>> +++ b/dlls/riched20/paint.c
>> @@ -617,10 +617,8 @@ static void ME_DrawParaDecoration(ME_Context* c, ME_Paragraph* para, int y, RECT
>>       MoveToEx(c->hDC, c->pt.x, y + bounds->top, NULL);
>>       LineTo(c->hDC, c->pt.x, y + para->nHeight - bounds->bottom);
>>       if (border_details[idx].dble) {
>> -        rc.left = c->pt.x + 1;
>> -        rc.right = rc.left + border_width;
>> -        rc.top = y + bounds->top;
>> -        rc.bottom = y + para->nHeight - bounds->bottom;
>> +        SetRect(&rc, c->pt.x + 1, y + bounds->top, rc.left + border_width,
>> +                y + para->nHeight - bounds->bottom);
> 
> 
> This is using rc.left uninitialised.
Thanks Huw for catching this!

I have amended my coccinelle script to generate compile failures in
those cases. There were two more of those in my patch.

How do you prefer to handle this cases? Still use SetRect() or leave
them open coded?

thanks
bye
	michael



More information about the wine-devel mailing list