summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-07-24 21:43:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-07-24 21:43:59 (GMT)
commit712c226038212283ffeefad494538d30cf767eef (patch)
treeae197744810ab7d438f00d5bc69a9f320a5ed2e0 /src/H5S.c
parentdecf1830efac293971cf7119c15fc1c9993263e9 (diff)
downloadhdf5-712c226038212283ffeefad494538d30cf767eef.zip
hdf5-712c226038212283ffeefad494538d30cf767eef.tar.gz
hdf5-712c226038212283ffeefad494538d30cf767eef.tar.bz2
[svn-r14010] Description:
Fix problem with dataspace messages where the version of the format for a dataspace message could depend on the "use the latest format" flag from the file after it was initially created. Also, move debuging routine into separate file. Tested on: FreeBSD/32 6.2 (duty) FreeBSD/64 6.2 (liberty) Linux/32 2.6 (kagiso) Mac OS X/32 10.4.10 (amazon) Solaris/32 2.10 (linew)
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c52
1 files changed, 19 insertions, 33 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 95c4783..45069c1 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -313,6 +313,10 @@ H5S_create(H5S_class_t type)
/* Initialize default dataspace state */
new_ds->extent.type = type;
+ if(type == H5S_NULL)
+ new_ds->extent.version = H5O_SDSPACE_VERSION_2;
+ else
+ new_ds->extent.version = H5O_SDSPACE_VERSION_1;
new_ds->extent.rank = 0;
new_ds->extent.size = new_ds->extent.max = NULL;
@@ -618,6 +622,7 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src)
/* Copy the regular fields */
dst->type = src->type;
+ dst->version = src->version;
dst->nelem = src->nelem;
dst->rank = src->rank;
@@ -2322,50 +2327,31 @@ H5S_extent_nelem(const H5S_extent_t *ext)
/*-------------------------------------------------------------------------
- * Function: H5S_debug
+ * Function: H5S_set_latest_version
*
- * Purpose: Prints debugging information about a data space.
+ * Purpose: Set the encoding for a dataspace to the latest version.
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Robb Matzke
- * Tuesday, July 21, 1998
- *
- * Modifications:
+ * Programmer: Quincey Koziol
+ * Tuesday, July 24, 2007
*
*-------------------------------------------------------------------------
*/
herr_t
-H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, int fwidth)
+H5S_set_latest_version(H5S_t *ds)
{
- const H5S_t *mesg = (const H5S_t*)_mesg;
-
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_debug)
+ herr_t ret_value = SUCCEED; /* Return value */
- switch(H5S_GET_EXTENT_TYPE(mesg)) {
- case H5S_NULL:
- fprintf(stream, "%*s%-*s H5S_NULL\n", indent, "", fwidth,
- "Space class:");
- break;
-
- case H5S_SCALAR:
- fprintf(stream, "%*s%-*s H5S_SCALAR\n", indent, "", fwidth,
- "Space class:");
- break;
+ FUNC_ENTER_NOAPI(H5S_set_latest_version, FAIL)
- case H5S_SIMPLE:
- fprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth,
- "Space class:");
- H5O_debug_id(H5O_SDSPACE_ID, f, dxpl_id, &(mesg->extent), stream,
- indent + 3, MAX(0, fwidth - 3));
- break;
+ /* Sanity check */
+ HDassert(ds);
- default:
- fprintf(stream, "%*s%-*s **UNKNOWN-%ld**\n", indent, "", fwidth,
- "Space class:", (long)(H5S_GET_EXTENT_TYPE(mesg)));
- break;
- } /* end switch */
+ /* Set encoding of extent to latest version */
+ ds->extent.version = H5O_SDSPACE_VERSION_LATEST;
- FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5S_debug() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5S_set_latest_version() */