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

@@ -23,9 +23,9 @@
#include <isc/mutex.h>
#include <isc/net.h>
#include <isc/print.h>
#include <isc/socket.h>
#include <isc/task.h>
#include <isc/timer.h>
#include <isc/socket.h>
#include <isc/util.h>
#include <dns/dnssec.h>
@@ -40,33 +40,35 @@
#include <dns/result.h>
#include <dns/types.h>
#include <dst/result.h>
#include <dst/dst.h>
#include <dst/result.h>
#define CHECK(str, x) { \
if ((x) != ISC_R_SUCCESS) { \
printf("%s: %s\n", (str), isc_result_totext(x)); \
exit(-1); \
} \
}
#define CHECK(str, x) \
{ \
if ((x) != ISC_R_SUCCESS) { \
printf("%s: %s\n", (str), isc_result_totext(x)); \
exit(-1); \
} \
}
isc_mutex_t lock;
dst_key_t *key;
isc_mem_t *mctx;
unsigned char qdata[1024], rdata[1024];
isc_buffer_t qbuffer, rbuffer;
isc_taskmgr_t *taskmgr;
isc_task_t *task1;
isc_log_t *lctx = NULL;
isc_logconfig_t *logconfig = NULL;
isc_socket_t *s;
isc_sockaddr_t address;
char output[10 * 1024];
isc_buffer_t outbuf;
isc_mutex_t lock;
dst_key_t * key;
isc_mem_t * mctx;
unsigned char qdata[1024], rdata[1024];
isc_buffer_t qbuffer, rbuffer;
isc_taskmgr_t * taskmgr;
isc_task_t * task1;
isc_log_t * lctx = NULL;
isc_logconfig_t * logconfig = NULL;
isc_socket_t * s;
isc_sockaddr_t address;
char output[10 * 1024];
isc_buffer_t outbuf;
static const dns_master_style_t *style = &dns_master_style_debug;
static void
senddone(isc_task_t *task, isc_event_t *event) {
senddone(isc_task_t *task, isc_event_t *event)
{
isc_socketevent_t *sevent = (isc_socketevent_t *)event;
REQUIRE(sevent != NULL);
@@ -79,11 +81,12 @@ senddone(isc_task_t *task, isc_event_t *event) {
}
static void
recvdone(isc_task_t *task, isc_event_t *event) {
recvdone(isc_task_t *task, isc_event_t *event)
{
isc_socketevent_t *sevent = (isc_socketevent_t *)event;
isc_buffer_t source;
isc_result_t result;
dns_message_t *response;
isc_buffer_t source;
isc_result_t result;
dns_message_t * response;
REQUIRE(sevent != NULL);
REQUIRE(sevent->ev_type == ISC_SOCKEVENT_RECVDONE);
@@ -117,17 +120,18 @@ recvdone(isc_task_t *task, isc_event_t *event) {
}
static void
buildquery(void) {
isc_result_t result;
buildquery(void)
{
isc_result_t result;
dns_rdataset_t *question = NULL;
dns_name_t *qname = NULL;
isc_region_t r, inr;
dns_message_t *query;
char nametext[] = "host.example";
isc_buffer_t namesrc, namedst;
unsigned char namedata[256];
isc_sockaddr_t sa;
dns_compress_t cctx;
dns_name_t * qname = NULL;
isc_region_t r, inr;
dns_message_t * query;
char nametext[] = "host.example";
isc_buffer_t namesrc, namedst;
unsigned char namedata[256];
isc_sockaddr_t sa;
dns_compress_t cctx;
query = NULL;
result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER, &query);
@@ -137,8 +141,7 @@ buildquery(void) {
result = dns_message_gettemprdataset(query, &question);
CHECK("dns_message_gettemprdataset", result);
dns_rdataset_makequestion(question, dns_rdataclass_in,
dns_rdatatype_a);
dns_rdataset_makequestion(question, dns_rdataclass_in, dns_rdatatype_a);
result = dns_message_gettempname(query, &qname);
CHECK("dns_message_gettempname", result);
isc_buffer_init(&namesrc, nametext, strlen(nametext));
@@ -178,8 +181,8 @@ buildquery(void) {
isc_sockaddr_any(&sa);
result = isc_socket_bind(s, &sa, 0);
CHECK("isc_socket_bind", result);
result = isc_socket_sendto(s, &r, task1, senddone, NULL, &address,
NULL);
result =
isc_socket_sendto(s, &r, task1, senddone, NULL, &address, NULL);
CHECK("isc_socket_sendto", result);
inr.base = rdata;
@@ -190,17 +193,18 @@ buildquery(void) {
}
int
main(int argc, char *argv[]) {
bool verbose = false;
main(int argc, char *argv[])
{
bool verbose = false;
isc_socketmgr_t *socketmgr;
isc_timermgr_t *timermgr;
struct in_addr inaddr;
dns_fixedname_t fname;
dns_name_t *name;
isc_buffer_t b;
int ch;
isc_result_t result;
in_port_t port = 53;
isc_timermgr_t * timermgr;
struct in_addr inaddr;
dns_fixedname_t fname;
dns_name_t * name;
isc_buffer_t b;
int ch;
isc_result_t result;
in_port_t port = 53;
RUNTIME_CHECK(isc_app_start() == ISC_R_SUCCESS);
@@ -239,9 +243,8 @@ main(int argc, char *argv[]) {
RUNTIME_CHECK(isc_log_create(mctx, &lctx, &logconfig) == ISC_R_SUCCESS);
s = NULL;
RUNTIME_CHECK(isc_socket_create(socketmgr, PF_INET,
isc_sockettype_udp, &s) ==
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_socket_create(socketmgr, PF_INET, isc_sockettype_udp,
&s) == ISC_R_SUCCESS);
inaddr.s_addr = htonl(INADDR_LOOPBACK);
isc_sockaddr_fromin(&address, &inaddr, port);
@@ -254,8 +257,8 @@ main(int argc, char *argv[]) {
key = NULL;
result = dst_key_fromfile(name, 33180, DNS_KEYALG_RSASHA1,
DST_TYPE_PUBLIC | DST_TYPE_PRIVATE,
NULL, mctx, &key);
DST_TYPE_PUBLIC | DST_TYPE_PRIVATE, NULL,
mctx, &key);
CHECK("dst_key_fromfile", result);
buildquery();