diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2005-05-22 19:53:57 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2005-05-22 19:53:57 +0000 |
commit | 18263c857f150b630e8e99e884907742e3878c44 (patch) | |
tree | edcfb9a47bf693d9071fa03585dcc4ad689fe5d4 /src/fifop.c | |
parent | ff4fe15b6dc6b6d6b224021aa1eadfe047426b5c (diff) |
fixed a bug with priorities
svn path=/trunk/externals/zexy/; revision=3067
Diffstat (limited to 'src/fifop.c')
-rw-r--r-- | src/fifop.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/fifop.c b/src/fifop.c index a9dcb47..d8617ee 100644 --- a/src/fifop.c +++ b/src/fifop.c @@ -54,6 +54,7 @@ typedef struct _fifop static t_fifop_prioritylist*fifop_genprioritylist(t_fifop*x, t_float priority) { + int i; t_fifop_prioritylist*result=0, *dummy=0; if(x->fifo_list!=0) @@ -71,22 +72,23 @@ static t_fifop_prioritylist*fifop_genprioritylist(t_fifop*x, t_float priority) result=dummy; dummy=dummy->next; } - dummy=result; + dummy=result; /* dummy points to the FIFO-before the one we want to insert */ } /* create a new priority list */ result = (t_fifop_prioritylist*)getbytes(sizeof( t_fifop_prioritylist*)); result->priority=priority; result->fifo_start=0; + result->next=0; /* insert it into the list of priority lists */ - if(dummy!=0){ + if(dummy==0){ + /* insert at the beginning */ + result->next=x->fifo_list; + x->fifo_list=result; + } else { + /* post insert into the list of FIFOs */ result->next=dummy->next; dummy->next =result; - } else { - result->next=0; - } - if(x->fifo_list==0){ - x->fifo_list=result; } /* return the result */ |