]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - audiod.c
sched: Directly pass context pointer to pre/post_select().
[paraslash.git] / audiod.c
index ee1364433e77de965e715fe59692040e6e590989..6b77e338565dc633c15d891f9ed05de73fa38f96 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -93,11 +93,7 @@ enum vss_status_flags {
  */
 struct sched sched = {.max_fileno = 0};
 
-/**
- * The task for obtaining para_server's status (para_client stat).
- *
- * \sa struct task, struct sched.
- */
+/* The task for obtaining para_server's status (para_client stat). */
 struct status_task {
        /** The associated task structure of audiod. */
        struct task *task;
@@ -1004,16 +1000,15 @@ err:
        exit(EXIT_FAILURE);
 }
 
-static void signal_pre_select(struct sched *s, struct task *t)
+static void signal_pre_select(struct sched *s, void *context)
 {
-       struct signal_task *st = task_context(t);
+       struct signal_task *st = context;
        para_fd_set(st->fd, &s->rfds, &s->max_fileno);
 }
 
-static int signal_post_select(struct sched *s, __a_unused struct task *t)
+static int signal_post_select(struct sched *s, __a_unused void *context)
 {
        int signum;
-
        signum = para_next_signal(&s->rfds);
        switch (signum) {
        case SIGINT:
@@ -1025,16 +1020,16 @@ static int signal_post_select(struct sched *s, __a_unused struct task *t)
        return 0;
 }
 
-static void command_pre_select(struct sched *s, struct task *t)
+static void command_pre_select(struct sched *s, void *context)
 {
-       struct command_task *ct = task_context(t);
+       struct command_task *ct = context;
        para_fd_set(ct->fd, &s->rfds, &s->max_fileno);
 }
 
-static int command_post_select(struct sched *s, struct task *t)
+static int command_post_select(struct sched *s, void *context)
 {
        int ret;
-       struct command_task *ct = task_context(t);
+       struct command_task *ct = context;
        static struct timeval last_status_dump;
        struct timeval tmp, delay;
        bool force = true;
@@ -1196,9 +1191,9 @@ static void start_stop_decoders(void)
        btr_log_tree(sl->receiver_node->btrn, LL_NOTICE);
 }
 
-static void status_pre_select(struct sched *s, struct task *t)
+static void status_pre_select(struct sched *s, void *context)
 {
-       struct status_task *st = task_context(t);
+       struct status_task *st = context;
        int i, ret, cafn = stat_task->current_audio_format_num;
 
        if (must_start_decoder())
@@ -1228,9 +1223,9 @@ min_delay:
 }
 
 /* restart the client task if necessary */
-static int status_post_select(struct sched *s, struct task *t)
+static int status_post_select(struct sched *s, void *context)
 {
-       struct status_task *st = task_context(t);
+       struct status_task *st = context;
 
        if (audiod_status == AUDIOD_OFF) {
                if (!st->ct)