mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 06:48:05 +01:00
Add script for cleaning op operator usage in test files.
This patch adds a script written by Nick for bug #13172 to clean up the usage of ==, !=, <, >, <=, and >= by replacing them with their symbolic OP_* counterpart. This will ensure that a tool like Coccinelle doesn't get confused and silently ignore large blocks of code.
This commit is contained in:
parent
91c6bc160b
commit
7c3e980fb9
1 changed files with 11 additions and 0 deletions
11
scripts/coccinelle/test-operator-cleanup
Executable file
11
scripts/coccinelle/test-operator-cleanup
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/perl -w -p -i
|
||||
|
||||
next if m#^ */\*# or m#^ *\* #;
|
||||
|
||||
s/<([,)])/OP_LT$1/;
|
||||
s/(?<=[\s,])>([,)])/OP_GT$1/;
|
||||
#s/>([,)])/OP_GT$1/;
|
||||
s/==([,)])/OP_EQ$1/;
|
||||
s/>=([,)])/OP_GE$1/;
|
||||
s/<=([,)])/OP_LE$1/;
|
||||
s/!=([,)])/OP_NE$1/;
|
Loading…
Add table
Reference in a new issue