Changeset 97983 in webkit


Ignore:
Timestamp:
Oct 20, 2011 8:47:57 AM (12 years ago)
Author:
Philippe Normand
Message:

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

Reviewed by David Levin.

  • Scripts/webkitpy/style/checkers/cpp.py: Simplified the detection

of gst_ calls. Now just ignore NULL in all of them.

  • Scripts/webkitpy/style/checkers/cpp_unittest.py: Test for above change.
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r97976 r97983  
     12011-10-20  Philippe Normand  <pnormand@igalia.com>
     2
     3        [style] Allow usage of NULL in gst_*
     4        https://bugs.webkit.org/show_bug.cgi?id=70498
     5
     6        Reviewed by David Levin.
     7
     8        * Scripts/webkitpy/style/checkers/cpp.py: Simplified the detection
     9        of gst_ calls. Now just ignore NULL in all of them.
     10        * Scripts/webkitpy/style/checkers/cpp_unittest.py: Test for above change.
     11
    1122011-10-20  Leandro Pereira  <leandro@profusion.mobi>
    213
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py

    r97077 r97983  
    23782378        return
    23792379
    2380     # Don't warn about NULL usage in gst_*_many(). See Bug 39740
    2381     if search(r'\bgst_\w+_many\b', line):
    2382         return
    2383 
    2384     # Don't warn about NULL usage in some gst_structure_*(). See Bug 67194.
    2385     if search(r'\bgst_structure_[sg]et\b', line):
    2386         return
    2387     if search(r'\bgst_structure_remove_fields\b', line):
    2388         return
    2389     if search(r'\bgst_structure_new\b', line):
    2390         return
    2391     if search(r'\bgst_structure_id_new\b', line):
    2392         return
    2393     if search(r'\bgst_structure_id_[sg]et\b', line):
    2394         return
    2395 
    2396     # Don't warn about NULL usage in g_str{join,concat}(). See Bug 34834
    2397     if search(r'\bg_str(join|concat)\b', line):
     2380    # Don't warn about NULL usage in gst_*(). See Bug 70498.
     2381    if search(r'\bgst(_[a-z]+)+\b', line):
    23982382        return
    23992383
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

    r97077 r97983  
    41294129            '')
    41304130        self.assert_lint(
     4131            'gst_caps_new_simple(mime, "value", G_TYPE_INT, &value, NULL);',
     4132            '')
     4133        self.assert_lint(
     4134            'gst_caps_new_full(structure1, structure2, NULL);',
     4135            '')
     4136        self.assert_lint(
    41314137            'gchar* result = g_strconcat("part1", "part2", "part3", NULL);',
    41324138            '')
Note: See TracChangeset for help on using the changeset viewer.