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

@@ -14,22 +14,23 @@
#include <unistd.h>
#include <isc/print.h>
#include <isc/thread.h>
#include <isc/rwlock.h>
#include <isc/string.h>
#include <isc/thread.h>
#include <isc/util.h>
#ifdef WIN32
#define sleep(x) Sleep(1000 * x)
#define sleep(x) Sleep(1000 * x)
#endif
isc_rwlock_t lock;
static isc_threadresult_t
#ifdef WIN32
WINAPI
WINAPI
#endif
run1(void *arg) {
run1(void *arg)
{
char *message = arg;
RUNTIME_CHECK(isc_rwlock_lock(&lock, isc_rwlocktype_read) ==
@@ -38,29 +39,30 @@ run1(void *arg) {
sleep(1);
printf("%s giving up READ lock\n", message);
RUNTIME_CHECK(isc_rwlock_unlock(&lock, isc_rwlocktype_read) ==
ISC_R_SUCCESS);
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_rwlock_lock(&lock, isc_rwlocktype_read) ==
ISC_R_SUCCESS);
printf("%s got READ lock\n", message);
sleep(1);
printf("%s giving up READ lock\n", message);
RUNTIME_CHECK(isc_rwlock_unlock(&lock, isc_rwlocktype_read) ==
ISC_R_SUCCESS);
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_rwlock_lock(&lock, isc_rwlocktype_write) ==
ISC_R_SUCCESS);
printf("%s got WRITE lock\n", message);
sleep(1);
printf("%s giving up WRITE lock\n", message);
RUNTIME_CHECK(isc_rwlock_unlock(&lock, isc_rwlocktype_write) ==
ISC_R_SUCCESS);
ISC_R_SUCCESS);
return ((isc_threadresult_t)0);
}
static isc_threadresult_t
#ifdef WIN32
WINAPI
WINAPI
#endif
run2(void *arg) {
run2(void *arg)
{
char *message = arg;
RUNTIME_CHECK(isc_rwlock_lock(&lock, isc_rwlocktype_write) ==
@@ -69,31 +71,32 @@ run2(void *arg) {
sleep(1);
printf("%s giving up WRITE lock\n", message);
RUNTIME_CHECK(isc_rwlock_unlock(&lock, isc_rwlocktype_write) ==
ISC_R_SUCCESS);
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_rwlock_lock(&lock, isc_rwlocktype_write) ==
ISC_R_SUCCESS);
printf("%s got WRITE lock\n", message);
sleep(1);
printf("%s giving up WRITE lock\n", message);
RUNTIME_CHECK(isc_rwlock_unlock(&lock, isc_rwlocktype_write) ==
ISC_R_SUCCESS);
ISC_R_SUCCESS);
RUNTIME_CHECK(isc_rwlock_lock(&lock, isc_rwlocktype_read) ==
ISC_R_SUCCESS);
printf("%s got READ lock\n", message);
sleep(1);
printf("%s giving up READ lock\n", message);
RUNTIME_CHECK(isc_rwlock_unlock(&lock, isc_rwlocktype_read) ==
ISC_R_SUCCESS);
ISC_R_SUCCESS);
return ((isc_threadresult_t)0);
}
int
main(int argc, char *argv[]) {
main(int argc, char *argv[])
{
unsigned int nworkers;
unsigned int i;
isc_thread_t workers[100];
char name[100];
void *dupname;
char name[100];
void * dupname;
if (argc > 1)
nworkers = atoi(argv[1]);