wined3d: remove a useless variable

David Adam david.adam.cnrs at gmail.com
Sun Nov 14 13:56:59 CST 2010


OK. I missed that.
Sorry for the noise....

A+

David

2010/11/14 Nikolay Sivov <nsivov at codeweavers.com>

>  On 11/14/2010 22:41, David Adam wrote:
>
>
>
> 2010/11/14 Nikolay Sivov <nsivov at codeweavers.com>
>
>> On 11/14/2010 22:17, David Adam wrote:
>>
>>       if(wined3d_settings.rendertargetlock_mode == RTL_DISABLE) {
>>> -        static BOOL warned = FALSE;
>>> -        if(!warned) {
>>> -            ERR("The application tries to lock the render target, but
>>> render target locking is disabled\n");
>>> -            warned = TRUE;
>>> -        }
>>> +        ERR("The application tries to lock the render target, but render
>>> target locking is disabled\n");
>>>          return;
>>>      }
>>>
>> Why is it useless?
>>
>
> Maybe I missed something:
>
> Since warned= False we always enter in the if condition. Then warned=TRUE.
> But we leave the first if condition that is the lifetime of the variable. So
> the variable is destroyed ans is useless.
>
> Am I wrong?
>
> Well, yes. It's static. It's used to display error output once.
>
>
> A+
>
> David
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20101114/e7f8e167/attachment.htm>


More information about the wine-devel mailing list