Merge branch '46-just-use-clang-format-to-reformat-sources' into 'master'

Reformat source code with clang-format

Closes #46

See merge request isc-projects/bind9!2156

(cherry picked from commit 7099e79a9b)

4c3b063e Import Linux kernel .clang-format with small modifications
f50b1e06 Use clang-format to reformat the source files
11341c76 Update the definition files for Windows
df6c1f76 Remove tkey_test (which is no-op anyway)
This commit is contained in:
Ondřej Surý
2020-02-12 14:33:32 +00:00
parent dbe15330fe
commit c931d8e417
974 changed files with 75952 additions and 74434 deletions

View File

@@ -21,7 +21,8 @@
#include <dns/result.h>
static void
print_wirename(isc_region_t *name) {
print_wirename(isc_region_t *name)
{
unsigned char *ccurr, *cend;
if (name->length == 0) {
@@ -36,11 +37,12 @@ print_wirename(isc_region_t *name) {
}
static void
print_name(dns_name_t *name) {
print_name(dns_name_t *name)
{
isc_result_t result;
isc_buffer_t source;
isc_region_t r;
char s[1000];
char s[1000];
isc_buffer_init(&source, s, sizeof(s));
if (dns_name_countlabels(name) > 0)
@@ -58,28 +60,29 @@ print_name(dns_name_t *name) {
}
int
main(int argc, char *argv[]) {
char s[1000];
isc_result_t result;
dns_fixedname_t wname, wname2, oname, compname, downname;
isc_buffer_t source;
isc_region_t r;
dns_name_t *name, *comp, *down;
main(int argc, char *argv[])
{
char s[1000];
isc_result_t result;
dns_fixedname_t wname, wname2, oname, compname, downname;
isc_buffer_t source;
isc_region_t r;
dns_name_t * name, *comp, *down;
const dns_name_t *origin;
unsigned int downcase = 0;
size_t len;
bool quiet = false;
bool concatenate = false;
bool got_name = false;
bool check_absolute = false;
bool check_wildcard = false;
bool test_downcase = false;
bool inplace = false;
bool want_split = false;
unsigned int labels, split_label = 0;
dns_fixedname_t fprefix, fsuffix;
dns_name_t *prefix, *suffix;
int ch;
unsigned int downcase = 0;
size_t len;
bool quiet = false;
bool concatenate = false;
bool got_name = false;
bool check_absolute = false;
bool check_wildcard = false;
bool test_downcase = false;
bool inplace = false;
bool want_split = false;
unsigned int labels, split_label = 0;
dns_fixedname_t fprefix, fsuffix;
dns_name_t * prefix, *suffix;
int ch;
while ((ch = isc_commandline_parse(argc, argv, "acdiqs:w")) != -1) {
switch (ch) {
@@ -143,8 +146,8 @@ main(int argc, char *argv[]) {
isc_buffer_init(&source, argv[1], len);
isc_buffer_add(&source, len);
comp = dns_fixedname_initname(&compname);
result = dns_name_fromtext(comp, &source, origin,
0, NULL);
result = dns_name_fromtext(comp, &source, origin, 0,
NULL);
if (result != 0) {
fprintf(stderr,
"dns_name_fromtext() failed: %s\n",
@@ -209,10 +212,9 @@ main(int argc, char *argv[]) {
if (got_name) {
printf("Concatenating.\n");
result = dns_name_concatenate(
dns_fixedname_name(&wname),
dns_fixedname_name(&wname2),
dns_fixedname_name(&wname2),
NULL);
dns_fixedname_name(&wname),
dns_fixedname_name(&wname2),
dns_fixedname_name(&wname2), NULL);
name = dns_fixedname_name(&wname2);
if (result == ISC_R_SUCCESS) {
if (check_absolute &&
@@ -235,7 +237,8 @@ main(int argc, char *argv[]) {
print_wirename(&r);
printf("%u labels, "
"%u bytes.\n",
dns_name_countlabels(name),
dns_name_countlabels(
name),
r.length);
}
} else
@@ -274,16 +277,15 @@ main(int argc, char *argv[]) {
dns_name_toregion(down, &r);
print_wirename(&r);
printf("%u labels, %u bytes.\n",
dns_name_countlabels(down),
r.length);
dns_name_countlabels(down), r.length);
}
isc_buffer_init(&source, s, sizeof(s));
print_name(down);
}
if (comp != NULL && dns_name_countlabels(name) > 0) {
int order;
unsigned int nlabels;
int order;
unsigned int nlabels;
dns_namereln_t namereln;
namereln = dns_name_fullcompare(name, comp, &order,