sched: nuke "flag" field of struct task
authorAndre <maan@p133.(none)>
Mon, 5 Jun 2006 19:46:17 +0000 (21:46 +0200)
committerAndre <maan@p133.(none)>
Mon, 5 Jun 2006 19:46:17 +0000 (21:46 +0200)
It is unused. Kill PRE_ADD_TAIL and POST_ADD_TAIL too.

audiod.c
recv.c
sched.c
sched.h
stdin.c
stdout.c
write_common.c

index 709cdfe..54863cb 100644 (file)
--- 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.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;
        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.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);
 }
        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->post_select = audiod_post_select;
        t->event_handler = NULL;
        t->private_data = t;
-       t->flags = 0;
        sprintf(t->status, "audiod task");
 }
 
        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.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");
 }
 
        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.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");
 }
        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 cf178d2..8639ce2 100644 (file)
--- 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.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);
 
        sprintf(rn.task.status, "receiver node");
        register_task(&rn.task);
 
diff --git a/sched.c b/sched.c
index bd98a51..27d71f6 100644 (file)
--- 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);
        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->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;
 }
        }
        return t;
 }
diff --git a/sched.h b/sched.h
index 0363f0d..632fddd 100644 (file)
--- a/sched.h
+++ b/sched.h
@@ -8,7 +8,6 @@ struct sched {
 
 struct task {
        void *private_data;
 
 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);
        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];
 };
 
        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);
 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 22f1dd9..d33be35 100644 (file)
--- 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->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;
        sit->task.pre_select = stdin_pre_select;
        sit->task.post_select = stdin_post_select;
        sit->task.event_handler = stdin_default_event_handler;
index 1c60669..e9277d9 100644 (file)
--- 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.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");
 }
        sot->eof = 0;
        sprintf(sot->task.status, "stdout writer");
 }
index a28a105..4350c9f 100644 (file)
@@ -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->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;
 }
 
        return g;
 }