From edc78d6023c379c19afff8c94632d7118295ff60 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Thu, 8 Nov 2007 05:28:47 +0000 Subject: improve linked-list macros in two ways: - the *_CURRENT macros no longer need the list head pointer argument - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/sched.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main/sched.c') diff --git a/main/sched.c b/main/sched.c index a68692db0..986badd16 100644 --- a/main/sched.c +++ b/main/sched.c @@ -177,11 +177,11 @@ static void schedule(struct sched_context *con, struct sched *s) AST_LIST_TRAVERSE_SAFE_BEGIN(&con->schedq, cur, list) { if (ast_tvcmp(s->when, cur->when) == -1) { - AST_LIST_INSERT_BEFORE_CURRENT(&con->schedq, s, list); + AST_LIST_INSERT_BEFORE_CURRENT(s, list); break; } } - AST_LIST_TRAVERSE_SAFE_END + AST_LIST_TRAVERSE_SAFE_END; if (!cur) AST_LIST_INSERT_TAIL(&con->schedq, s, list); @@ -278,13 +278,13 @@ int ast_sched_del(struct sched_context *con, int id) ast_mutex_lock(&con->lock); AST_LIST_TRAVERSE_SAFE_BEGIN(&con->schedq, s, list) { if (s->id == id) { - AST_LIST_REMOVE_CURRENT(&con->schedq, list); + AST_LIST_REMOVE_CURRENT(list); con->schedcnt--; sched_release(con, s); break; } } - AST_LIST_TRAVERSE_SAFE_END + AST_LIST_TRAVERSE_SAFE_END; #ifdef DUMP_SCHEDULER /* Dump contents of the context while we have the lock so nothing gets screwed up by accident. */ -- cgit v1.2.3