summaryrefslogtreecommitdiff
path: root/e2fsprogs/e2fsck/dict.c
diff options
context:
space:
mode:
authorMike Frysinger2005-09-25 05:18:04 +0000
committerMike Frysinger2005-09-25 05:18:04 +0000
commit7ad978045dbc4bb45c0cc7b0629be18aa8d9ba7f (patch)
tree26e67eb347ca52388d9cf5819fe1c2f80ade19e7 /e2fsprogs/e2fsck/dict.c
parentde242f6d5f14a3a40749f97e86ab8d982c86b529 (diff)
downloadbusybox-7ad978045dbc4bb45c0cc7b0629be18aa8d9ba7f.zip
busybox-7ad978045dbc4bb45c0cc7b0629be18aa8d9ba7f.tar.gz
fix building with debugging enabled #413
Diffstat (limited to 'e2fsprogs/e2fsck/dict.c')
-rw-r--r--e2fsprogs/e2fsck/dict.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/e2fsprogs/e2fsck/dict.c b/e2fsprogs/e2fsck/dict.c
index 3d6c85f..48a1e74 100644
--- a/e2fsprogs/e2fsck/dict.c
+++ b/e2fsprogs/e2fsck/dict.c
@@ -562,9 +562,11 @@ void dict_insert(dict_t *dict, dnode_t *node, const void *key)
node->key = key;
+#ifndef NDEBUG
assert (!dict_isfull(dict));
assert (!dict_contains(dict, node));
assert (!dnode_is_in_a_dict(node));
+#endif
/* basic binary tree insert */
@@ -642,7 +644,9 @@ void dict_insert(dict_t *dict, dnode_t *node, const void *key)
dict_root(dict)->color = dnode_black;
+#ifdef E2FSCK_NOTUSED
assert (dict_verify(dict));
+#endif
}
#ifdef E2FSCK_NOTUSED
@@ -816,7 +820,9 @@ dnode_t *dict_delete(dict_t *dict, dnode_t *delete)
dict_root(dict)->color = dnode_black;
}
+#ifdef E2FSCK_NOTUSED
assert (dict_verify(dict));
+#endif
return delete;
}
@@ -998,7 +1004,9 @@ dnode_t *dnode_init(dnode_t *dnode, void *data)
void dnode_destroy(dnode_t *dnode)
{
+#ifndef NDEBUG
assert (!dnode_is_in_a_dict(dnode));
+#endif
free(dnode);
}
@@ -1055,10 +1063,10 @@ void dict_load_next(dict_load_t *load, dnode_t *newnode, const void *key)
dict_t *dict = load->dictptr;
dnode_t *nil = &load->nilnode;
+#ifndef NDEBUG
assert (!dnode_is_in_a_dict(newnode));
assert (dict->nodecount < dict->maxcount);
-#ifndef NDEBUG
if (dict->nodecount > 0) {
if (dict->dupes)
assert (dict->compare(nil->left->key, key) <= 0);
@@ -1152,7 +1160,9 @@ void dict_load_end(dict_load_t *load)
complete->color = dnode_black;
dict_root(dict) = complete;
+#ifdef E2FSCK_NOTUSED
assert (dict_verify(dict));
+#endif
}
void dict_merge(dict_t *dest, dict_t *source)