diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-02-04 07:37:15 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-02-04 07:37:15 (GMT) |
commit | 0a8bba91530eb333e7d3f17e18aac12db44eda63 (patch) | |
tree | 9b6cf88bc5113878ddeca5facadc1c3347ba0654 /src/H5Odbg.c | |
parent | f555ac654b71f0bcaab99775f8c2fe1dac26bfab (diff) | |
download | hdf5-0a8bba91530eb333e7d3f17e18aac12db44eda63.zip hdf5-0a8bba91530eb333e7d3f17e18aac12db44eda63.tar.gz hdf5-0a8bba91530eb333e7d3f17e18aac12db44eda63.tar.bz2 |
[svn-r13232] Description:
Remove the "scaffolding" for shared message method invocation and
simplify the way shared messages are dealt with in general.
Tested on:
FreeBSD/32 6.2 (duty)
Mac OS X/32 10.4.8 (amazon)
Diffstat (limited to 'src/H5Odbg.c')
-rw-r--r-- | src/H5Odbg.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/H5Odbg.c b/src/H5Odbg.c index 13428cf..a53493e 100644 --- a/src/H5Odbg.c +++ b/src/H5Odbg.c @@ -247,8 +247,7 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i { unsigned i, chunkno; size_t mesg_total = 0, chunk_total = 0; - int *sequence; - const H5O_msg_class_t *debug_type; /* Type of message to use for callbacks */ + unsigned *sequence; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5O_debug_real, FAIL) @@ -356,9 +355,11 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i } /* end for */ /* debug each message */ - if(NULL == (sequence = H5MM_calloc(NELMTS(H5O_msg_class_g) * sizeof(int)))) + if(NULL == (sequence = H5MM_calloc(NELMTS(H5O_msg_class_g) * sizeof(unsigned)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") for(i = 0, mesg_total = 0; i < oh->nmesgs; i++) { + const H5O_msg_class_t *debug_type; /* Type of message to use for callbacks */ + mesg_total += H5O_SIZEOF_MSGHDR_OH(oh) + oh->mesg[i].raw_size; HDfprintf(stream, "%*sMessage %d...\n", indent, "", i); @@ -410,13 +411,9 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i HDfprintf(stream, "*** BAD MESSAGE RAW ADDRESS\n"); /* decode the message */ - if((oh->mesg[i].flags & H5O_MSG_FLAG_SHARED) && !H5O_NEW_SHARED(oh->mesg[i].type)) { - debug_type = H5O_MSG_SHARED; - } else { - debug_type = oh->mesg[i].type; - } /* end else */ - if(NULL==oh->mesg[i].native && debug_type->decode) - oh->mesg[i].native = (debug_type->decode)(f, dxpl_id, oh->mesg[i].flags, oh->mesg[i].raw); + debug_type = oh->mesg[i].type; + if(NULL == oh->mesg[i].native && debug_type->decode) + H5O_LOAD_NATIVE(f, dxpl_id, &oh->mesg[i], FAIL) /* print the message */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), @@ -425,17 +422,6 @@ H5O_debug_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, haddr_t addr, FILE *stream, i (debug_type->debug)(f, dxpl_id, oh->mesg[i].native, stream, indent + 6, MAX(0, fwidth - 6)); else HDfprintf(stream, "%*s<No info for this message>\n", indent + 6, ""); - - /* If the message is shared then also print the pointed-to message */ - if((oh->mesg[i].flags & H5O_MSG_FLAG_SHARED) && !H5O_NEW_SHARED(oh->mesg[i].type)) { - H5O_shared_t *shared = (H5O_shared_t*)(oh->mesg[i].native); - void *mesg; - - mesg = H5O_shared_read(f, dxpl_id, shared, oh->mesg[i].type, NULL); - if(oh->mesg[i].type->debug) - (oh->mesg[i].type->debug)(f, dxpl_id, mesg, stream, indent + 3, MAX (0, fwidth - 3)); - H5O_msg_free_real(oh->mesg[i].type, mesg); - } /* end if */ } /* end for */ sequence = H5MM_xfree(sequence); |