From 5b395a7b97775f62083675f13537179150befd3f Mon Sep 17 00:00:00 2001 From: Corey Farrell Date: Fri, 29 Dec 2017 23:59:00 -0500 Subject: core: Use macros to generate ao2_container callbacks where possible. This uses AO2_STRING_FIELD_HASH_FN and AO2_STRING_FIELD_CMP_FN where possible in the Asterisk core. This removes CMP_STOP from the result of CMP_FN callbacks for the following structure types: * ast_bucket_metadata * ast_bucket_scheme * generic_monitor_instance_list (ccss.c) * named_acl Change-Id: Ide4c1449a894bce70dea1fef664dade9b57578f1 --- main/named_acl.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'main/named_acl.c') diff --git a/main/named_acl.c b/main/named_acl.c index 458d4d397..9ea89903e 100644 --- a/main/named_acl.c +++ b/main/named_acl.c @@ -107,19 +107,8 @@ struct named_acl { char name[ACL_NAME_LENGTH]; /* Same max length as a configuration category */ }; -static int named_acl_hash_fn(const void *obj, const int flags) -{ - const struct named_acl *entry = obj; - return ast_str_hash(entry->name); -} - -static int named_acl_cmp_fn(void *obj, void *arg, const int flags) -{ - struct named_acl *entry1 = obj; - struct named_acl *entry2 = arg; - - return (!strcmp(entry1->name, entry2->name)) ? (CMP_MATCH | CMP_STOP) : 0; -} +AO2_STRING_FIELD_HASH_FN(named_acl, name) +AO2_STRING_FIELD_CMP_FN(named_acl, name) /*! \brief destructor for named_acl_config */ static void named_acl_config_destructor(void *obj) -- cgit v1.2.3