mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-01 00:28:18 +00:00
tool/misc: new append_u_to_constants.cocci
This commit is contained in:
parent
45a92aba53
commit
6c87a5c39f
25
tool/misc/append_u_to_constants.cocci
Normal file
25
tool/misc/append_u_to_constants.cocci
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// append 'u' suffix to decimal or hexadecimal constants
|
||||
//
|
||||
|
||||
@r1@
|
||||
// match decimal or hexadecimal constant without suffix 'u'
|
||||
constant C =~ "^[(0x)0-9a-fA-F]+$";
|
||||
@@
|
||||
C
|
||||
|
||||
@script:python p@
|
||||
// define Cu := C + 'u'
|
||||
C << r1.C;
|
||||
Cu;
|
||||
@@
|
||||
coccinelle.Cu = coccinelle.C + 'u'
|
||||
|
||||
@@
|
||||
// replace C with Cu
|
||||
constant r1.C;
|
||||
identifier p.Cu;
|
||||
@@
|
||||
- C
|
||||
+ Cu
|
||||
|
Loading…
Reference in New Issue
Block a user