summaryrefslogtreecommitdiffstats
path: root/src/H5Tvlen.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-07-24 19:10:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-07-24 19:10:00 (GMT)
commit492e5ca2b48782bb4759ee1d0a59b0210f011528 (patch)
treef2c334cd5e2afb9ca40492340efe57d1f3af1ae6 /src/H5Tvlen.c
parent05973a4e8610a7f6893d0eaed9c3eee3b008ba60 (diff)
downloadhdf5-492e5ca2b48782bb4759ee1d0a59b0210f011528.zip
hdf5-492e5ca2b48782bb4759ee1d0a59b0210f011528.tar.gz
hdf5-492e5ca2b48782bb4759ee1d0a59b0210f011528.tar.bz2
[svn-r14004] Description:
Fix problem with datatype messages where the version of the format for a datatype message could depend on the "use the latest format" flag from the file after it was initially created. 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)
Diffstat (limited to 'src/H5Tvlen.c')
-rw-r--r--src/H5Tvlen.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c
index 1d71498..bbc698f 100644
--- a/src/H5Tvlen.c
+++ b/src/H5Tvlen.c
@@ -115,20 +115,20 @@ H5Tvlen_create(hid_t base_id)
H5TRACE1("i", "i", base_id);
/* Check args */
- if (NULL==(base=H5I_object_verify(base_id,H5I_DATATYPE)))
+ if(NULL == (base = H5I_object_verify(base_id, H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype")
/* Create up VL datatype */
- if ((dt=H5T_vlen_create(base))==NULL)
+ if((dt = H5T_vlen_create(base)) == NULL)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid VL location")
/* Atomize the type */
- if ((ret_value=H5I_register(H5I_DATATYPE, dt))<0)
+ if((ret_value = H5I_register(H5I_DATATYPE, dt)) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register datatype")
done:
FUNC_LEAVE_API(ret_value)
-}
+} /* end H5Tvlen_create() */
/*-------------------------------------------------------------------------
@@ -157,7 +157,7 @@ H5T_vlen_create(const H5T_t *base)
FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_create)
/* Check args */
- assert(base);
+ HDassert(base);
/* Build new type */
if(NULL == (dt = H5T_alloc()))
@@ -171,19 +171,22 @@ H5T_vlen_create(const H5T_t *base)
dt->shared->force_conv = TRUE;
dt->shared->parent = H5T_copy(base, H5T_COPY_ALL);
+ /* Inherit encoding version from base type */
+ dt->shared->version = base->shared->version;
+
/* This is a sequence, not a string */
dt->shared->u.vlen.type = H5T_VLEN_SEQUENCE;
/* Set up VL information */
- if (H5T_set_loc(dt, NULL, H5T_LOC_MEMORY)<0)
+ if(H5T_set_loc(dt, NULL, H5T_LOC_MEMORY) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location")
/* Set return value */
- ret_value=dt;
+ ret_value = dt;
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5T_vlen_create() */
/*-------------------------------------------------------------------------
@@ -284,7 +287,7 @@ H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc)
break;
default:
- HGOTO_ERROR (H5E_DATATYPE, H5E_BADRANGE, FAIL, "invalid VL datatype location")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "invalid VL datatype location")
} /* end switch */ /*lint !e788 All appropriate cases are covered */
} /* end if */