From: Peter Johnson Date: Mon, 22 Apr 2002 01:39:50 +0000 (-0000) Subject: Splint cleanups. X-Git-Tag: v0.2.0~245 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa5199cf4dd0c76464b766cd35e6b24a80429cf2;p=yasm Splint cleanups. svn path=/trunk/yasm/; revision=594 --- diff --git a/libyasm/hamt.c b/libyasm/hamt.c index 1f56bd1b..111fd6d8 100644 --- a/libyasm/hamt.c +++ b/libyasm/hamt.c @@ -76,23 +76,22 @@ ReHashKey(const char *key, int Level) return vHash; } -/*@-compdef -nullret@*/ HAMT * HAMT_new(void) { - HAMT *hamt; + /*@out@*/ HAMT *hamt = xmalloc(sizeof(HAMT)); int i; - hamt = xmalloc(sizeof(HAMT)); SLIST_INIT(&hamt->entries); hamt->root = xmalloc(32*sizeof(HAMTNode)); - for (i=0; i<32; i++) + for (i=0; i<32; i++) { + hamt->root[i].BitMapKey = 0; hamt->root[i].BaseValue = NULL; + } return hamt; } -/*@=compdef =nullret@*/ static void HAMT_delete_trie(HAMTNode *node) @@ -111,7 +110,7 @@ HAMT_delete_trie(HAMTNode *node) } void -HAMT_delete(HAMT *hamt, void (*deletefunc) (/*@keep@*/ void *data)) +HAMT_delete(HAMT *hamt, void (*deletefunc) (/*@only@*/ void *data)) { int i; diff --git a/src/hamt.c b/src/hamt.c index 1f56bd1b..111fd6d8 100644 --- a/src/hamt.c +++ b/src/hamt.c @@ -76,23 +76,22 @@ ReHashKey(const char *key, int Level) return vHash; } -/*@-compdef -nullret@*/ HAMT * HAMT_new(void) { - HAMT *hamt; + /*@out@*/ HAMT *hamt = xmalloc(sizeof(HAMT)); int i; - hamt = xmalloc(sizeof(HAMT)); SLIST_INIT(&hamt->entries); hamt->root = xmalloc(32*sizeof(HAMTNode)); - for (i=0; i<32; i++) + for (i=0; i<32; i++) { + hamt->root[i].BitMapKey = 0; hamt->root[i].BaseValue = NULL; + } return hamt; } -/*@=compdef =nullret@*/ static void HAMT_delete_trie(HAMTNode *node) @@ -111,7 +110,7 @@ HAMT_delete_trie(HAMTNode *node) } void -HAMT_delete(HAMT *hamt, void (*deletefunc) (/*@keep@*/ void *data)) +HAMT_delete(HAMT *hamt, void (*deletefunc) (/*@only@*/ void *data)) { int i;