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 commitd3b49b6675)0255a974revise .clang-format and add a C formatting script in utile851ed0bapply the modified style
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user