Changeset 185245 in webkit
- Timestamp:
- Jun 5, 2015 4:06:49 AM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r185244 r185245 1 2015-06-04 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 3 check-webkit-style should recommend using nullptr instead of recommending using 0 for the null pointer in C++ code. 4 https://bugs.webkit.org/show_bug.cgi?id=145680 5 6 Reviewed by Brent Fulgham. 7 8 * Scripts/webkitpy/style/checkers/cpp.py: 9 (check_for_null): 10 * Scripts/webkitpy/style/checkers/cpp_unittest.py: 11 (WebKitStyleTest.test_null_false_zero): 12 1 13 2015-06-05 Stephanie Lewis <slewis@apple.com> 2 14 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r183567 r185245 2723 2723 # FIXME: We should recommend using nullptr instead of NULL in C++ code per 2724 2724 # <http://www.webkit.org/coding/coding-style.html#zero-null>. 2725 error(line_number, 'readability/null', 5, 'Use 0instead of NULL.')2725 error(line_number, 'readability/null', 5, 'Use nullptr instead of NULL.') 2726 2726 return 2727 2727 … … 2731 2731 # NULLs occurring in strings. 2732 2732 if search(r'\bNULL\b', line) and search(r'\bNULL\b', CleansedLines.collapse_strings(line)): 2733 # FIXME: We should recommend using nullptr instead of 0 or null in C++ code per 2734 # <http://www.webkit.org/coding/coding-style.html#zero-null>. 2735 error(line_number, 'readability/null', 4, 'Use 0 or null instead of NULL (even in *comments*).') 2733 error(line_number, 'readability/null', 4, 'Use nullptr instead of NULL (even in *comments*).') 2736 2734 2737 2735 def get_line_width(line): -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r183567 r185245 4600 4600 4601 4601 def test_null_false_zero(self): 4602 # 1. In C++, the null pointer value should be written as 0. In C,4602 # 1. In C++, the null pointer value should be written as nullptr. In C, 4603 4603 # it should be written as NULL. In Objective-C and Objective-C++, 4604 4604 # follow the guideline for C or C++, respectively, but use nil to … … 4606 4606 self.assert_lint( 4607 4607 'functionCall(NULL)', 4608 'Use 0instead of NULL.'4608 'Use nullptr instead of NULL.' 4609 4609 ' [readability/null] [5]', 4610 4610 'foo.cpp') 4611 4611 self.assert_lint( 4612 4612 "// Don't use NULL in comments since it isn't in code.", 4613 'Use 0 or nullinstead of NULL (even in *comments*).'4613 'Use nullptr instead of NULL (even in *comments*).' 4614 4614 ' [readability/null] [4]', 4615 4615 'foo.cpp') 4616 4616 self.assert_lint( 4617 4617 '"A string with NULL" // and a comment with NULL is tricky to flag correctly in cpp_style.', 4618 'Use 0 or nullinstead of NULL (even in *comments*).'4618 'Use nullptr instead of NULL (even in *comments*).' 4619 4619 ' [readability/null] [4]', 4620 4620 'foo.cpp') … … 4727 4727 self.assert_lint( 4728 4728 'gtk_widget_style_get_property(style, NULL, NULL);', 4729 'Use 0instead of NULL. [readability/null] [5]',4729 'Use nullptr instead of NULL. [readability/null] [5]', 4730 4730 'foo.cpp') 4731 4731 self.assert_lint( 4732 4732 'gtk_widget_style_get_valist(style, NULL, NULL);', 4733 'Use 0instead of NULL. [readability/null] [5]',4733 'Use nullptr instead of NULL. [readability/null] [5]', 4734 4734 'foo.cpp') 4735 4735 … … 4792 4792 self.assert_lint( 4793 4793 'if (LIKELY(foo == NULL))', 4794 'Use 0instead of NULL. [readability/null] [5]')4794 'Use nullptr instead of NULL. [readability/null] [5]') 4795 4795 self.assert_lint( 4796 4796 'if (UNLIKELY(foo == NULL))', 4797 'Use 0instead of NULL. [readability/null] [5]')4797 'Use nullptr instead of NULL. [readability/null] [5]') 4798 4798 4799 4799 def test_directive_indentation(self):
Note: See TracChangeset
for help on using the changeset viewer.