]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use coccinelle to add braces to nested single line statement
authorOndřej Surý <ondrej@sury.org>
Thu, 13 Feb 2020 17:16:57 +0000 (18:16 +0100)
committerOndřej Surý <ondrej@sury.org>
Thu, 13 Feb 2020 20:58:55 +0000 (21:58 +0100)
commit36c6105e4f43b604dac660adf91f2c15e299bae1
tree03422f2849dc39a0443be43e7f5f07ce4f65b986
parentc823ed4f07e7417ff50bad63597f817b025ac5de
Use coccinelle to add braces to nested single line statement

Both clang-tidy and uncrustify chokes on statement like this:

for (...)
if (...)
break;

This commit uses a very simple semantic patch (below) to add braces around such
statements.

Semantic patch used:

@@
statement S;
expression E;
@@

while (...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

for (...;...;...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

if (...)
- if (E) S
+ { if (E) { S } }
43 files changed:
bin/named/config.c
bin/named/controlconf.c
bin/named/server.c
bin/named/statschannel.c
bin/tests/optional/db_test.c
contrib/dlz/drivers/dlz_odbc_driver.c
contrib/dlz/modules/mysql/dlz_mysql_dynamic.c
contrib/dlz/modules/mysqldyn/dlz_mysqldyn_mod.c
lib/bind9/check.c
lib/dns/adb.c
lib/dns/cache.c
lib/dns/db.c
lib/dns/dlz.c
lib/dns/dnssec.c
lib/dns/dst_api.c
lib/dns/dst_parse.c
lib/dns/dyndb.c
lib/dns/journal.c
lib/dns/master.c
lib/dns/name.c
lib/dns/nsec.c
lib/dns/peer.c
lib/dns/pkcs11ecdsa_link.c
lib/dns/pkcs11eddsa_link.c
lib/dns/pkcs11rsa_link.c
lib/dns/rbtdb.c
lib/dns/rdata/generic/caa_257.c
lib/dns/rdata/generic/loc_29.c
lib/dns/rdata/generic/nxt_30.c
lib/dns/rdata/generic/x25_19.c
lib/dns/rdata/in_1/apl_42.c
lib/dns/rdata/in_1/wks_11.c
lib/dns/rdatalist.c
lib/dns/resolver.c
lib/dns/sdb.c
lib/dns/zone.c
lib/irs/getnameinfo.c
lib/isc/httpd.c
lib/isc/log.c
lib/isc/pk11.c
lib/isc/unix/file.c
lib/isccfg/parser.c
lib/ns/query.c