diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-03-03 20:06:29 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-03-03 20:06:29 (GMT) |
commit | 1083071530471faf1641b4182785311aa9bac674 (patch) | |
tree | e0068035580a0b04407cea1a12947e3ea528fbf3 /src/H5B.c | |
parent | 5585643bb3643bbba7245b2c742e8008d8df5cfc (diff) | |
download | hdf5-1083071530471faf1641b4182785311aa9bac674.zip hdf5-1083071530471faf1641b4182785311aa9bac674.tar.gz hdf5-1083071530471faf1641b4182785311aa9bac674.tar.bz2 |
[svn-r6452] Purpose:
Code cleanup
Description:
Add B-tree node debugging routine for symbol table nodes (i.e. groups)
Platforms tested:
FreeBSD 4.7 (sleipnir)
Diffstat (limited to 'src/H5B.c')
-rw-r--r-- | src/H5B.c | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -800,6 +800,8 @@ H5B_decode_key(H5F_t *f, H5B_t *bt, int idx) FUNC_ENTER_NOINIT(H5B_decode_key); + assert(bt->key[idx].dirty==0); + bt->key[idx].nkey = bt->native + idx * bt->type->sizeof_nkey; if ((bt->type->decode) (f, bt, bt->key[idx].rkey, bt->key[idx].nkey) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTDECODE, FAIL, "unable to decode key"); @@ -1658,6 +1660,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->cache_info.dirty = TRUE; bt->key[idx].dirty = TRUE; if (idx>0) { + /* Don't propagate change out of this B-tree node */ *lt_key_changed = FALSE; } else { HDmemcpy(lt_key, bt->key[idx].nkey, type->sizeof_nkey); @@ -1667,6 +1670,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->cache_info.dirty = TRUE; bt->key[idx+1].dirty = TRUE; if (idx+1<bt->nchildren) { + /* Don't propagate change out of this B-tree node */ *rt_key_changed = FALSE; } else { HDmemcpy(rt_key, bt->key[idx+1].nkey, type->sizeof_nkey); @@ -2102,10 +2106,20 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "Address:", bt->child[i]); - H5B_decode_key(f, bt, i); - if (type->debug_key) - (type->debug_key)(stream, indent+3, MAX (0, fwidth-3), + /* If there is a key debugging routine, use it to display the left & right keys */ + if (type->debug_key) { + /* Decode the 'left' key & print it */ + if(bt->key[i].nkey==NULL) + H5B_decode_key(f, bt, i); + (type->debug_key)(stream, f, dxpl_id, indent+3, MAX (0, fwidth-3), bt->key[i].nkey, udata); + + /* Decode the 'right' key & print it */ + if(bt->key[i+1].nkey==NULL) + H5B_decode_key(f, bt, i+1); + (type->debug_key)(stream, f, dxpl_id, indent+3, MAX (0, fwidth-3), + bt->key[i+1].nkey, udata); + } } done: |