diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-08 05:28:47 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-11-08 05:28:47 +0000 |
commit | a45a413db3bdce126d5cb28ed49b776fdebb4b1d (patch) | |
tree | 444ea944312fd31b5524ee43f8cfc97e2884c6de /pbx | |
parent | beabbf77e66fbdd59fdcb5e12dade8039fd0b683 (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: http://svn.digium.com/svn/asterisk/trunk@89106 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-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); } |