[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

hamaji at chromium.org hamaji at chromium.org
Fri Feb 26 22:23:27 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 092ab0e8f19f1ec5b6b41d035e88e173f9ff2265
Author: hamaji at chromium.org <hamaji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Feb 18 02:13:03 2010 +0000

    2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
    
            Reviewed by Eric Seidel.
    
            check-webkit-style: Misses variables that contain underscores.
            https://bugs.webkit.org/show_bug.cgi?id=33724
    
            - Check identifiers whose types are unsigned.
            - Check bitfields properly.
    
            * Scripts/webkitpy/style/processors/cpp.py:
            * Scripts/webkitpy/style/processors/cpp_unittest.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54918 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index a81b236..e718d8f 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,19 @@
 
         Reviewed by Eric Seidel.
 
+        check-webkit-style: Misses variables that contain underscores.
+        https://bugs.webkit.org/show_bug.cgi?id=33724
+
+        - Check identifiers whose types are unsigned.
+        - Check bitfields properly.
+
+        * Scripts/webkitpy/style/processors/cpp.py:
+        * Scripts/webkitpy/style/processors/cpp_unittest.py:
+
+2010-02-17  Shinichiro Hamaji  <hamaji at chromium.org>
+
+        Reviewed by Eric Seidel.
+
         check-webkit-style should report the number of files checked
         https://bugs.webkit.org/show_bug.cgi?id=34971
 
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
index b94a91b..f83ae6a 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
@@ -2425,7 +2425,9 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
     # Convert "long long", "long double", and "long long int" to
     # simple types, but don't remove simple "long".
     line = sub(r'long (long )?(?=long|double|int)', '', line)
-    line = sub(r'\b(unsigned|signed|inline|using|static|const|volatile|auto|register|extern|typedef|restrict|struct|class|virtual)(?=\W)', '', line)
+    # Convert unsigned/signed types to simple types, too.
+    line = sub(r'(unsigned|signed) (?=char|short|int|long)', '', line)
+    line = sub(r'\b(inline|using|static|const|volatile|auto|register|extern|typedef|restrict|struct|class|virtual)(?=\W)', '', line)
 
     # Remove all template parameters by removing matching < and >.
     # Loop until no templates are removed to remove nested templates.
@@ -2453,8 +2455,9 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
     # Detect variable and functions.
     type_regexp = r'\w([\w]|\s*[*&]\s*|::)+'
     identifier_regexp = r'(?P<identifier>[\w:]+)'
+    maybe_bitfield_regexp = r'(:\s*\d+\s*)?'
     character_after_identifier_regexp = r'(?P<character_after_identifier>[[;()=,])(?!=)'
-    declaration_without_type_regexp = r'\s*' + identifier_regexp + r'\s*' + character_after_identifier_regexp
+    declaration_without_type_regexp = r'\s*' + identifier_regexp + r'\s*' + maybe_bitfield_regexp + character_after_identifier_regexp
     declaration_with_type_regexp = r'\s*' + type_regexp + r'\s' + declaration_without_type_regexp
     is_function_arguments = False
     number_of_identifiers = 0
@@ -2986,4 +2989,3 @@ class CppProcessor(object):
 def process_file_data(filename, file_extension, lines, error, verbosity):
     processor = CppProcessor(filename, file_extension, error, verbosity)
     processor.process(lines)
-
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
index 2beb3e1..c786b8e 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
@@ -3516,6 +3516,12 @@ class WebKitStyleTest(CppStyleTestBase):
                          '_length' + name_error_message)
         self.assert_lint('short length_;',
                          'length_' + name_error_message)
+        self.assert_lint('unsigned _length;',
+                         '_length' + name_error_message)
+        self.assert_lint('unsigned int _length;',
+                         '_length' + name_error_message)
+        self.assert_lint('unsigned long long _length;',
+                         '_length' + name_error_message)
 
         # Pointers, references, functions, templates, and adjectives.
         self.assert_lint('char* under_score;',
@@ -3612,6 +3618,10 @@ class WebKitStyleTest(CppStyleTestBase):
         # const_iterator is allowed as well.
         self.assert_lint('typedef VectorType::const_iterator const_iterator;', '')
 
+        # Bitfields.
+        self.assert_lint('unsigned _fillRule : 1;',
+                         '_fillRule' + name_error_message)
+
 
     def test_comments(self):
         # A comment at the beginning of a line is ok.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list