Commit c6eca3b6 authored by mrobinson@webkit.org's avatar mrobinson@webkit.org

2010-12-30 Martin Robinson <mrobinson@igalia.com>

        Reviewed by Darin Adler.

        check-webkit-style should ignore NULL usage in calls to gtk_widget_style_get
        https://bugs.webkit.org/show_bug.cgi?id=51758

        Add a check-webkit-style exception for gtk_widget_style_get and NULL usage.

        * Scripts/webkitpy/style/checkers/cpp.py: Add the exception.
        * Scripts/webkitpy/style/checkers/cpp_unittest.py: Add some tests for this.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74809 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2a97615d
2010-12-30 Martin Robinson <mrobinson@igalia.com>
Reviewed by Darin Adler.
check-webkit-style should ignore NULL usage in calls to gtk_widget_style_get
https://bugs.webkit.org/show_bug.cgi?id=51758
Add a check-webkit-style exception for gtk_widget_style_get and NULL usage.
* Scripts/webkitpy/style/checkers/cpp.py: Add the exception.
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Add some tests for this.
2010-12-29 Patrick Gansterer <paroga@webkit.org>
Unreviewed WinCE buildfix.
......@@ -2283,6 +2283,10 @@ def check_for_null(clean_lines, line_number, file_state, error):
if search(r'\bgdk_pixbuf_save_to\w+\b', line):
return
# Don't warn about NULL usage in gtk_widget_style_get(). See Bug 51758.
if search(r'\bgtk_widget_style_get\(\w+\b', line):
return
if search(r'\bNULL\b', line):
error(line_number, 'readability/null', 5, 'Use 0 instead of NULL.')
return
......
......@@ -3858,6 +3858,17 @@ class WebKitStyleTest(CppStyleTestBase):
self.assert_lint(
'gchar* result = gdk_pixbuf_save_to_stream(pixbuf, function, data, type, error, NULL);',
'')
self.assert_lint(
'gtk_widget_style_get(style, "propertyName", &value, "otherName", &otherValue, NULL);',
'')
self.assert_lint(
'gtk_widget_style_get_property(style, NULL, NULL);',
'Use 0 instead of NULL. [readability/null] [5]',
'foo.cpp')
self.assert_lint(
'gtk_widget_style_get_valist(style, NULL, NULL);',
'Use 0 instead of NULL. [readability/null] [5]',
'foo.cpp')
# 2. C++ and C bool values should be written as true and
# false. Objective-C BOOL values should be written as YES and NO.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment