Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2010-02-23 Leandro Pereira <leandro@profusion.mobi>
        Reviewed by NOBODY.

        Fix false positives for 'delete *pointer' statements.
        http://webkit.org/b/35235

        * WebKitTools/Scripts/webkitpy/style/processors/cpp.py:

Canonical link: https://commits.webkit.org/46453@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Feb 23, 2010
1 parent 301a5f3 commit 59e8780
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions WebKitTools/ChangeLog
@@ -1,3 +1,12 @@
2010-02-23 Leandro Pereira <leandro@profusion.mobi>

Reviewed by NOBODY.

Fix false positives for 'delete *pointer' statements.
http://webkit.org/b/35235

* WebKitTools/Scripts/webkitpy/style/processors/cpp.py:

2010-02-23 Shinichiro Hamaji <hamaji@chromium.org>

Reviewed by Eric Seidel.
Expand Down
2 changes: 1 addition & 1 deletion WebKitTools/Scripts/webkitpy/style/processors/cpp.py
Expand Up @@ -1367,7 +1367,7 @@ def check_spacing(file_extension, clean_lines, line_number, error):

if file_extension == 'cpp':
# C++ should have the & or * beside the type not the variable name.
matched = match(r'\s*\w+(?<!\breturn)\s+(?P<pointer_operator>\*|\&)\w+', line)
matched = match(r'\s*\w+(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\w+', line)
if matched:
error(line_number, 'whitespace/declaration', 3,
'Declaration has space between type name and %s in %s' % (matched.group('pointer_operator'), matched.group(0).strip()))
Expand Down
Expand Up @@ -1547,6 +1547,7 @@ def test_pointer_reference_marker_location(self):
'Declaration has space between type name and * in int *b [whitespace/declaration] [3]',
'foo.cpp')
self.assert_lint('return *b;', '', 'foo.cpp')
self.assert_lint('delete *b;', '', 'foo.cpp')
self.assert_lint('int *b;', '', 'foo.c')
self.assert_lint('int* b;',
'Declaration has space between * and variable name in int* b [whitespace/declaration] [3]',
Expand Down

0 comments on commit 59e8780

Please sign in to comment.