Merge branch 'each-style-tweak' into 'master'

adjust clang-format options to get closer to ISC style

See merge request isc-projects/bind9!3061

(cherry picked from commit d3b49b6675)

0255a974 revise .clang-format and add a C formatting script in util
e851ed0b apply the modified style
This commit is contained in:
Ondřej Surý
2020-02-14 05:35:17 +00:00
parent c646c20e79
commit cdef20bb66
672 changed files with 36044 additions and 42228 deletions

View File

@@ -23,28 +23,27 @@
#include <isc/util.h>
typedef struct {
isc_mem_t * mctx;
isc_task_t * task;
isc_mem_t *mctx;
isc_task_t *task;
isc_timer_t *timer;
unsigned int ticks;
char name[16];
bool exiting;
isc_task_t * peer;
char name[16];
bool exiting;
isc_task_t *peer;
} t_info;
#define MAX_TASKS 3
#define T2_SHUTDOWNOK (ISC_EVENTCLASS(1024) + 0)
#define MAX_TASKS 3
#define T2_SHUTDOWNOK (ISC_EVENTCLASS(1024) + 0)
#define T2_SHUTDOWNDONE (ISC_EVENTCLASS(1024) + 1)
#define FOO_EVENT (ISC_EVENTCLASS(1024) + 2)
#define FOO_EVENT (ISC_EVENTCLASS(1024) + 2)
static t_info tasks[MAX_TASKS];
static unsigned int task_count;
static isc_taskmgr_t * task_manager;
static t_info tasks[MAX_TASKS];
static unsigned int task_count;
static isc_taskmgr_t *task_manager;
static isc_timermgr_t *timer_manager;
static void
t1_shutdown(isc_task_t *task, isc_event_t *event)
{
t1_shutdown(isc_task_t *task, isc_event_t *event) {
t_info *info = event->ev_arg;
printf("task %s (%p) t1_shutdown\n", info->name, task);
@@ -53,8 +52,7 @@ t1_shutdown(isc_task_t *task, isc_event_t *event)
}
static void
t2_shutdown(isc_task_t *task, isc_event_t *event)
{
t2_shutdown(isc_task_t *task, isc_event_t *event) {
t_info *info = event->ev_arg;
printf("task %s (%p) t2_shutdown\n", info->name, task);
@@ -63,9 +61,8 @@ t2_shutdown(isc_task_t *task, isc_event_t *event)
}
static void
shutdown_action(isc_task_t *task, isc_event_t *event)
{
t_info * info = event->ev_arg;
shutdown_action(isc_task_t *task, isc_event_t *event) {
t_info *info = event->ev_arg;
isc_event_t *nevent;
INSIST(event->ev_type == ISC_TASKEVENT_SHUTDOWN);
@@ -84,16 +81,14 @@ shutdown_action(isc_task_t *task, isc_event_t *event)
}
static void
foo_event(isc_task_t *task, isc_event_t *event)
{
foo_event(isc_task_t *task, isc_event_t *event) {
printf("task(%p) foo\n", task);
isc_event_free(&event);
}
static void
tick(isc_task_t *task, isc_event_t *event)
{
t_info * info = event->ev_arg;
tick(isc_task_t *task, isc_event_t *event) {
t_info *info = event->ev_arg;
isc_event_t *nevent;
INSIST(event->ev_type == ISC_TIMEREVENT_TICK);
@@ -126,10 +121,9 @@ tick(isc_task_t *task, isc_event_t *event)
}
static t_info *
new_task(isc_mem_t *mctx, const char *name)
{
t_info * ti;
isc_time_t expires;
new_task(isc_mem_t *mctx, const char *name) {
t_info *ti;
isc_time_t expires;
isc_interval_t interval;
RUNTIME_CHECK(task_count < MAX_TASKS);
@@ -161,12 +155,11 @@ new_task(isc_mem_t *mctx, const char *name)
}
int
main(int argc, char *argv[])
{
main(int argc, char *argv[]) {
unsigned int workers;
t_info * t1, *t2;
isc_task_t * task;
isc_mem_t * mctx, *mctx2;
t_info *t1, *t2;
isc_task_t *task;
isc_mem_t *mctx, *mctx2;
RUNTIME_CHECK(isc_app_start() == ISC_R_SUCCESS);