diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-28 15:02:54 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-28 15:02:54 (GMT) |
commit | ea343ef85416b42f68f28fb1024702c6726f7eea (patch) | |
tree | d5c401bf83f7f5578df06c54f9fd9fb198732ed2 /hl | |
parent | eb16d8bc2b2f37c7a1d75fe7bf5258eba21515b2 (diff) | |
download | hdf5-ea343ef85416b42f68f28fb1024702c6726f7eea.zip hdf5-ea343ef85416b42f68f28fb1024702c6726f7eea.tar.gz hdf5-ea343ef85416b42f68f28fb1024702c6726f7eea.tar.bz2 |
[svn-r14115] Description:
Remove all plain calls to H5Gopen() from source, replacing them with
either H5Gopen2().
Add test for H5Gopen1().
Reformatted several pieces of code, to clean them up.
Tested on:
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Linux/32 2.6 (kagiso)
Linux/64 2.6 (smirom)
Solaris/32 5.10 (linew)
Mac OS X/32 10.4.10 (amazon)
Diffstat (limited to 'hl')
-rw-r--r-- | hl/src/H5LT.c | 37 | ||||
-rw-r--r-- | hl/test/test_ds.c | 8 |
2 files changed, 20 insertions, 25 deletions
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 8ee7fd0..717352f 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -1299,31 +1299,26 @@ herr_t H5LT_open_id( hid_t loc_id, const char *obj_name, int obj_type /*basic object type*/ ) { + hid_t obj_id = -1; - hid_t obj_id = -1; - - switch ( obj_type ) - { - case H5G_DATASET: - - /* Open the dataset. */ - if ( (obj_id = H5Dopen( loc_id, obj_name )) < 0 ) - return -1; - break; - - case H5G_GROUP: - - /* Open the group. */ - if ( (obj_id = H5Gopen( loc_id, obj_name )) < 0 ) - return -1; - break; + switch(obj_type) { + case H5G_DATASET: + /* Open the dataset. */ + if((obj_id = H5Dopen(loc_id, obj_name)) < 0) + return -1; + break; - default: - return -1; - } + case H5G_GROUP: + /* Open the group. */ + if((obj_id = H5Gopen2(loc_id, obj_name, H5P_DEFAULT)) < 0) + return -1; + break; - return obj_id; + default: + return -1; + } + return obj_id; } diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 265a45e..c4bd1ab 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -1962,7 +1962,7 @@ static int test_errors(void) goto out; /* open the group. */ - if ((gid = H5Gopen(fid,"grp"))<0) + if ((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0) goto out; /* verify that it is not a dimension scale dataset */ @@ -2016,7 +2016,7 @@ static int test_errors(void) goto out; /* open the group. */ - if ((gid = H5Gopen(fid,"grp"))<0) + if ((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0) goto out; /* try to detach "ds_a" from "grp" */ @@ -2044,7 +2044,7 @@ static int test_errors(void) goto out; /* open the group. */ - if ((gid = H5Gopen(fid,"grp"))<0) + if ((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0) goto out; /* try to detach "grp" from "dset_a" */ @@ -2212,7 +2212,7 @@ static int test_iterators(void) TESTING2("iterate on group "); /* open */ - if ((gid = H5Gopen(fid,"grp"))<0) + if ((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0) goto out; /* try to iterate, return error */ |