From 704605b466aca3ae6ca6d1e03b6af55e3d245502 Mon Sep 17 00:00:00 2001 From: Andre Date: Mon, 5 Jun 2006 21:46:17 +0200 Subject: [PATCH] sched: nuke "flag" field of struct task It is unused. Kill PRE_ADD_TAIL and POST_ADD_TAIL too. --- audiod.c | 5 ----- recv.c | 1 - sched.c | 10 ++-------- sched.h | 6 ------ stdin.c | 1 - stdout.c | 1 - write_common.c | 1 - 7 files changed, 2 insertions(+), 23 deletions(-) diff --git a/audiod.c b/audiod.c index 709cdfe1..54863cb6 100644 --- a/audiod.c +++ b/audiod.c @@ -654,7 +654,6 @@ static void open_filters(int slot_num) s->fc->task.pre_select = filter_pre_select; s->fc->task.event_handler = filter_event_handler; s->fc->task.private_data = s->fc; - s->fc->task.flags = 0; s->fc->eof = 0; s->receiver_node->output_eof = &s->fc->eof; @@ -789,7 +788,6 @@ static void open_receiver(int format) rn->task.pre_select = a->receiver->pre_select; rn->task.post_select = a->receiver->post_select; rn->task.event_handler = rn_event_handler; - rn->task.flags = 0; sprintf(rn->task.status, "%s receiver node", rn->receiver->name); register_task(&rn->task); } @@ -998,7 +996,6 @@ static void init_audiod_task(struct task *t) t->post_select = audiod_post_select; t->event_handler = NULL; t->private_data = t; - t->flags = 0; sprintf(t->status, "audiod task"); } @@ -1582,7 +1579,6 @@ void signal_setup_default(struct signal_task *st) st->task.pre_select = signal_pre_select; st->task.post_select = signal_post_select; st->task.private_data = st; - st->task.flags = 0; sprintf(st->task.status, "signal task"); } @@ -1615,7 +1611,6 @@ static void init_command_task(struct command_task *ct) ct->task.post_select = command_post_select; ct->task.event_handler = NULL; ct->task.private_data = ct; - ct->task.flags = 0; ct->fd = audiod_get_socket(); /* doesn't return on errors */ sprintf(ct->task.status, "command task"); } diff --git a/recv.c b/recv.c index cf178d20..8639ce2b 100644 --- a/recv.c +++ b/recv.c @@ -102,7 +102,6 @@ int main(int argc, char *argv[]) rn.task.pre_select = r->pre_select; rn.task.post_select = r->post_select; rn.task.event_handler = rn_event_handler; - rn.task.flags = 0; sprintf(rn.task.status, "receiver node"); register_task(&rn.task); diff --git a/sched.c b/sched.c index bd98a515..27d71f67 100644 --- a/sched.c +++ b/sched.c @@ -65,17 +65,11 @@ void *register_task(struct task *t) PARA_INFO_LOG("registering %s (%p)\n", t->status, t); if (t->pre_select) { PARA_DEBUG_LOG("pre_select: %p\n", &t->pre_select); - if (t->flags & PRE_ADD_TAIL) - list_add_tail(&t->pre_select_node, &pre_select_list); - else - list_add(&t->pre_select_node, &pre_select_list); + list_add(&t->pre_select_node, &pre_select_list); } if (t->post_select) { PARA_DEBUG_LOG("post_select: %p\n", &t->pre_select); - if (t->flags & POST_ADD_TAIL) - list_add_tail(&t->post_select_node, &post_select_list); - else - list_add(&t->post_select_node, &post_select_list); + list_add(&t->post_select_node, &post_select_list); } return t; } diff --git a/sched.h b/sched.h index 0363f0d1..632fddde 100644 --- a/sched.h +++ b/sched.h @@ -8,7 +8,6 @@ struct sched { struct task { void *private_data; - unsigned flags; int ret; void (*pre_select)(struct sched *s, struct task *t); void (*post_select)(struct sched *s, struct task *t); @@ -18,11 +17,6 @@ struct task { char status[MAXLINE]; }; -enum task_flags { - PRE_ADD_TAIL = 1, - POST_ADD_TAIL = 2, -}; - void *register_task(struct task *t); void unregister_task(struct task *t); int sched(struct sched *s); diff --git a/stdin.c b/stdin.c index 22f1dd97..d33be358 100644 --- a/stdin.c +++ b/stdin.c @@ -47,7 +47,6 @@ void stdin_set_defaults(struct stdin_task *sit) sit->bufsize = 16 * 1024, sit->loaded = 0, sit->eof = 0, - sit->task.flags = 0, sit->task.pre_select = stdin_pre_select; sit->task.post_select = stdin_post_select; sit->task.event_handler = stdin_default_event_handler; diff --git a/stdout.c b/stdout.c index 1c60669a..e9277d99 100644 --- a/stdout.c +++ b/stdout.c @@ -52,7 +52,6 @@ void stdout_set_defaults(struct stdout_task *sot) sot->task.pre_select = stdout_pre_select; sot->task.post_select = stdout_post_select; sot->task.event_handler = stdout_default_event_handler; - sot->task.flags = 0; sot->eof = 0; sprintf(sot->task.status, "stdout writer"); } diff --git a/write_common.c b/write_common.c index a28a1052..4350c9f1 100644 --- a/write_common.c +++ b/write_common.c @@ -127,7 +127,6 @@ struct writer_node_group *wng_new(unsigned num_writers) g->written = para_calloc(num_writers * sizeof(size_t)); g->task.private_data = g; g->task.post_select = wng_post_select; - g->task.flags = 0; return g; } -- 2.39.5