<div dir="ltr"><br><br><br>2014-05-30 8:01 GMT-07:00 Marcello Maggioni <<a href="mailto:hayarms@gmail.com">hayarms@gmail.com</a>>:<br>><br>><br>><br>><br>> 2014-05-29 23:08 GMT-07:00 Pete Cooper <<a href="mailto:peter_cooper@apple.com">peter_cooper@apple.com</a>>:<br>
><br>>> Hi Marcello<br>>><br>>> This is great.  Thanks for working on this.<br>>><br>>> So the first patch "flag_nodes.patch” contains quite a bit of code cleanup.  Its all good cleanup, but as there’s quite a lot of it can you please separate it out and rebase the other patches on top of the cleanup work.<br>
>><br>>> The * here is a neat trick, but not really valid for a bool.  Would && work the same?<br>>><br>>> +    SubclassData = <br>>> +      (SubclassData & ~NUW) | (b * NUW);<br>
>><br>><br>> Hmm, I have to admit I copied this from the approach used in the Operator.h:89 for the "OverflowingBinaryOperator" class.<br>><br>> I thought it was strange, but I assumed it worked because it was there. Maybe would be a good idea to change it everywhere? (in two separate patches)<br>
>  <br><br><br>More on this.<br><br>I think this should work because in the C++ standard I found:<br><br> §4.7/4  (Integral Conversion):<br><br>If the source type is bool, the value false is converted to zero and the value true is converted to one.<div>
<br></div><div><br></div><div>So ideally "true" is converted to 1 for the multiplication and (1 * FLAG) == FLAG.</div><div><br></div><div>  (SubclassData & ~NUW) | (b && NUW); <br></div><div>I don't think would work (if that is what you meant).</div>
<div><br></div><div>Otherwise there is the more standard:</div><div>(SubclassData & ~NUW) | (b ? NUW : 0); <br></div><div><br></div><div>Marcello</div></div>