1 #!/usr/bin/perl -w -p -i
3 # Copyright (c) 2001 Matej Pfajfar.
4 # Copyright (c) 2001-2004, Roger Dingledine.
5 # Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
6 # Copyright (c) 2007-2019, The Tor Project, Inc.
7 # See LICENSE for licensing information
9 # This script looks for instances of C comparison operators as macro arguments,
10 # and replaces them with our OP_* equivalents.
12 # Some macros that take operators are our tt_int_op() testing macro, and the
13 # standard timercmp() macro. Coccinelle can't handle their syntax, however,
14 # unless we give them their operators as a macro too.
16 next if m
#^ */\*# or m#^ *\* #;
19 s/(?<=[\s,])>([,)])/OP_GT$1/;