Title: [113565] trunk/Tools
Revision
113565
Author
[email protected]
Date
2012-04-09 02:48:31 -0700 (Mon, 09 Apr 2012)

Log Message

check-webkit-style should ignore NULL usage in gtk_style_context_get_style
https://bugs.webkit.org/show_bug.cgi?id=83412

Patch by Martin Robinson <[email protected]> on 2012-04-09
Reviewed by David Levin.

Accept NULL as an argument for gtk_style_context_get_style, because it's
used as a sentinel in a variable argument list.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_for_null): Add an exception.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(WebKitStyleTest.test_null_false_zero): Add a test for the exception.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (113564 => 113565)


--- trunk/Tools/ChangeLog	2012-04-09 09:42:56 UTC (rev 113564)
+++ trunk/Tools/ChangeLog	2012-04-09 09:48:31 UTC (rev 113565)
@@ -1,3 +1,18 @@
+2012-04-09  Martin Robinson  <[email protected]>
+
+        check-webkit-style should ignore NULL usage in gtk_style_context_get_style
+        https://bugs.webkit.org/show_bug.cgi?id=83412
+
+        Reviewed by David Levin.
+
+        Accept NULL as an argument for gtk_style_context_get_style, because it's
+        used as a sentinel in a variable argument list. 
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_for_null): Add an exception.
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (WebKitStyleTest.test_null_false_zero): Add a test for the exception.
+
 2012-04-09  Dirk Pranke  <[email protected]>
 
         webkitpy: use the filesystem object properly in fileuploader

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (113564 => 113565)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2012-04-09 09:42:56 UTC (rev 113564)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2012-04-09 09:48:31 UTC (rev 113565)
@@ -2433,8 +2433,8 @@
     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):
+    # Don't warn about NULL usage in gtk_widget_style_get() or gtk_style_context_get_style. See Bug 51758
+    if search(r'\bgtk_widget_style_get\(\w+\b', line) or search(r'\bgtk_style_context_get_style\(\w+\b', line):
         return
 
     # Don't warn about NULL usage in soup_server_new(). See Bug 77890.

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (113564 => 113565)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2012-04-09 09:42:56 UTC (rev 113564)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2012-04-09 09:48:31 UTC (rev 113565)
@@ -4268,6 +4268,9 @@
             'gtk_widget_style_get(style, "propertyName", &value, "otherName", &otherValue, NULL);',
             '')
         self.assert_lint(
+            'gtk_style_context_get_style(context, "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')
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to