diff options
| author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-09-10 19:10:20 +0200 |
| commit | 284837daa07b29d6a63a748544a90b1f5842ac5c (patch) | |
| tree | ecd258180bde91fe741e0cfd2638beb3c6da7e8e /Tools/Scripts/webkitpy/style/checkers/cpp.py | |
| parent | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (diff) | |
| download | qtwebkit-284837daa07b29d6a63a748544a90b1f5842ac5c.tar.gz | |
Imported WebKit commit 68645295d2e3e09af2c942f092556f06aa5f8b0d (http://svn.webkit.org/repository/webkit/trunk@128073)
New snapshot
Diffstat (limited to 'Tools/Scripts/webkitpy/style/checkers/cpp.py')
| -rw-r--r-- | Tools/Scripts/webkitpy/style/checkers/cpp.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp.py b/Tools/Scripts/webkitpy/style/checkers/cpp.py index 45c49aab4..1e3f8767f 100644 --- a/Tools/Scripts/webkitpy/style/checkers/cpp.py +++ b/Tools/Scripts/webkitpy/style/checkers/cpp.py @@ -2425,7 +2425,7 @@ def check_for_comparisons_to_zero(clean_lines, line_number, error): line = clean_lines.elided[line_number] # Include NULL here so that users don't have to convert NULL to 0 first and then get this error. - if search(r'[=!]=\s*(NULL|0|true|false)\W', line) or search(r'\W(NULL|0|true|false)\s*[=!]=', line): + if search(r'[=!]=\s*(NULL|0|true|false)[^\w.]', line) or search(r'[^\w.](NULL|0|true|false)\s*[=!]=', line): if not search('LIKELY', line) and not search('UNLIKELY', line): error(line_number, 'readability/comparison_to_zero', 5, 'Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.') |
