Messages in this thread Patch in this message | | | From | Joe Perches <> | Subject | [PATCH 1/3] checkpatch: Find hex constants as a single IDENT | Date | Wed, 31 Oct 2012 03:13:11 -0700 |
| |
Hexadecimal values are currently found in 2 parts. A hex constant like 0x123456abcdef is found as 0 and then x123456abcdef and later coalesced.
Instead, reverse the order of the 2 searches in $Constant to find 0x first, then 0 so that the entire hex constant is found all at once.
Signed-off-by: Joe Perches <joe@perches.com> --- scripts/checkpatch.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f18750e..099a0ad 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -227,7 +227,7 @@ our $Inline = qr{inline|__always_inline|noinline}; our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; our $Lval = qr{$Ident(?:$Member)*}; -our $Constant = qr{(?i:(?:[0-9]+|0x[0-9a-f]+)[ul]*)}; +our $Constant = qr{(?i:(?:0x[0-9a-f]+|[0-9]+)[ul]*)}; our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; our $Compare = qr{<=|>=|==|!=|<|>}; our $Operators = qr{ -- 1.7.8.112.g3fd21
| |