diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2007-11-08 05:28:47 +0000 |
---|---|---|
committer | Kevin P. Fleming <kpfleming@digium.com> | 2007-11-08 05:28:47 +0000 |
commit | edc78d6023c379c19afff8c94632d7118295ff60 (patch) | |
tree | 444ea944312fd31b5524ee43f8cfc97e2884c6de /pbx/pbx_dundi.c | |
parent | 950528b638cc290e4ea661ec3426f73230703e9e (diff) |
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
Diffstat (limited to 'pbx/pbx_dundi.c')
-rw-r--r-- | pbx/pbx_dundi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 7f3e06679..2a03cb671 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -3690,11 +3690,11 @@ static void reschedule_precache(const char *number, const char *context, int exp AST_LIST_LOCK(&pcq); AST_LIST_TRAVERSE_SAFE_BEGIN(&pcq, qe, list) { if (!strcmp(number, qe->number) && !strcasecmp(context, qe->context)) { - AST_LIST_REMOVE_CURRENT(&pcq, list); + AST_LIST_REMOVE_CURRENT(list); break; } } - AST_LIST_TRAVERSE_SAFE_END + AST_LIST_TRAVERSE_SAFE_END; if (!qe) { len = sizeof(*qe); len += strlen(number) + 1; @@ -4195,11 +4195,11 @@ static void prune_peers(void) AST_LIST_LOCK(&peers); AST_LIST_TRAVERSE_SAFE_BEGIN(&peers, peer, list) { if (peer->dead) { - AST_LIST_REMOVE_CURRENT(&peers, list); + AST_LIST_REMOVE_CURRENT(list); destroy_peer(peer); } } - AST_LIST_TRAVERSE_SAFE_END + AST_LIST_TRAVERSE_SAFE_END; AST_LIST_UNLOCK(&peers); } @@ -4210,11 +4210,11 @@ static void prune_mappings(void) AST_LIST_LOCK(&peers); AST_LIST_TRAVERSE_SAFE_BEGIN(&mappings, map, list) { if (map->dead) { - AST_LIST_REMOVE_CURRENT(&mappings, list); + AST_LIST_REMOVE_CURRENT(list); destroy_map(map); } } - AST_LIST_TRAVERSE_SAFE_END + AST_LIST_TRAVERSE_SAFE_END; AST_LIST_UNLOCK(&peers); } |