Bug 94913 - Stylechecker warns about comparison to zero when comparing to 0.5
Summary: Stylechecker warns about comparison to zero when comparing to 0.5
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dominik Röttsches (drott)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-24 01:39 PDT by Dominik Röttsches (drott)
Modified: 2012-08-29 13:05 PDT (History)
7 users (show)

See Also:


Attachments
cpp.py regex fix. (3.00 KB, patch)
2012-08-29 06:14 PDT, Dominik Röttsches (drott)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Röttsches (drott) 2012-08-24 01:39:42 PDT
Stylechecker comlains about the following line
    if (fabs(result - value) == 0.5 && (result & 1))
with 
"Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]"

I believe that's a mistake.
Comment 1 Dominik Röttsches (drott) 2012-08-29 06:14:14 PDT
Created attachment 161208 [details]
cpp.py regex fix.
Comment 2 WebKit Review Bot 2012-08-29 13:05:32 PDT
Comment on attachment 161208 [details]
cpp.py regex fix.

Clearing flags on attachment: 161208

Committed r127036: <http://trac.webkit.org/changeset/127036>
Comment 3 WebKit Review Bot 2012-08-29 13:05:37 PDT
All reviewed patches have been landed.  Closing bug.