diff options
Diffstat (limited to 'cddl/contrib/opensolaris/common/ctf/ctf_hash.c')
-rw-r--r-- | cddl/contrib/opensolaris/common/ctf/ctf_hash.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cddl/contrib/opensolaris/common/ctf/ctf_hash.c b/cddl/contrib/opensolaris/common/ctf/ctf_hash.c index b10a7618f66e..5a36fbbd88cf 100644 --- a/cddl/contrib/opensolaris/common/ctf/ctf_hash.c +++ b/cddl/contrib/opensolaris/common/ctf/ctf_hash.c @@ -29,7 +29,7 @@ #include <ctf_impl.h> -static const ushort_t _CTF_EMPTY[1] = { 0 }; +static const uint_t _CTF_EMPTY[1] = { 0 }; int ctf_hash_create(ctf_hash_t *hp, ulong_t nelems) @@ -43,7 +43,7 @@ ctf_hash_create(ctf_hash_t *hp, ulong_t nelems) */ if (nelems == 0) { bzero(hp, sizeof (ctf_hash_t)); - hp->h_buckets = (ushort_t *)_CTF_EMPTY; + hp->h_buckets = (uint_t *)_CTF_EMPTY; hp->h_nbuckets = 1; return (0); } @@ -52,7 +52,7 @@ ctf_hash_create(ctf_hash_t *hp, ulong_t nelems) hp->h_nelems = nelems + 1; /* we use index zero as a sentinel */ hp->h_free = 1; /* first free element is index 1 */ - hp->h_buckets = ctf_alloc(sizeof (ushort_t) * hp->h_nbuckets); + hp->h_buckets = ctf_alloc(sizeof (uint_t) * hp->h_nbuckets); hp->h_chains = ctf_alloc(sizeof (ctf_helem_t) * hp->h_nelems); if (hp->h_buckets == NULL || hp->h_chains == NULL) { @@ -60,7 +60,7 @@ ctf_hash_create(ctf_hash_t *hp, ulong_t nelems) return (EAGAIN); } - bzero(hp->h_buckets, sizeof (ushort_t) * hp->h_nbuckets); + bzero(hp->h_buckets, sizeof (uint_t) * hp->h_nbuckets); bzero(hp->h_chains, sizeof (ctf_helem_t) * hp->h_nelems); return (0); @@ -92,7 +92,7 @@ ctf_hash_compute(const char *key, size_t len) } int -ctf_hash_insert(ctf_hash_t *hp, ctf_file_t *fp, ushort_t type, uint_t name) +ctf_hash_insert(ctf_hash_t *hp, ctf_file_t *fp, uint_t type, uint_t name) { ctf_strs_t *ctsp = &fp->ctf_str[CTF_NAME_STID(name)]; const char *str = ctsp->cts_strs + CTF_NAME_OFFSET(name); @@ -129,7 +129,7 @@ ctf_hash_insert(ctf_hash_t *hp, ctf_file_t *fp, ushort_t type, uint_t name) * If the key is not present, then call ctf_hash_insert() and hash it in. */ int -ctf_hash_define(ctf_hash_t *hp, ctf_file_t *fp, ushort_t type, uint_t name) +ctf_hash_define(ctf_hash_t *hp, ctf_file_t *fp, uint_t type, uint_t name) { const char *str = ctf_strptr(fp, name); ctf_helem_t *hep = ctf_hash_lookup(hp, fp, str, strlen(str)); @@ -147,7 +147,7 @@ ctf_hash_lookup(ctf_hash_t *hp, ctf_file_t *fp, const char *key, size_t len) ctf_helem_t *hep; ctf_strs_t *ctsp; const char *str; - ushort_t i; + uint_t i; ulong_t h = ctf_hash_compute(key, len) % hp->h_nbuckets; @@ -167,7 +167,7 @@ void ctf_hash_destroy(ctf_hash_t *hp) { if (hp->h_buckets != NULL && hp->h_nbuckets != 1) { - ctf_free(hp->h_buckets, sizeof (ushort_t) * hp->h_nbuckets); + ctf_free(hp->h_buckets, sizeof (uint_t) * hp->h_nbuckets); hp->h_buckets = NULL; } |