Changeset 88256 in webkit
- Timestamp:
- Jun 7, 2011 12:55:04 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r88246 r88256 1 2011-06-07 Dmitry Lomov <dslomov@google.com> 2 3 Reviewed by David Levin. 4 5 https://bugs.webkit.org/show_bug.cgi?id=62215 6 Allow comparisons with 0 in LIKELY and UNLIKELY macros. 7 8 * Scripts/webkitpy/style/checkers/cpp.py: 9 * Scripts/webkitpy/style/checkers/cpp_unittest.py: 10 1 11 2011-06-07 Nico Weber <thakis@chromium.org> 2 12 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r88179 r88256 2342 2342 # Include NULL here so that users don't have to convert NULL to 0 first and then get this error. 2343 2343 if search(r'[=!]=\s*(NULL|0|true|false)\W', line) or search(r'\W(NULL|0|true|false)\s*[=!]=', line): 2344 error(line_number, 'readability/comparison_to_zero', 5, 2345 'Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.') 2344 if not search('LIKELY', line) and not search('UNLIKELY', line): 2345 error(line_number, 'readability/comparison_to_zero', 5, 2346 'Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.') 2346 2347 2347 2348 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r88179 r88256 4138 4138 'if (othertrue == fontType)', 4139 4139 '') 4140 self.assert_lint( 4141 'if (LIKELY(foo == 0))', 4142 '') 4143 self.assert_lint( 4144 'if (UNLIKELY(foo == 0))', 4145 '') 4146 self.assert_lint( 4147 'if (LIKELY(foo == NULL))', 4148 'Use 0 instead of NULL. [readability/null] [5]') 4149 self.assert_lint( 4150 'if (UNLIKELY(foo == NULL))', 4151 'Use 0 instead of NULL. [readability/null] [5]') 4152 4140 4153 4141 4154 def test_using_std(self):
Note: See TracChangeset
for help on using the changeset viewer.