Changeset 181669 in webkit
- Timestamp:
- Mar 17, 2015, 3:57:40 PM (11 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/webkitpy/style/checkers/cpp.py (modified) (1 diff)
-
Scripts/webkitpy/style/checkers/cpp_unittest.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r181663 r181669 1 2015-03-17 Dean Jackson <dino@apple.com> 2 3 check-webkit-style should allow "bool a : 1" 4 https://bugs.webkit.org/show_bug.cgi?id=142794 5 6 Reviewed by Brent Fulgham. 7 8 We should allow member bitfields of the form: 9 10 bool m_var : 1; 11 12 It seems that Visual Studio 8 was the last compiler that 13 wasn't happy about not using unsigned here. We already have 14 about 500 cases (in WebCore) where people were ignoring this rule. 15 16 * Scripts/webkitpy/style/checkers/cpp.py: 17 (check_language): Allow "bool". 18 * Scripts/webkitpy/style/checkers/cpp_unittest.py: Add tests. 19 (CppStyleTest.test_enum_bitfields): 20 (CppStyleTest.test_plain_integral_bitfields): 21 1 22 2015-03-17 Benjamin Poulain <bpoulain@apple.com> 2 23 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r180981 r181669 3274 3274 if matched: 3275 3275 # Make sure the type is an enum and not an integral type 3276 if not match(r' char|(short(\s+int)?)|int|long(\s+(long|int))|(signed|unsigned)(\s+int)?', matched.group(3)):3276 if not match(r'bool|char|(short(\s+int)?)|int|long(\s+(long|int))|(signed|unsigned)(\s+int)?', matched.group(3)): 3277 3277 error(line_number, 'runtime/enum_bitfields', 5, 3278 3278 'Please declare enum bitfields as unsigned integral types.') -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r180981 r181669 2553 2553 self.assert_lint('mutable AnEnum a : 14;', errmsg) 2554 2554 self.assert_lint('const AnEnum a : 6;', errmsg) 2555 self.assert_lint('bool a : 1;', '') 2555 2556 2556 2557 # Integral bitfields must be declared with either signed or unsigned keyword. … … 2563 2564 self.assert_lint('long int a : 30;', errmsg) 2564 2565 self.assert_lint('int a = 1 ? 0 : 30;', '') 2565 2566 self.assert_lint('bool a : 1;', '') 2566 2567 2567 2568 class CleansedLinesTest(unittest.TestCase):
Note:
See TracChangeset
for help on using the changeset viewer.