diff options
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r-- | src/H5Olayout.c | 137 |
1 files changed, 68 insertions, 69 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 645ad73..6a9e624 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -91,8 +91,8 @@ H5O__layout_decode(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, unsigned H5_ATTR_UNU FUNC_ENTER_PACKAGE - HDassert(f); - HDassert(p); + assert(f); + assert(p); if (NULL == (mesg = H5FL_CALLOC(H5O_layout_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "memory allocation failed") @@ -798,9 +798,9 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(p); + assert(f); + assert(mesg); + assert(p); /* Message version */ *p++ = (uint8_t)((mesg->version < H5O_LAYOUT_VERSION_3) ? H5O_LAYOUT_VERSION_3 : mesg->version); @@ -819,7 +819,7 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, if (mesg->storage.u.compact.buf) H5MM_memcpy(p, mesg->storage.u.compact.buf, mesg->storage.u.compact.size); else - HDmemset(p, 0, mesg->storage.u.compact.size); + memset(p, 0, mesg->storage.u.compact.size); p += mesg->storage.u.compact.size; } /* end if */ break; @@ -835,7 +835,7 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, case H5D_CHUNKED: if (mesg->version < H5O_LAYOUT_VERSION_4) { /* Number of dimensions */ - HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); *p++ = (uint8_t)mesg->u.chunk.ndims; /* B-tree address */ @@ -850,11 +850,11 @@ H5O__layout_encode(H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, uint8_t *p, *p++ = mesg->u.chunk.flags; /* Number of dimensions */ - HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); + assert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS); *p++ = (uint8_t)mesg->u.chunk.ndims; /* Encoded # of bytes for each chunk dimension */ - HDassert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8); + assert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8); *p++ = (uint8_t)mesg->u.chunk.enc_bytes_per_dim; /* Dimension sizes */ @@ -956,7 +956,7 @@ H5O__layout_copy(const void *_mesg, void *_dest) FUNC_ENTER_PACKAGE /* check args */ - HDassert(mesg); + assert(mesg); /* Allocate destination message, if necessary */ if (!dest && NULL == (dest = H5FL_MALLOC(H5O_layout_t))) @@ -971,7 +971,7 @@ H5O__layout_copy(const void *_mesg, void *_dest) /* Deep copy the buffer for compact datasets also */ if (mesg->storage.u.compact.size > 0) { /* Sanity check */ - HDassert(mesg->storage.u.compact.buf); + assert(mesg->storage.u.compact.buf); /* Allocate memory for the raw data */ if (NULL == (dest->storage.u.compact.buf = H5MM_malloc(dest->storage.u.compact.size))) @@ -982,7 +982,7 @@ H5O__layout_copy(const void *_mesg, void *_dest) dest->storage.u.compact.size); } /* end if */ else - HDassert(dest->storage.u.compact.buf == NULL); + assert(dest->storage.u.compact.buf == NULL); break; case H5D_CONTIGUOUS: @@ -1042,8 +1042,8 @@ H5O__layout_size(const H5F_t *f, hbool_t H5_ATTR_UNUSED disable_shared, const vo FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); + assert(f); + assert(mesg); /* Compute serialized size */ /* (including possibly compact data) */ @@ -1110,7 +1110,7 @@ H5O__layout_free(void *_mesg) FUNC_ENTER_PACKAGE_NOERR - HDassert(mesg); + assert(mesg); /* Free resources within the message */ H5O__layout_reset(mesg); @@ -1141,9 +1141,9 @@ H5O__layout_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) FUNC_ENTER_PACKAGE /* check args */ - HDassert(f); - HDassert(open_oh); - HDassert(mesg); + assert(f); + assert(open_oh); + assert(mesg); /* Perform different actions, depending on the type of storage */ switch (mesg->type) { @@ -1203,8 +1203,8 @@ H5O__layout_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void *mesg_src, FUNC_ENTER_PACKAGE /* check args */ - HDassert(cpy_info); - HDassert(cpy_info->file_dst); + assert(cpy_info); + assert(cpy_info->file_dst); /* Check to ensure that the version of the message to be copied does not exceed the message version allowed by the destination file's high bound */ @@ -1243,9 +1243,9 @@ H5O__layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, FUNC_ENTER_PACKAGE /* check args */ - HDassert(file_src); - HDassert(layout_src); - HDassert(file_dst); + assert(file_src); + assert(layout_src); + assert(file_dst); /* Copy the layout information */ if (NULL == (layout_dst = (H5O_layout_t *)H5O__layout_copy(layout_src, NULL))) @@ -1345,102 +1345,101 @@ H5O__layout_debug(H5F_t H5_ATTR_UNUSED *f, const void *_mesg, FILE *stream, int FUNC_ENTER_PACKAGE_NOERR /* check args */ - HDassert(f); - HDassert(mesg); - HDassert(stream); - HDassert(indent >= 0); - HDassert(fwidth >= 0); + assert(f); + assert(mesg); + assert(stream); + assert(indent >= 0); + assert(fwidth >= 0); - HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Version:", mesg->version); + fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Version:", mesg->version); switch (mesg->type) { case H5D_CHUNKED: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Chunked"); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Chunked"); /* Chunk # of dims & size */ - HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, - "Number of dimensions:", (unsigned long)(mesg->u.chunk.ndims)); - HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Size:"); + fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, + "Number of dimensions:", (unsigned long)(mesg->u.chunk.ndims)); + fprintf(stream, "%*s%-*s {", indent, "", fwidth, "Size:"); for (u = 0; u < (size_t)mesg->u.chunk.ndims; u++) - HDfprintf(stream, "%s%lu", u ? ", " : "", (unsigned long)(mesg->u.chunk.dim[u])); - HDfprintf(stream, "}\n"); + fprintf(stream, "%s%lu", u ? ", " : "", (unsigned long)(mesg->u.chunk.dim[u])); + fprintf(stream, "}\n"); /* Index information */ switch (mesg->u.chunk.idx_type) { case H5D_CHUNK_IDX_BTREE: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "v1 B-tree"); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "v1 B-tree"); break; case H5D_CHUNK_IDX_NONE: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "Implicit"); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "Implicit"); break; case H5D_CHUNK_IDX_SINGLE: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "Single Chunk"); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "Single Chunk"); break; case H5D_CHUNK_IDX_FARRAY: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "Fixed Array"); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "Fixed Array"); /* (Should print the fixed array creation parameters) */ break; case H5D_CHUNK_IDX_EARRAY: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "Extensible Array"); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "Extensible Array"); /* (Should print the extensible array creation parameters) */ break; case H5D_CHUNK_IDX_BT2: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "v2 B-tree"); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Index Type:", "v2 B-tree"); /* (Should print the v2-Btree creation parameters) */ break; case H5D_CHUNK_IDX_NTYPES: default: - HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Index Type:", "Unknown", - (unsigned)mesg->u.chunk.idx_type); + fprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Index Type:", "Unknown", + (unsigned)mesg->u.chunk.idx_type); break; } /* end switch */ - HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, - "Index address:", mesg->storage.u.chunk.idx_addr); + fprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, + "Index address:", mesg->storage.u.chunk.idx_addr); break; case H5D_CONTIGUOUS: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Contiguous"); - HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, - "Data address:", mesg->storage.u.contig.addr); - HDfprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, - "Data Size:", mesg->storage.u.contig.size); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Contiguous"); + fprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, + "Data address:", mesg->storage.u.contig.addr); + fprintf(stream, "%*s%-*s %" PRIuHSIZE "\n", indent, "", fwidth, + "Data Size:", mesg->storage.u.contig.size); break; case H5D_COMPACT: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Compact"); - HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, - "Data Size:", mesg->storage.u.compact.size); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Compact"); + fprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, "Data Size:", mesg->storage.u.compact.size); break; case H5D_VIRTUAL: - HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Virtual"); - HDfprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, - "Global heap address:", mesg->storage.u.virt.serial_list_hobjid.addr); - HDfprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, - "Global heap index:", mesg->storage.u.virt.serial_list_hobjid.idx); + fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Type:", "Virtual"); + fprintf(stream, "%*s%-*s %" PRIuHADDR "\n", indent, "", fwidth, + "Global heap address:", mesg->storage.u.virt.serial_list_hobjid.addr); + fprintf(stream, "%*s%-*s %zu\n", indent, "", fwidth, + "Global heap index:", mesg->storage.u.virt.serial_list_hobjid.idx); for (u = 0; u < mesg->storage.u.virt.list_nused; u++) { - HDfprintf(stream, "%*sMapping %zu:\n", indent, "", u); - HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, - "Virtual selection:", "<Not yet implemented>"); - HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, - "Source file name:", mesg->storage.u.virt.list[u].source_file_name); - HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, - "Source dataset name:", mesg->storage.u.virt.list[u].source_dset_name); - HDfprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, - "Source selection:", "<Not yet implemented>"); + fprintf(stream, "%*sMapping %zu:\n", indent, "", u); + fprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, + "Virtual selection:", "<Not yet implemented>"); + fprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, + "Source file name:", mesg->storage.u.virt.list[u].source_file_name); + fprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, + "Source dataset name:", mesg->storage.u.virt.list[u].source_dset_name); + fprintf(stream, "%*s%-*s %s\n", indent + 3, "", fwidth - 3, + "Source selection:", "<Not yet implemented>"); } /* end for */ break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HDfprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Type:", "Unknown", - (unsigned)mesg->type); + fprintf(stream, "%*s%-*s %s (%u)\n", indent, "", fwidth, "Type:", "Unknown", + (unsigned)mesg->type); break; } /* end switch */ |