2010-05-26 Philippe Normand <pnormand@igalia.com>
authorphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 May 2010 09:21:24 +0000 (09:21 +0000)
committerphiln@webkit.org <philn@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 May 2010 09:21:24 +0000 (09:21 +0000)
        Reviewed by David Levin.

        [style] Allow usage of NULL in gst_*_many()
        https://bugs.webkit.org/show_bug.cgi?id=39740

        Don't warn if NULL is used by gst_*_many() functions. Zero can't
        be used for the reason explained in Bug 32858.

        * Scripts/webkitpy/style/checkers/cpp.py:
        * Scripts/webkitpy/style/checkers/cpp_unittest.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@60283 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py

index 398fd48..0a06e7d 100644 (file)
@@ -1,3 +1,16 @@
+2010-05-26  Philippe Normand  <pnormand@igalia.com>
+
+        Reviewed by David Levin.
+
+        [style] Allow usage of NULL in gst_*_many()
+        https://bugs.webkit.org/show_bug.cgi?id=39740
+
+        Don't warn if NULL is used by gst_*_many() functions. Zero can't
+        be used for the reason explained in Bug 32858.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+
 2010-05-27  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index 3e787d6..1570338 100644 (file)
@@ -1872,6 +1872,10 @@ def check_for_null(file_extension, clean_lines, line_number, error):
     if search(r'\bg_object_[sg]et\b', line):
         return
 
+    # Don't warn about NULL usage in gst_*_many(). See Bug 39740
+    if search(r'\bgst_\w+_many\b', line):
+        return
+
     # Don't warn about NULL usage in g_str{join,concat}(). See Bug 34834
     if search(r'\bg_str(join|concat)\b', line):
         return
index 5a5aabd..aea34cc 100644 (file)
@@ -3437,6 +3437,18 @@ class WebKitStyleTest(CppStyleTestBase):
             'g_object_set(foo, "prop", bar, NULL);',
             '')
         self.assert_lint(
+            'gst_bin_add_many(foo, bar, boo, NULL);',
+            '')
+        self.assert_lint(
+            'gst_bin_remove_many(foo, bar, boo, NULL);',
+            '')
+        self.assert_lint(
+            'gst_element_link_many(foo, bar, boo, NULL);',
+            '')
+        self.assert_lint(
+            'gst_element_unlink_many(foo, bar, boo, NULL);',
+            '')
+        self.assert_lint(
             'gchar* result = g_strconcat("part1", "part2", "part3", NULL);',
             '')
         self.assert_lint(