From 275928fc142e604d7d091feb5eff54c72f241964 Mon Sep 17 00:00:00 2001 From: John Birrell Date: Sat, 26 Apr 2008 00:54:52 +0000 Subject: Vendor import of the full userland contrib part of DTrace support from OpenSolaris. This commit resets files to match the versions in the OpenSolaris tree as of 2008/04/10. The changes in this import from the previous import are the ones that will subsequently re-applied to take files off the vendor branch. This is unfortunately necessary because the Solaris developers won't allow FreeBSD support #ifdefs in their source code because that creates 'dead code' (stuff that they never compile). --- tools/ctf/cvt/iidesc.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'tools/ctf/cvt/iidesc.c') diff --git a/tools/ctf/cvt/iidesc.c b/tools/ctf/cvt/iidesc.c index fc1cefc9321b2..b6b9a0c7f2351 100644 --- a/tools/ctf/cvt/iidesc.c +++ b/tools/ctf/cvt/iidesc.c @@ -68,10 +68,8 @@ iidesc_hash(int nbuckets, void *arg) } static int -iidesc_cmp(void *arg1, void *arg2) +iidesc_cmp(iidesc_t *src, iidesc_find_t *find) { - iidesc_t *src = arg1; - iidesc_find_t *find = arg2; iidesc_t *tgt = find->iif_tgt; if (src->ii_type != tgt->ii_type || @@ -91,7 +89,7 @@ iidesc_add(hash_t *hash, iidesc_t *new) find.iif_tgt = new; find.iif_ret = NULL; - (void) hash_match(hash, new, iidesc_cmp, &find); + (void) hash_match(hash, new, (int (*)())iidesc_cmp, &find); if (find.iif_ret != NULL) { iidesc_t *old = find.iif_ret; @@ -109,14 +107,13 @@ iidesc_add(hash_t *hash, iidesc_t *new) } void -iter_iidescs_by_name(tdata_t *td, char const *name, - int (*func)(void *, void *), void *data) +iter_iidescs_by_name(tdata_t *td, const char *name, + int (*func)(iidesc_t *, void *), void *data) { iidesc_t tmpdesc; - bzero(&tmpdesc, sizeof(tmpdesc)); - tmpdesc.ii_name = xstrdup(name); - (void) hash_match(td->td_iihash, &tmpdesc, func, data); - free(tmpdesc.ii_name); + bzero(&tmpdesc, sizeof (iidesc_t)); + tmpdesc.ii_name = (char *)name; + (void) hash_match(td->td_iihash, &tmpdesc, (int (*)())func, data); } iidesc_t * @@ -154,9 +151,8 @@ iidesc_dup_rename(iidesc_t *src, char const *name, char const *owner) /*ARGSUSED*/ void -iidesc_free(void *arg, void *private __unused) +iidesc_free(iidesc_t *idp, void *private) { - iidesc_t *idp = arg; if (idp->ii_name) free(idp->ii_name); if (idp->ii_nargs) -- cgit v1.2.3