summaryrefslogtreecommitdiffstats
path: root/src/H5P.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-04-28 13:59:08 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-04-28 13:59:08 (GMT)
commit66071d5078ad9841c8fbb430881ae2c6e059886e (patch)
tree163bf340ff1c2dcc9aebc35a1bea296a8da0e623 /src/H5P.c
parent4dcf59ae4461eec74a180d77783d9064d2aa3a58 (diff)
downloadhdf5-66071d5078ad9841c8fbb430881ae2c6e059886e.zip
hdf5-66071d5078ad9841c8fbb430881ae2c6e059886e.tar.gz
hdf5-66071d5078ad9841c8fbb430881ae2c6e059886e.tar.bz2
[svn-r377] Changes since 19980424
---------------------- ./src/H5A.c ./src/H5T.c Fixed memory leaks. More to come later but PureAtria doesn't make a Linux version of purify and the free version doesn't compile with the new SMP Linux kernels so I had to debug over the internet on a day that Sprint seemed to be having routing problems... oh well. I got rid of most of the leaks. ./src/H5Apublic.h Includes H5Ipublic.h for types in the header file. ./src/H5O.c Comments improved for H5O_read() ./test/tattr.c Removed a non-ANSI empty initializer. ./test/dsets.c Include <string.h> ./test/istore.c Fixed a non-ANSI pointer conversion.
Diffstat (limited to 'src/H5P.c')
-rw-r--r--src/H5P.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/H5P.c b/src/H5P.c
index b36e80c..fa94d6e 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -1449,8 +1449,8 @@ H5Pset_split (hid_t tid, const char *meta_ext, hid_t meta_tid,
const char *raw_ext, hid_t raw_tid)
{
H5F_access_t *tmpl = NULL;
- H5F_access_t *meta_tmpl = NULL;
- H5F_access_t *raw_tmpl = NULL;
+ H5F_access_t *meta_tmpl = &H5F_access_dflt;
+ H5F_access_t *raw_tmpl = &H5F_access_dflt;
FUNC_ENTER (H5Pset_split, FAIL);
@@ -1462,13 +1462,13 @@ H5Pset_split (hid_t tid, const char *meta_ext, hid_t meta_tid,
}
if (H5P_DEFAULT!=meta_tid &&
(H5P_FILE_ACCESS != H5Pget_class(meta_tid) ||
- NULL == (tmpl = H5I_object(meta_tid)))) {
+ NULL == (meta_tmpl = H5I_object(meta_tid)))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"not a file access template");
}
if (H5P_DEFAULT!=raw_tid &&
(H5P_FILE_ACCESS != H5Pget_class(raw_tid) ||
- NULL == (tmpl = H5I_object(raw_tid)))) {
+ NULL == (raw_tmpl = H5I_object(raw_tid)))) {
HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL,
"not a file access template");
}
@@ -1498,11 +1498,8 @@ H5Pset_split (hid_t tid, const char *meta_ext, hid_t meta_tid,
* if META_PROPERTIES and/or RAW_PROPERTIES are non-null then
* the file access property list of the meta file and/or raw
* file is copied and its OID returned through these arguments.
- * If the meta file or raw file has no property list then an OID
- * of FAIL (-1) is returned but the H5Pget_split() function
- * still returns SUCCEED. In the future, additional arguments
- * may be added to this function to match those added to
- * H5Pset_sec2().
+ * In the future, additional arguments may be added to this
+ * function to match those added to H5Pset_sec2().
*
* Return: Success: SUCCEED
*
@@ -1556,18 +1553,19 @@ H5Pget_split (hid_t tid, size_t meta_ext_size, char *meta_ext/*out*/,
strncpy (raw_ext, ".raw", raw_ext_size);
}
}
- if (meta_properties && tmpl->u.split.meta_access) {
+ if (meta_properties) {
+ assert (tmpl->u.split.meta_access);
*meta_properties = H5P_create (H5P_FILE_ACCESS,
H5P_copy (H5P_FILE_ACCESS,
tmpl->u.split.meta_access));
}
- if (raw_properties && tmpl->u.split.raw_access) {
+ if (raw_properties) {
+ assert (tmpl->u.split.raw_access);
*raw_properties = H5P_create (H5P_FILE_ACCESS,
H5P_copy (H5P_FILE_ACCESS,
tmpl->u.split.raw_access));
}
-
FUNC_LEAVE (SUCCEED);
}
@@ -1629,12 +1627,9 @@ H5Pset_family (hid_t tid, size_t offset_bits, hid_t memb_tid)
* Purpose: If the file access property list is set to the family driver
* then this function returns zero; otherwise it returns a
* negative value. On success, if MEMB_TID is a non-null
- * pointer it will be initialized with the OID of a copy of the
- * file access template used for the family members. If the
- * family members have no file access template (that is, they
- * are using the default values) then FAIL (-1) is returned for
- * the member property list OID but the function still returns
- * SUCCEED. In the future, additional arguments may be added to
+ * pointer it will be initialized with the id of an open
+ * property list: the file access property list for the family
+ * members. In the future, additional arguments may be added to
* this function to match those added to H5Pset_family().
*
* Return: Success: SUCCEED
@@ -1667,12 +1662,11 @@ H5Pget_family (hid_t tid, size_t *offset_bits/*out*/, hid_t *memb_tid/*out*/)
}
/* Output args */
- if (memb_tid && tmpl->u.fam.memb_access) {
+ if (memb_tid) {
+ assert (tmpl->u.fam.memb_access);
*memb_tid = H5P_create (H5P_FILE_ACCESS,
H5P_copy (H5P_FILE_ACCESS,
tmpl->u.fam.memb_access));
- } else if (memb_tid) {
- *memb_tid = FAIL;
}
if (offset_bits) *offset_bits = tmpl->u.fam.offset_bits;