Title: [94153] trunk/Tools
Revision
94153
Author
[email protected]
Date
2011-08-30 23:55:19 -0700 (Tue, 30 Aug 2011)

Log Message

        [stylechecker] complains about NULL usage in some gst_structure_ calls
        https://bugs.webkit.org/show_bug.cgi?id=67194

        Reviewed by Martin Robinson.

        Don't warn about NULL in some gst_structure_ calls. 0 can't be
        used for these, a proper sentinel is required.

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

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (94152 => 94153)


--- trunk/Tools/ChangeLog	2011-08-31 06:21:13 UTC (rev 94152)
+++ trunk/Tools/ChangeLog	2011-08-31 06:55:19 UTC (rev 94153)
@@ -1,3 +1,16 @@
+2011-08-30  Philippe Normand  <[email protected]>
+
+        [stylechecker] complains about NULL usage in some gst_structure_ calls
+        https://bugs.webkit.org/show_bug.cgi?id=67194
+
+        Reviewed by Martin Robinson.
+
+        Don't warn about NULL in some gst_structure_ calls. 0 can't be
+        used for these, a proper sentinel is required.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+
 2011-08-30  Adam Barth  <[email protected]>
 
         Remove old-style UI from garden-o-matic

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2011-08-31 06:21:13 UTC (rev 94152)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2011-08-31 06:55:19 UTC (rev 94153)
@@ -2381,6 +2381,18 @@
     if search(r'\bgst_\w+_many\b', line):
         return
 
+    # Don't warn about NULL usage in some gst_structure_*(). See Bug 67194.
+    if search(r'\bgst_structure_[sg]et\b', line):
+        return
+    if search(r'\bgst_structure_remove_fields\b', line):
+        return
+    if search(r'\bgst_structure_new\b', line):
+        return
+    if search(r'\bgst_structure_id_new\b', line):
+        return
+    if search(r'\bgst_structure_id_[sg]et\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

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2011-08-31 06:21:13 UTC (rev 94152)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2011-08-31 06:55:19 UTC (rev 94153)
@@ -4092,6 +4092,27 @@
             'gst_element_unlink_many(foo, bar, boo, NULL);',
             '')
         self.assert_lint(
+            'gst_structure_get(foo, "value", G_TYPE_INT, &value, NULL);',
+            '')
+        self.assert_lint(
+            'gst_structure_set(foo, "value", G_TYPE_INT, value, NULL);',
+            '')
+        self.assert_lint(
+            'gst_structure_remove_fields(foo, "value", "bar", NULL);',
+            '')
+        self.assert_lint(
+            'gst_structure_new("foo", "value", G_TYPE_INT, value, NULL);',
+            '')
+        self.assert_lint(
+            'gst_structure_id_new(FOO, VALUE, G_TYPE_INT, value, NULL);',
+            '')
+        self.assert_lint(
+            'gst_structure_id_set(FOO, VALUE, G_TYPE_INT, value, NULL);',
+            '')
+        self.assert_lint(
+            'gst_structure_id_get(FOO, VALUE, G_TYPE_INT, &value, NULL);',
+            '')
+        self.assert_lint(
             'gchar* result = g_strconcat("part1", "part2", "part3", NULL);',
             '')
         self.assert_lint(
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to