<br><br><div class="gmail_quote">2011/11/14 Sergey Radionov <span dir="ltr"><<a href="mailto:rsatom@gmail.com">rsatom@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex"><div>
> > About the "!=0" addition I think it would be clearer if you add a "!!"<br>
> > in front of the variable to make sure it is 0 or 1.<br>
> > Does that fix the warning?<br>
> ><br>
> No, it is not work. I try to eliminate<br>
</div>> *<br>
<div>> warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance<br>
</div>> warning)*<br>
<div>><br>
> But '!' (and therefore '!!') need bool argument, so it is not eliminate<br>
> problem.<br></div></blockquote></div></div></blockquote><div>I think I say stupidity. I will see C++ standard to find why '!!' not solve warnining...<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>
<br>
</div>Weird, we have a lot of pointers comparison using !<br>
<br>
like: pointer = malloc(1234);<br>
if (!pointer) ....<br></blockquote></div><div>It is not same thing. Warning C4800 corresponds only to assignment of int to bool variable:<br>bool b = (int)10;<br>but "if" not requare bool.<br><br><span lang="en"><span>In addition</span></span>, I think this warning is specific only to Visual C++, not gcc, but I am not shure.<br>
<br> </div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div><br>
> So the more correct way (in C++) make bool from int, is compare it with<br>
> zero.<br></div></blockquote></div></div><br>
</blockquote></div><br>