aboutsummaryrefslogtreecommitdiffstats
path: root/main/app.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-08 05:28:47 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-08 05:28:47 +0000
commita45a413db3bdce126d5cb28ed49b776fdebb4b1d (patch)
tree444ea944312fd31b5524ee43f8cfc97e2884c6de /main/app.c
parentbeabbf77e66fbdd59fdcb5e12dade8039fd0b683 (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 'main/app.c')
-rw-r--r--main/app.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main/app.c b/main/app.c
index f08c83929..f21a40e47 100644
--- a/main/app.c
+++ b/main/app.c
@@ -873,12 +873,12 @@ int ast_app_group_set_channel(struct ast_channel *chan, const char *data)
AST_RWLIST_WRLOCK(&groups);
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) {
if ((gi->chan == chan) && ((ast_strlen_zero(category) && ast_strlen_zero(gi->category)) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) {
- AST_RWLIST_REMOVE_CURRENT(&groups, list);
+ AST_RWLIST_REMOVE_CURRENT(list);
free(gi);
break;
}
}
- AST_RWLIST_TRAVERSE_SAFE_END
+ AST_RWLIST_TRAVERSE_SAFE_END;
if (ast_strlen_zero(group)) {
/* Enable unsetting the group */
@@ -964,11 +964,11 @@ int ast_app_group_discard(struct ast_channel *chan)
AST_RWLIST_WRLOCK(&groups);
AST_RWLIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) {
if (gi->chan == chan) {
- AST_RWLIST_REMOVE_CURRENT(&groups, list);
+ AST_RWLIST_REMOVE_CURRENT(list);
ast_free(gi);
}
}
- AST_RWLIST_TRAVERSE_SAFE_END
+ AST_RWLIST_TRAVERSE_SAFE_END;
AST_RWLIST_UNLOCK(&groups);
return 0;
@@ -1204,7 +1204,7 @@ static int ast_unlock_path_flock(const char *path)
AST_LIST_LOCK(&path_lock_list);
AST_LIST_TRAVERSE_SAFE_BEGIN(&path_lock_list, p, le) {
if (!strcmp(p->path, path)) {
- AST_LIST_REMOVE_CURRENT(&path_lock_list, le);
+ AST_LIST_REMOVE_CURRENT(le);
break;
}
}