[vlc-devel] [PATCH] 6 small npapi patch.

Sergey Radionov rsatom at gmail.com
Mon Nov 14 06:44:47 CET 2011


2011/11/14 Sergey Radionov <rsatom at gmail.com>

>
> > > About the "!=0" addition I think it would be clearer if you add a "!!"
>> > > in front of the variable to make sure it is 0 or 1.
>> > > Does that fix the warning?
>> > >
>> > No, it is not work. I try to eliminate
>> > *
>> > warning C4800: 'int' : forcing value to bool 'true' or 'false'
>> (performance
>> > warning)*
>> >
>> > But '!' (and therefore '!!') need bool argument, so it is not eliminate
>> > problem.
>>
> I think I say stupidity. I will see C++ standard to find why '!!' not
solve warnining...



>
>> Weird, we have a lot of pointers comparison using !
>>
>> like: pointer = malloc(1234);
>> if (!pointer) ....
>>
> It is not same thing. Warning C4800 corresponds only to assignment of int
> to bool variable:
> bool b = (int)10;
> but "if" not requare bool.
>
> In addition, I think this warning is specific only to Visual C++, not
> gcc, but I am not shure.
>
>
>
>>
>> > So the more correct way (in C++) make bool from int, is compare it with
>> > zero.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20111114/14e53c71/attachment.html>


More information about the vlc-devel mailing list