]> git.ipfire.org Git - thirdparty/bind9.git/commit
Use dns_fixedname_initname() where possible
authorMichał Kępień <michal@isc.org>
Wed, 28 Mar 2018 12:38:09 +0000 (14:38 +0200)
committerOndřej Surý <ondrej@sury.org>
Mon, 9 Apr 2018 10:14:16 +0000 (12:14 +0200)
commit4df4a8e73149dd4df1b9aad44db3c33e1c4f1880
tree9c5248d1446dac5d5a9ebe860e535c2b9cd682da
parent0d2a03c290586db7b1fa50a87e813636767c8fa2
Use dns_fixedname_initname() where possible

Replace dns_fixedname_init() calls followed by dns_fixedname_name()
calls with calls to dns_fixedname_initname() where it is possible
without affecting current behavior and/or performance.

This patch was mostly prepared using Coccinelle and the following
semantic patch:

    @@
    expression fixedname, name;
    @@
    - dns_fixedname_init(&fixedname);
     ...
    - name = dns_fixedname_name(&fixedname);
    + name = dns_fixedname_initname(&fixedname);

The resulting set of changes was then manually reviewed to exclude false
positives and apply minor tweaks.

It is likely that more occurrences of this pattern can be refactored in
an identical way.  This commit only takes care of the low-hanging fruit.
86 files changed:
bin/check/check-tool.c
bin/delv/delv.c
bin/dig/dighost.c
bin/dig/host.c
bin/dig/nslookup.c
bin/dnssec/dnssec-cds.c
bin/dnssec/dnssec-dsfromkey.c
bin/dnssec/dnssec-importkey.c
bin/dnssec/dnssec-keyfromlabel.c
bin/dnssec/dnssec-keygen.c
bin/dnssec/dnssec-signzone.c
bin/dnssec/dnssec-verify.c
bin/dnssec/dnssectool.c
bin/named/server.c
bin/named/tkeyconf.c
bin/named/zoneconf.c
bin/nsupdate/nsupdate.c
bin/tests/makejournal.c
bin/tests/optional/db_test.c
bin/tests/optional/dst_test.c
bin/tests/optional/name_test.c
bin/tests/optional/nsecify.c
bin/tests/optional/rbt_test.c
bin/tests/optional/sig0_test.c
bin/tests/system/dyndb/driver/instance.c
bin/tests/system/rsabigexponent/bigkey.c
bin/tools/dnstap-read.c
bin/tools/mdig.c
bin/tools/named-rrchecker.c
bin/tools/nsec3hash.c
contrib/dnsperf-2.1.0.0-1/dns.c
contrib/sdb/ldap/zone2ldap.c
contrib/sdb/pgsql/zonetodb.c
contrib/sdb/sqlite/zone2sqlite.c
doc/dev/dev.md
lib/bind9/check.c
lib/dns/adb.c
lib/dns/cache.c
lib/dns/catz.c
lib/dns/client.c
lib/dns/ds.c
lib/dns/journal.c
lib/dns/lookup.c
lib/dns/master.c
lib/dns/masterdump.c
lib/dns/name.c
lib/dns/nsec3.c
lib/dns/nta.c
lib/dns/rbt.c
lib/dns/rbtdb.c
lib/dns/rdataset.c
lib/dns/resolver.c
lib/dns/rootns.c
lib/dns/rpz.c
lib/dns/sdb.c
lib/dns/sdlz.c
lib/dns/ssu.c
lib/dns/tests/db_test.c
lib/dns/tests/dbiterator_test.c
lib/dns/tests/dh_test.c
lib/dns/tests/dnstap_test.c
lib/dns/tests/dnstest.c
lib/dns/tests/dst_test.c
lib/dns/tests/keytable_test.c
lib/dns/tests/name_test.c
lib/dns/tests/rbt_serialize_test.c
lib/dns/tests/rbt_test.c
lib/dns/tests/rsa_test.c
lib/dns/tests/tsig_test.c
lib/dns/tkey.c
lib/dns/tsig.c
lib/dns/update.c
lib/dns/validator.c
lib/dns/view.c
lib/dns/zone.c
lib/irs/dnsconf.c
lib/irs/getaddrinfo.c
lib/irs/getnameinfo.c
lib/ns/query.c
lib/ns/tests/nstest.c
lib/ns/update.c
lib/samples/nsprobe.c
lib/samples/resolve.c
lib/samples/sample-async.c
lib/samples/sample-request.c
lib/samples/sample-update.c