diff options
author | John Birrell <jb@FreeBSD.org> | 2008-04-26 04:01:35 +0000 |
---|---|---|
committer | John Birrell <jb@FreeBSD.org> | 2008-04-26 04:01:35 +0000 |
commit | 4cc75139b96639698b4e96da3b60cd3d81e9a959 (patch) | |
tree | 991b48bb736dc250125471b73aecbbb8c3354328 /cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c | |
parent | e9c7a604218405a972c7a532e655d5ef954c93d9 (diff) | |
download | src-4cc75139b96639698b4e96da3b60cd3d81e9a959.tar.gz src-4cc75139b96639698b4e96da3b60cd3d81e9a959.zip |
A lot of changes to make this code compile cleanly on FreeBSD.
Notes
Notes:
svn path=/head/; revision=178546
Diffstat (limited to 'cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c')
-rw-r--r-- | cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c b/cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c index b6b9a0c7f235..fc1cefc9321b 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/iidesc.c @@ -68,8 +68,10 @@ iidesc_hash(int nbuckets, void *arg) } static int -iidesc_cmp(iidesc_t *src, iidesc_find_t *find) +iidesc_cmp(void *arg1, void *arg2) { + iidesc_t *src = arg1; + iidesc_find_t *find = arg2; iidesc_t *tgt = find->iif_tgt; if (src->ii_type != tgt->ii_type || @@ -89,7 +91,7 @@ iidesc_add(hash_t *hash, iidesc_t *new) find.iif_tgt = new; find.iif_ret = NULL; - (void) hash_match(hash, new, (int (*)())iidesc_cmp, &find); + (void) hash_match(hash, new, iidesc_cmp, &find); if (find.iif_ret != NULL) { iidesc_t *old = find.iif_ret; @@ -107,13 +109,14 @@ iidesc_add(hash_t *hash, iidesc_t *new) } void -iter_iidescs_by_name(tdata_t *td, const char *name, - int (*func)(iidesc_t *, void *), void *data) +iter_iidescs_by_name(tdata_t *td, char const *name, + int (*func)(void *, void *), void *data) { iidesc_t tmpdesc; - bzero(&tmpdesc, sizeof (iidesc_t)); - tmpdesc.ii_name = (char *)name; - (void) hash_match(td->td_iihash, &tmpdesc, (int (*)())func, data); + bzero(&tmpdesc, sizeof(tmpdesc)); + tmpdesc.ii_name = xstrdup(name); + (void) hash_match(td->td_iihash, &tmpdesc, func, data); + free(tmpdesc.ii_name); } iidesc_t * @@ -151,8 +154,9 @@ iidesc_dup_rename(iidesc_t *src, char const *name, char const *owner) /*ARGSUSED*/ void -iidesc_free(iidesc_t *idp, void *private) +iidesc_free(void *arg, void *private __unused) { + iidesc_t *idp = arg; if (idp->ii_name) free(idp->ii_name); if (idp->ii_nargs) |