aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-25 01:01:49 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-25 01:01:49 +0000
commit3ce5f8f4ee27228b26f6d39d9e1cf75f439995a7 (patch)
tree6af2cfc1b0ec46aa179c5019f00274f1eba84fce /utils
parent7bf3c44abe26f6ce1dc917c33e5ed4a98e80776d (diff)
This is basically a complete rollback of r155401, as it was determined that
it would be best to maintain API compatibility. Instead, this commit introduces ao2_callback_data() which is functionally identical to ao2_callback() except that it allows you to pass arbitrary data to the callback. Reviewed by Mark Michelson via ReviewBoard: http://reviewboard.digium.com/r/64 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@158959 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils')
-rw-r--r--utils/hashtest2.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/utils/hashtest2.c b/utils/hashtest2.c
index 41582998c..3b0c62699 100644
--- a/utils/hashtest2.c
+++ b/utils/hashtest2.c
@@ -80,7 +80,7 @@ static int hash_string(const void *obj, const int flags)
return total;
}
-static int hashtab_compare_strings(void *a, void *b, void *data, int flags)
+static int hashtab_compare_strings(void *a, void *b, int flags)
{
const struct ht_element *ae = a, *be = b;
return !strcmp(ae->key, be->key) ? CMP_MATCH | CMP_STOP : 0;
@@ -137,7 +137,7 @@ static void add_element(void)
els_added++; /* unprotected, sometimes off, but, not really important, either */
}
-static int do_nothing_cb(void *obj, void *arg, void *data, int flags)
+static int do_nothing_cb(void *obj, void *arg, int flags)
{
return 0;
}
@@ -147,7 +147,7 @@ static void traverse_elements(void)
#ifdef DEBUG
printf("Traverse hashtab\n");
#endif
- ao2_callback(glob_hashtab, OBJ_NODATA, do_nothing_cb, NULL, NULL);
+ ao2_callback(glob_hashtab, OBJ_NODATA, do_nothing_cb, NULL);
els_traversals++; /* unprotected, sometimes off, but, not really important, either */
}
@@ -164,7 +164,7 @@ static void * del_element(unsigned int *seedp)
printf("- %s", keybuf);
#endif
lookup.key = keybuf;
- el = ao2_find(glob_hashtab, &lookup, NULL, OBJ_POINTER);
+ el = ao2_find(glob_hashtab, &lookup, OBJ_POINTER);
if (el) {
#ifdef DEBUG
printf("...YES (el=%x)\n", (unsigned long)el);
@@ -190,7 +190,7 @@ static int lookup_element(unsigned int *seedp)
x = my_rand(0,glob_highwater-1,seedp);
sprintf(keybuf, "key%08d", x);
lookup.key = keybuf;
- el = ao2_find(glob_hashtab, &lookup, NULL, OBJ_POINTER);
+ el = ao2_find(glob_hashtab, &lookup, OBJ_POINTER);
els_lookedup++;
if (el) {
els_found++;