Merge branch '46-add-curly-braces' into 'master'

Add curly braces using uncrustify and then reformat with clang-format back

Closes #46

See merge request isc-projects/bind9!3057

(cherry picked from commit 67b68e06ad)

36c6105e Use coccinelle to add braces to nested single line statement
d14bb713 Add copy of run-clang-tidy that can fixup the filepaths
056e133c Use clang-tidy to add curly braces around one-line statements
This commit is contained in:
Ondřej Surý
2020-02-13 21:28:07 +00:00
parent 6270e602ea
commit 2e55baddd8
639 changed files with 29724 additions and 17080 deletions

View File

@@ -53,8 +53,9 @@ my_send(isc_task_t *task, isc_event_t *event)
isc_task_shutdown(task);
}
if (dev->region.base != NULL)
if (dev->region.base != NULL) {
isc_mem_put(mctx, dev->region.base, dev->region.length);
}
isc_event_free(&event);
}
@@ -89,8 +90,9 @@ my_recv(isc_task_t *task, isc_event_t *event)
if (dev->result != ISC_R_SUCCESS) {
isc_socket_detach(&sock);
if (dev->region.base != NULL)
if (dev->region.base != NULL) {
isc_mem_put(mctx, dev->region.base, dev->region.length);
}
isc_event_free(&event);
isc_task_shutdown(task);
@@ -138,8 +140,9 @@ my_http_get(isc_task_t *task, isc_event_t *event)
if (dev->result != ISC_R_SUCCESS) {
isc_socket_detach(&sock);
isc_task_shutdown(task);
if (dev->region.base != NULL)
if (dev->region.base != NULL) {
isc_mem_put(mctx, dev->region.base, dev->region.length);
}
isc_event_free(&event);
return;
}
@@ -274,18 +277,22 @@ main(int argc, char *argv[])
if (argc > 1) {
workers = atoi(argv[1]);
if (workers < 1)
if (workers < 1) {
workers = 1;
if (workers > 8192)
}
if (workers > 8192) {
workers = 8192;
} else
}
} else {
workers = 2;
}
printf("%u workers\n", workers);
if (isc_net_probeipv6() == ISC_R_SUCCESS)
if (isc_net_probeipv6() == ISC_R_SUCCESS) {
pf = PF_INET6;
else
} else {
pf = PF_INET;
}
/*
* EVERYTHING needs a memory context.
@@ -357,10 +364,11 @@ main(int argc, char *argv[])
*/
so2 = NULL;
ina.s_addr = inet_addr("204.152.184.97");
if (0 && pf == PF_INET6)
if (0 && pf == PF_INET6) {
isc_sockaddr_v6fromin(&sockaddr, &ina, 80);
else
} else {
isc_sockaddr_fromin(&sockaddr, &ina, 80);
}
RUNTIME_CHECK(isc_socket_create(socketmgr, isc_sockaddr_pf(&sockaddr),
isc_sockettype_tcp,
&so2) == ISC_R_SUCCESS);
@@ -380,9 +388,9 @@ main(int argc, char *argv[])
*/
#ifndef WIN32
sleep(10);
#else
#else /* ifndef WIN32 */
Sleep(10000);
#endif
#endif /* ifndef WIN32 */
fprintf(stderr, "Destroying socket manager\n");
isc_socketmgr_destroy(&socketmgr);