[Webkit-unassigned] [Bug 143457] Fix -Wparentheses warning with GCC 5 in SaturatedArithmetic.h

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 6 16:08:48 PDT 2015


https://bugs.webkit.org/show_bug.cgi?id=143457

Michael Catanzaro <mcatanzaro at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |benjamin at webkit.org,
                   |                            |mcatanzaro at igalia.com,
                   |                            |zan at falconsigh.net

--- Comment #1 from Michael Catanzaro <mcatanzaro at igalia.com> ---
(In reply to comment #0)
> Another option is to use &&:
> 
> !((ua ^ ub) >> 31) && (uresult ^ ua) >> 31;

Didn't squint hard enough; that needs more parentheses. The choices are:

(!((ua ^ ub) >> 31)) & (uresult ^ ua) >> 31;

or

!((ua ^ ub) >> 31) && ((uresult ^ ua) >> 31);

I think I prefer the later.



For subtraction, we currently have this:

(ua ^ ub) >> 31 & (uresult ^ ua) >> 31

If we use && for addition, we'd want to use && there as well, so it would become:

((ua ^ ub) >> 31) && ((uresult ^ ua) >> 31)

That seems a bit clearer....

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150406/9f959408/attachment.html>


More information about the webkit-unassigned mailing list