2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Use clang-tidy to add curly braces around one-line statements

The command used to reformat the files in this commit was:

./util/run-clang-tidy \
	-clang-tidy-binary clang-tidy-11
	-clang-apply-replacements-binary clang-apply-replacements-11 \
	-checks=-*,readability-braces-around-statements \
	-j 9 \
	-fix \
	-format \
	-style=file \
	-quiet
clang-format -i --style=format $(git ls-files '*.c' '*.h')
uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
clang-format -i --style=format $(git ls-files '*.c' '*.h')
This commit is contained in:
Ondřej Surý
2020-02-13 21:48:23 +01:00
parent d14bb71319
commit 056e133c4c
637 changed files with 28926 additions and 16901 deletions

View File

@@ -100,9 +100,9 @@ fuzz_thread_client(void *arg)
*/
#ifdef __AFL_LOOP
for (int loop = 0; loop < 100000; loop++) {
#else
#else /* ifdef __AFL_LOOP */
{
#endif
#endif /* ifdef __AFL_LOOP */
ssize_t length;
ssize_t sent;
@@ -146,8 +146,9 @@ fuzz_thread_client(void *arg)
*/
(void)recvfrom(sockfd, buf, 65536, MSG_DONTWAIT, NULL, NULL);
while (!ready)
while (!ready) {
pthread_cond_wait(&cond, &mutex);
}
RUNTIME_CHECK(pthread_mutex_unlock(&mutex) == 0);
next:;
@@ -449,8 +450,9 @@ fuzz_thread_resolver(void *arg)
/* Skip the name to get to the qtype */
i = 0;
while (((llen = nameptr[i]) != 0) && (i < 255) &&
(((nameptr + i + 1 + llen) - buf) < length))
(((nameptr + i + 1 + llen) - buf) < length)) {
i += 1 + llen;
}
if (i <= 255) {
nameptr += 1 + i;
@@ -521,8 +523,9 @@ fuzz_thread_resolver(void *arg)
/* Skip the name to get to the qtype */
i = 0;
while (((llen = nameptr[i]) != 0) && (i < 255) &&
(((nameptr + i + 1 + llen) - buf) < length))
(((nameptr + i + 1 + llen) - buf) < length)) {
i += 1 + llen;
}
if (i <= 255) {
nameptr += 1 + i;
@@ -557,8 +560,9 @@ fuzz_thread_resolver(void *arg)
RUNTIME_CHECK(sent == length);
}
while (!ready)
while (!ready) {
pthread_cond_wait(&cond, &mutex);
}
RUNTIME_CHECK(pthread_mutex_unlock(&mutex) == 0);
}
@@ -579,7 +583,7 @@ fuzz_thread_resolver(void *arg)
* in persistent mode if it's present.
*/
__AFL_LOOP(0);
#endif
#endif /* ifdef __AFL_LOOP */
return (NULL);
}
@@ -688,8 +692,9 @@ fuzz_thread_tcp(void *arg)
do {
r = connect(sockfd, (struct sockaddr *)&servaddr,
sizeof(servaddr));
if (r != 0)
if (r != 0) {
usleep(10000);
}
} while (r != 0);
/*
@@ -700,8 +705,9 @@ fuzz_thread_tcp(void *arg)
close(sockfd);
while (!ready)
while (!ready) {
pthread_cond_wait(&cond, &mutex);
}
RUNTIME_CHECK(pthread_mutex_unlock(&mutex) == 0);
}