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 /main/loader.c | |
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 'main/loader.c')
-rw-r--r-- | main/loader.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/loader.c b/main/loader.c index d8567c840..e51505ea0 100644 --- a/main/loader.c +++ b/main/loader.c @@ -169,7 +169,7 @@ void ast_module_unregister(const struct ast_module_info *info) AST_LIST_LOCK(&module_list); AST_LIST_TRAVERSE_SAFE_BEGIN(&module_list, mod, entry) { if (mod->info == info) { - AST_LIST_REMOVE_CURRENT(&module_list, entry); + AST_LIST_REMOVE_CURRENT(entry); break; } } @@ -825,7 +825,7 @@ int load_modules(unsigned int preload_only) AST_LIST_TRAVERSE_SAFE_BEGIN(&load_order, order, entry) { if (!resource_name_match(order->resource, v->value)) { - AST_LIST_REMOVE_CURRENT(&load_order, entry); + AST_LIST_REMOVE_CURRENT(entry); ast_free(order->resource); ast_free(order); } @@ -849,7 +849,7 @@ int load_modules(unsigned int preload_only) switch (load_resource(order->resource, 1)) { case AST_MODULE_LOAD_SUCCESS: case AST_MODULE_LOAD_DECLINE: - AST_LIST_REMOVE_CURRENT(&load_order, entry); + AST_LIST_REMOVE_CURRENT(entry); ast_free(order->resource); ast_free(order); break; @@ -868,7 +868,7 @@ int load_modules(unsigned int preload_only) switch (load_resource(order->resource, 0)) { case AST_MODULE_LOAD_SUCCESS: case AST_MODULE_LOAD_DECLINE: - AST_LIST_REMOVE_CURRENT(&load_order, entry); + AST_LIST_REMOVE_CURRENT(entry); ast_free(order->resource); ast_free(order); break; @@ -961,7 +961,7 @@ int ast_loader_unregister(int (*v)(void)) AST_LIST_LOCK(&module_list); AST_LIST_TRAVERSE_SAFE_BEGIN(&updaters, cur, entry) { if (cur->updater == v) { - AST_LIST_REMOVE_CURRENT(&updaters, entry); + AST_LIST_REMOVE_CURRENT(entry); break; } } |