summaryrefslogtreecommitdiffstats
path: root/src/H5Ofphdf5.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2002-12-19 21:42:32 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2002-12-19 21:42:32 (GMT)
commita6955753874d6d8d3b02e39e2899f79035d8fa7a (patch)
tree13e17d90bde44b202a836282bd82fdf526ceb5ad /src/H5Ofphdf5.c
parent5977b667aad0ebf35fef45c3e766c1e0e434d8db (diff)
downloadhdf5-a6955753874d6d8d3b02e39e2899f79035d8fa7a.zip
hdf5-a6955753874d6d8d3b02e39e2899f79035d8fa7a.tar.gz
hdf5-a6955753874d6d8d3b02e39e2899f79035d8fa7a.tar.bz2
[svn-r6218] Purpose:
Bug Fix Description: Was encoding a value as DTYPE instead of MTIME, which would cause a couple of errors. Also, got rid of the EFL field as it's encoded in the PLIST already... Platforms tested: Linux...Modest test, FPHDF5 not fully implemented just yet.
Diffstat (limited to 'src/H5Ofphdf5.c')
-rw-r--r--src/H5Ofphdf5.c64
1 files changed, 17 insertions, 47 deletions
diff --git a/src/H5Ofphdf5.c b/src/H5Ofphdf5.c
index 765fa62..5b4afb3 100644
--- a/src/H5Ofphdf5.c
+++ b/src/H5Ofphdf5.c
@@ -134,7 +134,7 @@ H5O_fphdf5_decode(H5F_t *f, const uint8_t *p, H5O_shared_t UNUSED *sh)
p += H5O_DTYPE[0].raw_size(f, fmeta->dtype);
/* decode the modification time next */
- fmeta->mtime = H5O_DTYPE[0].decode(f, p, NULL);
+ fmeta->mtime = H5O_MTIME[0].decode(f, p, NULL);
if (!fmeta->mtime)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
@@ -169,15 +169,6 @@ H5O_fphdf5_decode(H5F_t *f, const uint8_t *p, H5O_shared_t UNUSED *sh)
/* jump past the dataset name part */
p += H5O_NAME[0].raw_size(f, fmeta->dset);
- /* decode the external file layout for the dataset */
- fmeta->efl = H5O_EFL[0].decode(f, p, NULL);
-
- if (!fmeta->efl)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
-
- /* jump past the dataset name part */
- p += H5O_EFL[0].raw_size(f, fmeta->efl);
-
/* decode the property list last */
fmeta->plist = H5O_PLIST[0].decode(f, p, NULL);
@@ -190,28 +181,25 @@ H5O_fphdf5_decode(H5F_t *f, const uint8_t *p, H5O_shared_t UNUSED *sh)
done:
if (!ret_value && fmeta) {
/* free up fmeta */
- if (H5O_SDSPACE[0].free)
+ if (H5O_SDSPACE[0].free && fmeta->sdim)
H5O_SDSPACE[0].free(fmeta->sdim);
- if (H5O_DTYPE[0].free)
+ if (H5O_DTYPE[0].free && fmeta->dtype)
H5O_DTYPE[0].free(fmeta->dtype);
- if (H5O_MTIME[0].free)
+ if (H5O_MTIME[0].free && fmeta->mtime)
H5O_MTIME[0].free(fmeta->mtime);
- if (H5O_LAYOUT[0].free)
+ if (H5O_LAYOUT[0].free && fmeta->layout)
H5O_LAYOUT[0].free(fmeta->layout);
- if (H5O_NAME[0].free)
- H5O_NAME[0].free(fmeta->group);
-
- if (H5O_NAME[0].free)
+ if (H5O_NAME[0].free && fmeta->group)
H5O_NAME[0].free(fmeta->dset);
- if (H5O_EFL[0].free)
- H5O_EFL[0].free(fmeta->efl);
+ if (H5O_NAME[0].free && fmeta->dset)
+ H5O_NAME[0].free(fmeta->dset);
- if (H5O_PLIST[0].free)
+ if (H5O_PLIST[0].free && fmeta->plist)
H5O_PLIST[0].free(fmeta->plist);
H5FL_FREE(H5O_fphdf5_t, fmeta);
@@ -275,7 +263,7 @@ H5O_fphdf5_encode(H5F_t *f, uint8_t *p, const void *mesg)
p += H5O_DTYPE[0].raw_size(f, fmeta->dtype);
/* encode the modification time next */
- ret_value = H5O_DTYPE[0].encode(f, p, fmeta->mtime);
+ ret_value = H5O_MTIME[0].encode(f, p, fmeta->mtime);
if (ret_value < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
@@ -310,15 +298,6 @@ H5O_fphdf5_encode(H5F_t *f, uint8_t *p, const void *mesg)
/* jump past the dataset name part */
p += H5O_NAME[0].raw_size(f, fmeta->dset);
- /* encode the external file layout stuff next */
- ret_value = H5O_EFL[0].encode(f, p, fmeta->efl);
-
- if (ret_value < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
-
- /* jump past the external file layout part */
- p += H5O_EFL[0].raw_size(f, fmeta->efl);
-
/* decode the property list last */
ret_value = H5O_PLIST[0].encode(f, p, fmeta->plist);
@@ -367,7 +346,6 @@ H5O_fphdf5_copy(const void *mesg, void *dest)
H5O_LAYOUT[0].copy(src->layout, dst->layout);
H5O_NAME[0].copy(src->group, dst->group);
H5O_NAME[0].copy(src->dset, dst->dset);
- H5O_EFL[0].copy(src->efl, dst->efl);
if (H5O_PLIST[0].copy)
H5O_PLIST[0].copy(src->plist, dst->plist);
@@ -414,7 +392,6 @@ H5O_fphdf5_size(H5F_t *f, const void *mesg)
ret_value += H5O_LAYOUT[0].raw_size(f, fmeta->layout);
ret_value += H5O_NAME[0].raw_size(f, fmeta->group);
ret_value += H5O_NAME[0].raw_size(f, fmeta->dset);
- ret_value += H5O_EFL[0].raw_size(f, fmeta->efl);
ret_value += H5O_PLIST[0].raw_size(f, fmeta->plist);
done:
@@ -464,9 +441,6 @@ H5O_fphdf5_reset(void *mesg)
if (H5O_NAME[0].reset)
ret_value = H5O_NAME[0].reset(fmeta->dset);
- if (H5O_EFL[0].reset)
- ret_value = H5O_EFL[0].reset(fmeta->efl);
-
if (H5O_PLIST[0].reset)
ret_value = H5O_PLIST[0].reset(fmeta->plist);
@@ -494,28 +468,25 @@ H5O_fphdf5_free(void *mesg)
FUNC_ENTER_NOAPI(H5O_fphdf5_free, FAIL);
assert(fmeta);
- if (H5O_SDSPACE[0].free)
+ if (H5O_SDSPACE[0].free && fmeta->sdim)
ret_value = H5O_SDSPACE[0].free(fmeta->sdim);
- if (H5O_DTYPE[0].free)
+ if (H5O_DTYPE[0].free && fmeta->dtype)
ret_value = H5O_DTYPE[0].free(fmeta->dtype);
- if (H5O_MTIME[0].free)
+ if (H5O_MTIME[0].free && fmeta->mtime)
ret_value = H5O_MTIME[0].free(fmeta->mtime);
- if (H5O_LAYOUT[0].free)
+ if (H5O_LAYOUT[0].free && fmeta->layout)
ret_value = H5O_MTIME[0].free(fmeta->layout);
- if (H5O_NAME[0].free)
+ if (H5O_NAME[0].free && fmeta->group)
ret_value = H5O_NAME[0].free(fmeta->group);
- if (H5O_NAME[0].free)
+ if (H5O_NAME[0].free && fmeta->dset)
ret_value = H5O_NAME[0].free(fmeta->dset);
- if (H5O_EFL[0].free)
- ret_value = H5O_EFL[0].free(fmeta->efl);
-
- if (H5O_PLIST[0].free)
+ if (H5O_PLIST[0].free && fmeta->plist)
ret_value = H5O_PLIST[0].free(fmeta->plist);
H5FL_FREE(H5O_fphdf5_t, fmeta);
@@ -571,7 +542,6 @@ H5O_fphdf5_debug(H5F_t UNUSED *f, const void *mesg,
ret_value = H5O_LAYOUT[0].debug(f, fmeta->layout, stream, indent + 1, fwidth);
ret_value = H5O_NAME[0].debug(f, fmeta->group, stream, indent + 1, fwidth);
ret_value = H5O_NAME[0].debug(f, fmeta->dset, stream, indent + 1, fwidth);
- ret_value = H5O_EFL[0].debug(f, fmeta->efl, stream, indent + 1, fwidth);
ret_value = H5O_PLIST[0].debug(f, fmeta->plist, stream, indent + 1, fwidth);
HDfprintf(stream, "}\n");