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

Sergey Radionov rsatom at gmail.com
Mon Nov 14 06:38:56 CET 2011


2011/11/14 Rafaël Carré <funman at videolan.org>

> Yeah.
>
> And since the declaration in my unix headers don't return const I
> committed a workaround which work for both: see a9aa594f5
>
 Yes, I'v seen it, but now compilation under Visual Studio is broken :) But
don't worry, I'll make patch for it.


> > > 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.
>
> 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/3c33ed23/attachment.html>


More information about the vlc-devel mailing list