summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--c++/src/H5CommonFG.cpp6
-rw-r--r--examples/Attributes.txt2
-rw-r--r--examples/h5_attribute.c2
-rw-r--r--examples/h5_compound.c2
-rw-r--r--examples/h5_dtransform.c2
-rw-r--r--examples/h5_extend_write.c4
-rw-r--r--examples/h5_group.c8
-rw-r--r--examples/h5_mount.c7
-rw-r--r--examples/h5_ref2reg.c12
-rw-r--r--examples/h5_reference.c22
-rw-r--r--examples/h5_select.c11
-rw-r--r--examples/h5_shared_mesg.c2
-rw-r--r--examples/h5_write.c13
-rw-r--r--examples/ph5example.c26
-rw-r--r--fortran/src/H5Df.c36
-rw-r--r--fortran/src/README6
-rw-r--r--hl/examples/ex_lite3.c19
-rw-r--r--hl/fortran/src/H5IMcc.c186
-rw-r--r--hl/src/H5LT.c383
-rw-r--r--hl/src/H5PT.c66
-rw-r--r--hl/src/H5TB.c102
-rw-r--r--hl/test/test_ds.c1031
-rw-r--r--hl/test/test_lite.c2
-rw-r--r--perform/benchpar.c4
-rw-r--r--perform/chunk.c28
-rw-r--r--perform/iopipe.c13
-rw-r--r--perform/overhead.c54
-rw-r--r--perform/perf.c16
-rw-r--r--perform/perf_meta.c19
-rw-r--r--perform/pio_engine.c8
-rw-r--r--src/H5Ddeprec.c10
-rw-r--r--src/H5Dpublic.h10
-rw-r--r--src/H5E.c5
-rw-r--r--src/H5vers.txt1
-rw-r--r--src/H5version.h15
-rw-r--r--test/Makefile.am6
-rw-r--r--test/big.c8
-rw-r--r--test/cache_api.c6
-rw-r--r--test/cmpd_dset.c27
-rw-r--r--test/dangle.c16
-rw-r--r--test/dsets.c1058
-rw-r--r--test/dtransform.c158
-rw-r--r--test/dtypes.c30
-rw-r--r--test/enum.c11
-rw-r--r--test/err_compat.c8
-rw-r--r--test/error_test.c8
-rw-r--r--test/extend.c4
-rw-r--r--test/external.c112
-rw-r--r--test/fillval.c28
-rw-r--r--test/flush1.c18
-rw-r--r--test/gen_bogus.c6
-rwxr-xr-xtest/gen_cross.c4
-rw-r--r--test/gen_deflate.c2
-rw-r--r--test/gen_filters.c2
-rw-r--r--test/gen_new_array.c4
-rw-r--r--test/gen_new_fill.c30
-rw-r--r--test/gen_new_group.c4
-rw-r--r--test/gen_new_mtime.c2
-rw-r--r--test/gen_noencoder.c4
-rw-r--r--test/gen_nullspace.c2
-rw-r--r--test/gen_old_array.c4
-rw-r--r--test/gen_old_layout.c2
-rw-r--r--test/gen_old_mtime.c2
-rw-r--r--test/getname.c54
-rw-r--r--test/istore.c48
-rw-r--r--test/links.c12
-rw-r--r--test/mount.c4
-rw-r--r--test/mtime.c2
-rw-r--r--test/ntypes.c192
-rwxr-xr-xtest/objcopy.c102
-rwxr-xr-xtest/reserved.c47
-rw-r--r--test/set_extent.c56
-rw-r--r--test/space_overflow.c10
-rw-r--r--test/stream_test.c19
-rw-r--r--test/tarray.c50
-rw-r--r--test/tattr.c225
-rw-r--r--test/testmeta.c12
-rw-r--r--test/tfile.c62
-rw-r--r--test/tgenprop.c30
-rw-r--r--test/th5o.c16
-rw-r--r--test/th5s.c42
-rw-r--r--test/titerate.c22
-rw-r--r--test/tmisc.c469
-rw-r--r--test/trefer.c58
-rw-r--r--test/tselect.c90
-rw-r--r--test/tsohm.c70
-rw-r--r--test/ttime.c4
-rw-r--r--test/ttsafe_acreate.c8
-rw-r--r--test/ttsafe_cancel.c16
-rw-r--r--test/ttsafe_dcreate.c63
-rw-r--r--test/ttsafe_error.c22
-rw-r--r--test/tunicode.c57
-rw-r--r--test/tvlstr.c90
-rw-r--r--test/tvltypes.c146
-rw-r--r--test/unlink.c36
-rw-r--r--test/vfd.c12
-rw-r--r--testpar/t_chunk_alloc.c44
-rw-r--r--testpar/t_coll_chunk.c18
-rw-r--r--testpar/t_dset.c480
-rw-r--r--testpar/t_filter_read.c32
-rw-r--r--testpar/t_mdset.c464
-rw-r--r--testpar/t_pflush1.c34
-rw-r--r--testpar/t_span_tree.c10
-rw-r--r--tools/h5copy/h5copygentest.c14
-rw-r--r--tools/h5diff/h5diffgentest.c235
-rw-r--r--tools/h5dump/h5dumpgentest.c1576
-rwxr-xr-xtools/h5import/h5import.c29
-rw-r--r--tools/h5jam/h5jamgentest.c8
-rw-r--r--tools/h5repack/h5repack_copy.c9
-rw-r--r--tools/h5repack/h5repack_refs.c4
-rw-r--r--tools/h5repack/h5repacktst.c289
-rw-r--r--tools/h5stat/h5stat_gentest.c6
-rw-r--r--tools/lib/talign.c2
-rw-r--r--tools/misc/h5repart_gentest.c42
114 files changed, 4429 insertions, 4712 deletions
diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp
index 7cd3705..a6a1530 100644
--- a/c++/src/H5CommonFG.cpp
+++ b/c++/src/H5CommonFG.cpp
@@ -164,13 +164,13 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co
hid_t space_id = data_space.getId();
hid_t create_plist_id = create_plist.getId();
- // Call C routine H5Dcreate to create the named dataset
- hid_t dataset_id = H5Dcreate( getLocId(), name, type_id, space_id, create_plist_id );
+ // Call C routine H5Dcreate2 to create the named dataset
+ hid_t dataset_id = H5Dcreate2( getLocId(), name, type_id, space_id, H5P_DEFAULT, create_plist_id, H5P_DEFAULT );
// If the creation of the dataset failed, throw an exception
if( dataset_id < 0 )
{
- throwException("createDataSet", "H5Dcreate failed");
+ throwException("createDataSet", "H5Dcreate2 failed");
}
// No failure, create and return the DataSet object
diff --git a/examples/Attributes.txt b/examples/Attributes.txt
index e32601c..299451b 100644
--- a/examples/Attributes.txt
+++ b/examples/Attributes.txt
@@ -22,7 +22,7 @@ H5Acreate2 example: Show how to create an attribute for a dataset and a group
dataspace = H5Screate_simple(rank, dimsf, NULL);
/* Create a dataset */
- dataset = H5Dcreate(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, "Dataset1", H5T_UINT8, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
<Write data to first dataset>
diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c
index b49b0e1..e26ed6e 100644
--- a/examples/h5_attribute.c
+++ b/examples/h5_attribute.c
@@ -95,7 +95,7 @@ main (void)
/*
* Create the dataset in the file.
*/
- dataset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, fid, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, "Dataset", H5T_NATIVE_INT, fid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write data to the dataset.
diff --git a/examples/h5_compound.c b/examples/h5_compound.c
index da22c87..3fca2a5 100644
--- a/examples/h5_compound.c
+++ b/examples/h5_compound.c
@@ -87,7 +87,7 @@ main(void)
/*
* Create the dataset.
*/
- dataset = H5Dcreate(file, DATASETNAME, s1_tid, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, DATASETNAME, s1_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Wtite data to the dataset;
diff --git a/examples/h5_dtransform.c b/examples/h5_dtransform.c
index 6f4108b..71ec10a 100644
--- a/examples/h5_dtransform.c
+++ b/examples/h5_dtransform.c
@@ -99,7 +99,7 @@ main (void)
* Create a new dataset within the file using defined dataspace and
* datatype and default dataset creation properties.
*/
- dataset = H5Dcreate(file, "data_no_trans", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, "data_no_trans", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
printf("\nOriginal Data: \n");
PRINT(windchillF);
diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c
index b54cc66..74f6c01 100644
--- a/examples/h5_extend_write.c
+++ b/examples/h5_extend_write.c
@@ -81,8 +81,8 @@ main (void)
* Create a new dataset within the file using cparms
* creation properties.
*/
- dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, dataspace,
- cparms);
+ dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT,
+ cparms, H5P_DEFAULT);
/*
* Extend the dataset. This call assures that dataset is at least 3 x 3.
diff --git a/examples/h5_group.c b/examples/h5_group.c
index f0adff7..da6a848 100644
--- a/examples/h5_group.c
+++ b/examples/h5_group.c
@@ -71,8 +71,8 @@ main(void)
plist = H5Pcreate(H5P_DATASET_CREATE);
H5Pset_chunk(plist, 2, cdims);
H5Pset_deflate( plist, 6);
- dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT,
- dataspace, plist);
+ dataset = H5Dcreate2(file, "/Data/Compressed_Data", H5T_NATIVE_INT,
+ dataspace, H5P_DEFAULT, plist, H5P_DEFAULT);
/*
* Close the first dataset .
*/
@@ -85,8 +85,8 @@ main(void)
dims[0] = 500;
dims[1] = 20;
dataspace = H5Screate_simple(RANK, dims, NULL);
- dataset = H5Dcreate(file, "/Data/Float_Data", H5T_NATIVE_FLOAT,
- dataspace, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, "/Data/Float_Data", H5T_NATIVE_FLOAT,
+ dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
*Close the second dataset and file.
diff --git a/examples/h5_mount.c b/examples/h5_mount.c
index 6c4910c..6da71a1 100644
--- a/examples/h5_mount.c
+++ b/examples/h5_mount.c
@@ -45,10 +45,9 @@ int main(void)
/*
* Initialization of buffer matrix "bm"
*/
- for(i =0; i<NX; i++) {
- for(j = 0; j<NY; j++)
+ for(i =0; i < NX; i++)
+ for(j = 0; j < NY; j++)
bm[i][j] = i + j;
- }
/*
* Create first file and a group in it.
@@ -69,7 +68,7 @@ int main(void)
dims[0] = NX;
dims[1] = NY;
sid = H5Screate_simple(RANK, dims, NULL);
- did = H5Dcreate(fid2, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ did = H5Dcreate2(fid2, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write data to the dataset.
diff --git a/examples/h5_ref2reg.c b/examples/h5_ref2reg.c
index 1459161..0cea797 100644
--- a/examples/h5_ref2reg.c
+++ b/examples/h5_ref2reg.c
@@ -70,7 +70,7 @@ int main(void)
/*
* Create integer dataset.
*/
- dsetv_id = H5Dcreate(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
+ dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write data to the dataset.
@@ -81,7 +81,7 @@ int main(void)
/*
* Dataset with references.
*/
- dsetr_id = H5Dcreate(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT);
+ dsetr_id = H5Dcreate2(file_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Create a reference to the hyperslab.
@@ -90,7 +90,7 @@ int main(void)
start[1] = 3;
count[0] = 2;
count[1] = 3;
- status = H5Sselect_hyperslab(space_id,H5S_SELECT_SET,start,NULL,count,NULL);
+ status = H5Sselect_hyperslab(space_id, H5S_SELECT_SET, start, NULL, count, NULL);
status = H5Rcreate(&ref[0], file_id, dsetnamev, H5R_DATASET_REGION, space_id);
/*
@@ -136,14 +136,14 @@ int main(void)
* Get name of the dataset the first region reference points to
* using H5Rget_name
*/
- name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, 10);
- printf (" Dataset's name (returned by H5Rget_name) the reference points to is %s, name length is %d\n", buf1, (int)name_size1);
+ name_size1 = H5Rget_name(dsetr_id, H5R_DATASET_REGION, &ref_out[0], (char*)buf1, 10);
+ printf(" Dataset's name (returned by H5Rget_name) the reference points to is %s, name length is %d\n", buf1, (int)name_size1);
/*
* Get name of the dataset the first region reference points to
* using H5Iget_name
*/
name_size2 = H5Iget_name(dsetv_id, (char*)buf2, 10);
- printf (" Dataset's name (returned by H5Iget_name) the reference points to is %s, name length is %d\n", buf2, (int)name_size2);
+ printf(" Dataset's name (returned by H5Iget_name) the reference points to is %s, name length is %d\n", buf2, (int)name_size2);
space_id = H5Rget_region(dsetr_id, H5R_DATASET_REGION,&ref_out[0]);
diff --git a/examples/h5_reference.c b/examples/h5_reference.c
index 3bd1ab3..31aa2cf 100644
--- a/examples/h5_reference.c
+++ b/examples/h5_reference.c
@@ -61,7 +61,7 @@ main(void) {
dim_b[0] = 2;
dim_b[1] = 6;
sid_b = H5Screate_simple(2, dim_b, NULL);
- did_b = H5Dcreate(fid, "B", H5T_NATIVE_FLOAT, sid_b, H5P_DEFAULT);
+ did_b = H5Dcreate2(fid, "B", H5T_NATIVE_FLOAT, sid_b, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Create dataset "R" to store references to the objects "A" and "B".
@@ -69,13 +69,13 @@ main(void) {
dim_r[0] = 2;
sid_r = H5Screate_simple(1, dim_r, NULL);
tid_r = H5Tcopy(H5T_STD_REF_OBJ);
- did_r = H5Dcreate(fid, "R", tid_r, sid_r, H5P_DEFAULT );
+ did_r = H5Dcreate2(fid, "R", tid_r, sid_r, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Allocate write and read buffers.
*/
- wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2);
- rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2);
+ wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * 2);
+ rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t) * 2);
/*
* Create references to the group "A" and dataset "B"
@@ -87,8 +87,7 @@ main(void) {
/*
* Write dataset R using default transfer properties.
*/
- status = H5Dwrite(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, wbuf);
+ status = H5Dwrite(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf);
/*
* Close all objects.
@@ -113,18 +112,17 @@ main(void) {
* Open and read dataset "R".
*/
did_r = H5Dopen2(fid, "R", H5P_DEFAULT);
- status = H5Dread(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, rbuf);
+ status = H5Dread(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf);
/*
* Find the type of referenced objects.
*/
status = H5Rget_obj_type2(did_r, H5R_OBJECT, &rbuf[0], &obj_type);
- if ( obj_type == H5O_TYPE_GROUP )
+ if(obj_type == H5O_TYPE_GROUP)
printf("First dereferenced object is a group. \n");
status = H5Rget_obj_type2(did_r, H5R_OBJECT, &rbuf[1], &obj_type);
- if ( obj_type == H5O_TYPE_DATASET )
+ if(obj_type == H5O_TYPE_DATASET)
printf("Second dereferenced object is a dataset. \n");
/*
@@ -145,9 +143,7 @@ main(void) {
H5Fclose(fid);
free(rbuf);
free(wbuf);
- return 0;
+ return 0;
}
-
-
diff --git a/examples/h5_select.c b/examples/h5_select.c
index d39458f..dc08b8a 100644
--- a/examples/h5_select.c
+++ b/examples/h5_select.c
@@ -87,7 +87,8 @@ main (void)
* Buffers' initialization.
*/
vector[0] = vector[MSPACE1_DIM - 1] = -1;
- for (i = 1; i < MSPACE1_DIM - 1; i++) vector[i] = i;
+ for(i = 1; i < MSPACE1_DIM - 1; i++)
+ vector[i] = i;
/*
* Create a file.
@@ -109,7 +110,7 @@ main (void)
* Create dataset in the file. Notice that creation
* property list plist is used.
*/
- dataset = H5Dcreate(file, "Matrix in file", H5T_NATIVE_INT, fid, plist);
+ dataset = H5Dcreate2(file, "Matrix in file", H5T_NATIVE_INT, fid, H5P_DEFAULT, plist, H5P_DEFAULT);
/*
* Select hyperslab for the dataset in the file, using 3x2 blocks,
@@ -302,8 +303,9 @@ main (void)
* 0 0 0 0 0 0 0 0 0
* 0 0 0 0 0 0 0 0 0
*/
- for (i=0; i < MSPACE_DIM1; i++) {
- for(j=0; j < MSPACE_DIM2; j++) printf("%3d ", matrix_out[i][j]);
+ for(i = 0; i < MSPACE_DIM1; i++) {
+ for(j = 0; j < MSPACE_DIM2; j++)
+ printf("%3d ", matrix_out[i][j]);
printf("\n");
}
@@ -330,3 +332,4 @@ main (void)
return 0;
}
+
diff --git a/examples/h5_shared_mesg.c b/examples/h5_shared_mesg.c
index ab79b15..41a23a2 100644
--- a/examples/h5_shared_mesg.c
+++ b/examples/h5_shared_mesg.c
@@ -290,7 +290,7 @@ create_standard_file(const char *filename, hid_t fcpl_id)
*/
for(x = 0; x < NUM_DATASETS; ++x) {
/* Create a dataset */
- dset_id = H5Dcreate(file_id, DSETNAME[x], type_id, space_id, H5P_DEFAULT);
+ dset_id = H5Dcreate2(file_id, DSETNAME[x], type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dset_id < 0) goto error;
/* Create an attribute on the dataset */
diff --git a/examples/h5_write.c b/examples/h5_write.c
index 3e2f73b..93d40ea 100644
--- a/examples/h5_write.c
+++ b/examples/h5_write.c
@@ -39,10 +39,9 @@ main (void)
/*
* Data and output buffer initialization.
*/
- for (j = 0; j < NX; j++) {
- for (i = 0; i < NY; i++)
+ for(j = 0; j < NX; j++)
+ for(i = 0; i < NY; i++)
data[j][i] = i + j;
- }
/*
* 0 1 2 3 4 5
* 1 2 3 4 5 6
@@ -77,14 +76,13 @@ main (void)
* Create a new dataset within the file using defined dataspace and
* datatype and default dataset creation properties.
*/
- dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace,
- H5P_DEFAULT);
+ dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write the data to the dataset using default transfer properties.
*/
- status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, data);
+ status = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
/*
* Close/release resources.
@@ -96,3 +94,4 @@ main (void)
return 0;
}
+
diff --git a/examples/ph5example.c b/examples/ph5example.c
index 851536a..7a41db2 100644
--- a/examples/ph5example.c
+++ b/examples/ph5example.c
@@ -271,12 +271,12 @@ phdf5writeInd(char *filename)
MESG("H5Pset_fapl_mpio succeed");
/* create the file collectively */
- fid1=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl1);
+ fid1 = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl1);
assert(fid1 != FAIL);
MESG("H5Fcreate succeed");
/* Release file-access template */
- ret=H5Pclose(acc_tpl1);
+ ret = H5Pclose(acc_tpl1);
assert(ret != FAIL);
@@ -285,22 +285,22 @@ phdf5writeInd(char *filename)
* and the slabs local to the MPI process.
* ------------------------- */
/* setup dimensionality object */
- sid1 = H5Screate_simple (SPACE1_RANK, dims1, NULL);
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
assert (sid1 != FAIL);
MESG("H5Screate_simple succeed");
/* create a dataset collectively */
- dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1,
- H5P_DEFAULT);
+ dataset1 = H5Dcreate2(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(dataset1 != FAIL);
- MESG("H5Dcreate succeed");
+ MESG("H5Dcreate2 succeed");
/* create another dataset collectively */
- dataset2 = H5Dcreate(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1,
- H5P_DEFAULT);
+ dataset2 = H5Dcreate2(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(dataset2 != FAIL);
- MESG("H5Dcreate succeed");
+ MESG("H5Dcreate2 succeed");
@@ -538,14 +538,14 @@ phdf5writeAll(char *filename)
/* create a dataset collectively */
- dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT);
+ dataset1 = H5Dcreate2(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(dataset1 != FAIL);
- MESG("H5Dcreate succeed");
+ MESG("H5Dcreate2 succeed");
/* create another dataset collectively */
- dataset2 = H5Dcreate(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1, H5P_DEFAULT);
+ dataset2 = H5Dcreate2(fid1, DATASETNAME2, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(dataset2 != FAIL);
- MESG("H5Dcreate 2 succeed");
+ MESG("H5Dcreate2 2 succeed");
/*
* Set up dimensions of the slab this process accesses.
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index 78d484f..929a056 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -19,7 +19,7 @@
/*----------------------------------------------------------------------------
* Name: h5dcreate_c
- * Purpose: Call H5Dcreate to create a dataset
+ * Purpose: Call H5Dcreate2 to create a dataset
* Inputs: loc_id - file or group identifier
* name - name of the dataset
* namelen - name length
@@ -35,41 +35,29 @@
int_f
nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *dset_id)
{
- int ret_value = -1;
- char *c_name;
- size_t c_namelen;
- hid_t c_loc_id;
- hid_t c_type_id;
- hid_t c_space_id;
+ char *c_name = NULL;
hid_t c_dset_id;
- hid_t c_crt_prp;
-
- /*
- * Define creation property
- */
- c_crt_prp = (hid_t)*crt_prp;
+ int ret_value = -1;
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
- if (c_name == NULL) return ret_value;
+ if(NULL == ( c_name = (char *)HD5f2cstring(name, (size_t)*namelen)))
+ goto DONE;
/*
- * Call H5Dcreate function.
+ * Call H5Dcreate2 function.
*/
- c_loc_id = (hid_t)*loc_id;
- c_type_id = (hid_t)*type_id;
- c_space_id = (hid_t)*space_id;
- c_dset_id = H5Dcreate(c_loc_id, c_name, c_type_id, c_space_id, c_crt_prp);
- if (c_dset_id < 0) goto DONE;
+ if((c_dset_id = H5Dcreate2((hid_t)*loc_id, c_name, (hid_t)*type_id, (hid_t)*space_id, H5P_DEFAULT, (hid_t)*crt_prp, H5P_DEFAULT)) < 0)
+ goto DONE;
*dset_id = (hid_t_f)c_dset_id;
+
ret_value = 0;
DONE:
- HDfree(c_name);
- return ret_value;
+ if(c_name)
+ HDfree(c_name);
+ return ret_value;
}
/*----------------------------------------------------------------------------
diff --git a/fortran/src/README b/fortran/src/README
index 6dcc0e0..508da69 100644
--- a/fortran/src/README
+++ b/fortran/src/README
@@ -156,8 +156,9 @@ About the Fortran APIs
For example, the C function to create a dataset has the following
prototype:
- hid_t H5Dcreate(hid_it loc_id, char *name, hid_t type_id,
- hid_t space_id, hid_t creation_prp);
+ hid_t H5Dcreate2(hid_it loc_id, char *name, hid_t type_id,
+ hid_t space_id, hid_t link_creation_prp, hid_t dset_creation_prp,
+ hid_t dset_access_prop);
The corresponding Fortran subroutine has the following form:
@@ -172,6 +173,7 @@ About the Fortran APIs
in the Reference Manual.) The seventh input parameter creation_prp
is optional, and may be omitted when the default creation property
list is used.
+ (XXX: Update this! - QAK)
* Parameters to the Fortran subroutines have one of the following
predefined datatypes (see the file H5fortran_types.f90 for KIND
diff --git a/hl/examples/ex_lite3.c b/hl/examples/ex_lite3.c
index f15820d..9164c7b 100644
--- a/hl/examples/ex_lite3.c
+++ b/hl/examples/ex_lite3.c
@@ -30,13 +30,13 @@ int main( void )
int i;
/* create a file */
- file_id = H5Fcreate ("ex_lite3.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file_id = H5Fcreate("ex_lite3.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* create a data space */
- space_id = H5Screate_simple(1,dims,NULL);
+ space_id = H5Screate_simple(1, dims, NULL);
/* create a dataset named "dset" */
- dset_id = H5Dcreate(file_id,"dset",H5T_NATIVE_INT,space_id,H5P_DEFAULT);
+ dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* close */
status = H5Dclose(dset_id);
@@ -48,7 +48,7 @@ int main( void )
*/
/* create and write the attribute "attr1" on the dataset "dset" */
- status = H5LTset_attribute_int(file_id,"dset","attr1",data,ATTR_SIZE);
+ status = H5LTset_attribute_int(file_id, "dset", "attr1", data, ATTR_SIZE);
/*-------------------------------------------------------------------------
* example of H5LTget_attribute_int
@@ -56,18 +56,15 @@ int main( void )
*/
/* get the attribute "attr1" from the dataset "dset" */
- status = H5LTget_attribute_int(file_id,"dset","attr1",data);
+ status = H5LTget_attribute_int(file_id, "dset", "attr1", data);
- for (i=0; i< ATTR_SIZE; i++ )
- {
- printf (" %d", data[i]);
- }
- printf ("\n");
+ for(i = 0; i < ATTR_SIZE; i++ )
+ printf(" %d", data[i]);
+ printf("\n");
/* close file */
status = H5Fclose(file_id);
return 0;
-
}
diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c
index 0b0f75a..651c60b 100644
--- a/hl/fortran/src/H5IMcc.c
+++ b/hl/fortran/src/H5IMcc.c
@@ -23,7 +23,7 @@
* private functions
*-------------------------------------------------------------------------
*/
-herr_t H5IM_get_palette( hid_t loc_id,
+herr_t H5IM_get_palette(hid_t loc_id,
const char *image_name,
int pal_number,
hid_t tid,
@@ -50,11 +50,11 @@ herr_t H5IM_get_palette( hid_t loc_id,
*-------------------------------------------------------------------------
*/
-herr_t H5IMmake_image_8bitf( hid_t loc_id,
+herr_t H5IMmake_image_8bitf(hid_t loc_id,
const char *dset_name,
hsize_t width,
hsize_t height,
- int_f *buf )
+ int_f *buf)
{
hid_t did; /* dataset ID */
hid_t sid; /* space ID */
@@ -71,35 +71,34 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
*/
/* create the data space for the dataset. */
- if ((sid=H5Screate_simple(IMAGE8_RANK,dims,NULL))<0)
+ if((sid = H5Screate_simple(IMAGE8_RANK, dims, NULL)) < 0)
return -1;
/* create the dataset as H5T_NATIVE_UCHAR */
- if ((did=H5Dcreate(loc_id,dset_name,H5T_NATIVE_UINT8,sid,H5P_DEFAULT))<0)
+ if((did = H5Dcreate2(loc_id, dset_name, H5T_NATIVE_UINT8, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
/* write with memory type H5T_NATIVE_INT */
/* Use long type if Fortran integer is 8 bytes and C long long is also 8 bytes*/
/* Fail if otherwise */
- if (buf)
- {
- if (sizeof(int_f) == sizeof(int)) {
- if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
- return -1;}
- else if (sizeof(int_f) == sizeof(long)) {
- if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
- return -1;}
- else if (sizeof(int_f) == sizeof(long_long)) {
- if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
- return -1;}
- else
- return -1;
+ if(buf) {
+ if(sizeof(int_f) == sizeof(int)) {
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ return -1;
+ } else if(sizeof(int_f) == sizeof(long)) {
+ if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ return -1;
+ } else if(sizeof(int_f) == sizeof(long_long)) {
+ if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ return -1;
+ } else
+ return -1;
}
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
return -1;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -108,15 +107,15 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
*/
/* attach the CLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 )
+ if(H5LTset_attribute_string(loc_id, dset_name, "CLASS", IMAGE_CLASS) < 0)
return -1;
/* attach the VERSION attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0 )
+ if(H5LTset_attribute_string(loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION) < 0)
return -1;
/* attach the IMAGE_SUBCLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_INDEXED" ) < 0 )
+ if(H5LTset_attribute_string(loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_INDEXED") < 0)
return -1;
return 0;
@@ -150,7 +149,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id,
*-------------------------------------------------------------------------
*/
-herr_t H5IMmake_image_24bitf( hid_t loc_id,
+herr_t H5IMmake_image_24bitf(hid_t loc_id,
const char *dset_name,
hsize_t width,
hsize_t height,
@@ -165,22 +164,21 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
* attach the image dimensions according to the interlace mode
*-------------------------------------------------------------------------
*/
- if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 )
- {
+ if(strcmp(interlace, "INTERLACE_PIXEL") == 0) {
/* Number of color planes is defined as the third dimension */
dims[0] = height;
dims[1] = width;
dims[2] = IMAGE24_RANK;
}
else
- if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 )
- {
+ if(strcmp(interlace, "INTERLACE_PLANE") == 0) {
/* Number of color planes is defined as the first dimension */
dims[0] = IMAGE24_RANK;
dims[1] = height;
dims[2] = width;
}
- else return -1;
+ else
+ return -1;
/*-------------------------------------------------------------------------
* create and write the dataset
@@ -188,33 +186,32 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
*/
/* create the data space for the dataset. */
- if ((sid=H5Screate_simple(IMAGE24_RANK,dims,NULL))<0)
+ if((sid = H5Screate_simple(IMAGE24_RANK, dims, NULL)) < 0)
return -1;
/* create the dataset as H5T_NATIVE_UCHAR */
- if ((did=H5Dcreate(loc_id,dset_name,H5T_NATIVE_UCHAR,sid,H5P_DEFAULT))<0)
+ if((did = H5Dcreate2(loc_id, dset_name, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
/* write with memory type H5T_NATIVE_INT */
- if (buf)
- {
- if (sizeof(int_f) == sizeof(int)) {
- if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
- return -1;}
- else if (sizeof(int_f) == sizeof(long)) {
- if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
- return -1;}
- else if (sizeof(int_f) == sizeof(long_long)) {
- if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
- return -1;}
- else
+ if(buf) {
+ if(sizeof(int_f) == sizeof(int)) {
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ return -1;
+ } else if(sizeof(int_f) == sizeof(long)) {
+ if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ return -1;
+ } else if(sizeof(int_f) == sizeof(long_long)) {
+ if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ return -1;
+ } else
return -1;
}
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
return -1;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -223,19 +220,19 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
*/
/* Attach the CLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 )
+ if(H5LTset_attribute_string(loc_id, dset_name, "CLASS", IMAGE_CLASS) < 0)
return -1;
/* Attach the VERSION attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION ) < 0 )
+ if(H5LTset_attribute_string(loc_id, dset_name, "IMAGE_VERSION", IMAGE_VERSION) < 0)
return -1;
/* Attach the IMAGE_SUBCLASS attribute */
- if ( H5LTset_attribute_string( loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR" ) < 0 )
+ if(H5LTset_attribute_string(loc_id, dset_name, "IMAGE_SUBCLASS", "IMAGE_TRUECOLOR") < 0)
return -1;
/* Attach the INTERLACE_MODE attribute. This attributes is only for true color images */
- if ( H5LTset_attribute_string( loc_id, dset_name, "INTERLACE_MODE", interlace ) < 0 )
+ if(H5LTset_attribute_string(loc_id, dset_name, "INTERLACE_MODE", interlace) < 0)
return -1;
return 0;
@@ -264,9 +261,9 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id,
*-------------------------------------------------------------------------
*/
-herr_t H5IMread_imagef( hid_t loc_id,
+herr_t H5IMread_imagef(hid_t loc_id,
const char *dset_name,
- int_f *buf )
+ int_f *buf)
{
hid_t did;
hid_t tid;
@@ -325,10 +322,10 @@ out:
*-------------------------------------------------------------------------
*/
-herr_t H5IMmake_palettef( hid_t loc_id,
+herr_t H5IMmake_palettef(hid_t loc_id,
const char *pal_name,
const hsize_t *pal_dims,
- int_f *pal_data )
+ int_f *pal_data)
{
@@ -337,10 +334,10 @@ herr_t H5IMmake_palettef( hid_t loc_id,
int has_pal;
/* Check if the dataset already exists */
- has_pal = H5LTfind_dataset( loc_id, pal_name );
+ has_pal = H5LTfind_dataset(loc_id, pal_name);
/* It exists. Return */
- if ( has_pal == 1 )
+ if(has_pal == 1)
return 0;
/*-------------------------------------------------------------------------
@@ -349,33 +346,32 @@ herr_t H5IMmake_palettef( hid_t loc_id,
*/
/* create the data space for the dataset. */
- if ((sid=H5Screate_simple(2,pal_dims,NULL))<0)
+ if((sid = H5Screate_simple(2, pal_dims, NULL)) < 0)
return -1;
/* create the dataset as H5T_NATIVE_UCHAR */
- if ((did=H5Dcreate(loc_id,pal_name,H5T_NATIVE_UCHAR,sid,H5P_DEFAULT))<0)
+ if((did = H5Dcreate2(loc_id, pal_name, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
/* write with memory type H5T_NATIVE_INT */
- if (pal_data)
- {
- if (sizeof(int_f) == sizeof(int)) {
- if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
- return -1;}
- else if (sizeof(int_f) == sizeof(long)) {
- if (H5Dwrite(did,H5T_NATIVE_LONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
- return -1;}
- else if (sizeof(int_f) == sizeof(long_long)) {
- if (H5Dwrite(did,H5T_NATIVE_LLONG,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0)
- return -1;}
- else
- return -1;
+ if(pal_data) {
+ if(sizeof(int_f) == sizeof(int)) {
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0)
+ return -1;
+ } else if(sizeof(int_f) == sizeof(long)) {
+ if(H5Dwrite(did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0)
+ return -1;
+ } else if(sizeof(int_f) == sizeof(long_long)) {
+ if(H5Dwrite(did, H5T_NATIVE_LLONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0)
+ return -1;
+ } else
+ return -1;
}
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
return -1;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
return -1;
/*-------------------------------------------------------------------------
@@ -384,11 +380,11 @@ herr_t H5IMmake_palettef( hid_t loc_id,
*/
/* Attach the attribute "CLASS" to the >>palette<< dataset*/
- if ( H5LTset_attribute_string( loc_id, pal_name, "CLASS", PALETTE_CLASS ) < 0 )
+ if(H5LTset_attribute_string(loc_id, pal_name, "CLASS", PALETTE_CLASS) < 0)
return -1;
/* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/
- if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 )
+ if(H5LTset_attribute_string(loc_id, pal_name, "PAL_VERSION", "1.2") < 0)
return -1;
return 0;
@@ -420,16 +416,16 @@ herr_t H5IMmake_palettef( hid_t loc_id,
*-------------------------------------------------------------------------
*/
-herr_t H5IMget_palettef( hid_t loc_id,
+herr_t H5IMget_palettef(hid_t loc_id,
const char *image_name,
int pal_number,
- int_f *pal_data )
+ int_f *pal_data)
{
if(sizeof(int_f) == sizeof(int))
return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_INT,pal_data);
- else if (sizeof(int_f) == sizeof(long))
+ else if(sizeof(int_f) == sizeof(long))
return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LONG,pal_data);
- else if (sizeof(int_f) == sizeof(long_long))
+ else if(sizeof(int_f) == sizeof(long_long))
return H5IM_get_palette(loc_id,image_name,pal_number,H5T_NATIVE_LLONG,pal_data);
else
return -1;
@@ -462,7 +458,7 @@ herr_t H5IMget_palettef( hid_t loc_id,
*
*-------------------------------------------------------------------------
*/
-herr_t H5IM_get_palette( hid_t loc_id,
+herr_t H5IM_get_palette(hid_t loc_id,
const char *image_name,
int pal_number,
hid_t tid,
@@ -486,7 +482,7 @@ herr_t H5IM_get_palette( hid_t loc_id,
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
has_pal = H5IM_find_palette(image_id);
- if(has_pal == 1 )
+ if(has_pal == 1)
{
if((attr_id = H5Aopen(image_id, ".", "PALETTE", H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -495,62 +491,62 @@ herr_t H5IM_get_palette( hid_t loc_id,
if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
/* Check if it is really a reference */
- if ( attr_class == H5T_REFERENCE )
+ if(attr_class == H5T_REFERENCE)
{
/* Get the reference(s) */
- if ( (attr_space_id = H5Aget_space( attr_id )) < 0 )
+ if((attr_space_id = H5Aget_space(attr_id)) < 0)
goto out;
- n_refs = H5Sget_simple_extent_npoints( attr_space_id );
+ n_refs = H5Sget_simple_extent_npoints(attr_space_id);
dim_ref = n_refs;
- refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref );
+ refbuf = malloc(sizeof(hobj_ref_t) * (int)dim_ref);
- if ( H5Aread( attr_id, attr_type, refbuf ) < 0 )
+ if(H5Aread(attr_id, attr_type, refbuf) < 0)
goto out;
/* Get the palette id */
- if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0 )
+ if((pal_id = H5Rdereference(image_id, H5R_OBJECT, &refbuf[pal_number])) < 0)
goto out;
/* Read the palette dataset using the memory type TID */
- if ( H5Dread( pal_id, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data ) < 0 )
+ if(H5Dread(pal_id, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data) < 0)
goto out;
- if ( H5Sclose( attr_space_id ) < 0 )
+ if(H5Sclose(attr_space_id) < 0)
goto out;
/* close the dereferenced dataset */
- if (H5Dclose(pal_id)<0)
+ if(H5Dclose(pal_id) < 0)
goto out;
- free( refbuf );
+ free(refbuf);
} /* H5T_REFERENCE */
- if ( H5Tclose( attr_type ) < 0 )
+ if(H5Tclose(attr_type) < 0)
goto out;
/* Close the attribute. */
- if ( H5Aclose( attr_id ) < 0 )
+ if(H5Aclose(attr_id) < 0)
goto out;
}
/* Close the image dataset. */
- if ( H5Dclose( image_id ) < 0 )
+ if(H5Dclose(image_id) < 0)
return -1;
return 0;
out:
- H5Dclose( image_id );
+ H5Dclose(image_id);
return -1;
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index a98d567..e226f89 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -45,6 +45,61 @@ static herr_t H5LT_get_attribute_mem(hid_t loc_id,
void *data);
/*-------------------------------------------------------------------------
+ * Function: H5LT_make_dataset
+ *
+ * Purpose: Creates and writes a dataset of a type tid
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Quincey Koziol, koziol@hdfgroup.org
+ *
+ * Date: October 10, 2007
+ *
+ *-------------------------------------------------------------------------
+ */
+
+static herr_t
+H5LT_make_dataset_numerical( hid_t loc_id,
+ const char *dset_name,
+ int rank,
+ const hsize_t *dims,
+ hid_t tid,
+ const void *data )
+{
+ hid_t did = -1, sid = -1;
+
+ /* Create the data space for the dataset. */
+ if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
+ return -1;
+
+ /* Create the dataset. */
+ if((did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
+
+ /* Write the dataset only if there is data to write */
+ if(data)
+ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0)
+ goto out;
+
+ /* End access to the dataset and release resources used by it. */
+ if(H5Dclose(did) < 0)
+ return -1;
+
+ /* Terminate access to the data space. */
+ if(H5Sclose(sid) < 0)
+ return -1;
+
+ return 0;
+
+out:
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Sclose(sid);
+ } H5E_END_TRY;
+ return -1;
+}
+
+/*-------------------------------------------------------------------------
*
* Public functions
*
@@ -77,39 +132,7 @@ herr_t H5LTmake_dataset( hid_t loc_id,
hid_t tid,
const void *data )
{
-
- hid_t did, sid;
-
- /* Create the data space for the dataset. */
- if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
- return -1;
-
- /* Create the dataset. */
- if ( (did = H5Dcreate( loc_id, dset_name, tid, sid, H5P_DEFAULT )) < 0 )
- goto out;
-
- /* Write the dataset only if there is data to write */
-
- if ( data )
- {
- if ( H5Dwrite( did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
- }
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) < 0 )
- return -1;
-
- /* Terminate access to the data space. */
- if ( H5Sclose( sid ) < 0 )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- H5Sclose( sid );
- return -1;
+ return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, tid, data));
}
/*-------------------------------------------------------------------------
@@ -137,39 +160,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id,
const hsize_t *dims,
const char *data )
{
-
- hid_t did, sid;
-
- /* Create the data space for the dataset. */
- if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
- return -1;
-
- /* Create the dataset. */
- if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_CHAR, sid, H5P_DEFAULT )) < 0 )
- goto out;
-
- /* Write the dataset only if there is data to write */
-
- if ( data )
- {
- if ( H5Dwrite( did, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
- }
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) < 0 )
- return -1;
-
- /* Terminate access to the data space. */
- if ( H5Sclose( sid ) < 0 )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- H5Sclose( sid );
- return -1;
+ return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_CHAR, data));
}
@@ -199,39 +190,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id,
const hsize_t *dims,
const short *data )
{
-
- hid_t did, sid;
-
- /* Create the data space for the dataset. */
- if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
- return -1;
-
- /* Create the dataset. */
- if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_SHORT, sid, H5P_DEFAULT )) < 0 )
- goto out;
-
- /* Write the dataset only if there is data to write */
-
- if ( data )
- {
- if ( H5Dwrite( did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
- }
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) < 0 )
- return -1;
-
- /* Terminate access to the data space. */
- if ( H5Sclose( sid ) < 0 )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- H5Sclose( sid );
- return -1;
+ return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_SHORT, data));
}
/*-------------------------------------------------------------------------
@@ -260,39 +219,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id,
const hsize_t *dims,
const int *data )
{
-
- hid_t did, sid;
-
- /* Create the data space for the dataset. */
- if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
- return -1;
-
- /* Create the dataset. */
- if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_INT, sid, H5P_DEFAULT )) < 0 )
- goto out;
-
- /* Write the dataset only if there is data to write */
-
- if ( data )
- {
- if ( H5Dwrite( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
- }
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) < 0 )
- return -1;
-
- /* Terminate access to the data space. */
- if ( H5Sclose( sid ) < 0 )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- H5Sclose( sid );
- return -1;
+ return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_INT, data));
}
@@ -323,39 +250,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id,
const hsize_t *dims,
const long *data )
{
-
- hid_t did, sid;
-
- /* Create the data space for the dataset. */
- if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
- return -1;
-
- /* Create the dataset. */
- if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_LONG, sid, H5P_DEFAULT )) < 0 )
- goto out;
-
- /* Write the dataset only if there is data to write */
-
- if ( data )
- {
- if ( H5Dwrite( did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
- }
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) < 0 )
- return -1;
-
- /* Terminate access to the data space. */
- if ( H5Sclose( sid ) < 0 )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- H5Sclose( sid );
- return -1;
+ return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_LONG, data));
}
/*-------------------------------------------------------------------------
@@ -384,39 +279,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id,
const hsize_t *dims,
const float *data )
{
-
- hid_t did, sid;
-
- /* Create the data space for the dataset. */
- if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
- return -1;
-
- /* Create the dataset. */
- if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT )) < 0 )
- goto out;
-
- /* Write the dataset only if there is data to write */
-
- if ( data )
- {
- if ( H5Dwrite( did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
- }
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) < 0 )
- return -1;
-
- /* Terminate access to the data space. */
- if ( H5Sclose( sid ) < 0 )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- H5Sclose( sid );
- return -1;
+ return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_FLOAT, data));
}
@@ -447,39 +310,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id,
const hsize_t *dims,
const double *data )
{
-
- hid_t did, sid;
-
- /* Create the data space for the dataset. */
- if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 )
- return -1;
-
- /* Create the dataset. */
- if ( (did = H5Dcreate( loc_id, dset_name, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT )) < 0 )
- goto out;
-
- /* Write the dataset only if there is data to write */
-
- if ( data )
- {
- if ( H5Dwrite( did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 )
- goto out;
- }
-
- /* End access to the dataset and release resources used by it. */
- if ( H5Dclose( did ) < 0 )
- return -1;
-
- /* Terminate access to the data space. */
- if ( H5Sclose( sid ) < 0 )
- return -1;
-
- return 0;
-
-out:
- H5Dclose( did );
- H5Sclose( sid );
- return -1;
+ return(H5LT_make_dataset_numerical(loc_id, dset_name, rank, dims, H5T_NATIVE_DOUBLE, data));
}
@@ -507,55 +338,53 @@ herr_t H5LTmake_dataset_string(hid_t loc_id,
const char *dset_name,
const char *buf )
{
+ hid_t did = -1;
+ hid_t sid = -1;
+ hid_t tid = -1;
+ size_t size;
- hid_t did=-1;
- hid_t sid=-1;
- hid_t tid;
- size_t size;
-
- /* create a string data type */
- if ( (tid = H5Tcopy( H5T_C_S1 )) < 0 )
- goto out;
-
- size = strlen(buf) + 1; /* extra null term */
+ /* create a string data type */
+ if((tid = H5Tcopy(H5T_C_S1)) < 0 )
+ goto out;
- if ( H5Tset_size(tid,size) < 0 )
- goto out;
+ size = strlen(buf) + 1; /* extra null term */
- if ( H5Tset_strpad(tid,H5T_STR_NULLTERM ) < 0 )
- goto out;
+ if(H5Tset_size(tid, size) < 0)
+ goto out;
- /* Create the data space for the dataset. */
- if ( (sid = H5Screate( H5S_SCALAR )) < 0 )
- goto out;
+ if(H5Tset_strpad(tid, H5T_STR_NULLTERM) < 0)
+ goto out;
- /* Create the dataset. */
- if ( (did = H5Dcreate(loc_id,dset_name,tid,sid,H5P_DEFAULT)) < 0 )
- goto out;
+ /* Create the data space for the dataset. */
+ if((sid = H5Screate(H5S_SCALAR)) < 0)
+ goto out;
- /* Write the dataset only if there is data to write */
+ /* Create the dataset. */
+ if((did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
- if (buf)
- {
- if ( H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 )
- goto out;
- }
+ /* Write the dataset only if there is data to write */
+ if(buf)
+ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto out;
- /* close*/
- if ( H5Dclose(did) < 0 )
- return -1;
- if ( H5Sclose(sid) < 0 )
- return -1;
- if ( H5Tclose(tid) < 0 )
- goto out;
+ /* close*/
+ if(H5Dclose(did) < 0)
+ return -1;
+ if(H5Sclose(sid) < 0)
+ return -1;
+ if(H5Tclose(tid) < 0)
+ goto out;
- return 0;
+ return 0;
out:
- H5Dclose(did);
- H5Tclose(tid);
- H5Sclose(sid);
- return -1;
+ H5E_BEGIN_TRY {
+ H5Dclose(did);
+ H5Tclose(tid);
+ H5Sclose(sid);
+ } H5E_END_TRY;
+ return -1;
}
@@ -574,7 +403,7 @@ out:
*/
static herr_t
-H5LT_read_dataset(hid_t loc_id, const char *dset_name, hid_t tid, void *data)
+H5LT_read_dataset_numerical(hid_t loc_id, const char *dset_name, hid_t tid, void *data)
{
hid_t did;
@@ -616,7 +445,7 @@ herr_t H5LTread_dataset(hid_t loc_id,
hid_t tid,
void *data)
{
- return(H5LT_read_dataset(loc_id, dset_name, tid, data));
+ return(H5LT_read_dataset_numerical(loc_id, dset_name, tid, data));
}
@@ -638,7 +467,7 @@ herr_t H5LTread_dataset_char( hid_t loc_id,
const char *dset_name,
char *data )
{
- return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_CHAR, data));
+ return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_CHAR, data));
}
/*-------------------------------------------------------------------------
@@ -659,7 +488,7 @@ herr_t H5LTread_dataset_short( hid_t loc_id,
const char *dset_name,
short *data )
{
- return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_SHORT, data));
+ return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_SHORT, data));
}
/*-------------------------------------------------------------------------
@@ -680,7 +509,7 @@ herr_t H5LTread_dataset_int( hid_t loc_id,
const char *dset_name,
int *data )
{
- return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_INT, data));
+ return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_INT, data));
}
/*-------------------------------------------------------------------------
@@ -701,7 +530,7 @@ herr_t H5LTread_dataset_long( hid_t loc_id,
const char *dset_name,
long *data )
{
- return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_LONG, data));
+ return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_LONG, data));
}
/*-------------------------------------------------------------------------
@@ -722,7 +551,7 @@ herr_t H5LTread_dataset_float( hid_t loc_id,
const char *dset_name,
float *data )
{
- return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_FLOAT, data));
+ return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_FLOAT, data));
}
@@ -744,7 +573,7 @@ herr_t H5LTread_dataset_double( hid_t loc_id,
const char *dset_name,
double *data )
{
- return(H5LTread_dataset(loc_id, dset_name, H5T_NATIVE_DOUBLE, data));
+ return(H5LT_read_dataset_numerical(loc_id, dset_name, H5T_NATIVE_DOUBLE, data));
}
diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c
index aedc7b5..f337360 100644
--- a/hl/src/H5PT.c
+++ b/hl/src/H5PT.c
@@ -83,8 +83,8 @@ hid_t H5PTcreate_fl ( hid_t loc_id,
hid_t ret_value;
/* Register the packet table ID type if this is the first table created */
- if( H5PT_ptable_id_type < 0)
- if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) <0)
+ if(H5PT_ptable_id_type < 0)
+ if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) < 0)
goto out;
/* Get memory for the table identifier */
@@ -94,35 +94,33 @@ hid_t H5PTcreate_fl ( hid_t loc_id,
dims[0] = 0;
dims_chunk[0] = chunk_size;
maxdims[0] = H5S_UNLIMITED;
- if ( (space_id = H5Screate_simple( 1, dims, maxdims )) < 0 )
+ if((space_id = H5Screate_simple(1, dims, maxdims)) < 0)
goto out;
/* Modify dataset creation properties to enable chunking */
- plist_id = H5Pcreate (H5P_DATASET_CREATE);
- if ( H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0 )
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(H5Pset_chunk(plist_id, 1, dims_chunk) < 0)
goto out;
if(compression >= 0 && compression <= 9)
- {
- if( H5Pset_deflate(plist_id, (unsigned)compression) < 0)
+ if(H5Pset_deflate(plist_id, (unsigned)compression) < 0)
goto out;
- }
/* Create the dataset. */
- if ( (dset_id=H5Dcreate( loc_id, dset_name, dtype_id, space_id, plist_id))<0 )
+ if((dset_id = H5Dcreate2(loc_id, dset_name, dtype_id, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0)
goto out;
/* Terminate access to the data space. */
- if ( H5Sclose( space_id ) < 0 )
+ if(H5Sclose(space_id) < 0)
goto out;
/* End access to the property list */
- if ( H5Pclose( plist_id ) < 0 )
+ if(H5Pclose(plist_id) < 0)
goto out;
/* Create the table identifier */
table->dset_id = dset_id;
- if((table->type_id = H5Tcopy(dtype_id)) <0)
+ if((table->type_id = H5Tcopy(dtype_id)) < 0)
goto out;
H5PT_create_index(table);
@@ -131,7 +129,7 @@ hid_t H5PTcreate_fl ( hid_t loc_id,
/* Get an ID for this table */
ret_value = H5Iregister(H5PT_ptable_id_type, table);
- if (ret_value != H5I_INVALID_HID)
+ if(ret_value != H5I_INVALID_HID)
H5PT_ptable_count++;
else
H5PT_close(table);
@@ -180,14 +178,14 @@ hid_t H5PTcreate_vl ( hid_t loc_id,
/* Create a variable length type that uses single bytes as its base type */
vltype = H5Tvlen_create(H5T_NATIVE_UCHAR);
- if (vltype < 0)
+ if(vltype < 0)
goto out;
- if((ret_value=H5PTcreate_fl(loc_id, dset_name, vltype, chunk_size, 0)) <0)
+ if((ret_value=H5PTcreate_fl(loc_id, dset_name, vltype, chunk_size, 0)) < 0)
goto out;
/* close the vltype */
- if (H5Tclose(vltype) < 0)
+ if(H5Tclose(vltype) < 0)
goto out;
return ret_value;
@@ -229,7 +227,7 @@ hid_t H5PTopen( hid_t loc_id,
/* Register the packet table ID type if this is the first table created */
if( H5PT_ptable_id_type < 0)
- if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free))<0)
+ if((H5PT_ptable_id_type = H5Iregister_type((size_t)H5PT_HASH_TABLE_SIZE, 0, (H5I_free_t)free)) < 0)
goto out;
table = (htbl_t *)malloc(sizeof(htbl_t));
@@ -237,35 +235,35 @@ hid_t H5PTopen( hid_t loc_id,
/* Open the dataset */
if((table->dset_id = H5Dopen2(loc_id, dset_name, H5P_DEFAULT)) < 0)
goto out;
- if (table->dset_id < 0)
+ if(table->dset_id < 0)
goto out;
/* Get the dataset's disk datatype */
- if ((type_id = H5Dget_type(table->dset_id)) < 0)
+ if((type_id = H5Dget_type(table->dset_id)) < 0)
goto out;
/* Get the table's native datatype */
- if ((table->type_id = H5Tget_native_type(type_id, H5T_DIR_ASCEND)) < 0)
+ if((table->type_id = H5Tget_native_type(type_id, H5T_DIR_ASCEND)) < 0)
goto out;
- if (H5Tclose(type_id) < 0)
+ if(H5Tclose(type_id) < 0)
goto out;
/* Initialize the current record pointer */
- if((H5PT_create_index(table)) <0)
+ if((H5PT_create_index(table)) < 0)
goto out;
/* Get number of records in table */
- if((space_id=H5Dget_space(table->dset_id)) <0)
+ if((space_id=H5Dget_space(table->dset_id)) < 0)
goto out;
- if ( H5Sget_simple_extent_dims( space_id, dims, NULL) < 0 )
+ if( H5Sget_simple_extent_dims( space_id, dims, NULL) < 0)
goto out;
table->size = dims[0];
/* Get an ID for this table */
ret_value = H5Iregister(H5PT_ptable_id_type, table);
- if (ret_value != H5I_INVALID_HID)
+ if(ret_value != H5I_INVALID_HID)
H5PT_ptable_count++;
else
H5PT_close(table);
@@ -311,11 +309,11 @@ herr_t H5PT_close( htbl_t* table)
goto out;
/* Close the dataset */
- if (H5Dclose(table->dset_id) < 0)
+ if(H5Dclose(table->dset_id) < 0)
goto out;
/* Close the memory datatype */
- if (H5Tclose(table->type_id) < 0)
+ if(H5Tclose(table->type_id) < 0)
goto out;
free(table);
@@ -370,7 +368,7 @@ herr_t H5PTclose( hid_t table_id )
/* Remove the packet table type ID if no more packet */
/* tables are open */
- if (H5PT_ptable_count == 0)
+ if(H5PT_ptable_count == 0)
{
H5Idestroy_type(H5PT_ptable_id_type);
H5PT_ptable_id_type = H5I_UNINIT;
@@ -419,11 +417,11 @@ herr_t H5PTappend( hid_t table_id,
goto out;
/* If we are asked to write 0 records, just do nothing */
- if (nrecords == 0)
+ if(nrecords == 0)
return 0;
if((H5TB_common_append_records(table->dset_id, table->type_id,
- nrecords, table->size, data)) <0)
+ nrecords, table->size, data)) < 0)
goto out;
/* Update table size */
@@ -473,7 +471,7 @@ herr_t H5PTget_next( hid_t table_id,
goto out;
/* If nrecords == 0, do nothing */
- if (nrecords == 0)
+ if(nrecords == 0)
return 0;
if((H5TB_common_read_records(table->dset_id, table->type_id,
@@ -516,11 +514,11 @@ herr_t H5PTread_packets( hid_t table_id,
/* find the table struct from its ID */
table = (htbl_t *) H5Iobject_verify(table_id, H5PT_ptable_id_type);
- if (table == NULL)
+ if(table == NULL)
goto out;
/* If nrecords == 0, do nothing */
- if (nrecords == 0)
+ if(nrecords == 0)
return 0;
if( H5TB_common_read_records(table->dset_id, table->type_id,
@@ -799,7 +797,7 @@ herr_t H5PTfree_vlen_readbuff( hid_t table_id,
if((table = (htbl_t *) H5Iobject_verify(table_id, H5PT_ptable_id_type)) == NULL)
goto out;
- if ((space_id = H5Screate_simple(1, &bufflen, NULL)) < 0)
+ if((space_id = H5Screate_simple(1, &bufflen, NULL)) < 0)
goto out;
/* Free the memory. If this succeeds, ret_value should be 0. */
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index 9f4b161..2471466 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -117,50 +117,44 @@ herr_t H5TBmake_table( const char *table_title,
return -1;
/* Modify dataset creation properties, i.e. enable chunking */
- plist_id = H5Pcreate (H5P_DATASET_CREATE);
- if(H5Pset_chunk ( plist_id, 1, dims_chunk ) < 0)
+ plist_id = H5Pcreate(H5P_DATASET_CREATE);
+ if(H5Pset_chunk(plist_id, 1, dims_chunk) < 0)
return -1;
/* Set the fill value using a struct as the data type. */
- if(fill_data )
- {
- if(H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0)
+ if(fill_data)
+ if(H5Pset_fill_value(plist_id, mem_type_id, fill_data) < 0)
return -1;
- }
/*
Dataset creation property list is modified to use
GZIP compression with the compression effort set to 6.
Note that compression can be used only when dataset is chunked.
*/
- if(compress )
- {
- if(H5Pset_deflate( plist_id, 6) < 0)
+ if(compress)
+ if(H5Pset_deflate(plist_id, 6) < 0)
return -1;
- }
/* Create the dataset. */
- if((did = H5Dcreate( loc_id, dset_name, mem_type_id, sid, plist_id )) < 0)
+ if((did = H5Dcreate2(loc_id, dset_name, mem_type_id, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0)
goto out;
/* Only write if there is something to write */
- if(data )
- {
+ if(data)
/* Write data to the dataset. */
if(H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0)
goto out;
- }
/* Terminate access to the data space. */
- if(H5Sclose( sid ) < 0)
+ if(H5Sclose(sid) < 0)
goto out;
/* End access to the dataset */
- if(H5Dclose( did ) < 0)
+ if(H5Dclose(did) < 0)
goto out;
/* End access to the property list */
- if(H5Pclose( plist_id ) < 0)
+ if(H5Pclose(plist_id) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1915,11 +1909,11 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*/
/* Clone the property list */
- if(( plist_id3 = H5Pcopy( plist_id1 )) < 0)
+ if((plist_id3 = H5Pcopy(plist_id1)) < 0)
goto out;
/* Clone the type id */
- if(( type_id3 = H5Tcopy( type_id1 )) < 0)
+ if((type_id3 = H5Tcopy(type_id1)) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1930,18 +1924,18 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
dims[0] = 0;
/* Create a simple data space with unlimited size */
- if((space_id3 = H5Screate_simple( 1, dims, maxdims )) < 0)
+ if((space_id3 = H5Screate_simple(1, dims, maxdims)) < 0)
return -1;
/* Create the dataset */
- if((dataset_id3 = H5Dcreate( loc_id1, dset_name3, type_id3, space_id3, plist_id3 )) < 0)
+ if((dataset_id3 = H5Dcreate2(loc_id1, dset_name3, type_id3, space_id3, H5P_DEFAULT, plist_id3, H5P_DEFAULT)) < 0)
goto out;
/*-------------------------------------------------------------------------
* Attach the conforming table attributes
*-------------------------------------------------------------------------
*/
- if(H5TB_attach_attributes( "Merge table", loc_id1, dset_name3, nfields, type_id3 ) < 0)
+ if(H5TB_attach_attributes("Merge table", loc_id1, dset_name3, nfields, type_id3) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1949,13 +1943,13 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
*-------------------------------------------------------------------------
*/
- type_size = H5Tget_size( type_id3 );
+ type_size = H5Tget_size(type_id3);
/* alloc fill value attribute buffer */
- tmp_fill_buf = (unsigned char *)malloc((size_t) type_size );
+ tmp_fill_buf = (unsigned char *)malloc(type_size);
/* Get the fill value attributes */
- has_fill=H5TBAget_fill( loc_id1, dset_name1, dataset_id1, tmp_fill_buf );
+ has_fill = H5TBAget_fill(loc_id1, dset_name1, dataset_id1, tmp_fill_buf);
/*-------------------------------------------------------------------------
* Attach the fill attributes from previous table
@@ -2312,14 +2306,11 @@ herr_t H5TBinsert_field( hid_t loc_id,
/* Insert the old fields, counting with the new one */
for ( i = 0; i < nfields + 1; i++)
{
-
idx = i;
if(inserted )
idx = i - 1;
- if(i == position )
- {
-
+ if(i == position ) {
/* Get the new member size */
new_member_size = H5Tget_size( field_type );
@@ -2332,7 +2323,6 @@ herr_t H5TBinsert_field( hid_t loc_id,
inserted = 1;
continue;
-
}
/* Get the member name */
@@ -2356,8 +2346,6 @@ herr_t H5TBinsert_field( hid_t loc_id,
/* Close the member type */
if(H5Tclose( member_type_id ) < 0)
goto out;
-
-
} /* i */
/*-------------------------------------------------------------------------
@@ -2366,20 +2354,20 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Retrieve the size of chunk */
- if(H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0)
+ if(H5Pget_chunk(plist_id1, 1, dims_chunk) < 0)
goto out;
/* Create a new simple data space with unlimited size, using the dimension */
- if(( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0)
+ if((space_id2 = H5Screate_simple( 1, dims, maxdims)) < 0)
return -1;
/* Modify dataset creation properties, i.e. enable chunking */
- plist_id2 = H5Pcreate (H5P_DATASET_CREATE);
- if(H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0)
+ plist_id2 = H5Pcreate(H5P_DATASET_CREATE);
+ if(H5Pset_chunk(plist_id2, 1, dims_chunk) < 0)
return -1;
/* Create the dataset. */
- if(( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0)
+ if((dataset_id2 = H5Dcreate2(loc_id, "new", type_id2, space_id2, H5P_DEFAULT, plist_id2, H5P_DEFAULT)) < 0)
goto out;
@@ -2388,20 +2376,20 @@ herr_t H5TBinsert_field( hid_t loc_id,
*-------------------------------------------------------------------------
*/
- tmp_buf = (unsigned char *)calloc((size_t) nrecords, (size_t)total_size );
+ tmp_buf = (unsigned char *)calloc((size_t)nrecords, (size_t)total_size);
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = 0;
count[0] = nrecords;
- if(H5Sselect_hyperslab( space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
+ if(H5Sselect_hyperslab(space_id1, H5S_SELECT_SET, offset, NULL, count, NULL) < 0)
goto out;
/* Create a memory dataspace handle */
mem_size[0] = count[0];
- if((mem_space_id1 = H5Screate_simple( 1, mem_size, NULL )) < 0)
+ if((mem_space_id1 = H5Screate_simple(1, mem_size, NULL)) < 0)
goto out;
- if(H5Dread( dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0)
+ if(H5Dread(dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf) < 0)
goto out;
@@ -2837,12 +2825,11 @@ herr_t H5TBdelete_field( hid_t loc_id,
curr_offset += member_size;
- free( member_name );
+ free(member_name);
/* Close the member type */
- if(H5Tclose( member_type_id ) < 0)
+ if(H5Tclose(member_type_id) < 0)
goto out;
-
} /* i */
/*-------------------------------------------------------------------------
@@ -2851,48 +2838,45 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Retrieve the size of chunk */
- if(H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0)
+ if(H5Pget_chunk(plist_id1, 1, dims_chunk) < 0)
goto out;
/* Create a new simple data space with unlimited size, using the dimension */
- if(( space_id2 = H5Screate_simple( 1, dims, maxdims )) < 0)
+ if((space_id2 = H5Screate_simple(1, dims, maxdims)) < 0)
return -1;
/* Modify dataset creation properties, i.e. enable chunking */
- plist_id2 = H5Pcreate (H5P_DATASET_CREATE);
- if(H5Pset_chunk ( plist_id2, 1, dims_chunk ) < 0)
+ plist_id2 = H5Pcreate(H5P_DATASET_CREATE);
+ if(H5Pset_chunk(plist_id2, 1, dims_chunk) < 0)
return -1;
/* Create the dataset. */
- if(( dataset_id2 = H5Dcreate( loc_id, "new", type_id2, space_id2, plist_id2 )) < 0)
+ if((dataset_id2 = H5Dcreate2(loc_id, "new", type_id2, space_id2, H5P_DEFAULT, plist_id2, H5P_DEFAULT)) < 0)
goto out;
/*-------------------------------------------------------------------------
* We have to read field by field of the old dataset and save it into the new one
*-------------------------------------------------------------------------
*/
- for ( i = 0; i < nfields; i++)
- {
-
+ for ( i = 0; i < nfields; i++) {
/* Get the member name */
- member_name = H5Tget_member_name( type_id1,(unsigned) i );
+ member_name = H5Tget_member_name(type_id1, (unsigned)i);
/* Skip the field to delete */
- if(H5TB_find_field( member_name, field_name ) > 0 )
- {
- free( member_name );
+ if(H5TB_find_field(member_name, field_name) > 0) {
+ free(member_name);
continue;
}
/* Get the member type */
- if(( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0)
+ if((member_type_id = H5Tget_member_type(type_id1, (unsigned)i)) < 0)
goto out;
/* Get the member size */
- member_size = H5Tget_size( member_type_id );
+ member_size = H5Tget_size(member_type_id);
/* Create a read id */
- if(( read_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0)
+ if((read_type_id = H5Tcreate(H5T_COMPOUND, member_size)) < 0)
goto out;
/* Insert it into the new type */
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 604da3a..8fb8604 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -78,14 +78,14 @@ int main(void)
{
int nerrors=0;
- nerrors += test_simple()<0 ?1:0;
- nerrors += test_errors()<0 ?1:0;
- nerrors += test_rank()<0 ?1:0;
- nerrors += test_iterators()<0 ?1:0;
- nerrors += test_types()<0 ?1:0;
- nerrors += test_data()<0 ?1:0;
-
- if (nerrors) goto error;
+ nerrors += test_simple() < 0 ?1:0;
+ nerrors += test_errors() < 0 ?1:0;
+ nerrors += test_rank() < 0 ?1:0;
+ nerrors += test_iterators() < 0 ?1:0;
+ nerrors += test_types() < 0 ?1:0;
+ nerrors += test_data() < 0 ?1:0;
+
+ if(nerrors) goto error;
printf("All dimension scales tests passed.\n");
return 0;
@@ -159,7 +159,7 @@ static int test_simple(void)
*/
/* create a file using default properties */
- if ((fid=H5Fcreate(FILE1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((fid=H5Fcreate(FILE1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -168,27 +168,27 @@ static int test_simple(void)
*/
/* make a dataset */
- if (H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf)<0)
+ if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf) < 0)
goto out;
/* make a DS dataset for the first dimension */
- if (H5LTmake_dataset_int(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,DS_1_NAME,rankds,s1_dim,s1_wbuf) < 0)
goto out;
/* make a DS dataset with an alternate scale for the 2nd dimension */
- if (H5LTmake_dataset_int(fid,DS_11_NAME,rankds,s1_dim,s11_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,DS_11_NAME,rankds,s1_dim,s11_wbuf) < 0)
goto out;
/* make a DS dataset for the second dimension */
- if (H5LTmake_dataset_int(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,DS_2_NAME,rankds,s2_dim,s2_wbuf) < 0)
goto out;
/* make a DS dataset with an alternate scale for the 2nd dimension */
- if (H5LTmake_dataset_int(fid,DS_21_NAME,rankds,s2_dim,s21_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,DS_21_NAME,rankds,s2_dim,s21_wbuf) < 0)
goto out;
/* make a DS dataset with an alternate scale for the 2nd dimension */
- if (H5LTmake_dataset_int(fid,DS_22_NAME,rankds,s2_dim,s22_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,DS_22_NAME,rankds,s2_dim,s22_wbuf) < 0)
goto out;
@@ -200,7 +200,7 @@ static int test_simple(void)
TESTING2("attach scales");
/* get the dataset id for "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -209,15 +209,15 @@ static int test_simple(void)
*/
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_1_NAME dimension scale to "dset_a" at dimension 0 */
- if (H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -226,15 +226,15 @@ static int test_simple(void)
*/
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_11_NAME dimension scale to "dset_a" at dimension 0 */
- if (H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -243,15 +243,15 @@ static int test_simple(void)
*/
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
goto out;
/* attach the "ds2" dimension scale to "dset_a" as the 2nd dimension */
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -260,15 +260,15 @@ static int test_simple(void)
*/
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_21_NAME dimension scale to "dset_a" as the 2nd dimension */
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -277,15 +277,15 @@ static int test_simple(void)
*/
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
goto out;
/* attach the "ds22" dimension scale to "dset_a" as the 2nd dimension */
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
@@ -295,37 +295,37 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSis_attached(did,dsid,DIM0)<=0)
+ if(H5DSis_attached(did,dsid,DIM0)<=0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
- if ((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSis_attached(did,dsid,DIM1)<=0)
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
- if ((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSis_attached(did,dsid,DIM1)<=0)
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
- if ((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSis_attached(did,dsid,DIM1)<=0)
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
/* close dataset ID of "dset_a" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
@@ -345,23 +345,23 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/* verify that "dset_a" has 1 dimension scale at DIM 0 */
- if ((nscales = H5DSget_num_scales(did,0))<0)
+ if((nscales = H5DSget_num_scales(did,0)) < 0)
goto out;
- if (nscales!=2)
+ if(nscales!=2)
goto out;
/* verify that "dset_a" has 3 dimension scales at DIM 1 */
- if ((nscales = H5DSget_num_scales(did,1))<0)
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
goto out;
- if (nscales!=3)
+ if(nscales!=3)
goto out;
/* close dataset ID of "dset_a" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
@@ -371,11 +371,11 @@ static int test_simple(void)
*/
/* make a dataset */
- if (H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf)<0)
+ if(H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf) < 0)
goto out;
/* make a DS dataset for the first dimension */
- if (H5LTmake_dataset_int(fid,"ds_b_1",rankds,s1_dim,s1_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,"ds_b_1",rankds,s1_dim,s1_wbuf) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -383,15 +383,15 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,0)<0)
+ if(H5DSattach_scale(did,dsid,0) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -400,23 +400,23 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_b" */
- if ((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
goto out;
/* verify that "dset_b" has 1 dimension scale at DIM 0 */
- if ((nscales = H5DSget_num_scales(did,0))<0)
+ if((nscales = H5DSget_num_scales(did,0)) < 0)
goto out;
- if (nscales!=1)
+ if(nscales!=1)
goto out;
/* verify that "dset_b" has 0 dimension scales at DIM 1 */
- if ((nscales = H5DSget_num_scales(did,1))<0)
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
goto out;
- if (nscales!=0)
+ if(nscales!=0)
goto out;
/* close dataset ID of "dset_b" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -436,23 +436,23 @@ static int test_simple(void)
*/
/* make a dataset */
- if (H5LTmake_dataset_int(fid,"dset_c",rank,dims,buf)<0)
+ if(H5LTmake_dataset_int(fid,"dset_c",rank,dims,buf) < 0)
goto out;
/* make a DS dataset for the first dimension */
- if (H5LTmake_dataset_int(fid,"ds_c_1",rankds,s1_dim,s1_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,"ds_c_1",rankds,s1_dim,s1_wbuf) < 0)
goto out;
/* make a DS dataset for the second dimension */
- if (H5LTmake_dataset_int(fid,"ds_c_2",rankds,s2_dim,s2_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,"ds_c_2",rankds,s2_dim,s2_wbuf) < 0)
goto out;
/* make a DS dataset with an alternate scale for the 2nd dimension */
- if (H5LTmake_dataset_int(fid,"ds_c_21",rankds,s2_dim,s2_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,"ds_c_21",rankds,s2_dim,s2_wbuf) < 0)
goto out;
/* make a DS dataset with an alternate scale for the 2nd dimension */
- if (H5LTmake_dataset_int(fid,"ds_c_22",rankds,s2_dim,s2_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,"ds_c_22",rankds,s2_dim,s2_wbuf) < 0)
goto out;
@@ -461,38 +461,38 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_c_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_c_1", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,0)<0)
+ if(H5DSattach_scale(did,dsid,0) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,1)<0)
+ if(H5DSattach_scale(did,dsid,1) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,1)<0)
+ if(H5DSattach_scale(did,dsid,1) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,1)<0)
+ if(H5DSattach_scale(did,dsid,1) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -500,19 +500,19 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
goto out;
/* verify that "dset_c" has 1 dimension scale at DIM 0 */
- if ((nscales = H5DSget_num_scales(did,0))<0)
+ if((nscales = H5DSget_num_scales(did,0)) < 0)
goto out;
- if (nscales!=1)
+ if(nscales!=1)
goto out;
/* verify that "dset_c" has 3 dimension scales at DIM 1 */
- if ((nscales = H5DSget_num_scales(did,1))<0)
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
goto out;
- if (nscales!=3)
+ if(nscales!=3)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -521,23 +521,23 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_c" */
- if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_c_21", H5P_DEFAULT)) < 0)
goto out;
/* detach the "ds_c_21" dimension scale to "dset_c" in DIM 1 */
- if (H5DSdetach_scale(did,dsid,1)<0)
+ if(H5DSdetach_scale(did,dsid,1) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* close dataset ID of "dset_c" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -545,14 +545,14 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
goto out;
/* verify that "dset_c" has 2 dimension scales at DIM 1 */
- if ((nscales = H5DSget_num_scales(did,1))<0)
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
goto out;
- if (nscales!=2)
+ if(nscales!=2)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -561,23 +561,23 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_c" */
- if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_c_22", H5P_DEFAULT)) < 0)
goto out;
/* detach the "ds_c_22" dimension scale to "dset_c" in DIM 1 */
- if (H5DSdetach_scale(did,dsid,1)<0)
+ if(H5DSdetach_scale(did,dsid,1) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* close dataset ID of "dset_c" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -585,14 +585,14 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
goto out;
/* verify that "dset_c" has 1 dimension scale at DIM 1 */
- if ((nscales = H5DSget_num_scales(did,1))<0)
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
goto out;
- if (nscales!=1)
+ if(nscales!=1)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -601,23 +601,23 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_c" */
- if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_c_2", H5P_DEFAULT)) < 0)
goto out;
/* detach the "ds_c_2" dimension scale to "dset_c" in DIM 1 */
- if (H5DSdetach_scale(did,dsid,1)<0)
+ if(H5DSdetach_scale(did,dsid,1) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* close dataset ID of "dset_c" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -625,14 +625,14 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_c", H5P_DEFAULT)) < 0)
goto out;
/* verify that "dset_c" has 1 dimension scale at DIM 1 */
- if ((nscales = H5DSget_num_scales(did,1))<0)
+ if((nscales = H5DSget_num_scales(did,1)) < 0)
goto out;
- if (nscales!=0)
+ if(nscales!=0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
@@ -640,34 +640,34 @@ static int test_simple(void)
* create 3 datasets: 1 "data" dataset and 2 dimension scales
*-------------------------------------------------------------------------
*/
- if (H5LTmake_dataset_int(fid,"dset_d",rank,dims,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"dset_d",rank,dims,NULL) < 0)
goto out;
- if (H5LTmake_dataset_int(fid,"ds_d_1",rankds,s1_dim,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_d_1",rankds,s1_dim,NULL) < 0)
goto out;
- if (H5LTmake_dataset_int(fid,"ds_d_2",rankds,s2_dim,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_d_2",rankds,s2_dim,NULL) < 0)
goto out;
/*-------------------------------------------------------------------------
* attach them
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,0)<0)
+ if(H5DSattach_scale(did,dsid,0) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,1)<0)
+ if(H5DSattach_scale(did,dsid,1) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -675,24 +675,24 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSis_attached(did,dsid,DIM0)<=0)
+ if(H5DSis_attached(did,dsid,DIM0)<=0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSis_attached(did,dsid,DIM1)<=0)
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
@@ -702,27 +702,27 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_d" */
- if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
goto out;
/* detach the dimension scale to "dset_d" in DIM 0 */
- if (H5DSdetach_scale(did,dsid,DIM0)<0)
+ if(H5DSdetach_scale(did,dsid,DIM0) < 0)
goto out;
/* verify attach, it must return 0 for no attach */
- if (H5DSis_attached(did,dsid,DIM0)!=0)
+ if(H5DSis_attached(did,dsid,DIM0)!=0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* close dataset ID of "dset_d" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -731,33 +731,33 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_d" */
- if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_d_1", H5P_DEFAULT)) < 0)
goto out;
/* attach "ds_d_1" again in DIM 0 */
- if (H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
/* verify attach, it must return 1 for attach */
- if (H5DSis_attached(did,dsid,DIM0)!=1)
+ if(H5DSis_attached(did,dsid,DIM0)!=1)
goto out;
/* verify that "ds_d_1" has only 1 scale at DIM0 */
- if ((nscales = H5DSget_num_scales(did,DIM0))<0)
+ if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
goto out;
- if (nscales!=1)
+ if(nscales!=1)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* close dataset ID of "dset_d" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -766,37 +766,37 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_d" */
- if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
goto out;
/* detach the "ds_d_2" dimension scale to "dset_d" in DIM 1 */
- if (H5DSdetach_scale(did,dsid,DIM1)<0)
+ if(H5DSdetach_scale(did,dsid,DIM1) < 0)
goto out;
/* detach again, it should fail */
- if (H5DSdetach_scale(did,dsid,DIM1)==SUCCEED)
+ if(H5DSdetach_scale(did,dsid,DIM1)==SUCCEED)
goto out;
/* verify attach, it must return 0 for no attach */
- if (H5DSis_attached(did,dsid,DIM1)!=0)
+ if(H5DSis_attached(did,dsid,DIM1)!=0)
goto out;
/* verify that "ds_d_1" has no scale at DIM1 */
- if ((nscales = H5DSget_num_scales(did,DIM1))<0)
+ if((nscales = H5DSget_num_scales(did,DIM1)) < 0)
goto out;
- if (nscales!=0)
+ if(nscales!=0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* close dataset ID of "dset_d" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -805,47 +805,47 @@ static int test_simple(void)
*/
/* get the dataset id for "dset_d" */
- if ((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_d", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_d_2", H5P_DEFAULT)) < 0)
goto out;
/* attach "ds_d_2" in DIM 1 */
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
/* verify attach, it must return 1 for attach */
- if (H5DSis_attached(did,dsid,DIM1)!=1)
+ if(H5DSis_attached(did,dsid,DIM1)!=1)
goto out;
/* verify that "ds_d_2" has only 1 scale at DIM1 */
- if ((nscales = H5DSget_num_scales(did,DIM0))<0)
+ if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
goto out;
- if (nscales!=1)
+ if(nscales!=1)
goto out;
/* attach "ds_d_2" again in DIM 1 */
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
/* verify attach, it must return 1 for attach */
- if (H5DSis_attached(did,dsid,DIM1)!=1)
+ if(H5DSis_attached(did,dsid,DIM1)!=1)
goto out;
/* verify that "ds_d_2" has only 1 scale at DIM1 */
- if ((nscales = H5DSget_num_scales(did,DIM0))<0)
+ if((nscales = H5DSget_num_scales(did,DIM0)) < 0)
goto out;
- if (nscales!=1)
+ if(nscales != 1)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* close dataset ID of "dset_d" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -858,22 +858,21 @@ static int test_simple(void)
goto out;
/* create the data space for the dataset */
- if ((sid=H5Screate_simple(rank,dims,NULL))<0)
+ if((sid = H5Screate_simple(rank,dims,NULL)) < 0)
goto out;
- for (i=0; i<5; i++)
- {
+ for(i = 0; i < 5; i++) {
sprintf(dname,"dset_%d",i);
- if ((did = H5Dcreate(gid,dname,H5T_NATIVE_INT,sid,H5P_DEFAULT))<0)
+ if((did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
sprintf(sname,"ds_%d",i);
- if((dsid = H5Dcreate(gid,sname,H5T_NATIVE_INT,sid,H5P_DEFAULT))<0)
+ if((dsid = H5Dcreate2(gid, sname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if(H5DSset_scale(dsid,"scale")<0)
+ if(H5DSset_scale(dsid,"scale") < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
}
@@ -882,22 +881,20 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- for (i=0; i<5; i++)
- {
- sprintf(dname,"dset_%d",i);
- if ((did = H5Dopen2(gid,dname, H5P_DEFAULT))<0)
+ for(i = 0; i < 5; i++) {
+ sprintf(dname, "dset_%d", i);
+ if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
- for (j=0; j<5; j++)
- {
- sprintf(sname,"ds_%d",j);
- if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT))<0)
+ for(j = 0; j < 5; j++) {
+ sprintf(sname, "ds_%d", j);
+ if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
- if(H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did, dsid, DIM0) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
}
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
}
@@ -906,22 +903,20 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- for (i=0; i<5; i++)
- {
- sprintf(dname,"dset_%d",i);
- if ((did = H5Dopen2(gid,dname, H5P_DEFAULT))<0)
+ for(i = 0; i < 5; i++) {
+ sprintf(dname, "dset_%d", i);
+ if((did = H5Dopen2(gid, dname, H5P_DEFAULT)) < 0)
goto out;
- for (j=0; j<5; j++)
- {
- sprintf(sname,"ds_%d",j);
- if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT))<0)
+ for(j = 0; j < 5; j++) {
+ sprintf(sname, "ds_%d", j);
+ if((dsid = H5Dopen2(gid, sname, H5P_DEFAULT)) < 0)
goto out;
- if(H5DSdetach_scale(did,dsid,DIM0)<0)
+ if(H5DSdetach_scale(did, dsid, DIM0) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
}
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
}
@@ -931,29 +926,29 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- for (i=0; i<5; i++)
+ for(i=0; i<5; i++)
{
sprintf(dname,"dset_%d",i);
- if ((did = H5Dopen2(gid,dname, H5P_DEFAULT))<0)
+ if((did = H5Dopen2(gid,dname, H5P_DEFAULT)) < 0)
goto out;
- for (j=0; j<5; j++)
+ for(j=0; j<5; j++)
{
sprintf(sname,"ds_%d",j);
- if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(gid,sname, H5P_DEFAULT)) < 0)
goto out;
- if(H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
}
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
}
/* close */
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Gclose(gid)<0)
+ if(H5Gclose(gid) < 0)
goto out;
@@ -968,30 +963,30 @@ static int test_simple(void)
TESTING2("attach only to 1 dimension");
/* make a dataset */
- if (H5LTmake_dataset_int(fid,"dset_e",rank,dims,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"dset_e",rank,dims,NULL) < 0)
goto out;
/* make a scale */
- if (H5LTmake_dataset_int(fid,"ds_e_1",rankds,s1_dim,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_e_1",rankds,s1_dim,NULL) < 0)
goto out;
/* attach the DS to dimension 1 */
- if ((did = H5Dopen2(fid,"dset_e", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_e", H5P_DEFAULT)) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_e_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_e_1", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
- if (H5DSis_attached(did,dsid,DIM1)<=0)
+ if(H5DSis_attached(did,dsid,DIM1)<=0)
goto out;
/* try to detach all dimensions. for dimensions 0 and 2, it is an error */
- for (i=0; i<rank; i++)
+ for(i=0; i<rank; i++)
{
- if ( i==1 )
+ if( i==1 )
{
- if(H5DSdetach_scale(did,dsid,(unsigned)i)<0)
+ if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
goto out;
}
else
@@ -1001,9 +996,9 @@ static int test_simple(void)
}
}
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -1016,7 +1011,7 @@ static int test_simple(void)
TESTING2("set/get label");
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1024,9 +1019,9 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if (H5DSset_label(did,DIM0,DIM0_LABEL)<0)
+ if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
goto out;
- if (H5DSset_label(did,DIM1,DIM1_LABEL)<0)
+ if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1034,14 +1029,14 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if (H5DSget_label(did,DIM0,dim0_label,sizeof(dim0_label))<0)
+ if(H5DSget_label(did,DIM0,dim0_label,sizeof(dim0_label)) < 0)
goto out;
- if (H5DSget_label(did,DIM1,dim1_label,sizeof(dim1_label))<0)
+ if(H5DSget_label(did,DIM1,dim1_label,sizeof(dim1_label)) < 0)
goto out;
- if (strcmp(DIM0_LABEL,dim0_label)!=0)
+ if(strcmp(DIM0_LABEL,dim0_label)!=0)
goto out;
- if (strcmp(DIM1_LABEL,dim1_label)!=0)
+ if(strcmp(DIM1_LABEL,dim1_label)!=0)
goto out;
/*-------------------------------------------------------------------------
@@ -1049,33 +1044,33 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((dim0_label_size=H5DSget_label(did,DIM0,NULL,(size_t)0))<0)
+ if((dim0_label_size=H5DSget_label(did,DIM0,NULL,(size_t)0)) < 0)
goto out;
- if ((dim1_label_size=H5DSget_label(did,DIM1,NULL,(size_t)0))<0)
+ if((dim1_label_size=H5DSget_label(did,DIM1,NULL,(size_t)0)) < 0)
goto out;
/* allocate */
dim0_labeld = (char*)malloc(dim0_label_size * sizeof(char));
dim1_labeld = (char*)malloc(dim1_label_size * sizeof(char));
- if ( dim0_labeld==NULL || dim1_labeld==NULL)
+ if( dim0_labeld==NULL || dim1_labeld==NULL)
goto out;
- if (H5DSget_label(did,DIM0,dim0_labeld,(size_t)dim0_label_size)<0)
+ if(H5DSget_label(did,DIM0,dim0_labeld,(size_t)dim0_label_size) < 0)
goto out;
- if (H5DSget_label(did,DIM1,dim1_labeld,(size_t)dim1_label_size)<0)
+ if(H5DSget_label(did,DIM1,dim1_labeld,(size_t)dim1_label_size) < 0)
goto out;
- if (strncmp(DIM0_LABEL,dim0_labeld,(size_t)(dim0_label_size-1))!=0)
+ if(strncmp(DIM0_LABEL,dim0_labeld,(size_t)(dim0_label_size-1))!=0)
goto out;
- if (strncmp(DIM1_LABEL,dim1_labeld,(size_t)(dim1_label_size-1))!=0)
+ if(strncmp(DIM1_LABEL,dim1_labeld,(size_t)(dim1_label_size-1))!=0)
goto out;
- if (dim0_labeld)
+ if(dim0_labeld)
{
free(dim0_labeld);
dim0_labeld=NULL;
}
- if (dim1_labeld)
+ if(dim1_labeld)
{
free(dim1_labeld);
dim1_labeld=NULL;
@@ -1087,19 +1082,19 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if (H5DSget_label(did,DIM0,dim0_labels,sizeof(dim0_labels))<0)
+ if(H5DSget_label(did,DIM0,dim0_labels,sizeof(dim0_labels)) < 0)
goto out;
- if (H5DSget_label(did,DIM1,dim1_labels,sizeof(dim1_labels))<0)
+ if(H5DSget_label(did,DIM1,dim1_labels,sizeof(dim1_labels)) < 0)
goto out;
- if (strncmp(DIM0_LABEL,dim0_label,sizeof(dim0_labels)-1)!=0)
+ if(strncmp(DIM0_LABEL,dim0_label,sizeof(dim0_labels)-1)!=0)
goto out;
- if (strncmp(DIM1_LABEL,dim1_label,sizeof(dim1_labels)-1)!=0)
+ if(strncmp(DIM1_LABEL,dim1_label,sizeof(dim1_labels)-1)!=0)
goto out;
- if (H5Dclose(did))
+ if(H5Dclose(did))
goto out;
PASSED();
@@ -1110,14 +1105,14 @@ static int test_simple(void)
*/
TESTING2("set scale/get scale name");
- if ((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSset_scale(dsid,SCALE_1_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
goto out;
/* verify that DS_1_NAME is a dimension scale dataset */
- if ((H5DSis_scale(dsid))==0)
+ if((H5DSis_scale(dsid))==0)
goto out;
/*-------------------------------------------------------------------------
@@ -1126,22 +1121,22 @@ static int test_simple(void)
*/
/* get the lenght of the scale name (pass NULL in name) */
- if ((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0))<0)
+ if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) < 0)
goto out;
/* allocate a buffer */
name_out = (char*)malloc(name_len * sizeof(char));
- if (name_out == NULL)
+ if(name_out == NULL)
goto out;
/* get the scale name using this buffer */
- if (H5DSget_scale_name(dsid,name_out,(size_t)name_len)<0)
+ if(H5DSget_scale_name(dsid,name_out,(size_t)name_len) < 0)
goto out;
- if (strcmp(SCALE_1_NAME,name_out)!=0)
+ if(strcmp(SCALE_1_NAME,name_out)!=0)
goto out;
- if (name_out)
+ if(name_out)
{
free(name_out);
name_out=NULL;
@@ -1153,10 +1148,10 @@ static int test_simple(void)
*/
/* get the scale name using this buffer */
- if (H5DSget_scale_name(dsid,sname,sizeof(sname))<0)
+ if(H5DSget_scale_name(dsid,sname,sizeof(sname)) < 0)
goto out;
- if (strcmp(SCALE_1_NAME,sname)!=0)
+ if(strcmp(SCALE_1_NAME,sname)!=0)
goto out;
/*-------------------------------------------------------------------------
@@ -1165,13 +1160,13 @@ static int test_simple(void)
*/
/* get the scale name using this buffer */
- if (H5DSget_scale_name(dsid,snames,sizeof(snames))<0)
+ if(H5DSget_scale_name(dsid,snames,sizeof(snames)) < 0)
goto out;
- if (strncmp(SCALE_1_NAME,snames,sizeof(snames)-1)!=0)
+ if(strncmp(SCALE_1_NAME,snames,sizeof(snames)-1)!=0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
/*-------------------------------------------------------------------------
@@ -1179,32 +1174,32 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
- if ((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_11_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSset_scale(dsid,SCALE_11_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_11_NAME) < 0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
- if ((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSset_scale(dsid,SCALE_2_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
- if ((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_21_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSset_scale(dsid,SCALE_21_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_21_NAME) < 0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
- if ((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_22_NAME, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSset_scale(dsid,SCALE_22_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_22_NAME) < 0)
goto out;
- if (H5Dclose(dsid))
+ if(H5Dclose(dsid))
goto out;
@@ -1217,13 +1212,13 @@ static int test_simple(void)
TESTING2("iterate scales (verify scale)");
/* get the dataset id for "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
dim = 0;
/* iterate trough the 1st dimension of "dset_a" and verify that its DS is valid */
- if (H5DSiterate_scales(did,dim,NULL,verify_scale,NULL)<0)
+ if(H5DSiterate_scales(did,dim,NULL,verify_scale,NULL) < 0)
goto out;
/* iterate trough the 2nd dimension of "dset_a" and verify that its DS is valid
@@ -1231,11 +1226,11 @@ static int test_simple(void)
dim = 1;
scale_idx = 2;
- if (H5DSiterate_scales(did,dim,&scale_idx,verify_scale,NULL)<0)
+ if(H5DSiterate_scales(did,dim,&scale_idx,verify_scale,NULL) < 0)
goto out;
/* close dataset ID of "dset_a" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -1249,13 +1244,13 @@ static int test_simple(void)
/* get the dataset id for "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
dim = 0;
/* iterate trough the 1st dimension of "dset_a" and read the DS */
- if (H5DSiterate_scales(did,dim,NULL,read_scale,s1_wbuf)<0)
+ if(H5DSiterate_scales(did,dim,NULL,read_scale,s1_wbuf) < 0)
goto out;
/* iterate trough the 2nd dimension of "dset_a" and read the DS
@@ -1263,11 +1258,11 @@ static int test_simple(void)
dim = 1;
scale_idx = 2;
- if (H5DSiterate_scales(did,dim,&scale_idx,read_scale,s22_wbuf)<0)
+ if(H5DSiterate_scales(did,dim,&scale_idx,read_scale,s22_wbuf) < 0)
goto out;
/* close dataset ID of "dset_a" */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -1279,19 +1274,19 @@ static int test_simple(void)
TESTING2("iterate scales (verify the scale sizes match)");
/* get the dataset id for "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/* get dataset space */
- if ((sid = H5Dget_space(did))<0)
+ if((sid = H5Dget_space(did)) < 0)
goto out;
/* get rank */
- if ((rank=H5Sget_simple_extent_ndims(sid))<0)
+ if((rank=H5Sget_simple_extent_ndims(sid)) < 0)
goto out;
/* get dimensions of dataset */
- if (H5Sget_simple_extent_dims(sid,dims,NULL)<0)
+ if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
goto out;
{
@@ -1301,24 +1296,24 @@ static int test_simple(void)
/* iterate trough all the dimensions */
for(dim=0; dim<(unsigned)rank; dim++)
{
- if ((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL))<0)
+ if((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL)) < 0)
goto out;
/* "dset_a" was defined with all dimension scales size matching the size of its dimensions */
- if (match_size==0)
+ if(match_size==0)
goto out;
/* both DS_1_NAME and DS_2_NAME are the on the first index */
- if (idx!=0)
+ if(idx!=0)
goto out;
}
}
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
PASSED();
@@ -1333,42 +1328,42 @@ static int test_simple(void)
* create 3 datasets: 1 "data" dataset and dimension scales (some are empty)
*-------------------------------------------------------------------------
*/
- if (H5LTmake_dataset_int(fid,"dset_f",rank,dims,buf)<0)
+ if(H5LTmake_dataset_int(fid,"dset_f",rank,dims,buf) < 0)
goto out;
- if (H5LTmake_dataset_int(fid,"ds_f_1",rankds,s1_dim,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_f_1",rankds,s1_dim,NULL) < 0)
goto out;
- if (H5LTmake_dataset_int(fid,"ds_f_11",rankds,s1_dim,s1_wbuf)<0)
+ if(H5LTmake_dataset_int(fid,"ds_f_11",rankds,s1_dim,s1_wbuf) < 0)
goto out;
- if (H5LTmake_dataset_int(fid,"ds_f_2",rankds,s2_dim,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_f_2",rankds,s2_dim,NULL) < 0)
goto out;
/*-------------------------------------------------------------------------
* attach them
*-------------------------------------------------------------------------
*/
- if ((did = H5Dopen2(fid,"dset_f", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_f", H5P_DEFAULT)) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_f_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_f_1", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_f_11", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_f_11", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if ((dsid = H5Dopen2(fid,"ds_f_2", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_f_2", H5P_DEFAULT)) < 0)
goto out;
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1376,19 +1371,19 @@ static int test_simple(void)
*-------------------------------------------------------------------------
*/
/* get the dataset id for "dset_f" */
- if ((did = H5Dopen2(fid,"dset_f", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_f", H5P_DEFAULT)) < 0)
goto out;
/* get dataset space */
- if ((sid = H5Dget_space(did))<0)
+ if((sid = H5Dget_space(did)) < 0)
goto out;
/* get rank */
- if ((rank=H5Sget_simple_extent_ndims(sid))<0)
+ if((rank=H5Sget_simple_extent_ndims(sid)) < 0)
goto out;
/* get dimensions of dataset */
- if (H5Sget_simple_extent_dims(sid,dims,NULL)<0)
+ if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
goto out;
{
@@ -1401,7 +1396,7 @@ static int test_simple(void)
/* always start at 1st scale */
idx=0;
- if ((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL))<0)
+ if((match_size=H5DSiterate_scales(did,dim,&idx,match_dim_scale,NULL)) < 0)
goto out;
/* "dset_e" was defined with :
@@ -1410,20 +1405,20 @@ static int test_simple(void)
switch(dim)
{
case 0: /* for DIM 0, we get a valid scale at IDX 1 */
- if (match_size!=1 && idx!=1)
+ if(match_size!=1 && idx!=1)
goto out;
break;
case 1: /* for DIM 1, we get no valid scales */
- if (match_size!=0 && idx!=0)
+ if(match_size!=0 && idx!=0)
goto out;
}/*switch*/
}/*for*/
}
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
PASSED();
@@ -1483,7 +1478,7 @@ static herr_t verify_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visit
*/
/* the parameter DS dataset must be a valid DS dataset */
- if ((H5DSis_scale(scale_id))==1)
+ if((H5DSis_scale(scale_id))==1)
{
ret = 1;
}
@@ -1527,32 +1522,32 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor
dim=dim;
/* get space */
- if ((sid = H5Dget_space(scale_id))<0)
+ if((sid = H5Dget_space(scale_id)) < 0)
goto out;
/* get type */
- if ((tid = H5Dget_type(scale_id))<0)
+ if((tid = H5Dget_type(scale_id)) < 0)
goto out;
/* get size of the DS array */
- if ((nelmts = H5Sget_simple_extent_npoints(sid))<0)
+ if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
goto out;
/* get type */
- if ((mtid=H5Tget_native_type(tid,H5T_DIR_DEFAULT))<0)
+ if((mtid=H5Tget_native_type(tid,H5T_DIR_DEFAULT)) < 0)
goto out;
/* get type size */
- if ((size=H5Tget_size(mtid))==0)
+ if((size=H5Tget_size(mtid))==0)
goto out;
- if (nelmts)
+ if(nelmts)
{
buf=(char *) malloc((size_t)(nelmts*size));
- if ( buf==NULL)
+ if( buf==NULL)
goto out;
- if (H5Dread(scale_id,mtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dread(scale_id,mtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto out;
for(i=0; i<nelmts; i++)
{
- if (buf[i] != data[i])
+ if(buf[i] != data[i])
{
printf("read and write buffers differ\n");
goto out;
@@ -1561,13 +1556,13 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor
} /* if */
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Tclose(tid)<0)
+ if(H5Tclose(tid) < 0)
goto out;
- if (H5Tclose(mtid)<0)
+ if(H5Tclose(mtid) < 0)
goto out;
- if (buf)
+ if(buf)
free(buf);
@@ -1579,7 +1574,7 @@ static herr_t read_scale(hid_t dset, unsigned dim, hid_t scale_id, void *visitor
H5Sclose(sid);
H5Tclose(tid);
H5Tclose(mtid);
- if (buf)
+ if(buf)
free(buf);
} H5E_END_TRY;
@@ -1621,15 +1616,15 @@ static herr_t match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor
*/
/* get dataset space */
- if ((sid = H5Dget_space(did))<0)
+ if((sid = H5Dget_space(did)) < 0)
goto out;
/* get dimensions of dataset */
- if (H5Sget_simple_extent_dims(sid,dims,NULL)<0)
+ if(H5Sget_simple_extent_dims(sid,dims,NULL) < 0)
goto out;
/* close the dataspace id */
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1638,25 +1633,25 @@ static herr_t match_dim_scale(hid_t did, unsigned dim, hid_t dsid, void *visitor
*/
/* get the space for the scale */
- if ((sid = H5Dget_space(dsid))<0)
+ if((sid = H5Dget_space(dsid)) < 0)
goto out;
/* get size of the DS array */
- if ((nelmts = H5Sget_simple_extent_npoints(sid))<0)
+ if((nelmts = H5Sget_simple_extent_npoints(sid)) < 0)
goto out;
/* close */
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
/* the size of the DS array must match the dimension of the dataset */
- if (nelmts == (hssize_t)dims[dim])
+ if(nelmts == (hssize_t)dims[dim])
ret = 1;
/* if the scale is empty assume it cannot be used */
storage_size=H5Dget_storage_size(dsid);
- if (storage_size==0)
+ if(storage_size==0)
ret = 0;
return ret;
@@ -1730,22 +1725,22 @@ static int test_errors(void)
*/
/* create a file using default properties */
- if ((fid=H5Fcreate(FILE2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* create a group */
if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* create the data space for the dataset */
- if ((sid=H5Screate_simple(rank,dims,NULL))<0)
+ if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
goto out;
/* create the data space for the scale */
- if ((sidds=H5Screate_simple(rankds,s1_dim,NULL))<0)
+ if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
goto out;
/* create a dataset */
- if ((did=H5Dcreate(fid,"dset_a",H5T_NATIVE_INT,sid,H5P_DEFAULT))<0)
+ if((did = H5Dcreate2(fid, "dset_a", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* create a dataset for the scale */
- if ((dsid=H5Dcreate(fid,"ds_a",H5T_NATIVE_INT,sidds,H5P_DEFAULT))<0)
+ if((dsid = H5Dcreate2(fid, "ds_a", H5T_NATIVE_INT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -1755,7 +1750,7 @@ static int test_errors(void)
TESTING2("attach a dataset to itself");
- if (H5DSattach_scale(did,did,0)==SUCCEED)
+ if(H5DSattach_scale(did, did, 0) == SUCCEED)
goto out;
PASSED();
@@ -1766,7 +1761,7 @@ static int test_errors(void)
*/
TESTING2("attach a group with a dataset");
- if (H5DSattach_scale(gid,dsid,0)==SUCCEED)
+ if(H5DSattach_scale(gid,dsid,0)==SUCCEED)
goto out;
PASSED();
@@ -1777,7 +1772,7 @@ static int test_errors(void)
*/
TESTING2("attach a dataset with a group");
- if (H5DSattach_scale(did,gid,0)==SUCCEED)
+ if(H5DSattach_scale(did,gid,0)==SUCCEED)
goto out;
PASSED();
@@ -1788,7 +1783,7 @@ static int test_errors(void)
*/
TESTING2("set scale for a group");
- if (H5DSset_scale(gid,"scale 1")==SUCCEED)
+ if(H5DSset_scale(gid,"scale 1")==SUCCEED)
goto out;
PASSED();
@@ -1799,15 +1794,15 @@ static int test_errors(void)
*/
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Sclose(sidds)<0)
+ if(H5Sclose(sidds) < 0)
goto out;
- if (H5Gclose(gid)<0)
+ if(H5Gclose(gid) < 0)
goto out;
@@ -1819,35 +1814,35 @@ static int test_errors(void)
TESTING2("attach a scale that has scales");
/* create the data space for the scale */
- if ((sidds=H5Screate_simple(rankds,s1_dim,NULL))<0)
+ if((sidds = H5Screate_simple(rankds, s1_dim, NULL)) < 0)
goto out;
/* create a dataset "ds_b" for the scale */
- if ((dsid=H5Dcreate(fid,"ds_b",H5T_NATIVE_INT,sidds,H5P_DEFAULT))<0)
+ if((dsid = H5Dcreate2(fid, "ds_b", H5T_NATIVE_INT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* open the previous written "ds_a" */
- if ((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
goto out;
/* attach "ds_b" to "ds_a", valid */
- if(H5DSattach_scale(did,dsid,0)<0)
+ if(H5DSattach_scale(did, dsid, 0) < 0)
goto out;
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
- if (H5Sclose(sidds)<0)
+ if(H5Sclose(sidds) < 0)
goto out;
/* open the previous written "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid, "dset_a", H5P_DEFAULT)) < 0)
goto out;
/* open the previous written "ds_a" */
- if ((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid, "ds_a", H5P_DEFAULT)) < 0)
goto out;
/* try to attach "ds_a" to "dset_a", not valid */
@@ -1855,27 +1850,27 @@ static int test_errors(void)
goto out;
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/* open the previous written "ds_a" */
- if ((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
goto out;
/* open the previous written "ds_b" */
- if ((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
goto out;
/* detach "ds_b" to "ds_a" */
- if(H5DSdetach_scale(did,dsid,0)<0)
+ if(H5DSdetach_scale(did,dsid,0) < 0)
goto out;
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -1888,11 +1883,11 @@ static int test_errors(void)
TESTING2("attach to a dataset that is a scale");
/* open the previous written "ds_b", that is a scale */
- if ((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
goto out;
/* open the previous written "ds_a" */
- if ((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
goto out;
/* try to attach "ds_a" to "ds_b", not valid */
@@ -1900,9 +1895,9 @@ static int test_errors(void)
goto out;
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -1915,19 +1910,19 @@ static int test_errors(void)
TESTING2("attach to a dataset that is a reserved class dataset");
/* make an image */
- if (H5IMmake_image_8bit(fid,"image",(hsize_t)100,(hsize_t)50,NULL)<0)
+ if(H5IMmake_image_8bit(fid,"image",(hsize_t)100,(hsize_t)50,NULL) < 0)
goto out;
/* make a palette */
- if (H5IMmake_palette(fid,"pallete",pal_dims,NULL)<0)
+ if(H5IMmake_palette(fid,"pallete",pal_dims,NULL) < 0)
goto out;
/* open the previous written "ds_b" */
- if ((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_b", H5P_DEFAULT)) < 0)
goto out;
/* open the image dataset */
- if ((did = H5Dopen2(fid,"image", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"image", H5P_DEFAULT)) < 0)
goto out;
/* try to attach "ds_a" to the image, not valid */
@@ -1935,9 +1930,9 @@ static int test_errors(void)
goto out;
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -1950,27 +1945,27 @@ static int test_errors(void)
TESTING2("is scale");
/* open a non scale dataset */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/* verify that it is not a dimension scale dataset */
- if ((H5DSis_scale(did))==1)
+ if((H5DSis_scale(did))==1)
goto out;
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
/* open the group. */
- if ((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
goto out;
/* verify that it is not a dimension scale dataset */
- if ((H5DSis_scale(gid))==1)
+ if((H5DSis_scale(gid))==1)
goto out;
/* close */
- if (H5Gclose(gid)<0)
+ if(H5Gclose(gid) < 0)
goto out;
PASSED();
@@ -1984,11 +1979,11 @@ static int test_errors(void)
TESTING2("detach scale from dataset it is not attached to");
/* open the previous written "ds_a" */
- if ((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
goto out;
/* open the previous written "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/* try to detach "ds_a" from "dset_a" */
@@ -1996,9 +1991,9 @@ static int test_errors(void)
goto out;
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2012,11 +2007,11 @@ static int test_errors(void)
TESTING2("detach scale from group");
/* open the previous written "ds_a" */
- if ((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_a", H5P_DEFAULT)) < 0)
goto out;
/* open the group. */
- if ((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
goto out;
/* try to detach "ds_a" from "grp" */
@@ -2024,9 +2019,9 @@ static int test_errors(void)
goto out;
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5Gclose(gid)<0)
+ if(H5Gclose(gid) < 0)
goto out;
PASSED();
@@ -2040,11 +2035,11 @@ static int test_errors(void)
TESTING2("detach scale when scale is group");
/* open the previous written "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/* open the group. */
- if ((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
goto out;
/* try to detach "grp" from "dset_a" */
@@ -2052,16 +2047,16 @@ static int test_errors(void)
goto out;
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
- if (H5Gclose(gid)<0)
+ if(H5Gclose(gid) < 0)
goto out;
PASSED();
/* close */
- if (H5Fclose(fid)<0)
+ if(H5Fclose(fid) < 0)
goto out;
return 0;
@@ -2108,19 +2103,19 @@ static int test_iterators(void)
*/
/* create a file using default properties */
- if ((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
/* create a group */
if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* close */
- if (H5Gclose(gid)<0)
+ if(H5Gclose(gid) < 0)
goto out;
/* make a dataset */
- if (H5LTmake_dataset_int(fid,"dset_a",rank,dims,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,NULL) < 0)
goto out;
/* make a DS dataset */
- if (H5LTmake_dataset_int(fid,"ds_a",rankds,s1_dim,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_a",rankds,s1_dim,NULL) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2131,15 +2126,15 @@ static int test_iterators(void)
TESTING2("iterate when the dataset has no scales ");
/* get the dataset id for "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/* try to iterate trough the 1st dimension of "dset_a", return error */
- if (H5DSiterate_scales(did,0,NULL,verify_scale,NULL)<0)
+ if(H5DSiterate_scales(did,0,NULL,verify_scale,NULL) < 0)
goto out;
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2153,15 +2148,15 @@ static int test_iterators(void)
TESTING2("iterate on dimension that is outside the rank ");
/* get the dataset id for "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/* try to iterate trough the 3rd dimension of "dset_a", return error */
- if (H5DSiterate_scales(did,3,NULL,verify_scale,NULL)==SUCCEED)
+ if(H5DSiterate_scales(did,3,NULL,verify_scale,NULL)==SUCCEED)
goto out;
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2174,32 +2169,32 @@ static int test_iterators(void)
TESTING2("iterate for dimension with many scales ");
/* open the previously written "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
- for (i=0; i<100; i++)
+ for(i=0; i<100; i++)
{
/* make a DS */
sprintf(dname,"ds_%d",i);
- if (H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL)<0)
+ if(H5LTmake_dataset_int(fid,dname,rankds,s1_dim,NULL) < 0)
goto out;
/* open */
- if ((dsid = H5Dopen2(fid,dname, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,dname, H5P_DEFAULT)) < 0)
goto out;
/* attach */
- if(H5DSattach_scale(did,dsid,0)<0)
+ if(H5DSattach_scale(did,dsid,0) < 0)
goto out;
/* close */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
}
/* iterate trough the 1st dimension of "dset_a" */
- if (H5DSiterate_scales(did,0,NULL,op_bogus,NULL)<0)
+ if(H5DSiterate_scales(did,0,NULL,op_bogus,NULL) < 0)
goto out;
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2212,15 +2207,15 @@ static int test_iterators(void)
TESTING2("iterate on group ");
/* open */
- if ((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
+ if((gid = H5Gopen2(fid, "grp", H5P_DEFAULT)) < 0)
goto out;
/* try to iterate, return error */
- if (H5DSiterate_scales(gid,0,NULL,verify_scale,NULL)==SUCCEED)
+ if(H5DSiterate_scales(gid,0,NULL,verify_scale,NULL)==SUCCEED)
goto out;
/* close */
- if (H5Gclose(gid)<0)
+ if(H5Gclose(gid) < 0)
goto out;
PASSED();
@@ -2252,7 +2247,7 @@ static int test_iterators(void)
/* close */
- if (H5Fclose(fid)<0)
+ if(H5Fclose(fid) < 0)
goto out;
return 0;
@@ -2299,23 +2294,23 @@ static int test_rank(void)
*/
/* create a file using default properties */
- if ((fid=H5Fcreate(FILE4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((fid=H5Fcreate(FILE4,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
/* make a dataset a 3D data dataset */
- if (H5LTmake_dataset_int(fid,"dset_a",3,dims3,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"dset_a",3,dims3,NULL) < 0)
goto out;
/* make a 1D scale dataset */
- if (H5LTmake_dataset_int(fid,"ds_a_0",1,dims1,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_a_0",1,dims1,NULL) < 0)
goto out;
/* make a 2D scale dataset */
- if (H5LTmake_dataset_int(fid,"ds_a_1",2,dims2,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_a_1",2,dims2,NULL) < 0)
goto out;
/* make a 3D scale dataset */
- if (H5LTmake_dataset_int(fid,"ds_a_2",3,dims3,NULL)<0)
+ if(H5LTmake_dataset_int(fid,"ds_a_2",3,dims3,NULL) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2325,23 +2320,23 @@ static int test_rank(void)
TESTING2("attach");
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
- for (i=0; i<3; i++)
+ for(i=0; i<3; i++)
{
sprintf(name,"ds_a_%d",i);
- if((dsid = H5Dopen2(fid,name, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
- if(H5DSattach_scale(did,dsid,(unsigned)i)<0)
+ if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
goto out;
- if (H5DSis_attached(did,dsid,(unsigned)i)<=0)
+ if(H5DSis_attached(did,dsid,(unsigned)i)<=0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
}
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2354,22 +2349,22 @@ static int test_rank(void)
TESTING2("detach");
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
- for (i=0; i<3; i++)
+ for(i=0; i<3; i++)
{
sprintf(name,"ds_a_%d",i);
- if((dsid = H5Dopen2(fid,name, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
- if(H5DSdetach_scale(did,dsid,(unsigned)i)<0)
+ if(H5DSdetach_scale(did,dsid,(unsigned)i) < 0)
goto out;
- if (H5DSis_attached(did,dsid,(unsigned)i)!=0)
+ if(H5DSis_attached(did,dsid,(unsigned)i)!=0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
}
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2381,35 +2376,35 @@ static int test_rank(void)
TESTING2("attach, set, get names, labels");
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
- for (i=0; i<3; i++)
+ for(i=0; i<3; i++)
{
sprintf(name,"ds_a_%d",i);
- if((dsid = H5Dopen2(fid,name, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,name, H5P_DEFAULT)) < 0)
goto out;
- if (H5DSset_scale(dsid,name)<0)
+ if(H5DSset_scale(dsid,name) < 0)
goto out;
- if(H5DSattach_scale(did,dsid,(unsigned)i)<0)
+ if(H5DSattach_scale(did,dsid,(unsigned)i) < 0)
goto out;
- if (H5DSis_attached(did,dsid,(unsigned)i)<=0)
+ if(H5DSis_attached(did,dsid,(unsigned)i)<=0)
goto out;
- if (H5DSget_scale_name(dsid,names,sizeof(names))<0)
+ if(H5DSget_scale_name(dsid,names,sizeof(names)) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
- if (H5DSset_label(did,(unsigned)i,name)<0)
+ if(H5DSset_label(did,(unsigned)i,name) < 0)
goto out;
- if (H5DSget_label(did,(unsigned)i,namel,sizeof(namel))<0)
+ if(H5DSget_label(did,(unsigned)i,namel,sizeof(namel)) < 0)
goto out;
- if (strcmp(name,names)!=0)
+ if(strcmp(name,names)!=0)
goto out;
- if (strcmp(name,namel)!=0)
+ if(strcmp(name,namel)!=0)
goto out;
}
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2422,35 +2417,35 @@ static int test_rank(void)
TESTING2("attach a scalar scale");
/* create the data space for the dataset */
- if ((sid=H5Screate_simple(2,dimss,NULL))<0)
+ if((sid = H5Screate_simple(2, dimss, NULL)) < 0)
goto out;
/* create a dataset of rank 2 */
- if ((did=H5Dcreate(fid,"dset_b",H5T_NATIVE_INT,sid,H5P_DEFAULT))<0)
+ if((did = H5Dcreate2(fid, "dset_b", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* create a scalar space */
- if ((sidds = H5Screate(H5S_SCALAR))<0)
+ if((sidds = H5Screate(H5S_SCALAR)) < 0)
goto out;
/* create a dataset of scalar rank for the scale */
- if ((dsid=H5Dcreate(fid,"ds_b_1",H5T_NATIVE_FLOAT,sidds,H5P_DEFAULT))<0)
+ if((dsid = H5Dcreate2(fid, "ds_b_1", H5T_NATIVE_FLOAT, sidds, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* write */
- if(H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,bufi)<0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, bufi) < 0)
goto out;
- if(H5Dwrite(dsid,H5T_NATIVE_FLOAT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buff)<0)
+ if(H5Dwrite(dsid, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buff) < 0)
goto out;
/* attach */
- if(H5DSattach_scale(did,dsid,0)<0)
+ if(H5DSattach_scale(did, dsid, 0) < 0)
goto out;
- if(H5DSattach_scale(did,dsid,1)<0)
+ if(H5DSattach_scale(did, dsid, 1) < 0)
goto out;
/* close */
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
- if (H5Sclose(sidds)<0)
+ if(H5Sclose(sidds) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
PASSED();
@@ -2459,7 +2454,7 @@ static int test_rank(void)
* close
*-------------------------------------------------------------------------
*/
- if (H5Fclose(fid)<0)
+ if(H5Fclose(fid) < 0)
goto out;
return 0;
@@ -2504,7 +2499,7 @@ static int test_types(void)
*-------------------------------------------------------------------------
*/
/* create a file using default properties */
- if ((fid=H5Fcreate(FILE5,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((fid=H5Fcreate(FILE5,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2513,15 +2508,15 @@ static int test_types(void)
*/
/* make a dataset */
- if (H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf)<0)
+ if(H5LTmake_dataset_int(fid,"dset_a",rank,dims,buf) < 0)
goto out;
/* make a DS dataset for the first dimension */
- if (H5LTmake_dataset_float(fid,DS_1_NAME,rankds,s1_dim,s1_float)<0)
+ if(H5LTmake_dataset_float(fid,DS_1_NAME,rankds,s1_dim,s1_float) < 0)
goto out;
/* make a DS dataset for the second dimension */
- if (H5LTmake_dataset(fid,DS_2_NAME,rankds,s2_dim,H5T_NATIVE_USHORT,s2_ushort)<0)
+ if(H5LTmake_dataset(fid,DS_2_NAME,rankds,s2_dim,H5T_NATIVE_USHORT,s2_ushort) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2532,40 +2527,40 @@ static int test_types(void)
TESTING2("floating point and short scales");
/* get the dataset id for "dset_a" */
- if ((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_a", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_1_NAME, H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_1_NAME dimension scale to "dset_a" at dimension 0 */
- if (H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
/* set name */
- if (H5DSset_scale(dsid,SCALE_1_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,DS_2_NAME, H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_2_NAME dimension scale to "dset_a" at dimension 1 */
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
/* set name */
- if (H5DSset_scale(dsid,SCALE_2_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* set a label */
- if (H5DSset_label(did,DIM0,DIM0_LABEL)<0)
+ if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
goto out;
- if (H5DSset_label(did,DIM1,DIM1_LABEL)<0)
+ if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
goto out;
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2576,15 +2571,15 @@ static int test_types(void)
*/
/* make a dataset */
- if (H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf)<0)
+ if(H5LTmake_dataset_int(fid,"dset_b",rank,dims,buf) < 0)
goto out;
/* make a DS dataset for the first dimension */
- if (H5LTmake_dataset_string(fid,"ds_b_1",s1_str)<0)
+ if(H5LTmake_dataset_string(fid,"ds_b_1",s1_str) < 0)
goto out;
/* make a DS dataset for the second dimension */
- if (H5LTmake_dataset_string(fid,"ds_b_2",s2_str)<0)
+ if(H5LTmake_dataset_string(fid,"ds_b_2",s2_str) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2595,39 +2590,39 @@ static int test_types(void)
TESTING2("string scales");
/* get the dataset id for "dset_b" */
- if ((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"dset_b", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_b_1", H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_1_NAME dimension scale to "dset_b" at dimension 0 */
- if (H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
/* set name */
- if (H5DSset_scale(dsid,SCALE_1_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"ds_b_2", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"ds_b_2", H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_2_NAME dimension scale to "dset_b" at dimension 1 */
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
/* set name */
- if (H5DSset_scale(dsid,SCALE_2_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* set a label */
- if (H5DSset_label(did,DIM0,DIM0_LABEL)<0)
+ if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
goto out;
- if (H5DSset_label(did,DIM1,DIM1_LABEL)<0)
+ if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
goto out;
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2636,7 +2631,7 @@ static int test_types(void)
* close
*-------------------------------------------------------------------------
*/
- if (H5Fclose(fid)<0)
+ if(H5Fclose(fid) < 0)
goto out;
return 0;
@@ -2680,7 +2675,7 @@ static int test_data(void)
*-------------------------------------------------------------------------
*/
/* create a file using default properties */
- if ((fid=H5Fcreate(FILE6,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
+ if((fid=H5Fcreate(FILE6,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2689,15 +2684,15 @@ static int test_data(void)
*/
/* read ASCII bathymetry data */
- if (read_data("dsdata.txt",2,dims,&vals)<0)
+ if(read_data("dsdata.txt",2,dims,&vals) < 0)
goto out;
/* read the latitude */
- if (read_data("dslat.txt",1,latdims,&latbuf)<0)
+ if(read_data("dslat.txt",1,latdims,&latbuf) < 0)
goto out;
/* read the longitude */
- if (read_data("dslon.txt",1,londims,&lonbuf)<0)
+ if(read_data("dslon.txt",1,londims,&lonbuf) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2713,29 +2708,29 @@ static int test_data(void)
*/
/* make a DS dataset for the first dimension */
- if (H5LTmake_dataset_float(fid,"lat",1,latdims,latbuf)<0)
+ if(H5LTmake_dataset_float(fid, "lat", 1, latdims, latbuf) < 0)
goto out;
/* make a DS dataset for the second dimension */
- if (H5LTmake_dataset_float(fid,"lon",1,londims,lonbuf)<0)
+ if(H5LTmake_dataset_float(fid, "lon", 1, londims, lonbuf) < 0)
goto out;
/* make a dataset for the data. a fill value is set */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_fill_value(dcpl,H5T_NATIVE_FLOAT,&fill)<0)
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_FLOAT, &fill) < 0)
goto out;
- if ((sid=H5Screate_simple(2,dims,NULL))<0)
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0)
goto out;
- if ((did=H5Dcreate(fid,"data",H5T_NATIVE_FLOAT,sid,dcpl))<0)
+ if((did = H5Dcreate2(fid, "data", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto out;
- if (H5Dwrite(did,H5T_NATIVE_FLOAT,H5S_ALL,H5S_ALL,H5P_DEFAULT,vals)<0)
+ if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, vals) < 0)
goto out;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
- if (H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -2744,40 +2739,40 @@ static int test_data(void)
*/
/* get the dataset id for "data" */
- if ((did = H5Dopen2(fid,"data", H5P_DEFAULT))<0)
+ if((did = H5Dopen2(fid,"data", H5P_DEFAULT)) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"lat", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"lat", H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_1_NAME dimension scale to "data" at dimension 0 */
- if (H5DSattach_scale(did,dsid,DIM0)<0)
+ if(H5DSattach_scale(did,dsid,DIM0) < 0)
goto out;
/* set name */
- if (H5DSset_scale(dsid,SCALE_1_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_1_NAME) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* get the DS dataset id */
- if ((dsid = H5Dopen2(fid,"lon", H5P_DEFAULT))<0)
+ if((dsid = H5Dopen2(fid,"lon", H5P_DEFAULT)) < 0)
goto out;
/* attach the DS_2_NAME dimension scale to "data" at dimension 1 */
- if (H5DSattach_scale(did,dsid,DIM1)<0)
+ if(H5DSattach_scale(did,dsid,DIM1) < 0)
goto out;
/* set name */
- if (H5DSset_scale(dsid,SCALE_2_NAME)<0)
+ if(H5DSset_scale(dsid,SCALE_2_NAME) < 0)
goto out;
/* close DS id */
- if (H5Dclose(dsid)<0)
+ if(H5Dclose(dsid) < 0)
goto out;
/* set a label */
- if (H5DSset_label(did,DIM0,DIM0_LABEL)<0)
+ if(H5DSset_label(did,DIM0,DIM0_LABEL) < 0)
goto out;
- if (H5DSset_label(did,DIM1,DIM1_LABEL)<0)
+ if(H5DSset_label(did,DIM1,DIM1_LABEL) < 0)
goto out;
/* close */
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
PASSED();
@@ -2788,7 +2783,7 @@ static int test_data(void)
* close
*-------------------------------------------------------------------------
*/
- if (H5Fclose(fid)<0)
+ if(H5Fclose(fid) < 0)
goto out;
return 0;
@@ -2832,7 +2827,7 @@ static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf )
strcpy(data_file, "");
/* compose the name of the file to open, using the srcdir, if appropriate */
- if (srcdir)
+ if(srcdir)
{
strcpy(data_file, srcdir);
strcat(data_file, "/");
@@ -2841,13 +2836,13 @@ static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf )
strcat(data_file,fname);
f = fopen(data_file, "r");
- if ( f == NULL )
+ if( f == NULL )
{
printf( "Could not open file %s\n", data_file );
return -1;
}
- for (i=0, nelms=1; i < ndims; i++)
+ for(i=0, nelms=1; i < ndims; i++)
{
fscanf( f, "%s %u", str, &j);
fscanf( f, "%d",&n );
@@ -2857,7 +2852,7 @@ static int read_data( const char* fname, int ndims, hsize_t *dims, float **buf )
*buf = (float*) malloc (nelms * sizeof( float ));
- for (j = 0; j < nelms; j++)
+ for(j = 0; j < nelms; j++)
{
fscanf( f, "%f",&val );
(*buf)[j] = val;
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c
index a9b9f30..d8aeb99 100644
--- a/hl/test/test_lite.c
+++ b/hl/test/test_lite.c
@@ -418,7 +418,7 @@ static int test_attr(void)
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) goto out;
/* Create the dataset */
- if((dataset_id = H5Dcreate(file_id , "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) goto out;
+ if((dataset_id = H5Dcreate2(file_id , "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out;
/* Close */
H5Dclose(dataset_id);
diff --git a/perform/benchpar.c b/perform/benchpar.c
index d0718fc..3ebbe6b 100644
--- a/perform/benchpar.c
+++ b/perform/benchpar.c
@@ -386,8 +386,8 @@ int main(int argc, char *argv[])
assert(dcpl>0);
/* Create dataset */
- dsid=H5Dcreate(fid,DEFAULT_DATASET_NAME,DEFAULT_HDF5_DATATYPE,file_sid,dcpl);
- assert(dsid>0);
+ dsid = H5Dcreate2(fid, DEFAULT_DATASET_NAME, DEFAULT_HDF5_DATATYPE, file_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ assert(dsid > 0);
/* Close dataset creation property list */
ret=H5Pclose(dcpl);
diff --git a/perform/chunk.c b/perform/chunk.c
index a3aabe0..2777da0 100644
--- a/perform/chunk.c
+++ b/perform/chunk.c
@@ -149,29 +149,29 @@ create_dataset (void)
/* The data space */
size[0] = size[1] = DS_SIZE * CH_SIZE;
- space = H5Screate_simple (2, size, size);
+ space = H5Screate_simple(2, size, size);
/* The storage layout and compression */
- dcpl = H5Pcreate (H5P_DATASET_CREATE);
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
size[0] = size[1] = CH_SIZE;
- H5Pset_chunk (dcpl, 2, size);
- H5Zregister (H5Z_COUNTER);
- H5Pset_filter (dcpl, FILTER_COUNTER, 0, 0, NULL);
+ H5Pset_chunk(dcpl, 2, size);
+ H5Zregister(H5Z_COUNTER);
+ H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL);
/* The dataset */
- dset = H5Dcreate (file, "dset", H5T_NATIVE_SCHAR, space, dcpl);
- assert (dset>=0);
+ dset = H5Dcreate2(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ assert(dset>=0);
/* The data */
- buf = calloc (1, SQUARE (DS_SIZE*CH_SIZE));
- H5Dwrite (dset, H5T_NATIVE_SCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
- free (buf);
+ buf = calloc(1, SQUARE (DS_SIZE*CH_SIZE));
+ H5Dwrite(dset, H5T_NATIVE_SCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ free(buf);
/* Close */
- H5Dclose (dset);
- H5Sclose (space);
- H5Pclose (dcpl);
- H5Fclose (file);
+ H5Dclose(dset);
+ H5Sclose(space);
+ H5Pclose(dcpl);
+ H5Fclose(file);
}
diff --git a/perform/iopipe.c b/perform/iopipe.c
index 8728fab..d736f17 100644
--- a/perform/iopipe.c
+++ b/perform/iopipe.c
@@ -224,12 +224,13 @@ main (void)
/* Create the dataset */
file_space = H5Screate_simple (2, size, size);
- assert (file_space>=0);
- dset = H5Dcreate (file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT);
- assert (dset>=0);
- the_data = malloc ((size_t)(size[0]*size[1]));
- /*initial fill for lazy malloc*/
- memset (the_data, 0xAA, (size_t)(size[0]*size[1]));
+ assert(file_space >= 0);
+ dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(dset >= 0);
+ the_data = malloc((size_t)(size[0] * size[1]));
+
+ /* initial fill for lazy malloc */
+ memset(the_data, 0xAA, (size_t)(size[0] * size[1]));
/* Fill raw */
synchronize ();
diff --git a/perform/overhead.c b/perform/overhead.c
index 45dbe9a..5076103 100644
--- a/perform/overhead.c
+++ b/perform/overhead.c
@@ -206,32 +206,28 @@ test(fill_t fill_style, const double splits[],
int j;
h5_stat_t sb;
- if (!had) had = calloc((size_t)cur_size[0], sizeof(int));
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) goto error;
- if (!use_rdcc) {
- if (H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL)<0) goto error;
- if (H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0)<0) goto error;
+ if(!had) had = calloc((size_t)cur_size[0], sizeof(int));
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error;
+ if(!use_rdcc) {
+ if(H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL) < 0) goto error;
+ if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0) < 0) goto error;
}
- if ((file=H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
- goto error;
- }
- if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dcpl, 1, ch_size)<0) goto error;
- if ((xfer=H5Pcreate(H5P_DATASET_XFER))<0) goto error;
- if (H5Pset_btree_ratios(xfer, splits[0], splits[1], splits[2])<0) {
- goto error;
- }
- if ((fspace=H5Screate_simple(1, cur_size, max_size))<0) goto error;
- if ((mspace=H5Screate_simple(1, ch_size, ch_size))<0) goto error;
- if ((dset=H5Dcreate(file, "chunked", H5T_NATIVE_INT,
- fspace, dcpl))<0) goto error;
+ if((file = H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_chunk(dcpl, 1, ch_size) < 0) goto error;
+ if((xfer = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
+ if(H5Pset_btree_ratios(xfer, splits[0], splits[1], splits[2]) < 0) goto error;
+ if((fspace = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if((mspace = H5Screate_simple(1, ch_size, ch_size)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "chunked", H5T_NATIVE_INT,
+ fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
#if !defined( __MWERKS__)
/*
workaround for a bug in the Metrowerks version 6.0 open function
*/
- if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666))<0) goto error;
+ if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error;
#endif
for (i=1; i<=cur_size[0]; i++) {
@@ -262,8 +258,8 @@ test(fill_t fill_style, const double splits[],
/* Write the chunk */
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_start, NULL,
- hs_count, NULL)<0) goto error;
- if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i)<0) {
+ hs_count, NULL) < 0) goto error;
+ if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, xfer, &i) < 0) {
goto error;
}
@@ -272,8 +268,8 @@ test(fill_t fill_style, const double splits[],
/* Determine overhead */
if (verbose) {
- if (H5Fflush(file, H5F_SCOPE_LOCAL)<0) goto error;
- if (HDfstat(fd, &sb)<0) goto error;
+ if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
+ if (HDfstat(fd, &sb) < 0) goto error;
/*
* The extra cast in the following statement is a bug workaround
* for the Win32 version 5.0 compiler.
@@ -318,7 +314,7 @@ test(fill_t fill_style, const double splits[],
#if !defined( __MWERKS__)
- if (HDfstat(fd, &sb)<0) goto error;
+ if (HDfstat(fd, &sb) < 0) goto error;
printf("%-7s %8.3f\n", sname,
(double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/
(hssize_t)cur_size[0]);
@@ -374,14 +370,12 @@ main(int argc, char *argv[])
/* Default split ratios */
H5Eset_auto2(H5E_DEFAULT, display_error_cb, NULL);
- if ((xfer=H5Pcreate(H5P_DATASET_XFER))<0) goto error;
- if (H5Pget_btree_ratios(xfer, splits+0, splits+1, splits+2)<0) {
- goto error;
- }
- if (H5Pclose(xfer)<0) goto error;
+ if((xfer = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
+ if(H5Pget_btree_ratios(xfer, splits+0, splits+1, splits+2) < 0) goto error;
+ if(H5Pclose(xfer) < 0) goto error;
/* Parse command-line options */
- for (i=1, j=0; i<argc; i++) {
+ for(i = 1, j = 0; i < argc; i++) {
if (!strcmp(argv[i], "forward")) {
fill_style = FILL_FORWARD;
} else if (!strcmp(argv[i], "reverse")) {
diff --git a/perform/perf.c b/perform/perf.c
index cd7473d..33f7433 100644
--- a/perform/perf.c
+++ b/perform/perf.c
@@ -191,22 +191,22 @@ int main(int argc, char **argv)
}
/* create the parallel file */
- fid=H5Fcreate(opt_file,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
+ fid = H5Fcreate(opt_file, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL);
/* define a contiquous dataset of opt_iter*nprocs*opt_block chars */
- dims[0] = opt_iter*nprocs*opt_block;
- sid = H5Screate_simple (RANK, dims, NULL);
+ dims[0] = opt_iter * nprocs * opt_block;
+ sid = H5Screate_simple(RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL);
- dataset = H5Dcreate(fid, "Dataset1", H5T_NATIVE_CHAR, sid,
- H5P_DEFAULT);
- VRFY((dataset >= 0), "H5Dcreate succeeded", H5FATAL);
+ dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL);
/* create the memory dataspace and the file dataspace */
dims[0] = opt_block;
- mem_dataspace = H5Screate_simple (RANK, dims, NULL);
+ mem_dataspace = H5Screate_simple(RANK, dims, NULL);
VRFY((mem_dataspace >= 0), "", H5FATAL);
- file_dataspace = H5Dget_space (dataset);
+ file_dataspace = H5Dget_space(dataset);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded", H5FATAL);
/* now each process writes a block of opt_block chars in round robbin
diff --git a/perform/perf_meta.c b/perform/perf_meta.c
index dd73140..572dfff 100644
--- a/perform/perf_meta.c
+++ b/perform/perf_meta.c
@@ -324,14 +324,15 @@ create_dsets(hid_t file)
/*
* Create a dataset using the default dataset creation properties.
*/
- for(i=0; i<NUM_DSETS; i++) {
+ for(i = 0; i < NUM_DSETS; i++) {
sprintf(dset_name, "dataset %d", i);
- if((dataset = H5Dcreate(file, dset_name, H5T_NATIVE_DOUBLE,
- space, H5P_DEFAULT)) < 0)
- goto error;
+ if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
- if (H5Dclose(dataset) < 0) goto error;
- }
+ if(H5Dclose(dataset) < 0)
+ goto error;
+ } /* end for */
return 0;
@@ -472,7 +473,7 @@ create_attrs_2(void)
char attr_name[128];
int i, j;
p_time attr_t = {0, 0, 0, 1000000, 0, ""};
- p_time create_t = {0, 0, 0, 1000000, 0, "H5Dcreate"};
+ p_time create_t = {0, 0, 0, 1000000, 0, "H5Dcreate2"};
p_time close_t = {0, 0, 0, 1000000, 0, ""};
#ifdef H5_HAVE_PARALLEL
@@ -493,8 +494,8 @@ create_attrs_2(void)
for(i = 0; i < NUM_DSETS; i++) {
sprintf(dset_name, "dataset %d", i);
create_t.start = retrieve_time();
- if((dataset = H5Dcreate(file, dset_name, H5T_NATIVE_DOUBLE,
- space, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE,
+ space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
perf(&create_t, create_t.start, retrieve_time());
diff --git a/perform/pio_engine.c b/perform/pio_engine.c
index 23c3edd..f42a849 100644
--- a/perform/pio_engine.c
+++ b/perform/pio_engine.c
@@ -848,17 +848,17 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
}/* end else */
sprintf(dname, "Dataset_%ld", ndset);
- h5ds_id = H5Dcreate(fd->h5fd, dname, ELMT_H5_TYPE,
- h5dset_space_id, h5dcpl);
+ h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE,
+ h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT);
- if (h5ds_id < 0) {
+ if(h5ds_id < 0) {
fprintf(stderr, "HDF5 Dataset Create failed\n");
GOTOERROR(FAIL);
}
hrc = H5Pclose(h5dcpl);
/* verifying the close of the dcpl */
- if (hrc < 0) {
+ if(hrc < 0) {
fprintf(stderr, "HDF5 Property List Close failed\n");
GOTOERROR(FAIL);
}
diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c
index 465ac41..d23df69 100644
--- a/src/H5Ddeprec.c
+++ b/src/H5Ddeprec.c
@@ -106,9 +106,10 @@ H5D_init_deprec_interface(void)
FUNC_LEAVE_NOAPI(H5D_init())
} /* H5D_init_deprec_interface() */
+#ifndef H5_NO_DEPRECATED_SYMBOLS
/*-------------------------------------------------------------------------
- * Function: H5Dcreate
+ * Function: H5Dcreate1
*
* Purpose: Creates a new dataset named NAME at LOC_ID, opens the
* dataset for access, and associates with that dataset constant
@@ -137,7 +138,7 @@ H5D_init_deprec_interface(void)
*-------------------------------------------------------------------------
*/
hid_t
-H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
+H5Dcreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t dcpl_id)
{
H5G_loc_t loc; /* Object location to insert dataset into */
@@ -145,7 +146,7 @@ H5Dcreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
const H5S_t *space; /* Dataspace for dataset */
hid_t ret_value; /* Return value */
- FUNC_ENTER_API(H5Dcreate, FAIL)
+ FUNC_ENTER_API(H5Dcreate1, FAIL)
H5TRACE5("i", "i*siii", loc_id, name, type_id, space_id, dcpl_id);
/* Check arguments */
@@ -178,9 +179,8 @@ done:
HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset")
FUNC_LEAVE_API(ret_value)
-} /* end H5Dcreate() */
+} /* end H5Dcreate1() */
-#ifndef H5_NO_DEPRECATED_SYMBOLS
/*-------------------------------------------------------------------------
* Function: H5Dopen1
diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h
index be858ac..d7f6574 100644
--- a/src/H5Dpublic.h
+++ b/src/H5Dpublic.h
@@ -116,14 +116,6 @@ H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
H5_DLL herr_t H5Dset_extent(hid_t dset_id, const hsize_t *size);
H5_DLL herr_t H5Ddebug(hid_t dset_id);
-/* Functions and variables defined for compatibility with previous versions
- * of the HDF5 API.
- *
- * Use of these functions and variables is deprecated.
- */
-H5_DLL hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id,
- hid_t space_id, hid_t plist_id);
-
/* Symbols defined for compatibility with previous versions of the HDF5 API.
*
* Use of these symbols is deprecated.
@@ -137,6 +129,8 @@ H5_DLL hid_t H5Dcreate(hid_t file_id, const char *name, hid_t type_id,
/* Function prototypes */
+H5_DLL hid_t H5Dcreate1(hid_t file_id, const char *name, hid_t type_id,
+ hid_t space_id, hid_t dcpl_id);
H5_DLL hid_t H5Dopen1(hid_t file_id, const char *name);
H5_DLL herr_t H5Dextend(hid_t dset_id, const hsize_t *size);
diff --git a/src/H5E.c b/src/H5E.c
index b97f72f..6e553c6 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -321,8 +321,13 @@ H5E_get_stack(void)
/* Set the thread-specific info */
estack->nused = 0;
+#ifdef H5_USE_16_API
+ estack->auto_op.vers = 1;
+ estack->auto_op.u.func1 = (H5E_auto1_t)H5Eprint1;
+#else /* H5_USE_16_API */
estack->auto_op.vers = 2;
estack->auto_op.u.func2 = (H5E_auto2_t)H5Eprint2;
+#endif /* H5_USE_16_API */
estack->auto_data = NULL;
/* (It's not necessary to release this in this API, it is
diff --git a/src/H5vers.txt b/src/H5vers.txt
index 39f27e4..5745521 100644
--- a/src/H5vers.txt
+++ b/src/H5vers.txt
@@ -49,6 +49,7 @@ FUNCTION: H5Acreate; ; v10, v18
FUNCTION: H5Adelete; ; v10, v18
FUNCTION: H5Aiterate; H5A_operator; v10, v18
FUNCTION: H5Arename; ; v16, v18
+FUNCTION: H5Dcreate; ; v10, v18
FUNCTION: H5Dopen; ; v10, v18
FUNCTION: H5Eclear; ; v10, v18
FUNCTION: H5Eget_auto; ; v10, v18
diff --git a/src/H5version.h b/src/H5version.h
index 5573e5b..311bb3b 100644
--- a/src/H5version.h
+++ b/src/H5version.h
@@ -54,6 +54,10 @@
#define H5Arename_vers 1
#endif /* !defined(H5Arename_vers) */
+#if !defined(H5Dcreate_vers)
+#define H5Dcreate_vers 1
+#endif /* !defined(H5Dcreate_vers) */
+
#if !defined(H5Dopen_vers)
#define H5Dopen_vers 1
#endif /* !defined(H5Dopen_vers) */
@@ -169,6 +173,17 @@
#error "H5Arename_vers set to invalid value"
#endif /* H5Arename_vers */
+#if !defined(H5Dcreate_vers) || H5Dcreate_vers == 2
+#ifndef H5Dcreate_vers
+#define H5Dcreate_vers 2
+#endif /* H5Dcreate_vers */
+#define H5Dcreate H5Dcreate2
+#elif H5Dcreate_vers == 1
+#define H5Dcreate H5Dcreate1
+#else /* H5Dcreate_vers */
+#error "H5Dcreate_vers set to invalid value"
+#endif /* H5Dcreate_vers */
+
#if !defined(H5Dopen_vers) || H5Dopen_vers == 2
#ifndef H5Dopen_vers
#define H5Dopen_vers 2
diff --git a/test/Makefile.am b/test/Makefile.am
index 8ced149..1406df3 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -59,9 +59,9 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat testmeta
# --enable-build-all at configure time.
# The gen_old_* files can only be compiled with older versions of the library
# so do not appear in this list.
-BUILD_ALL_PROGS=gen_bogus gen_deflate gen_filters gen_new_array gen_new_fill \
- gen_new_group gen_new_mtime gen_new_super gen_noencoder \
- gen_nullspace space_overflow gen_cross gen_udlinks
+BUILD_ALL_PROGS=gen_bogus gen_cross gen_deflate gen_filters gen_new_array \
+ gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \
+ gen_nullspace gen_udlinks space_overflow
if BUILD_ALL_CONDITIONAL
noinst_PROGRAMS=$(BUILD_ALL_PROGS)
diff --git a/test/big.c b/test/big.c
index 3c9cbd5..fa61a9b 100644
--- a/test/big.c
+++ b/test/big.c
@@ -295,16 +295,16 @@ writer (char* filename, hid_t fapl, int wrt_n)
* We should create a dataset allocating space late and never writing fill values.
* EIP 4/8/03
- if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0 ||
- (d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0) {
+ if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0 ||
+ (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
goto error;
}
*/
dcpl = H5Pcreate(H5P_DATASET_CREATE);
H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
- if ((d1=H5Dcreate (file, "d1", H5T_NATIVE_INT, space1, dcpl)) < 0 ||
- (d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, dcpl)) < 0) {
+ if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, space1, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0 ||
+ (d2 = H5Dcreate2(file, "d2", H5T_NATIVE_INT, space2, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
goto error;
}
diff --git a/test/cache_api.c b/test/cache_api.c
index 1b9a37e..a1da62f 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -1578,13 +1578,13 @@ mdc_api_call_smoke_check(void)
if ( pass ) {
sprintf(dset_name, "/dset%03d", i);
- dataset_ids[i] = H5Dcreate(file_id, dset_name, H5T_STD_I32BE,
- dataspace_id, properties);
+ dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE,
+ dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT);
if ( dataset_ids[i] < 0 ) {
pass = FALSE;
- failure_mssg = "H5Dcreate() failed.";
+ failure_mssg = "H5Dcreate2() failed.";
}
}
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index 223537d..85c2318 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -229,26 +229,25 @@ test_compound (char *filename, hid_t fapl)
}
/* Create the memory data type */
- if ((s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t))) < 0)
+ if((s1_tid = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0)
goto error;
array_dt = H5Tarray_create(H5T_NATIVE_INT, 1, memb_size, NULL);
- if (H5Tinsert (s1_tid, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0 ||
- H5Tinsert (s1_tid, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0 ||
- H5Tinsert (s1_tid, "c", HOFFSET(s1_t,c), array_dt) < 0 ||
- H5Tinsert (s1_tid, "d", HOFFSET(s1_t,d), H5T_NATIVE_INT) < 0 ||
- H5Tinsert (s1_tid, "e", HOFFSET(s1_t,e), H5T_NATIVE_INT) < 0)
+ if(H5Tinsert(s1_tid, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0 ||
+ H5Tinsert(s1_tid, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0 ||
+ H5Tinsert(s1_tid, "c", HOFFSET(s1_t, c), array_dt) < 0 ||
+ H5Tinsert(s1_tid, "d", HOFFSET(s1_t, d), H5T_NATIVE_INT) < 0 ||
+ H5Tinsert(s1_tid, "e", HOFFSET(s1_t, e), H5T_NATIVE_INT) < 0)
goto error;
H5Tclose(array_dt);
/* Create the dataset */
- if ((dataset = H5Dcreate (file, "s1", s1_tid, space, H5P_DEFAULT)) < 0) {
+ if((dataset = H5Dcreate2(file, "s1", s1_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- }
/* Write the data */
- if (H5Dwrite (dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0) {
+ if(H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1) < 0)
goto error;
- }
+
PASSED();
/*
@@ -1387,7 +1386,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
TESTING("writing data to contiguous and chunked datasets");
/* Create contiguous data set */
- if((dataset = H5Dcreate(file, DSET_NAME[0], src_tid, space, dcpl)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_NAME[0], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* Write the data to the dataset */
@@ -1402,7 +1401,7 @@ test_hdf5_src_subset(char *filename, hid_t fapl)
goto error;
/* Create chunked data set */
- if((dataset = H5Dcreate(file, DSET_NAME[1], src_tid, space, dcpl)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_NAME[1], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* Write the data to the dataset */
@@ -1591,7 +1590,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
TESTING("writing data to contiguous and chunked datasets");
/* Create contiguous data set */
- if((dataset = H5Dcreate(file, DSET_NAME[2], src_tid, space, dcpl)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_NAME[2], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* Write the data to the dataset */
@@ -1606,7 +1605,7 @@ test_hdf5_dst_subset(char *filename, hid_t fapl)
goto error;
/* Create chunked data set */
- if((dataset = H5Dcreate(file, DSET_NAME[3], src_tid, space, dcpl)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_NAME[3], src_tid, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* Write the data to the dataset */
diff --git a/test/dangle.c b/test/dangle.c
index 834d659..039c405 100644
--- a/test/dangle.c
+++ b/test/dangle.c
@@ -67,21 +67,21 @@ test_dangle_dataset(H5F_close_degree_t degree)
TEST_ERROR;
/* Create file access property list */
- if((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0)
+ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
TEST_ERROR;
/* Set file close degree */
- if(H5Pset_fclose_degree(fapl,degree) < 0)
+ if(H5Pset_fclose_degree(fapl, degree) < 0)
TEST_ERROR;
h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename);
- if((fid = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
- if((sid = H5Screate (H5S_SCALAR)) < 0)
+ if((sid = H5Screate(H5S_SCALAR)) < 0)
TEST_ERROR;
- if((dsid = H5Dcreate (fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0)
+ if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if(H5Dclose(dsid) < 0)
@@ -89,7 +89,7 @@ test_dangle_dataset(H5F_close_degree_t degree)
/* Try creating duplicate dataset */
H5E_BEGIN_TRY {
- if((dsid = H5Dcreate(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) >= 0)
+ if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0)
TEST_ERROR;
} H5E_END_TRY;
@@ -370,7 +370,7 @@ test_dangle_datatype2(H5F_close_degree_t degree)
/* Create a dataset that uses the named datatype & leave it open */
if((sid = H5Screate(H5S_SCALAR)) < 0)
TEST_ERROR;
- if((did = H5Dcreate(fid, DSETNAME, tid, sid, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(fid, DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
if(H5Sclose(sid) < 0)
TEST_ERROR;
@@ -452,7 +452,7 @@ test_dangle_attribute(H5F_close_degree_t degree)
if((sid = H5Screate(H5S_SCALAR)) < 0)
TEST_ERROR;
- if((dsid = H5Dcreate(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0)
+ if((dsid = H5Dcreate2(fid, DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Create an attribute on the dataset */
diff --git a/test/dsets.c b/test/dsets.c
index 3e8a25d..8125d75 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -206,9 +206,9 @@ test_create(hid_t file)
* Create a dataset using the default dataset creation properties. We're
* not sure what they are, so we won't check.
*/
- dataset = H5Dcreate(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT);
- if (dataset<0) goto error;
+ dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dataset < 0) goto error;
/* Close the dataset */
if(H5Dclose(dataset) < 0) goto error;
@@ -223,8 +223,8 @@ test_create(hid_t file)
* reporting.
*/
H5E_BEGIN_TRY {
- dataset = H5Dcreate(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
- H5P_DEFAULT);
+ dataset = H5Dcreate2(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
H5_FAILED();
@@ -267,10 +267,10 @@ test_create(hid_t file)
status = H5Pset_chunk(create_parms, 2, csize);
assert(status >= 0);
H5E_BEGIN_TRY {
- dataset = H5Dcreate(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
- create_parms);
+ dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, create_parms, H5P_DEFAULT);
} H5E_END_TRY;
- if (dataset >= 0) {
+ if(dataset >= 0) {
H5_FAILED();
puts(" Opened a dataset with incorrect chunking parameters.");
goto error;
@@ -281,10 +281,10 @@ test_create(hid_t file)
status = H5Pset_chunk(create_parms, 2, csize);
assert(status >= 0);
- dataset = H5Dcreate(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
- create_parms);
- if (dataset < 0) goto error;
- H5Pclose (create_parms);
+ dataset = H5Dcreate2(file, DSET_CHUNKED_NAME, H5T_NATIVE_DOUBLE, space,
+ H5P_DEFAULT, create_parms, H5P_DEFAULT);
+ if(dataset < 0) goto error;
+ H5Pclose(create_parms);
/* Test dataset address. Should be undefined. */
if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
@@ -292,7 +292,7 @@ test_create(hid_t file)
/*
* Close the chunked dataset.
*/
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
/*
* Create a compact dataset, then close it.
@@ -304,11 +304,11 @@ test_create(hid_t file)
status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY);
assert(status >= 0);
- dataset = H5Dcreate(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE,
- small_space, create_parms);
+ dataset = H5Dcreate2(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE,
+ small_space, H5P_DEFAULT, create_parms, H5P_DEFAULT);
if(dataset < 0) goto error;
H5Pclose(create_parms);
- if(H5Dclose(dataset) <0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
return 0;
@@ -353,33 +353,33 @@ test_simple_io(hid_t fapl)
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
/* Initialize the dataset */
- for (i = n = 0; i < DSET_DIM1; i++)
- for (j = 0; j < DSET_DIM2; j++)
+ for(i = n = 0; i < DSET_DIM1; i++)
+ for(j = 0; j < DSET_DIM2; j++)
points[i][j] = n++;
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
/* Create the data space */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* Create a small conversion buffer to test strip mining */
tconv_buf = HDmalloc((size_t)1000);
- xfer = H5Pcreate (H5P_DATASET_XFER);
- assert (xfer>=0);
- if (H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error;
+ xfer = H5Pcreate(H5P_DATASET_XFER);
+ assert(xfer>=0);
+ if(H5Pset_buffer (xfer, (size_t)1000, tconv_buf, NULL) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SIMPLE_IO_NAME, H5T_NATIVE_INT, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Test dataset address. Should be undefined. */
- if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
+ if(H5Dget_offset(dataset) != HADDR_UNDEF) goto error;
/* Write the data to the dataset */
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points) < 0)
goto error;
/* Test dataset address in file. Open the same file as a C file, seek
@@ -388,13 +388,13 @@ test_simple_io(hid_t fapl)
if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error;
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, check) < 0)
goto error;
/* Check that the values read are the same as the values written */
- for (i = 0; i < DSET_DIM1; i++) {
- for (j = 0; j < DSET_DIM2; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i = 0; i < DSET_DIM1; i++) {
+ for(j = 0; j < DSET_DIM2; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
@@ -412,9 +412,9 @@ test_simple_io(hid_t fapl)
HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2);
/* Check that the values read are the same as the values written */
- for (i = 0; i < DSET_DIM1; i++) {
- for (j = 0; j < DSET_DIM2; j++) {
- if (points[i][j] != rdata[i][j]) {
+ for(i = 0; i < DSET_DIM1; i++) {
+ for(j = 0; j < DSET_DIM2; j++) {
+ if(points[i][j] != rdata[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
@@ -468,26 +468,26 @@ test_userblock_offset(hid_t fapl)
if((fcpl=H5Pcreate(H5P_FILE_CREATE)) < 0) goto error;
if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK) < 0) goto error;
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
goto error;
/* Create the data space */
dims[0] = DSET_DIM1;
dims[1] = DSET_DIM2;
- if ((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_USERBLOCK_IO_NAME, H5T_NATIVE_INT, space,
- H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_USERBLOCK_IO_NAME, H5T_NATIVE_INT, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Write the data to the dataset */
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0)
goto error;
/* Test dataset address in file. Open the same file as a C file, seek
* the data position as H5Dget_offset points to, read the dataset, and
* compare it with the data written in.*/
- if((offset=H5Dget_offset(dataset))==HADDR_UNDEF) goto error;
+ if((offset = H5Dget_offset(dataset)) == HADDR_UNDEF) goto error;
if(H5Dclose(dataset) < 0) goto error;
if(H5Fclose(file) < 0) goto error;
@@ -497,9 +497,9 @@ test_userblock_offset(hid_t fapl)
HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2);
/* Check that the values read are the same as the values written */
- for (i = 0; i < DSET_DIM1; i++) {
- for (j = 0; j < DSET_DIM2; j++) {
- if (points[i][j] != rdata[i][j]) {
+ for(i = 0; i < DSET_DIM1; i++) {
+ for(j = 0; j < DSET_DIM2; j++) {
+ if(points[i][j] != rdata[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
@@ -570,11 +570,11 @@ test_compact_io(hid_t fapl)
if(H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR
/* Create and write to a compact dataset */
- if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Test dataset address. Should be undefined. */
- if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR
+ if(H5Dget_offset(dataset) != HADDR_UNDEF) TEST_ERROR
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
TEST_ERROR
@@ -601,7 +601,7 @@ test_compact_io(hid_t fapl)
/* Check that the values read are the same as the values written */
for(i = 0; i < 16; i++)
for(j = 0; j < 8; j++)
- if (rbuf[i][j] != wbuf[i][j]) {
+ if(rbuf[i][j] != wbuf[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
@@ -679,7 +679,7 @@ test_max_compact(hid_t fapl)
assert(status >= 0);
/* Create and write to a compact dataset */
- if((dataset = H5Dcreate(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, plist)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0)
goto error;
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf) < 0)
@@ -736,7 +736,7 @@ test_max_compact(hid_t fapl)
/* Create and write to a compact dataset */
H5E_BEGIN_TRY {
- H5Dcreate(file, DSET_COMPACT_MAX2_NAME, H5T_NATIVE_INT, space, plist);
+ H5Dcreate2(file, DSET_COMPACT_MAX2_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, plist, H5P_DEFAULT);
} H5E_END_TRY;
/* Close file */
@@ -805,15 +805,15 @@ test_conv_buffer(hid_t fid)
cf = (CmpField *)HDcalloc((size_t)1, sizeof(CmpField));
/* Populate the data members */
- for (j = 0; j < DIM1; j++)
- for (k = 0; k < DIM2; k++)
- for (l = 0; l < DIM3; l++)
+ for(j = 0; j < DIM1; j++)
+ for(k = 0; k < DIM2; k++)
+ for(l = 0; l < DIM3; l++)
cf->a[j][k][l] = 10*(j+1) + l + k;
- for (j = 0; j < DIM2; j++)
+ for(j = 0; j < DIM2; j++)
cf->b[j] = (float)(100.*(j+1) + 0.01*j);
- for (j = 0; j < DIM3; j++)
+ for(j = 0; j < DIM3; j++)
cf->c[j] = 100.*(j+1) + 0.02*j;
@@ -839,7 +839,7 @@ test_conv_buffer(hid_t fid)
if(H5Tinsert (ctype1, "C", HOFFSET(CmpField, c), arr_type3) < 0) goto error;
/* Create the dataset */
- if((dataset = H5Dcreate(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
if(H5Dwrite(dataset, ctype1, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf) < 0) goto error;
if((ctype2 = H5Tcreate(H5T_COMPOUND, sizeof (CmpFieldR))) < 0) goto error;
@@ -863,7 +863,7 @@ test_conv_buffer(hid_t fid)
H5E_BEGIN_TRY {
status = H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, xfer_list, cfrR);
} H5E_END_TRY;
- if (status >= 0) {
+ if(status >= 0) {
H5_FAILED();
puts(" Library shouldn't allow conversion buffer too small");
goto error;
@@ -932,7 +932,7 @@ test_tconv(hid_t file)
TESTING("data type conversion");
/* Initialize the dataset */
- for (i = 0; i < 1000000; i++) {
+ for(i = 0; i < 1000000; i++) {
out[i*4+0] = 0x11;
out[i*4+1] = 0x22;
out[i*4+2] = 0x33;
@@ -941,23 +941,24 @@ test_tconv(hid_t file)
/* Create the data space */
dims[0] = 1000000;
- if ((space = H5Screate_simple (1, dims, NULL)) < 0) goto error;
+ if((space = H5Screate_simple (1, dims, NULL)) < 0) goto error;
/* Create the data set */
- if ((dataset = H5Dcreate(file, DSET_TCONV_NAME, H5T_STD_I32LE, space,
- H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_TCONV_NAME, H5T_STD_I32LE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
/* Write the data to the dataset */
- if (H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- out) < 0) goto error;
+ if(H5Dwrite(dataset, H5T_STD_I32LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, out) < 0)
+ goto error;
/* Read data with byte order conversion */
- if (H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in) < 0)
+ if(H5Dread(dataset, H5T_STD_I32BE, H5S_ALL, H5S_ALL, H5P_DEFAULT, in) < 0)
goto error;
/* Check */
- for (i = 0; i < 1000000; i++) {
- if (in[4*i+0]!=out[4*i+3] ||
+ for(i = 0; i < 1000000; i++) {
+ if(in[4*i+0]!=out[4*i+3] ||
in[4*i+1]!=out[4*i+2] ||
in[4*i+2]!=out[4*i+1] ||
in[4*i+3]!=out[4*i+0]) {
@@ -967,7 +968,7 @@ test_tconv(hid_t file)
}
}
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
free (out);
free (in);
puts(" PASSED");
@@ -1134,7 +1135,7 @@ filter_bogus2(unsigned int flags, size_t cd_nelmts,
/* Check if this filter is supposed to do something */
if(cd_values[2]>0) {
/* Check whether we are "uncompressing" */
- if (flags & H5Z_FLAG_REVERSE) {
+ if(flags & H5Z_FLAG_REVERSE) {
/* Do nothing */
} /* end if */
/* "Compressing" */
@@ -1199,7 +1200,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts,
unsigned int value;
void *data;
- if (cd_nelmts!=3 || !cd_values)
+ if(cd_nelmts!=3 || !cd_values)
return 0;
offset = cd_values[0];
length = cd_values[1];
@@ -1210,7 +1211,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts,
data = HDmalloc((size_t)length);
HDmemset(data, (int)value, (size_t)length);
- if (flags & H5Z_FLAG_REVERSE) { /* Varify data is actually corrupted during read */
+ if(flags & H5Z_FLAG_REVERSE) { /* Varify data is actually corrupted during read */
dst += offset;
if(HDmemcmp(data, dst, (size_t)length)!=0) return 0;
*buf_size = nbytes;
@@ -1315,18 +1316,18 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
herr_t status; /* Error status */
/* Create the data space */
- if ((sid = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error;
/*
* Create a small conversion buffer to test strip mining. We
* might as well test all we can!
*/
- if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
tconv_buf = HDmalloc((size_t)1000);
- if (H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error;
- if ((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR;
+ if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error;
+ if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR;
- if (if_fletcher32==DISABLE_FLETCHER32) {
+ if(if_fletcher32==DISABLE_FLETCHER32) {
if(H5Pset_edc_check(dxpl, H5Z_DISABLE_EDC) < 0)
goto error;
if(H5Z_DISABLE_EDC != H5Pget_edc_check(dxpl))
@@ -1343,8 +1344,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
} /* end if */
/* Create the dataset */
- if ((dataset = H5Dcreate(fid, name, H5T_NATIVE_INT, sid,
- dcpl)) < 0) goto error;
+ if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
+ dcpl, H5P_DEFAULT)) < 0) goto error;
+
PASSED();
/*----------------------------------------------------------------------
@@ -1353,12 +1355,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (uninitialized read)");
- if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
goto error;
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (0!=check[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(0!=check[i][j]) {
H5_FAILED();
printf(" Read a non-zero value.\n");
printf(" At index %lu,%lu\n",
@@ -1376,13 +1378,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (write)");
- for (i=n=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
+ for(i=n=0; i<size[0]; i++) {
+ for(j=0; j<size[1]; j++) {
points[i][j] = (int)(n++);
}
}
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
TEST_ERROR;
if((*dset_size=H5Dget_storage_size(dataset))==0) TEST_ERROR;
@@ -1417,13 +1419,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
} else {
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i=0; i<size[0]; i++) {
+ for(j=0; j<size[1]; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
fprintf(stderr," Read different values than written.\n");
fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -1446,12 +1448,12 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (modify)");
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]/2; j++) {
+ for(i=0; i<size[0]; i++) {
+ for(j=0; j<size[1]/2; j++) {
points[i][j] = (int)HDrandom ();
}
}
- if (H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
+ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
TEST_ERROR;
if(corrupted) {
@@ -1476,13 +1478,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
if(status>=0) TEST_ERROR;
} else {
/* Read the dataset back and check it */
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i=0; i<size[0]; i++) {
+ for(j=0; j<size[1]; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n",
@@ -1556,15 +1558,15 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
*/
TESTING(" filters (partial I/O)");
- for (i=0; i<(size_t)hs_size[0]; i++) {
- for (j=0; j<(size_t)hs_size[1]; j++) {
+ for(i=0; i<(size_t)hs_size[0]; i++) {
+ for(j=0; j<(size_t)hs_size[1]; j++) {
points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom();
}
}
- if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size,
+ if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size,
NULL) < 0) TEST_ERROR;
/* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */
- if (H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0)
+ if(H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0)
TEST_ERROR;
if(corrupted) {
@@ -1588,13 +1590,13 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
} H5E_END_TRY;
if(status>=0) TEST_ERROR;
} else {
- if (H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0)
+ if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0)
TEST_ERROR;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)hs_size[0]; i++) {
- for (j=0; j<(size_t)hs_size[1]; j++) {
- if (points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] !=
+ for(i=0; i<(size_t)hs_size[0]; i++) {
+ for(j=0; j<(size_t)hs_size[1]; j++) {
+ if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] !=
check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) {
H5_FAILED();
fprintf(stderr," Read different values than written.\n");
@@ -1616,9 +1618,9 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
/* Get the storage size of the dataset */
if((*dset_size=H5Dget_storage_size(dataset))==0) goto error;
/* Clean up objects used for this test */
- if (H5Dclose (dataset) < 0) goto error;
- if (H5Sclose (sid) < 0) goto error;
- if (H5Pclose (dxpl) < 0) goto error;
+ if(H5Dclose (dataset) < 0) goto error;
+ if(H5Sclose (sid) < 0) goto error;
+ if(H5Pclose (dxpl) < 0) goto error;
free (tconv_buf);
return(0);
@@ -1709,10 +1711,10 @@ test_filter_noencoder(const char *dset_name, hid_t fapl)
if(space_id < 0) goto error;
H5E_BEGIN_TRY{
- test_dset_id = H5Dcreate(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id , dcpl_id);
+ test_dset_id = H5Dcreate2(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
}H5E_END_TRY
- if (test_dset_id >= 0) goto error;
+ if(test_dset_id >= 0) goto error;
/* Attempt to extend the dataset. This should fail because
* the dataset has a fill value and is instructed to fill on
@@ -1745,15 +1747,15 @@ test_filter_noencoder(const char *dset_name, hid_t fapl)
error:
H5_FAILED();
- if (dset_id != -1)
+ if(dset_id != -1)
H5Dclose(dset_id);
- if (test_dset_id != -1)
+ if(test_dset_id != -1)
H5Dclose(test_dset_id);
- if (space_id != -1)
+ if(space_id != -1)
H5Sclose(space_id);
- if (dcpl_id != -1)
+ if(dcpl_id != -1)
H5Pclose(dcpl_id);
- if (file_id != -1)
+ if(file_id != -1)
H5Fclose(file_id);
return -1;
}
@@ -1827,13 +1829,13 @@ test_get_filter_info(void)
/* Verify that get_filter_info throws an error when given a bad filter */
/* (Depends on 1.6 compatibility flag) */
#ifdef H5_WANT_H5_V1_6_COMPAT
- if (H5Zget_filter_info(-1, &flags) < 0) TEST_ERROR
- if (flags != 0) TEST_ERROR
+ if(H5Zget_filter_info(-1, &flags) < 0) TEST_ERROR
+ if(flags != 0) TEST_ERROR
#else /* H5_WANT_H5_V1_6_COMPAT */
H5E_BEGIN_TRY {
err = H5Zget_filter_info(-1, &flags);
} H5E_END_TRY;
- if (err >= 0) TEST_ERROR
+ if(err >= 0) TEST_ERROR
#endif /* H5_WANT_H5_V1_6_COMPAT */
PASSED();
@@ -1894,7 +1896,7 @@ UNUSED
hsize_t shuffle_size; /* Size of dataset with shuffle filter */
#endif /* H5_HAVE_FILTER_SHUFFLE */
-#if (defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
+#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
hsize_t combo_size; /* Size of dataset with shuffle+deflate filter */
#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
@@ -1907,14 +1909,14 @@ UNUSED
*/
puts("Testing 'null' filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Zregister (H5Z_BOGUS) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Zregister (H5Z_BOGUS) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_BOGUS, 0, (size_t)0, NULL) < 0) goto error;
if(test_filter_internal(file,DSET_BOGUS_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&null_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
/*----------------------------------------------------------
* STEP 1: Test Fletcher32 Checksum by itself.
@@ -1923,7 +1925,7 @@ UNUSED
#ifdef H5_HAVE_FILTER_FLETCHER32
puts("Testing Fletcher32 checksum(enabled for read)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_FLETCHER32, 0, (size_t)0, NULL) < 0) goto error;
/* Enable checksum during read */
@@ -1951,7 +1953,7 @@ UNUSED
/* Temporarily disable this test because the changes in chunk caching conflicts with
* the way this test is conducted. -slu 2007/7/20 */
- if (H5Zregister (H5Z_CORRUPT) < 0) goto error;
+ if(H5Zregister (H5Z_CORRUPT) < 0) goto error;
if(H5Pset_filter(dc, H5Z_FILTER_CORRUPT, 0, (size_t)3, data_corrupt) < 0) goto error;
if(test_filter_internal(file,DSET_FLETCHER32_NAME_3,dc,DISABLE_FLETCHER32,DATA_CORRUPTED,&fletcher32_size) < 0) goto error;
if(fletcher32_size<=null_size) {
@@ -1961,7 +1963,7 @@ UNUSED
} /* end if */
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_FLETCHER32 */
TESTING("fletcher32 checksum");
@@ -1976,12 +1978,12 @@ UNUSED
#ifdef H5_HAVE_FILTER_DEFLATE
puts("Testing deflate filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_deflate (dc, 6) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_deflate (dc, 6) < 0) goto error;
if(test_filter_internal(file,DSET_DEFLATE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&deflate_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_DEFLATE */
TESTING("deflate filter");
SKIPPED();
@@ -1994,21 +1996,21 @@ UNUSED
*/
#ifdef H5_HAVE_FILTER_SZIP
TESTING("szip filter (with encoder)");
- if ( h5_szip_can_encode() == 1) {
+ if( h5_szip_can_encode() == 1) {
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
puts("");
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size) < 0) goto error;
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
} else {
SKIPPED();
}
TESTING("szip filter (without encoder)");
- if ( h5_szip_can_encode() != 1) {
+ if( h5_szip_can_encode() != 1) {
puts("");
if(test_filter_noencoder(NOENCODER_SZIP_DATASET, fapl) < 0) goto error;
} else {
@@ -2028,8 +2030,8 @@ UNUSED
#ifdef H5_HAVE_FILTER_SHUFFLE
puts("Testing shuffle filter");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
if(test_filter_internal(file,DSET_SHUFFLE_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&shuffle_size) < 0) goto error;
if(shuffle_size!=null_size) {
@@ -2039,7 +2041,7 @@ UNUSED
} /* end if */
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_SHUFFLE */
TESTING("shuffle filter");
SKIPPED();
@@ -2053,27 +2055,27 @@ UNUSED
#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
puts("Testing shuffle+deflate+checksum filters(checksum first)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_fletcher32 (dc) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
- if (H5Pset_deflate (dc, 6) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_deflate (dc, 6) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
puts("Testing shuffle+deflate+checksum filters(checksum last)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
- if (H5Pset_deflate (dc, 6) < 0) goto error;
- if (H5Pset_fletcher32 (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_deflate (dc, 6) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_DEF_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
#else /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
TESTING("shuffle+deflate+fletcher32 filters");
SKIPPED();
@@ -2088,14 +2090,14 @@ UNUSED
TESTING("shuffle+szip+checksum filters(checksum first, with encoder)");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_fletcher32 (dc) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
/* Make sure encoding is enabled */
- if ( h5_szip_can_encode() == 1) {
+ if( h5_szip_can_encode() == 1) {
puts("");
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
} else {
SKIPPED();
@@ -2103,31 +2105,31 @@ UNUSED
TESTING("shuffle+szip+checksum filters(checksum first, without encoder)");
- if ( h5_szip_can_encode() != 1) {
+ if( h5_szip_can_encode() != 1) {
puts("");
- if (test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET,fapl) < 0) goto error;
+ if(test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET,fapl) < 0) goto error;
} else {
SKIPPED();
}
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
TESTING("shuffle+szip+checksum filters(checksum last, with encoder)");
/* Make sure encoding is enabled */
- if ( h5_szip_can_encode() == 1) {
+ if( h5_szip_can_encode() == 1) {
puts("");
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
- if (H5Pset_fletcher32 (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block) < 0) goto error;
+ if(H5Pset_fletcher32 (dc) < 0) goto error;
if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size) < 0) goto error;
/* Clean up objects used for this test */
- if (H5Pclose (dc) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
} else {
SKIPPED();
@@ -2185,7 +2187,7 @@ test_missing_filter(hid_t file)
} /* end if */
/* Unregister deflate filter (use internal function) */
- if (H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) {
+ if(H5Z_unregister(H5Z_FILTER_DEFLATE) < 0) {
H5_FAILED();
printf(" Line %d: Can't unregister deflate filter\n",__LINE__);
goto error;
@@ -2229,28 +2231,28 @@ test_missing_filter(hid_t file)
} /* end if */
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
+ if((dsid = H5Dcreate2(file, DSET_MISSING_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
- if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
+ if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
printf(" Line %d: Error flushing file\n",__LINE__);
goto error;
@@ -2272,7 +2274,7 @@ test_missing_filter(hid_t file)
} /* end if */
/* Read data */
- if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
printf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
@@ -2280,9 +2282,9 @@ test_missing_filter(hid_t file)
/* Compare data */
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)dims[0]; i++) {
- for (j=0; j<(size_t)dims[1]; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i=0; i<(size_t)dims[0]; i++) {
+ for(j=0; j<(size_t)dims[1]; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
printf(" Line %d: Read different values than written.\n",__LINE__);
printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@@ -2342,7 +2344,7 @@ test_missing_filter(hid_t file)
H5E_BEGIN_TRY {
ret = H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check);
} H5E_END_TRY;
- if (ret>=0) {
+ if(ret>=0) {
H5_FAILED();
printf(" Line %d: Should not be able to read dataset data\n", __LINE__);
goto error;
@@ -2429,19 +2431,19 @@ test_onebyte_shuffle(hid_t file)
#ifdef H5_HAVE_FILTER_SHUFFLE
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use shuffling algorithm with 8-bit */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_shuffle (dc) < 0) goto error;
+ if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_shuffle (dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_ONEBYTE_SHUF_NAME, H5T_NATIVE_UCHAR,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
- for (i= 0;i< 10; i++)
- for (j = 0; j < 20; j++)
+ for(i= 0;i< 10; i++)
+ for(j = 0; j < 20; j++)
orig_data[i][j] = (unsigned char)HDrandom();
PASSED();
@@ -2458,7 +2460,7 @@ test_onebyte_shuffle(hid_t file)
TESTING("8-bit shuffling (write)");
#ifdef H5_HAVE_FILTER_SHUFFLE
- if (H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
@@ -2476,14 +2478,14 @@ test_onebyte_shuffle(hid_t file)
#ifdef H5_HAVE_FILTER_SHUFFLE
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (new_data[i][j] != orig_data[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n",
@@ -2497,8 +2499,8 @@ test_onebyte_shuffle(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Pclose (dc) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Pclose (dc) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2562,20 +2564,20 @@ test_nbit_int(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_INT_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_INT_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of int */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = (int)(((long_long)HDrandom() %
(long_long)HDpow(2.0, (double)(precision - 1))) << offset);
@@ -2598,7 +2600,7 @@ test_nbit_int(hid_t file)
TESTING(" nbit int (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -2615,7 +2617,7 @@ test_nbit_int(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
@@ -2623,9 +2625,9 @@ test_nbit_int(hid_t file)
* Use mask for checking the significant bits, ignoring the padding bits
*/
mask = ~(~0 << (precision + offset)) & (~0 << offset);
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if ((new_data[i][j] & mask) != (orig_data[i][j] & mask)) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if((new_data[i][j] & mask) != (orig_data[i][j] & mask)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -2638,11 +2640,11 @@ test_nbit_int(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Tclose(mem_datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Tclose(mem_datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2703,16 +2705,16 @@ test_nbit_float(hid_t file)
if(H5Tset_ebias(datatype, (size_t)31) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_FLOAT_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_FLOAT_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
PASSED();
#else
SKIPPED();
@@ -2727,7 +2729,7 @@ test_nbit_float(hid_t file)
TESTING(" nbit float (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
@@ -2745,17 +2747,17 @@ test_nbit_float(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
* Assume size of int = size of float
*/
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */
- if (new_data[i][j] != orig_data[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */
+ if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -2768,10 +2770,10 @@ test_nbit_float(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2836,16 +2838,16 @@ test_nbit_double(hid_t file)
if(H5Tset_ebias(datatype, (size_t)255) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_DOUBLE_NAME, datatype,
- space, dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_DOUBLE_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
PASSED();
#else
@@ -2861,7 +2863,7 @@ test_nbit_double(hid_t file)
TESTING(" nbit double (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -2878,17 +2880,17 @@ test_nbit_double(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
* Assume size of long_long = size of double
*/
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */
- if (new_data[i][j] != orig_data[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(!(orig_data[i][j]==orig_data[i][j])) continue; /* skip if value is NaN */
+ if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -2901,10 +2903,10 @@ test_nbit_double(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -2974,22 +2976,22 @@ test_nbit_array(hid_t file)
mem_array_datatype = H5Tarray_create(mem_base_datatype, 2, adims, NULL);
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_ARRAY_NAME, array_datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_ARRAY_NAME, array_datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of unsigned int */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++)
- for (m = 0; m < (size_t)adims[0]; m++)
- for (n = 0; n < (size_t)adims[1]; n++)
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++)
+ for(m = 0; m < (size_t)adims[0]; m++)
+ for(n = 0; n < (size_t)adims[1]; n++)
orig_data[i][j][m][n] = (unsigned int)(((long_long)HDrandom() %
(long_long)HDpow(2.0, (double)precision)) << offset);
PASSED();
@@ -3006,7 +3008,7 @@ test_nbit_array(hid_t file)
TESTING(" nbit array (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
@@ -3024,17 +3026,17 @@ test_nbit_array(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written
*/
- for (i=0; i<(size_t)size[0]; i++)
- for (j=0; j<(size_t)size[1]; j++)
- for (m = 0; m < (size_t)adims[0]; m++)
- for (n = 0; n < (size_t)adims[1]; n++) {
- if (new_data[i][j][m][n]!= orig_data[i][j][m][n]) {
+ for(i=0; i<(size_t)size[0]; i++)
+ for(j=0; j<(size_t)size[1]; j++)
+ for(m = 0; m < (size_t)adims[0]; m++)
+ for(n = 0; n < (size_t)adims[1]; n++) {
+ if(new_data[i][j][m][n]!= orig_data[i][j][m][n]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu,%lu,%lu\n",
@@ -3047,13 +3049,13 @@ test_nbit_array(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(array_datatype) < 0) goto error;
- if (H5Tclose(base_datatype) < 0) goto error;
- if (H5Tclose(mem_array_datatype) < 0) goto error;
- if (H5Tclose(mem_base_datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(array_datatype) < 0) goto error;
+ if(H5Tclose(base_datatype) < 0) goto error;
+ if(H5Tclose(mem_array_datatype) < 0) goto error;
+ if(H5Tclose(mem_base_datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3156,20 +3158,20 @@ test_nbit_compound(hid_t file)
if(H5Tinsert(cmpd_tid, "f", HOFFSET(atomic, f), f_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME, cmpd_tid,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of member datatypes */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j].i = (int)(((long_long)HDrandom() %
(long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]);
orig_data[i][j].c = (char)(((long_long)HDrandom() %
@@ -3199,7 +3201,7 @@ test_nbit_compound(hid_t file)
TESTING(" nbit compound (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -3216,7 +3218,7 @@ test_nbit_compound(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
@@ -3226,9 +3228,9 @@ test_nbit_compound(hid_t file)
i_mask = ~(~0 << (precision[0] + offset[0])) & (~0 << offset[0]);
c_mask = ~(~0 << (precision[1] + offset[1])) & (~0 << offset[1]);
s_mask = ~(~0 << (precision[2] + offset[2])) & (~0 << offset[2]);
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
- if ((new_data[i][j].i & i_mask) != (orig_data[i][j].i & i_mask) ||
+ for(i=0; i<size[0]; i++) {
+ for(j=0; j<size[1]; j++) {
+ if((new_data[i][j].i & i_mask) != (orig_data[i][j].i & i_mask) ||
(new_data[i][j].c & c_mask) != (orig_data[i][j].c & c_mask) ||
(new_data[i][j].s & s_mask) != (orig_data[i][j].s & s_mask) ||
(orig_data[i][j].f==orig_data[i][j].f && new_data[i][j].f != orig_data[i][j].f))
@@ -3245,15 +3247,15 @@ test_nbit_compound(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(i_tid) < 0) goto error;
- if (H5Tclose(c_tid) < 0) goto error;
- if (H5Tclose(s_tid) < 0) goto error;
- if (H5Tclose(f_tid) < 0) goto error;
- if (H5Tclose(cmpd_tid) < 0) goto error;
- if (H5Tclose(mem_cmpd_tid) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(i_tid) < 0) goto error;
+ if(H5Tclose(c_tid) < 0) goto error;
+ if(H5Tclose(s_tid) < 0) goto error;
+ if(H5Tclose(f_tid) < 0) goto error;
+ if(H5Tclose(cmpd_tid) < 0) goto error;
+ if(H5Tclose(mem_cmpd_tid) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3403,20 +3405,20 @@ test_nbit_compound_2(hid_t file)
if(H5Tinsert(cmpd_tid2, "d", HOFFSET(complex, d), array_cmplx_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_2, cmpd_tid2,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME_2, cmpd_tid2,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data, assuming size of long_long >= size of member datatypes */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j].a.i = (int)(((long_long)HDrandom() %
(long_long)HDpow(2.0, (double)(precision[0]-1))) << offset[0]);
orig_data[i][j].a.c = (char)(((long_long)HDrandom() %
@@ -3459,7 +3461,7 @@ test_nbit_compound_2(hid_t file)
TESTING(" nbit compound complex (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -3476,7 +3478,7 @@ test_nbit_compound_2(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
@@ -3487,8 +3489,8 @@ test_nbit_compound_2(hid_t file)
c_mask = ~(~0 << (precision[1] + offset[1])) & (~0 << offset[1]);
s_mask = ~(~0 << (precision[2] + offset[2])) & (~0 << offset[2]);
b_mask = ~(~0 << (precision[4] + offset[4])) & (~0 << offset[4]);
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
b_failed = 0;
d_failed = 0;
@@ -3529,22 +3531,22 @@ test_nbit_compound_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(i_tid) < 0) goto error;
- if (H5Tclose(c_tid) < 0) goto error;
- if (H5Tclose(s_tid) < 0) goto error;
- if (H5Tclose(f_tid) < 0) goto error;
- if (H5Tclose(v_tid) < 0) goto error;
- if (H5Tclose(cmpd_tid2) < 0) goto error;
- if (H5Tclose(cmpd_tid1) < 0) goto error;
- if (H5Tclose(mem_cmpd_tid2) < 0) goto error;
- if (H5Tclose(mem_cmpd_tid1) < 0) goto error;
- if (H5Tclose(array_tid) < 0) goto error;
- if (H5Tclose(base_tid) < 0) goto error;
- if (H5Tclose(array_cmplx_tid) < 0) goto error;
- if (H5Tclose(mem_array_cmplx_tid) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(i_tid) < 0) goto error;
+ if(H5Tclose(c_tid) < 0) goto error;
+ if(H5Tclose(s_tid) < 0) goto error;
+ if(H5Tclose(f_tid) < 0) goto error;
+ if(H5Tclose(v_tid) < 0) goto error;
+ if(H5Tclose(cmpd_tid2) < 0) goto error;
+ if(H5Tclose(cmpd_tid1) < 0) goto error;
+ if(H5Tclose(mem_cmpd_tid2) < 0) goto error;
+ if(H5Tclose(mem_cmpd_tid1) < 0) goto error;
+ if(H5Tclose(array_tid) < 0) goto error;
+ if(H5Tclose(base_tid) < 0) goto error;
+ if(H5Tclose(array_cmplx_tid) < 0) goto error;
+ if(H5Tclose(mem_array_cmplx_tid) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3627,20 +3629,20 @@ test_nbit_compound_3(hid_t file)
if(H5Tinsert(cmpd_tid, "o", HOFFSET(atomic, o), o_tid) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(1, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(1, size, NULL)) < 0) goto error;
/* Use nbit filter */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if (H5Pset_chunk(dc, 1, chunk_size) < 0) goto error;
- if (H5Pset_nbit(dc) < 0) goto error;
+ if(H5Pset_chunk(dc, 1, chunk_size) < 0) goto error;
+ if(H5Pset_nbit(dc) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NBIT_COMPOUND_NAME_3, cmpd_tid,
- space, dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_NBIT_COMPOUND_NAME_3, cmpd_tid,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Create the dataset object reference points to */
- if ((obj_ref_dataset = H5Dcreate(file, "nbit_obj_ref", H5T_NATIVE_INT,
- space, H5P_DEFAULT)) < 0) goto error;
+ if((obj_ref_dataset = H5Dcreate2(file, "nbit_obj_ref", H5T_NATIVE_INT,
+ space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
for(i = 0; i < (size_t)size[0]; i++) {
@@ -3672,7 +3674,7 @@ test_nbit_compound_3(hid_t file)
TESTING(" nbit compound with no-op type (write)");
#ifdef H5_HAVE_FILTER_NBIT
- if (H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0)
goto error;
PASSED();
@@ -3689,12 +3691,12 @@ test_nbit_compound_3(hid_t file)
#ifdef H5_HAVE_FILTER_NBIT
/* Read the dataset back */
- if (H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0)
goto error;
/* Check that the values read are the same as the values written */
- for (i = 0; i < (size_t)size[0]; i++) {
+ for(i = 0; i < (size_t)size[0]; i++) {
if(new_data[i].i != orig_data[i].i ||
strcmp(new_data[i].str, orig_data[i].str) !=0 ||
strcmp(new_data[i].vl_str, orig_data[i].vl_str) !=0 ||
@@ -3730,18 +3732,18 @@ test_nbit_compound_3(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error;
- if (H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error;
- if (H5Tclose(i_tid) < 0) goto error;
- if (H5Tclose(str_tid) < 0) goto error;
- if (H5Tclose(vl_str_tid) < 0) goto error;
- if (H5Tclose(v_tid) < 0) goto error;
- if (H5Tclose(o_tid) < 0) goto error;
- if (H5Tclose(cmpd_tid) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(obj_ref_dataset) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, new_data) < 0) goto error;
+ if(H5Dvlen_reclaim(cmpd_tid, space, H5P_DEFAULT, orig_data) < 0) goto error;
+ if(H5Tclose(i_tid) < 0) goto error;
+ if(H5Tclose(str_tid) < 0) goto error;
+ if(H5Tclose(vl_str_tid) < 0) goto error;
+ if(H5Tclose(v_tid) < 0) goto error;
+ if(H5Tclose(o_tid) < 0) goto error;
+ if(H5Tclose(cmpd_tid) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(obj_ref_dataset) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3795,25 +3797,25 @@ test_scaleoffset_int(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
+ if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, let library calculate minbits */
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_INT_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = HDrandom() % 10000;
/* even-numbered values are negtive */
@@ -3835,7 +3837,7 @@ test_scaleoffset_int(hid_t file)
TESTING(" scaleoffset int without fill value (write)");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -3851,13 +3853,13 @@ test_scaleoffset_int(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (new_data[i][j] != orig_data[i][j]) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(new_data[i][j] != orig_data[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -3870,10 +3872,10 @@ test_scaleoffset_int(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -3930,25 +3932,25 @@ test_scaleoffset_int_2(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000;
- if (H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval) < 0) goto error;
+ if(H5Pset_fill_value(dc, H5T_NATIVE_INT, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, let library calculate minbits */
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_INT,H5Z_SO_INT_MINBITS_DEFAULT) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_INT_NAME_2, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_INT_NAME_2, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -3961,7 +3963,7 @@ test_scaleoffset_int_2(hid_t file)
stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (int)HDrandom() % 10000;
/* even-numbered values are negtive */
@@ -3984,7 +3986,7 @@ test_scaleoffset_int_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
- if (H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4000,12 +4002,12 @@ test_scaleoffset_int_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (j=0; j<(size_t)size[1]; j++) {
- if (new_data[0][j] != orig_data[0][j]) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(new_data[0][j] != orig_data[0][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
@@ -4017,10 +4019,10 @@ test_scaleoffset_int_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4072,27 +4074,27 @@ test_scaleoffset_float(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
+ if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 3,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_FLOAT_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = (float)((HDrandom() % 100000) / (float)1000.0);
/* even-numbered values are negtive */
@@ -4114,7 +4116,7 @@ test_scaleoffset_float(hid_t file)
TESTING(" scaleoffset float without fill value, D-scaling (write)");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4130,13 +4132,13 @@ test_scaleoffset_float(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -3.0)) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -3.0)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -4149,10 +4151,10 @@ test_scaleoffset_float(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4209,27 +4211,27 @@ test_scaleoffset_float_2(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000.0;
- if (H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error;
+ if(H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 3,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,3) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_FLOAT_NAME_2, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_FLOAT_NAME_2, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -4242,7 +4244,7 @@ test_scaleoffset_float_2(hid_t file)
stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (float)((HDrandom() % 100000) / (float)1000.0);
/* even-numbered values are negtive */
@@ -4265,7 +4267,7 @@ test_scaleoffset_float_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
- if (H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4281,12 +4283,12 @@ test_scaleoffset_float_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (j=0; j<(size_t)size[1]; j++) {
- if (HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -3.0)) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -3.0)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
@@ -4297,10 +4299,10 @@ test_scaleoffset_float_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4352,27 +4354,27 @@ test_scaleoffset_double(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Fill value undefined */
- if (H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
+ if(H5Pset_fill_value(dc, datatype, NULL) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 7,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_DOUBLE_NAME, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Initialize data */
- for (i= 0;i< (size_t)size[0]; i++)
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(i= 0;i< (size_t)size[0]; i++)
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0;
/* even-numbered values are negtive */
@@ -4394,7 +4396,7 @@ test_scaleoffset_double(hid_t file)
TESTING(" scaleoffset double without fill value, D-scaling (write)");
#ifdef H5_HAVE_FILTER_SCALEOFFSET
- if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4410,13 +4412,13 @@ test_scaleoffset_double(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)size[0]; i++) {
- for (j=0; j<(size_t)size[1]; j++) {
- if (HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -7.0)) {
+ for(i=0; i<(size_t)size[0]; i++) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -7.0)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
@@ -4429,10 +4431,10 @@ test_scaleoffset_double(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4489,27 +4491,27 @@ test_scaleoffset_double_2(hid_t file)
if(H5Tset_order(datatype, H5T_ORDER_BE) < 0) goto error;
/* Create the data space for the dataset */
- if ((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Create the dataset property list */
if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Set fill value */
fillval = 10000.0;
- if (H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error;
+ if(H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error;
/* Set up to use scaleoffset filter, decimal scale factor is 7,
* use variable-minimum-bits method
*/
- if (H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
- if (H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) goto error;
+ if(H5Pset_scaleoffset(dc, H5Z_SO_FLOAT_DSCALE,7) < 0) goto error;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_SCALEOFFSET_DOUBLE_NAME_2, datatype,
- space,dc)) < 0) goto error;
+ if((dataset = H5Dcreate2(file, DSET_SCALEOFFSET_DOUBLE_NAME_2, datatype,
+ space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error;
/* Create the memory data space */
- if ((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((mspace = H5Screate_simple(2, size, NULL)) < 0) goto error;
/* Select hyperslab for data to write, using 1x5 blocks,
* (1,1) stride and (1,1) count starting at the position (0,0).
@@ -4522,7 +4524,7 @@ test_scaleoffset_double_2(hid_t file)
stride, count, block) < 0) goto error;
/* Initialize data of hyperslab */
- for (j = 0; j < (size_t)size[1]; j++) {
+ for(j = 0; j < (size_t)size[1]; j++) {
orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0;
/* even-numbered values are negtive */
@@ -4545,7 +4547,7 @@ test_scaleoffset_double_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* only data in the hyperslab will be written, other value should be fill value */
- if (H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
+ if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
orig_data) < 0) goto error;
PASSED();
#else
@@ -4561,12 +4563,12 @@ test_scaleoffset_double_2(hid_t file)
#ifdef H5_HAVE_FILTER_SCALEOFFSET
/* Read the dataset back */
- if (H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
+ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT,
new_data) < 0) goto error;
/* Check that the values read are the same as the values written */
- for (j=0; j<(size_t)size[1]; j++) {
- if (HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -7.0)) {
+ for(j=0; j<(size_t)size[1]; j++) {
+ if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -7.0)) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j);
@@ -4578,10 +4580,10 @@ test_scaleoffset_double_2(hid_t file)
* Cleanup
*----------------------------------------------------------------------
*/
- if (H5Tclose(datatype) < 0) goto error;
- if (H5Pclose(dc) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Tclose(datatype) < 0) goto error;
+ if(H5Pclose(dc) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
PASSED();
#else
@@ -4627,7 +4629,7 @@ test_multiopen (hid_t file)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk(dcpl, 1, cur_size) < 0) goto error;
if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
- if((dset1 = H5Dcreate(file, "multiopen", H5T_NATIVE_INT, space, dcpl)) < 0) goto error;
+ if((dset1 = H5Dcreate2(file, "multiopen", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if((dset2 = H5Dopen2(dset1, ".", H5P_DEFAULT)) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
@@ -4692,61 +4694,61 @@ test_types(hid_t file)
/* bitfield_1 */
nelmts = sizeof(buf);
- if ((type=H5Tcopy(H5T_STD_B8LE)) < 0 ||
+ if((type=H5Tcopy(H5T_STD_B8LE)) < 0 ||
(space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT)) < 0)
+ (dset=H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
- if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Tclose(type) < 0) goto error;
- if (H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* bitfield_2 */
nelmts = sizeof(buf)/2;
- if ((type=H5Tcopy(H5T_STD_B16LE)) < 0 ||
+ if((type=H5Tcopy(H5T_STD_B16LE)) < 0 ||
(space=H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset=H5Dcreate(grp, "bitfield_2", type, space, H5P_DEFAULT)) < 0)
+ (dset=H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
- if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ for(i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Tclose(type) < 0) goto error;
- if (H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* opaque_1 */
nelmts = sizeof(buf);
if((type = H5Tcreate(H5T_OPAQUE, (size_t)1)) < 0 ||
H5Tset_tag(type, "testing 1-byte opaque type") < 0 ||
(space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset = H5Dcreate(grp, "opaque_1", type, space, H5P_DEFAULT)) < 0)
+ (dset = H5Dcreate2(grp, "opaque_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Tclose(type) < 0) goto error;
- if (H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* opaque_2 */
nelmts = sizeof(buf)/4;
if((type = H5Tcreate(H5T_OPAQUE, (size_t)4)) < 0 ||
H5Tset_tag(type, "testing 4-byte opaque type") < 0 ||
(space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset = H5Dcreate(grp, "opaque_2", type, space, H5P_DEFAULT)) < 0)
+ (dset = H5Dcreate2(grp, "opaque_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
for(i = 0; i < sizeof buf; i++)
buf[i] = (unsigned char)0xff ^ (unsigned char)i;
if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Tclose(type) < 0) goto error;
- if (H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* Cleanup */
- if (H5Gclose(grp) < 0) goto error;
+ if(H5Gclose(grp) < 0) goto error;
PASSED();
return 0;
@@ -4822,7 +4824,7 @@ test_can_apply(hid_t file)
}
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
@@ -4831,9 +4833,9 @@ test_can_apply(hid_t file)
/* Create new dataset */
/* (Should fail because the 'can apply' filter should indicate inappropriate combination) */
H5E_BEGIN_TRY {
- dsid = H5Dcreate(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_DOUBLE, sid, dcpl);
+ dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- if (dsid >=0) {
+ if(dsid >=0) {
H5_FAILED();
printf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
H5Dclose(dsid);
@@ -4841,21 +4843,21 @@ test_can_apply(hid_t file)
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
+ if((dsid = H5Dcreate2(file, DSET_CAN_APPLY_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
} /* end if */
/* Flush the file (to clear the cache) */
- if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
+ if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) {
H5_FAILED();
printf(" Line %d: Error flushing file\n",__LINE__);
goto error;
@@ -4876,7 +4878,7 @@ test_can_apply(hid_t file)
} /* end if */
/* Read data */
- if (H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
+ if(H5Dread(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) {
H5_FAILED();
printf(" Line %d: Error reading dataset data\n",__LINE__);
goto error;
@@ -4884,9 +4886,9 @@ test_can_apply(hid_t file)
/* Compare data */
/* Check that the values read are the same as the values written */
- for (i=0; i<(size_t)dims[0]; i++) {
- for (j=0; j<(size_t)dims[1]; j++) {
- if (points[i][j] != check[i][j]) {
+ for(i=0; i<(size_t)dims[0]; i++) {
+ for(j=0; j<(size_t)dims[1]; j++) {
+ if(points[i][j] != check[i][j]) {
H5_FAILED();
printf(" Line %d: Read different values than written.\n",__LINE__);
printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@@ -4965,9 +4967,9 @@ file)
#ifdef H5_HAVE_FILTER_SZIP
- if (h5_szip_can_encode() == 1) {
+ if(h5_szip_can_encode() == 1) {
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
@@ -5019,9 +5021,9 @@ file)
/* (Should succeed; according to the new algorithm, scanline should be reset
to 2*128 satisfying 'maximum blocks per scanline' condition) */
H5E_BEGIN_TRY {
- dsid = H5Dcreate(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, dcpl);
+ dsid = H5Dcreate2(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- if (dsid <=0) {
+ if(dsid <=0) {
H5_FAILED();
printf(" Line %d: Should have created dataset!\n",__LINE__);
goto error;
@@ -5049,7 +5051,7 @@ file)
} /* end if */
/* Create another data space */
- if ((sid = H5Screate_simple(2, dims2, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims2, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
@@ -5078,9 +5080,9 @@ file)
/* Create new dataset */
/* (Should fail because the 'can apply' filter should indicate inappropriate combination) */
H5E_BEGIN_TRY {
- dsid = H5Dcreate(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, dcpl);
+ dsid = H5Dcreate2(file, DSET_CAN_APPLY_SZIP_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- if (dsid >=0) {
+ if(dsid >=0) {
H5_FAILED();
printf(" Line %d: Shouldn't have created dataset!\n",__LINE__);
H5Dclose(dsid);
@@ -5166,14 +5168,14 @@ test_set_local(hid_t fapl)
/* Initialize the integer & floating-point dataset */
n=1.0;
- for (i = 0; i < DSET_DIM1; i++)
- for (j = 0; j < DSET_DIM2; j++) {
+ for(i = 0; i < DSET_DIM1; i++)
+ for(j = 0; j < DSET_DIM2; j++) {
points[i][j] = (int)n++;
points_dbl[i][j] = (double)1.5*n++;
}
/* Open file */
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
+ if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open file\n",__LINE__);
goto error;
@@ -5202,21 +5204,21 @@ test_set_local(hid_t fapl)
}
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) {
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) {
H5_FAILED();
printf(" Line %d: Can't open dataspace\n",__LINE__);
goto error;
} /* end if */
/* Create new dataset */
- if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, dcpl)) < 0) {
+ if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
@@ -5231,14 +5233,14 @@ test_set_local(hid_t fapl)
/* Create new dataset */
/* (Shouldn't get modified by output filter) */
- if ((dsid = H5Dcreate(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, dcpl)) < 0) {
+ if((dsid = H5Dcreate2(file, DSET_SET_LOCAL_NAME_2, H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" Line %d: Can't create dataset\n",__LINE__);
goto error;
} /* end if */
/* Write data */
- if (H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) {
+ if(H5Dwrite(dsid, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, points_dbl) < 0) {
H5_FAILED();
printf(" Line %d: Error writing dataset data\n",__LINE__);
goto error;
@@ -5309,9 +5311,9 @@ test_set_local(hid_t fapl)
/* Compare data */
/* Check that the values read are the modified version of what was written */
- for (i=0; i<dims[0]; i++) {
- for (j=0; j<dims[1]; j++) {
- if ((points[i][j]+(int)sizeof(int)) != check[i][j]) {
+ for(i=0; i<dims[0]; i++) {
+ for(j=0; j<dims[1]; j++) {
+ if((points[i][j]+(int)sizeof(int)) != check[i][j]) {
H5_FAILED();
printf(" Line %d: Read different values than written.\n",__LINE__);
printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@@ -5359,8 +5361,8 @@ test_set_local(hid_t fapl)
/* Compare data */
/* Check that the values read are the modified version of what was written */
- for (i=0; i<dims[0]; i++) {
- for (j=0; j<dims[1]; j++) {
+ for(i=0; i<dims[0]; i++) {
+ for(j=0; j<dims[1]; j++) {
/* If the difference between two values is greater than 0.001%, they're
* considered not equal. */
if(!DBL_REL_EQUAL(points_dbl[i][j],check_dbl[i][j],0.00001)) {
@@ -5382,7 +5384,7 @@ test_set_local(hid_t fapl)
} /* end if */
/* Close file */
- if (H5Fclose(file) < 0) {
+ if(H5Fclose(file) < 0) {
H5_FAILED();
printf(" Line %d: Can't close file\n",__LINE__);
goto error;
@@ -5425,7 +5427,7 @@ test_compare_dcpl(hid_t file)
TESTING("comparing dataset creation property lists");
/* Create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
/* Create dcpl with special filter */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
@@ -5437,19 +5439,19 @@ test_compare_dcpl(hid_t file)
#endif /* H5_HAVE_FILTER_DEFLATE */
/* Create first dataset */
- if ((dsid = H5Dcreate(file, DSET_COMPARE_DCPL_NAME, H5T_NATIVE_INT, sid, dcpl)) <0) TEST_ERROR
+ if((dsid = H5Dcreate2(file, DSET_COMPARE_DCPL_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get copy of dataset's dataset creation property list */
- if ((dcpl1=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
+ if((dcpl1=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
/* Close dataset */
if(H5Dclose (dsid) < 0) TEST_ERROR
/* Create second dataset */
- if ((dsid = H5Dcreate(file, DSET_COMPARE_DCPL_NAME_2, H5T_NATIVE_INT, sid, dcpl)) <0) TEST_ERROR
+ if((dsid = H5Dcreate2(file, DSET_COMPARE_DCPL_NAME_2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
/* Get copy of dataset's dataset creation property list */
- if ((dcpl2=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
+ if((dcpl2=H5Dget_create_plist(dsid)) < 0) TEST_ERROR
/* Close dataset */
if(H5Dclose (dsid) < 0) TEST_ERROR
@@ -5515,40 +5517,40 @@ test_filter_delete(hid_t file)
#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
/* create the data space */
- if ((sid = H5Screate_simple(2, dims, NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(2, dims, NULL)) < 0) goto error;
/* create dcpl */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk(dcpl, 2, chunk_dims) < 0) goto error;
- if (H5Pset_fletcher32 (dcpl) < 0) goto error;
- if (H5Pset_deflate (dcpl, 6) < 0) goto error;
- if (H5Pset_shuffle (dcpl) < 0) goto error;
+ if(H5Pset_fletcher32 (dcpl) < 0) goto error;
+ if(H5Pset_deflate (dcpl, 6) < 0) goto error;
+ if(H5Pset_shuffle (dcpl) < 0) goto error;
/* create a dataset */
- if ((dsid = H5Dcreate(file,"dsetdel", H5T_NATIVE_INT, sid, dcpl)) <0) goto error;
+ if((dsid = H5Dcreate2(file,"dsetdel", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
/* get copy of dataset's dataset creation property list */
- if ((dcpl1=H5Dget_create_plist(dsid)) < 0) goto error;
+ if((dcpl1=H5Dget_create_plist(dsid)) < 0) goto error;
/*----------------------------------------------------------------------
* delete the deflate filter
*----------------------------------------------------------------------
*/
/* delete the deflate filter */
- if (H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE) < 0) goto error;
+ if(H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE) < 0) goto error;
/* get information about filters */
- if ((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
+ if((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
/* check if filter was deleted */
- for (i=0; i<nfilters; i++) {
+ for(i=0; i<nfilters; i++) {
#ifdef H5_WANT_H5_V1_6_COMPAT
filtn = H5Pget_filter(dcpl1, (unsigned)i, NULL, NULL, NULL, (size_t)0, NULL);
#else
filtn = H5Pget_filter(dcpl1, (unsigned)i, NULL, NULL, NULL, (size_t)0, NULL, NULL);
#endif
- if (H5Z_FILTER_DEFLATE==filtn)
+ if(H5Z_FILTER_DEFLATE==filtn)
goto error;
}
@@ -5556,7 +5558,7 @@ test_filter_delete(hid_t file)
H5E_BEGIN_TRY {
ret=H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE);
} H5E_END_TRY;
- if (ret >=0) {
+ if(ret >=0) {
H5_FAILED();
printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__);
goto error;
@@ -5567,13 +5569,13 @@ test_filter_delete(hid_t file)
*----------------------------------------------------------------------
*/
/* delete all filters */
- if (H5Premove_filter(dcpl1,H5Z_FILTER_ALL) < 0) goto error;
+ if(H5Premove_filter(dcpl1,H5Z_FILTER_ALL) < 0) goto error;
/* get information about filters */
- if ((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
+ if((nfilters = H5Pget_nfilters(dcpl1)) < 0) goto error;
/* check if filters were deleted */
- if (nfilters)goto error;
+ if(nfilters)goto error;
/*----------------------------------------------------------------------
* close
@@ -5581,10 +5583,10 @@ test_filter_delete(hid_t file)
*/
/* clean up objects used for this test */
- if (H5Pclose (dcpl) < 0) goto error;
- if (H5Pclose (dcpl1) < 0) goto error;
- if (H5Dclose (dsid) < 0) goto error;
- if (H5Sclose (sid) < 0) goto error;
+ if(H5Pclose (dcpl) < 0) goto error;
+ if(H5Pclose (dcpl1) < 0) goto error;
+ if(H5Dclose (dsid) < 0) goto error;
+ if(H5Sclose (sid) < 0) goto error;
PASSED();
#else
@@ -5683,7 +5685,7 @@ error:
H5Dclose(dset_id);
H5Tclose(ftype_id);
H5Tclose(mtype_id);
- if (buf)
+ if(buf)
free(buf);
} H5E_END_TRY;
return -1;
@@ -5718,7 +5720,7 @@ test_filters_endianess(hid_t fapl)
char *srcdir = getenv("srcdir"); /* the source directory */
char data_file[512]=""; /* buffer to hold name of existing file */
- for (i=0; i<2; i++){
+ for(i=0; i<2; i++){
buf[i]=1;
}
@@ -5733,25 +5735,25 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fcreate("test_filters.h5", H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
/* create a data space */
- if ((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(rank,dims,NULL)) < 0) goto error;
/* create dcpl */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
if(H5Pset_chunk(dcpl,rank,chunk_dims) < 0) goto error;
- if (H5Pset_fletcher32 (dcpl) < 0) goto error;
+ if(H5Pset_fletcher32 (dcpl) < 0) goto error;
/* create a dataset */
- if ((dsid = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,dcpl)) <0) goto error;
+ if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
goto error;
/* close */
- if (H5Pclose (dcpl) < 0) goto error;
- if (H5Dclose (dsid) < 0) goto error;
- if (H5Sclose (sid) < 0) goto error;
- if (H5Fclose (fid) < 0) goto error;
+ if(H5Pclose (dcpl) < 0) goto error;
+ if(H5Dclose (dsid) < 0) goto error;
+ if(H5Sclose (sid) < 0) goto error;
+ if(H5Fclose (fid) < 0) goto error;
/*-------------------------------------------------------------------------
* step 2: open a file written on a little-endian machine in step 1
@@ -5760,7 +5762,7 @@ test_filters_endianess(hid_t fapl)
/* compose the name of the file to open, using the srcdir, if appropriate */
HDstrcpy(data_file, "");
- if ( srcdir ) {
+ if( srcdir ) {
HDstrcpy(data_file, srcdir);
HDstrcat(data_file, "/");
}
@@ -5770,10 +5772,10 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error;
/* read */
- if (auxread_fdata(fid,"dset") < 0) goto error;
+ if(auxread_fdata(fid,"dset") < 0) goto error;
/* close */
- if (H5Fclose(fid) < 0) goto error;
+ if(H5Fclose(fid) < 0) goto error;
/*-------------------------------------------------------------------------
* step 3: open a file written on a big-endian machine in step 1
@@ -5782,7 +5784,7 @@ test_filters_endianess(hid_t fapl)
/* compose the name of the file to open, using the srcdir, if appropriate */
HDstrcpy(data_file, "");
- if ( srcdir ) {
+ if( srcdir ) {
HDstrcpy(data_file, srcdir);
HDstrcat(data_file, "/");
}
@@ -5792,10 +5794,10 @@ test_filters_endianess(hid_t fapl)
if((fid = H5Fopen(data_file, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0) goto error;
/* read */
- if (auxread_fdata(fid,"dset") < 0) goto error;
+ if(auxread_fdata(fid,"dset") < 0) goto error;
/* close */
- if (H5Fclose(fid) < 0) goto error;
+ if(H5Fclose(fid) < 0) goto error;
PASSED();
#else
@@ -5840,7 +5842,7 @@ test_zero_dims(hid_t file)
if((s = H5Screate_simple(1, &dsize, &dmax)) < 0) TEST_ERROR;
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
if(H5Pset_chunk(dcpl, 1, &csize) < 0) TEST_ERROR;
- if((d = H5Dcreate(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
+ if((d = H5Dcreate2(file, ZERODIM_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
if(H5Dwrite(d, H5T_NATIVE_INT, s, s, H5P_DEFAULT, (void*)911) < 0) TEST_ERROR;
@@ -5912,14 +5914,14 @@ test_missing_chunk(hid_t file)
if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, NULL) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, MISSING_CHUNK_DATASET, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
+ if((d = H5Dcreate2(file, MISSING_CHUNK_DATASET, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Select elements in every other chunk */
hs_start[0]=0;
hs_stride[0]=10;
hs_count[0]=10;
hs_block[0]=5;
- if (H5Sselect_hyperslab(s, H5S_SELECT_SET, hs_start, hs_stride, hs_count,
+ if(H5Sselect_hyperslab(s, H5S_SELECT_SET, hs_start, hs_stride, hs_count,
hs_block) < 0) TEST_ERROR;
/* Write selected data */
@@ -6000,7 +6002,7 @@ test_random_chunks(void)
assert(NPOINTS < 100);
/* Create file for first test */
- if ((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((file = H5Fcreate(RC_FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create dataspace */
if((s = H5Screate_simple(2, dsize, NULL)) < 0) TEST_ERROR;
@@ -6012,18 +6014,18 @@ test_random_chunks(void)
if(H5Pset_chunk(dcpl, 2, csize) < 0) TEST_ERROR;
/* Set early allocation time */
- if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
+ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
+ if((d = H5Dcreate2(file, dname, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Initialization of check array for repeated coordinates */
- for (i=0; i<dsize[0]/csize[0]; i++)
- for (j=0; j<dsize[1]/csize[1]; j++)
+ for(i=0; i<dsize[0]/csize[0]; i++)
+ for(j=0; j<dsize[1]/csize[1]; j++)
check2[i][j] = 0;
/* Generate random point coordinates. Only one point is selected per chunk */
- for (i=0; i<NPOINTS; i++){
+ for(i=0; i<NPOINTS; i++){
do {
chunk_row = (int)HDrandom () % (dsize[0]/csize[0]);
chunk_col = (int)HDrandom () % (dsize[1]/csize[1]);
@@ -6101,7 +6103,7 @@ test_random_chunks(void)
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR;
/* Create dataset */
- if((d = H5Dcreate(file, dname, H5T_NATIVE_INT, s, dcpl)) < 0) TEST_ERROR;
+ if((d = H5Dcreate2(file, dname, H5T_NATIVE_INT, s, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Extend both dimensions of the dataset */
if(H5Dset_extent(d, nsize) < 0) TEST_ERROR;
@@ -6231,7 +6233,7 @@ test_deprec(hid_t file)
* Create a dataset using the default dataset creation properties. We're
* not sure what they are, so we won't check.
*/
- if(( dataset = H5Dcreate(file, DSET_DEPREC_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT)) < 0) goto error;
/* Close the dataset */
if(H5Dclose(dataset) < 0) goto error;
@@ -6242,7 +6244,7 @@ test_deprec(hid_t file)
* reporting.
*/
H5E_BEGIN_TRY {
- dataset = H5Dcreate(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
+ dataset = H5Dcreate1(file, DSET_DEFAULT_NAME, H5T_NATIVE_DOUBLE, space,
H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
@@ -6285,7 +6287,7 @@ test_deprec(hid_t file)
status = H5Pset_chunk(create_parms, 2, csize);
assert(status >= 0);
H5E_BEGIN_TRY {
- dataset = H5Dcreate(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space,
+ dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space,
create_parms);
} H5E_END_TRY;
if(dataset >= 0) {
@@ -6299,13 +6301,13 @@ test_deprec(hid_t file)
status = H5Pset_chunk(create_parms, 2, csize);
assert(status >= 0);
- if((dataset = H5Dcreate(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error;
+ if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_CHUNKED, H5T_NATIVE_DOUBLE, space, create_parms)) < 0) goto error;
H5Pclose(create_parms);
/*
* Close the chunked dataset.
*/
- if (H5Dclose(dataset) < 0) goto error;
+ if(H5Dclose(dataset) < 0) goto error;
/*
@@ -6325,7 +6327,7 @@ test_deprec(hid_t file)
status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY);
assert(status >= 0);
- if(( dataset = H5Dcreate(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) goto error;
+ if((dataset = H5Dcreate1(file, DSET_DEPREC_NAME_COMPACT, H5T_NATIVE_DOUBLE, small_space, create_parms)) < 0) goto error;
H5Pclose(create_parms);
if(H5Dclose(dataset) < 0) goto error;
diff --git a/test/dtransform.c b/test/dtransform.c
index 3b53aed..b1bca24 100644
--- a/test/dtransform.c
+++ b/test/dtransform.c
@@ -107,28 +107,28 @@ const int transformData[ROWS][COLS] =
hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, dset; \
hsize_t dim[2] = {ROWS, COLS}; \
\
- if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; \
- if((dset = H5Dcreate(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT))<0) TEST_ERROR; \
+ if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \
+ if((dset = H5Dcreate2(file_id, "/transformtest_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; \
\
if(SIGNED) \
{ \
- if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \
- if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; \
- if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; \
- if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR; \
+ if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
+ if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \
+ if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \
} \
else \
{ \
- if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \
- if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; \
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData)<0) TEST_ERROR; \
- if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR; \
+ if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
+ if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \
+ if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \
} \
\
\
TESTING("contiguous, no data type conversion ("TEST_STR"->"TEST_STR")") \
\
- if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array)<0) TEST_ERROR; \
+ if(H5Dread(dset, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \
if(SIGNED) \
COMPARE(TYPE, array, COMPARE_DATA, 2) \
else \
@@ -138,15 +138,15 @@ const int transformData[ROWS][COLS] =
{ \
TESTING("contiguous, with type conversion (float->"TEST_STR")") \
\
- if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array)<0) TEST_ERROR; \
+ if(H5Dread(dset_id_float, HDF_TYPE, H5S_ALL, H5S_ALL, XFORM, array) < 0) TEST_ERROR; \
if(SIGNED) \
COMPARE(TYPE, array, COMPARE_DATA, 2) \
else \
UCOMPARE(TYPE, array, COMPARE_DATA, 4) \
} \
\
- if(H5Dclose(dset)<0) TEST_ERROR; \
- if(H5Sclose(dataspace)<0) TEST_ERROR; \
+ if(H5Dclose(dset) < 0) TEST_ERROR; \
+ if(H5Sclose(dataspace) < 0) TEST_ERROR; \
}
#define TEST_TYPE_CHUNK(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \
@@ -161,35 +161,35 @@ const int transformData[ROWS][COLS] =
hsize_t offset[2] = {0, 0}; \
\
\
- if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; \
+ if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR; \
\
cparms = H5Pcreate(H5P_DATASET_CREATE); \
if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR; \
\
- if((dset_chunk = H5Dcreate(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, cparms))<0) TEST_ERROR; \
+ if((dset_chunk = H5Dcreate2(file_id, "/transformtest_chunk_"TEST_STR, HDF_TYPE, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR; \
filespace = H5Dget_space (dset_chunk); \
memspace = H5Screate_simple(2, dim, NULL); \
if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; \
\
if(SIGNED) \
{ \
- if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \
- if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; \
- if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; \
- if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR; \
+ if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
+ if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR; \
+ if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR; \
} \
else \
{ \
- if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; \
- if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; \
- if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData)<0) TEST_ERROR; \
- if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR; \
+ if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR; \
+ if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR; \
+ if(H5Dwrite(dset_chunk, H5T_NATIVE_INT, dataspace, filespace, dxpl_id_utrans, transformData) < 0) TEST_ERROR; \
+ if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR; \
} \
\
\
TESTING("chunked, no data type conversion ("TEST_STR"->"TEST_STR")") \
\
- if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array)<0) TEST_ERROR; \
+ if(H5Dread(dset_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \
if(SIGNED) \
COMPARE(TYPE, array, COMPARE_DATA, 2) \
else \
@@ -199,7 +199,7 @@ const int transformData[ROWS][COLS] =
{ \
TESTING("chunked, with type conversion (float->"TEST_STR")") \
\
- if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array)<0) TEST_ERROR; \
+ if(H5Dread(dset_id_float_chunk, HDF_TYPE, memspace, filespace, XFORM, array) < 0) TEST_ERROR; \
if(SIGNED) \
COMPARE(TYPE, array, COMPARE_DATA, 2) \
else \
@@ -207,15 +207,15 @@ const int transformData[ROWS][COLS] =
} \
\
\
- if(H5Pclose(cparms)<0) TEST_ERROR; \
- if(H5Dclose(dset_chunk)<0) TEST_ERROR; \
- if(H5Sclose(dataspace)<0) TEST_ERROR; \
- if(H5Sclose(memspace)<0) TEST_ERROR; \
+ if(H5Pclose(cparms) < 0) TEST_ERROR; \
+ if(H5Dclose(dset_chunk) < 0) TEST_ERROR; \
+ if(H5Sclose(dataspace) < 0) TEST_ERROR; \
+ if(H5Sclose(memspace) < 0) TEST_ERROR; \
}
#define INVALID_SET_TEST(TRANSFORM) \
{ \
- if(H5Pset_data_transform(dxpl_id, TRANSFORM)<0) \
+ if(H5Pset_data_transform(dxpl_id, TRANSFORM) < 0) \
{ \
PASSED(); \
} \
@@ -237,16 +237,16 @@ int main(void)
/* inverses the utrans transform in init_test to get back original array */
const char* utrans_inv = "(x/3)*4 - 100";
- if((file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) TEST_ERROR;
-
- if((dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
- if((dxpl_id_simple = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
- if((dxpl_id_utrans_inv = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
- if((dxpl_id_polynomial = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
- if(H5Pset_data_transform(dxpl_id_c_to_f, c_to_f)<0) TEST_ERROR;
- if(H5Pset_data_transform(dxpl_id_polynomial, polynomial)<0) TEST_ERROR;
- if(H5Pset_data_transform(dxpl_id_simple, simple)<0) TEST_ERROR;
- if(H5Pset_data_transform(dxpl_id_utrans_inv, utrans_inv)<0) TEST_ERROR;
+ if((file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
+
+ if((dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
+ if((dxpl_id_simple = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
+ if((dxpl_id_utrans_inv = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
+ if((dxpl_id_polynomial = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
+ if(H5Pset_data_transform(dxpl_id_c_to_f, c_to_f) < 0) TEST_ERROR;
+ if(H5Pset_data_transform(dxpl_id_polynomial, polynomial) < 0) TEST_ERROR;
+ if(H5Pset_data_transform(dxpl_id_simple, simple) < 0) TEST_ERROR;
+ if(H5Pset_data_transform(dxpl_id_utrans_inv, utrans_inv) < 0) TEST_ERROR;
if((dxpl_id_polynomial_copy = H5Pcopy(dxpl_id_polynomial)) < 0) TEST_ERROR;
if((dxpl_id_c_to_f_copy = H5Pcopy(dxpl_id_c_to_f)) < 0) TEST_ERROR;
@@ -317,17 +317,17 @@ int main(void)
if(test_getset(dxpl_id_c_to_f) < 0) TEST_ERROR;
/* Close the objects we opened/created */
- if(H5Dclose(dset_id_int)<0) TEST_ERROR;
- if(H5Dclose(dset_id_int_chunk)<0) TEST_ERROR;
- if(H5Dclose(dset_id_float)<0) TEST_ERROR;
- if(H5Dclose(dset_id_float_chunk)<0) TEST_ERROR;
- if(H5Fclose(file_id)<0) TEST_ERROR;
- if(H5Pclose(dxpl_id_c_to_f)<0) TEST_ERROR;
- if(H5Pclose(dxpl_id_c_to_f_copy)<0) TEST_ERROR;
- if(H5Pclose(dxpl_id_polynomial)<0) TEST_ERROR;
- if(H5Pclose(dxpl_id_polynomial_copy)<0) TEST_ERROR;
- if(H5Pclose(dxpl_id_simple)<0) TEST_ERROR;
- if(H5Pclose(dxpl_id_utrans_inv)<0) TEST_ERROR;
+ if(H5Dclose(dset_id_int) < 0) TEST_ERROR;
+ if(H5Dclose(dset_id_int_chunk) < 0) TEST_ERROR;
+ if(H5Dclose(dset_id_float) < 0) TEST_ERROR;
+ if(H5Dclose(dset_id_float_chunk) < 0) TEST_ERROR;
+ if(H5Fclose(file_id) < 0) TEST_ERROR;
+ if(H5Pclose(dxpl_id_c_to_f) < 0) TEST_ERROR;
+ if(H5Pclose(dxpl_id_c_to_f_copy) < 0) TEST_ERROR;
+ if(H5Pclose(dxpl_id_polynomial) < 0) TEST_ERROR;
+ if(H5Pclose(dxpl_id_polynomial_copy) < 0) TEST_ERROR;
+ if(H5Pclose(dxpl_id_simple) < 0) TEST_ERROR;
+ if(H5Pclose(dxpl_id_utrans_inv) < 0) TEST_ERROR;
return 0;
@@ -346,43 +346,43 @@ int init_test(hid_t file_id)
hsize_t dim[2] = {ROWS, COLS};
hsize_t offset[2] = {0, 0};
- if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
- if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
+ if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
+ if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
- if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR;
- if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR;
+ if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c) < 0) TEST_ERROR;
+ if(H5Pset_data_transform(dxpl_id_utrans, utrans) < 0) TEST_ERROR;
cparms = H5Pcreate(H5P_DATASET_CREATE);
- if(H5Pset_chunk(cparms, 2, dim)<0) TEST_ERROR;
+ if(H5Pset_chunk(cparms, 2, dim) < 0) TEST_ERROR;
- if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR;
+ if((dataspace = H5Screate_simple(2, dim, NULL)) < 0) TEST_ERROR;
TESTING("Intializing test...")
- if((dset_id_int = H5Dcreate(file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT))<0) TEST_ERROR;
- if(H5Dwrite(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR;
+ if((dset_id_int = H5Dcreate2(file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
+ if(H5Dwrite(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR;
- if((dset_id_float = H5Dcreate(file_id, "/default_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT))<0) TEST_ERROR;
- if(H5Dwrite(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR;
+ if((dset_id_float = H5Dcreate2(file_id, "/default_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
+ if(H5Dwrite(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR;
- if((dset_id_int_chunk = H5Dcreate(file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, cparms))<0) TEST_ERROR;
+ if((dset_id_int_chunk = H5Dcreate2(file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR;
filespace = H5Dget_space (dset_id_int_chunk);
if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR;
- if(H5Dwrite(dset_id_int_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR;
+ if(H5Dwrite(dset_id_int_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR;
- if((dset_id_float_chunk = H5Dcreate(file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, cparms))<0) TEST_ERROR;
- if(H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR;
+ if((dset_id_float_chunk = H5Dcreate2(file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR;
+ if(H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat) < 0) TEST_ERROR;
PASSED();
- if(H5Pclose(cparms)<0) TEST_ERROR;
- if(H5Pclose(dxpl_id_f_to_c)<0) TEST_ERROR;
- if(H5Pclose(dxpl_id_utrans)<0) TEST_ERROR;
- if(H5Sclose(dataspace)<0) TEST_ERROR;
+ if(H5Pclose(cparms) < 0) TEST_ERROR;
+ if(H5Pclose(dxpl_id_f_to_c) < 0) TEST_ERROR;
+ if(H5Pclose(dxpl_id_utrans) < 0) TEST_ERROR;
+ if(H5Sclose(dataspace) < 0) TEST_ERROR;
return 0;
error:
@@ -407,7 +407,7 @@ int test_poly(const hid_t dxpl_id_polynomial)
}
TESTING("data transform, polynomial transform (int->float)")
- if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread)<0) TEST_ERROR;
+ if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread) < 0) TEST_ERROR;
COMPARE(float, polyflread, polyflres, 2.0)
@@ -421,7 +421,7 @@ int test_poly(const hid_t dxpl_id_polynomial)
}
TESTING("data transform, polynomial transform (float->int)")
- if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyintread)<0) TEST_ERROR;
+ if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyintread) < 0) TEST_ERROR;
COMPARE(int, polyintread, polyflres, 4)
return 0;
@@ -449,11 +449,11 @@ int test_copy(const hid_t dxpl_id_c_to_f_copy, const hid_t dxpl_id_polynomial_co
TESTING("data transform, linear transform w/ copied property")
- if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f_copy, windchillFintread)<0) TEST_ERROR;
+ if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f_copy, windchillFintread) < 0) TEST_ERROR;
COMPARE(int, windchillFintread, windchillFfloat, 2)
TESTING("data transform, polynomial transform w/ copied property")
- if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial_copy, polyintread)<0) TEST_ERROR;
+ if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_polynomial_copy, polyintread) < 0) TEST_ERROR;
COMPARE(int, polyintread, polyflres, 2)
return 0;
@@ -469,7 +469,7 @@ int test_trivial(const hid_t dxpl_id_simple)
int row, col;
TESTING("data transform, trivial transform, without type conversion")
- if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread)<0) TEST_ERROR;
+ if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFfloatread) < 0) TEST_ERROR;
for(row = 0; row<ROWS; row++)
{
for(col = 0; col<COLS; col++)
@@ -485,7 +485,7 @@ int test_trivial(const hid_t dxpl_id_simple)
PASSED();
TESTING("data transform, trivial transform, with type conversion")
- if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFintread)<0) TEST_ERROR;
+ if(H5Dread(dset_id_float, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl_id_simple, windchillFintread) < 0) TEST_ERROR;
for(row = 0; row<ROWS; row++)
{
for(col = 0; col<COLS; col++)
@@ -525,10 +525,10 @@ int test_getset(const hid_t dxpl_id_c_to_f)
PASSED();
free(ptrgetTest);
- if(H5Pset_data_transform(dxpl_id_c_to_f, simple)<0) TEST_ERROR;
+ if(H5Pset_data_transform(dxpl_id_c_to_f, simple) < 0) TEST_ERROR;
TESTING("data transform, read after reseting of transform property")
- if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread)<0) TEST_ERROR;
+ if(H5Dread(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillFfloatread) < 0) TEST_ERROR;
for(row = 0; row<ROWS; row++)
{
for(col = 0; col<COLS; col++)
@@ -573,7 +573,7 @@ int test_set(void)
const char* str = "(9/5.0)*x + 32";
char* ptrgetTest = malloc(strlen(str)+1);
- if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR;
+ if((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR;
/* Test get before set */
H5Eget_auto2(H5E_DEFAULT,&func,NULL);
diff --git a/test/dtypes.c b/test/dtypes.c
index d509a39..e527757 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -1600,25 +1600,25 @@ test_compound_9(void)
goto error;
} /* end if */
- if((dset_id = H5Dcreate(file,"Dataset",dup_tid,space_id,H5P_DEFAULT)) < 0) {
+ if((dset_id = H5Dcreate2(file, "Dataset", dup_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
printf("Can't create dataset\n");
goto error;
} /* end if */
- if(H5Dwrite(dset_id,dup_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) {
+ if(H5Dwrite(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) {
H5_FAILED(); AT();
printf("Can't write data\n");
goto error;
} /* end if */
- if(H5Dread(dset_id,dup_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata) < 0) {
+ if(H5Dread(dset_id, dup_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
printf("Can't read data\n");
goto error;
} /* end if */
- if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
+ if(rdata.i1 != wdata.i1 || rdata.i2 != wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
H5_FAILED(); AT();
printf("incorrect read data\n");
goto error;
@@ -1810,33 +1810,33 @@ test_compound_10(void)
} /* end if */
dim1[0] = 1;
- if((space_id=H5Screate_simple(1,dim1,NULL)) < 0) {
+ if((space_id = H5Screate_simple(1,dim1,NULL)) < 0) {
H5_FAILED(); AT();
printf("Can't create space\n");
goto error;
} /* end if */
- if((dset_id = H5Dcreate(file,"Dataset",arr_tid,space_id,H5P_DEFAULT)) < 0) {
+ if((dset_id = H5Dcreate2(file, "Dataset", arr_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED(); AT();
printf("Can't create dataset\n");
goto error;
} /* end if */
- if(H5Dwrite(dset_id,arr_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) {
+ if(H5Dwrite(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) {
H5_FAILED(); AT();
printf("Can't write data\n");
goto error;
} /* end if */
- if(H5Dread(dset_id,arr_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata) < 0) {
+ if(H5Dread(dset_id, arr_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata) < 0) {
H5_FAILED(); AT();
printf("Can't read data\n");
goto error;
} /* end if */
- for(i=0; i<ARRAY_DIM; i++) {
- if(rdata[i].i1!=wdata[i].i1 || rdata[i].i2!=wdata[i].i2 ||
- strcmp(rdata[i].str, wdata[i].str)) {
+ for(i = 0; i < ARRAY_DIM; i++) {
+ if(rdata[i].i1 != wdata[i].i1 || rdata[i].i2 != wdata[i].i2 ||
+ HDstrcmp(rdata[i].str, wdata[i].str)) {
H5_FAILED(); AT();
printf("incorrect read data\n");
goto error;
@@ -2498,7 +2498,7 @@ test_transient (hid_t fapl)
/* Create a dataset from a transient datatype */
if(H5Tclose(type) < 0) goto error;
if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) goto error;
- if((dset = H5Dcreate(file, "dset1", type, space, H5P_DEFAULT)) < 0)
+ if((dset = H5Dcreate2(file, "dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
/* The type returned from a dataset should not be modifiable */
@@ -2670,7 +2670,7 @@ test_named (hid_t fapl)
}
/* Create a dataset that uses the named type */
- if((dset = H5Dcreate(file, "dset1", type, space, H5P_DEFAULT)) < 0)
+ if((dset = H5Dcreate2(file, "dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
/* Get the dataset's datatype and make sure it's a named type */
@@ -2701,7 +2701,7 @@ test_named (hid_t fapl)
* first dataset.
*/
if(H5Dclose(dset) < 0) goto error;
- if((dset = H5Dcreate(file, "dset2", t2, space, H5P_DEFAULT)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "dset2", t2, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Reopen the second dataset and make sure the type is shared */
if(H5Tclose(t2) < 0) goto error;
@@ -2735,7 +2735,7 @@ test_named (hid_t fapl)
HDputs (" Copied type should not be a named type!");
goto error;
}
- if((dset = H5Dcreate(file, "dset3", t2, space, H5P_DEFAULT)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "dset3", t2, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
if((t3 = H5Dget_type(dset)) < 0) goto error;
if((status = H5Tcommitted(t3)) < 0) goto error;
if(status) {
diff --git a/test/enum.c b/test/enum.c
index bb50d11..e40965c 100644
--- a/test/enum.c
+++ b/test/enum.c
@@ -148,8 +148,8 @@ test_noconv(hid_t file)
if(H5Tenum_insert(type, "WHITE", CPTR(val, E1_WHITE)) < 0) FAIL_STACK_ERROR
if(H5Tenum_insert(type, "BLACK", CPTR(val, E1_BLACK)) < 0) FAIL_STACK_ERROR
- if((space=H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR
- if((dset=H5Dcreate(cwg, "color_table", type, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((space = H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR
+ if((dset = H5Dcreate2(cwg, "color_table", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dwrite(dset, type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR
if(H5Dread(dset, type, space, space, H5P_DEFAULT, data2) < 0) FAIL_STACK_ERROR
@@ -237,7 +237,7 @@ test_tr1(hid_t file)
if(H5Tenum_insert(f_type, "BLACK", CPTR(ival, 101)) < 0) FAIL_STACK_ERROR
if((space = H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR
- if((dset = H5Dcreate(cwg, "color_table", f_type, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dset = H5Dcreate2(cwg, "color_table", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dwrite(dset, m_type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR
if(H5Dread(dset, m_type, space, space, H5P_DEFAULT, data2) < 0) FAIL_STACK_ERROR
@@ -329,7 +329,7 @@ test_tr2(hid_t file)
if(H5Tenum_insert(f_type, "BLACK", CPTR(val2, 1010)) < 0) FAIL_STACK_ERROR
if((space = H5Screate_simple(1, ds_size, NULL)) < 0) FAIL_STACK_ERROR
- if((dset = H5Dcreate(cwg, "color_table", f_type, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dset = H5Dcreate2(cwg, "color_table", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dwrite(dset, m_type, space, space, H5P_DEFAULT, data1) < 0) FAIL_STACK_ERROR
if(H5Dread(dset, m_type, space, space, H5P_DEFAULT, data2) < 0) FAIL_STACK_ERROR
@@ -350,8 +350,7 @@ test_tr2(hid_t file)
PASSED();
}
- else
- {
+ else {
SKIPPED();
puts(" Test not compatible with current Virtual File Driver");
}
diff --git a/test/err_compat.c b/test/err_compat.c
index beb6bfc..33c172f 100644
--- a/test/err_compat.c
+++ b/test/err_compat.c
@@ -81,14 +81,14 @@ test_error(hid_t file)
/* Test H5E_BEGIN_TRY */
H5E_BEGIN_TRY {
- dataset = H5Dcreate(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_NAME, H5T_STD_I32BE, space,
- H5P_DEFAULT))<0) {
+ if ((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5Epush1(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE,
- "H5Dcreate failed");
+ "H5Dcreate2 failed");
goto error;
}
diff --git a/test/error_test.c b/test/error_test.c
index 3b3b617..97da864 100644
--- a/test/error_test.c
+++ b/test/error_test.c
@@ -64,7 +64,7 @@ hid_t ERR_MIN_GETNUM;
#define ERR_MAJ_API_MSG "Error in API"
#define ERR_MIN_SUBROUTINE_MSG "Error in subroutine"
#define ERR_MIN_ERRSTACK_MSG "Error in error stack"
-#define ERR_MIN_CREATE_MSG "Error in H5Dcreate"
+#define ERR_MIN_CREATE_MSG "Error in H5Dcreate2"
#define ERR_MIN_WRITE_MSG "Error in H5Dwrite"
#define ERR_MIN_GETNUM_MSG "Error in H5Eget_num"
@@ -114,13 +114,13 @@ test_error(hid_t file)
/* Test H5E_BEGIN_TRY */
H5E_BEGIN_TRY {
- dataset = H5Dcreate(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT)) < 0) {
+ if((dataset = H5Dcreate2(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5Epush(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE,
- "H5Dcreate failed");
+ "H5Dcreate2 failed");
goto error;
} /* end if */
diff --git a/test/extend.c b/test/extend.c
index 64037fa..2248b5d 100644
--- a/test/extend.c
+++ b/test/extend.c
@@ -61,7 +61,7 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me
TESTING(msg);
/* Create the dataset */
- if((dataset = H5Dcreate(file, name, H5T_NATIVE_INT, mem_space, cparms)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, name, H5T_NATIVE_INT, mem_space, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write the data */
for(i = 0; i < 5; i++)
@@ -157,7 +157,7 @@ write_data_deprec(const char *msg, hid_t file, const char *name, hid_t cparms, h
TESTING(msg);
/* Create the dataset */
- if((dataset = H5Dcreate(file, name, H5T_NATIVE_INT, mem_space, cparms)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, name, H5T_NATIVE_INT, mem_space, H5P_DEFAULT, cparms, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write the data */
for(i = 0; i < 5; i++)
diff --git a/test/external.c b/test/external.c
index 20ece60..44e586d 100644
--- a/test/external.c
+++ b/test/external.c
@@ -113,7 +113,7 @@ test_1a(hid_t file)
if(H5Pset_external(dcpl, "ext1.data", (off_t)0,
(hsize_t)(max_size[0] * sizeof(int))) < 0) goto error;
if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
- if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl)) < 0)
+ if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
if(H5Dclose(dset) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
@@ -183,28 +183,29 @@ test_1a(hid_t file)
static int
test_1b(hid_t file)
{
- hid_t dcpl=-1; /*dataset creation properties */
- hid_t space=-1; /*data space */
- hid_t dset=-1; /*dataset */
+ hid_t dcpl = -1; /*dataset creation properties */
+ hid_t space = -1; /*data space */
+ hid_t dset = -1; /*dataset */
hsize_t cur_size[1]; /*current data space size */
hsize_t max_size[1]; /*maximum data space size */
TESTING("external storage is too small");
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = max_size[0] = 100;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)-1)) < 0) goto error;
- if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error;
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0,
+ (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) goto error;
+ if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
H5E_BEGIN_TRY {
- dset = H5Dcreate (file, "dset2", H5T_NATIVE_INT, space, dcpl);
+ dset = H5Dcreate2(file, "dset2", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- if (dset>=0) {
+ if(dset >= 0) {
H5_FAILED();
puts(" Small external file succeeded instead of failing.");
goto error;
}
- if (H5Sclose (space) < 0) goto error;
- if (H5Pclose (dcpl) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+
PASSED();
return 0;
@@ -246,21 +247,23 @@ test_1c(hid_t file)
hsize_t max_size[1]; /*maximum data space size */
TESTING("extendible dataspace, exact external size");
- if((dcpl=H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error;
+
+ if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = 100;
max_size[0] = 200;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int))) < 0) goto error;
- if ((space = H5Screate_simple (1, cur_size, max_size)) < 0) goto error;
- if ((dset = H5Dcreate (file, "dset3", H5T_NATIVE_INT, space, dcpl)) < 0)
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0,
+ (hsize_t)(max_size[0] * sizeof(int))) < 0) goto error;
+ if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "dset3", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dclose (dset) < 0) goto error;
- if (H5Sclose (space) < 0) goto error;
- if (H5Pclose (dcpl) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+
PASSED();
return 0;
- error:
+error:
H5E_BEGIN_TRY {
H5Dclose(dset);
H5Pclose(dcpl);
@@ -297,22 +300,24 @@ test_1d(hid_t file)
hsize_t max_size[1]; /*maximum data space size */
TESTING("extendible dataspace, external storage is too small");
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = 100;
max_size[0] = 200;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
- (hsize_t)(max_size[0]*sizeof(int)-1)) < 0) goto error;
- if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0,
+ (hsize_t)(max_size[0] * sizeof(int) - 1)) < 0) goto error;
+ if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
H5E_BEGIN_TRY {
- dset = H5Dcreate (file, "dset4", H5T_NATIVE_INT, space, dcpl);
+ dset = H5Dcreate2(file, "dset4", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- if (dset>=0) {
+ if(dset >= 0) {
H5_FAILED();
puts(" Small external file succeeded instead of failing.");
goto error;
}
- if (H5Sclose (space) < 0) goto error;
- if (H5Pclose (dcpl) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+
PASSED();
return 0;
@@ -364,7 +369,7 @@ test_1e(hid_t file)
cur_size[0] = 100;
max_size[0] = H5S_UNLIMITED;
if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
- if((dset = H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl)) < 0)
+ if((dset = H5Dcreate2(file, "dset5", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
if(H5Dclose(dset) < 0) goto error;
if(H5Sclose(space) < 0) goto error;
@@ -437,26 +442,28 @@ test_1f(hid_t file)
hsize_t max_size[1]; /*data space maximum size */
TESTING("multiple external files");
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
cur_size[0] = max_size[0] = 100;
- if (H5Pset_external(dcpl, "ext1.data", (off_t)0,
+ if(H5Pset_external(dcpl, "ext1.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error;
- if (H5Pset_external(dcpl, "ext2.data", (off_t)0,
+ if(H5Pset_external(dcpl, "ext2.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error;
- if (H5Pset_external(dcpl, "ext3.data", (off_t)0,
+ if(H5Pset_external(dcpl, "ext3.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error;
- if (H5Pset_external(dcpl, "ext4.data", (off_t)0,
+ if(H5Pset_external(dcpl, "ext4.data", (off_t)0,
(hsize_t)(max_size[0]*sizeof(int)/4)) < 0) goto error;
- if ((space=H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
- if ((dset=H5Dcreate(file, "dset6", H5T_NATIVE_INT, space, dcpl)) < 0)
+ if((space = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "dset6", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dclose(dset) < 0) goto error;
- if (H5Sclose(space) < 0) goto error;
- if (H5Pclose(dcpl) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+
PASSED();
return 0;
- error:
+error:
H5E_BEGIN_TRY {
H5Dclose(dset);
H5Pclose(dcpl);
@@ -638,33 +645,32 @@ test_2 (hid_t fapl)
goto error;
cur_size = 100;
if((space = H5Screate_simple(1, &cur_size, NULL)) < 0) goto error;
- if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
/*
* Read the entire dataset and compare with the original
*/
memset(whole, 0, sizeof(whole));
if(H5Dread(dset, H5T_NATIVE_INT, space, space, H5P_DEFAULT, whole) < 0) goto error;
- for(i = 0; i < 100; i++) {
- if (whole[i]!=(signed)i) {
+ for(i = 0; i < 100; i++)
+ if(whole[i] != (signed)i) {
H5_FAILED();
puts(" Incorrect value(s) read.");
goto error;
- }
- }
+ } /* end if */
/*
* Read the middle of the dataset
*/
- if ((hs_space=H5Scopy(space)) < 0) goto error;
- if (H5Sselect_hyperslab(hs_space, H5S_SELECT_SET, &hs_start, NULL,
+ if((hs_space = H5Scopy(space)) < 0) goto error;
+ if(H5Sselect_hyperslab(hs_space, H5S_SELECT_SET, &hs_start, NULL,
&hs_count, NULL) < 0) goto error;
- memset(whole, 0, sizeof(whole));
- if (H5Dread (dset, H5T_NATIVE_INT, hs_space, hs_space, H5P_DEFAULT,
+ HDmemset(whole, 0, sizeof(whole));
+ if(H5Dread(dset, H5T_NATIVE_INT, hs_space, hs_space, H5P_DEFAULT,
whole) < 0) goto error;
- if (H5Sclose (hs_space) < 0) goto error;
- for (i=hs_start; i<hs_start+hs_count; i++) {
- if (whole[i]!=(signed)i) {
+ if(H5Sclose(hs_space) < 0) goto error;
+ for(i = hs_start; i<hs_start+hs_count; i++) {
+ if(whole[i] != (signed)i) {
H5_FAILED();
puts(" Incorrect value(s) read.");
goto error;
@@ -755,7 +761,7 @@ test_3 (hid_t fapl)
/* Create the dataset */
if((mem_space = H5Screate_simple(1, &cur_size, &max_size)) < 0) goto error;
if((file_space = H5Scopy(mem_space)) < 0) goto error;
- if((dset = H5Dcreate(file, "dset1", H5T_NATIVE_INT, file_space, dcpl)) < 0)
+ if((dset = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, file_space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* Write the entire dataset and compare with the original */
diff --git a/test/fillval.c b/test/fillval.c
index 2d4d136..acbd2b9 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -322,7 +322,7 @@ test_getset_vl(hid_t fapl)
/* Write an dataset of this type. */
if((spaceid = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
- if((datasetid = H5Dcreate(fileid, "Dataset", typeid, spaceid, plistid)) < 0) TEST_ERROR
+ if((datasetid = H5Dcreate2(fileid, "Dataset", typeid, spaceid, H5P_DEFAULT, plistid, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close IDs (except datatype) */
if(H5Dclose(datasetid) < 0) TEST_ERROR
@@ -432,7 +432,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(H5Pget_fill_value(dcpl, comp_type_id, &fill_ctype) < 0) goto error;
fill_ctype.y = 4444;
if(H5Pset_fill_value(dcpl, comp_type_id, &fill_ctype) < 0) goto error;
- if((dset9 = H5Dcreate(file, "dset9", comp_type_id, space, dcpl)) < 0)
+ if((dset9 = H5Dcreate2(file, "dset9", comp_type_id, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* The three datasets test three fill
@@ -443,26 +443,26 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
#ifndef NO_FILLING
if(H5Pset_fill_value(dcpl, H5T_NATIVE_SHORT, &fill_s) < 0) goto error;
#endif
- if((dset1=H5Dcreate(file, "dset1", H5T_NATIVE_LONG, space, dcpl)) < 0)
+ if((dset1=H5Dcreate2(file, "dset1", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 3. Large to small fill conversion */
#ifndef NO_FILLING
if(H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0) goto error;
#endif
- if((dset2=H5Dcreate(file, "dset2", H5T_NATIVE_SHORT, space, dcpl)) < 0)
+ if((dset2=H5Dcreate2(file, "dset2", H5T_NATIVE_SHORT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 4. No conversion */
#ifndef NO_FILLING
if(H5Pset_fill_value(dcpl, H5T_NATIVE_LONG, &fill_l) < 0) goto error;
#endif
- if((dset3=H5Dcreate(file, "dset3", H5T_NATIVE_LONG, space, dcpl)) < 0)
+ if((dset3=H5Dcreate2(file, "dset3", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 5. late space allocation and never write fill value */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error;
- if((dset4=H5Dcreate(file, "dset4", H5T_NATIVE_LONG, space, dcpl)) < 0)
+ if((dset4=H5Dcreate2(file, "dset4", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 6. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC.
@@ -470,7 +470,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error;
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
H5E_BEGIN_TRY {
- if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL)
+ if(H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)!=FAIL)
goto error;
} H5E_END_TRY;
}
@@ -490,7 +490,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
if(H5Pget_fill_value(dcpl, comp_type_id, &fill_ctype) < 0) goto error;
fill_ctype.y = 4444;
if(H5Pset_fill_value(dcpl, comp_type_id, &fill_ctype) < 0) goto error;
- if((dset8 = H5Dcreate(file, "dset8", comp_type_id, space, dcpl)) < 0)
+ if((dset8 = H5Dcreate2(file, "dset8", comp_type_id, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
@@ -498,19 +498,19 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout)
/* 2. Never write fill value */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER) < 0) goto error;
- if((dset5 = H5Dcreate(file, "dset5", H5T_NATIVE_INT, space, dcpl)) < 0)
+ if((dset5 = H5Dcreate2(file, "dset5", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 3. Write fill value at space allocation time */
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
- if((dset6 = H5Dcreate(file, "dset6", H5T_NATIVE_LONG, space, dcpl)) < 0)
+ if((dset6 = H5Dcreate2(file, "dset6", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC.
* Supposed to fail. */
if(H5Pset_fill_value(dcpl, -1, NULL) < 0) goto error;
H5E_BEGIN_TRY {
- if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL)
+ if(H5Dcreate2(file, "dset7", H5T_NATIVE_LONG, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)!=FAIL)
goto error;
} H5E_END_TRY;
@@ -777,9 +777,9 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
/* Create dataset */
if((fspace = H5Screate_simple(5, cur_size, cur_size)) < 0)
goto error;
- if(datatype == H5T_INTEGER && (dset1 = H5Dcreate(file, dname, H5T_NATIVE_INT, fspace, dcpl)) < 0)
+ if(datatype == H5T_INTEGER && (dset1 = H5Dcreate2(file, dname, H5T_NATIVE_INT, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if(datatype == H5T_COMPOUND && (dset2 = H5Dcreate(file, dname, ctype_id, fspace, dcpl)) < 0)
+ if(datatype == H5T_COMPOUND && (dset2 = H5Dcreate2(file, dname, ctype_id, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
/* Read some data and make sure it's the fill value */
@@ -1455,7 +1455,7 @@ test_extend_cases(hid_t file, hid_t _dcpl, const char *dset_name,
if((fspace = H5Screate_simple(5, start_size, max_size)) < 0) TEST_ERROR
/* Create dataset */
- if((dset = H5Dcreate(file, dset_name, dtype, fspace, dcpl)) < 0) TEST_ERROR
+ if((dset = H5Dcreate2(file, dset_name, dtype, fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
/* Set up pointers to elements */
diff --git a/test/flush1.c b/test/flush1.c
index 04345e0..97ddf76 100644
--- a/test/flush1.c
+++ b/test/flush1.c
@@ -64,7 +64,7 @@ create_file(char* name, hid_t fapl)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
if(H5Pset_chunk(dcpl, 2, ch_size) < 0) FAIL_STACK_ERROR
if((space = H5Screate_simple(2, ds_size, NULL)) < 0) FAIL_STACK_ERROR
- if((dset = H5Dcreate(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Write some data */
for(i = 0; i < ds_size[0]; i++)
@@ -82,7 +82,7 @@ create_file(char* name, hid_t fapl)
for(i = 0; i < 100; i++) {
sprintf(name, "grp%02u", (unsigned)i);
if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if(H5Gclose(grp)<0) FAIL_STACK_ERROR
+ if(H5Gclose(grp) < 0) FAIL_STACK_ERROR
} /* end for */
return file;
@@ -117,10 +117,10 @@ extend_file(hid_t file)
size_t i, j;
/* Create a chunked dataset */
- if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dcpl, 2, ch_size)<0) goto error;
- if ((space=H5Screate_simple(2, ds_size, NULL))<0) goto error;
- if ((dset=H5Dcreate(file, "dset2", H5T_NATIVE_FLOAT, space, H5P_DEFAULT))<0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error;
+ if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "dset2", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
/* Write some data */
@@ -135,7 +135,7 @@ extend_file(hid_t file)
}
}
if (H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, H5P_DEFAULT,
- the_data)<0) goto error;
+ the_data) < 0) goto error;
return file;
@@ -185,13 +185,13 @@ main(void)
h5_fixname(FILENAME[0], fapl, name, sizeof name);
file = create_file(name, fapl);
/* Flush and exit without closing the library */
- if (H5Fflush(file, H5F_SCOPE_GLOBAL)<0) goto error;
+ if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) goto error;
/* Create the file */
h5_fixname(FILENAME[2], fapl, name, sizeof name);
file = create_file(name, fapl);
/* Flush and exit without closing the library */
- if (H5Fflush(file, H5F_SCOPE_GLOBAL)<0) goto error;
+ if(H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) goto error;
/* Add a bit to the file and don't flush the new part */
extend_file(file);
diff --git a/test/gen_bogus.c b/test/gen_bogus.c
index 93ed08c..a4daedc 100644
--- a/test/gen_bogus.c
+++ b/test/gen_bogus.c
@@ -56,7 +56,7 @@ int main(void)
if(H5Pinsert(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, H5O_BOGUS_MSG_FLAGS_SIZE, &bogus_flags, NULL, NULL, NULL, NULL, NULL, NULL) < 0) goto error;
/* Create dataset with "bogus" message, but no message flags */
- if((did = H5Dcreate(fid, "/Dataset1", H5T_NATIVE_INT, sid, dcpl)) < 0) goto error;
+ if((did = H5Dcreate2(fid, "/Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did) < 0) goto error;
/* Set "fail if unknown" message flag for bogus message */
@@ -64,7 +64,7 @@ int main(void)
if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error;
/* Create second dataset, with "fail if unknown" message flag */
- if((did = H5Dcreate(fid, "/Dataset2", H5T_NATIVE_INT, sid, dcpl)) < 0) goto error;
+ if((did = H5Dcreate2(fid, "/Dataset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did) < 0) goto error;
/* Set "mark if unknown" message flag for bogus message */
@@ -72,7 +72,7 @@ int main(void)
if(H5Pset(dcpl, H5O_BOGUS_MSG_FLAGS_NAME, &bogus_flags) < 0) goto error;
/* Create second dataset, with "mark if unknown" message flag */
- if((did = H5Dcreate(fid, "/Dataset3", H5T_NATIVE_INT, sid, dcpl)) < 0) goto error;
+ if((did = H5Dcreate2(fid, "/Dataset3", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did) < 0) goto error;
/* Close dataset creation property list */
diff --git a/test/gen_cross.c b/test/gen_cross.c
index 9642577..46afc35 100755
--- a/test/gen_cross.c
+++ b/test/gen_cross.c
@@ -82,8 +82,8 @@ main (void)
* Create a new dataset within the file using defined dataspace and
* datatype and default dataset creation properties.
*/
- dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace,
- H5P_DEFAULT);
+ dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write the data to the dataset using default transfer properties.
diff --git a/test/gen_deflate.c b/test/gen_deflate.c
index 00d6011..16de92e 100644
--- a/test/gen_deflate.c
+++ b/test/gen_deflate.c
@@ -90,7 +90,7 @@ main(void)
printf("H5Pset_deflate() failed!\n");
/* Create the compressed dataset */
- dset = H5Dcreate(file, "Dataset1", H5T_NATIVE_INT, space, dcpl);
+ dset = H5Dcreate2(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
if(dset<0)
printf("dset<0!\n");
diff --git a/test/gen_filters.c b/test/gen_filters.c
index a938531..6d24fb3 100644
--- a/test/gen_filters.c
+++ b/test/gen_filters.c
@@ -57,7 +57,7 @@ test_filters_endianess(void)
if(H5Pset_fletcher32(dcpl) < 0) goto error;
/* create a dataset */
- if((dsid = H5Dcreate(fid, "dset", H5T_NATIVE_INT, sid, dcpl)) < 0) goto error;
+ if((dsid = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
diff --git a/test/gen_new_array.c b/test/gen_new_array.c
index 3e625b9..3f54e79 100644
--- a/test/gen_new_array.c
+++ b/test/gen_new_array.c
@@ -128,7 +128,7 @@ main(void)
printf("field 4 insert<0!\n");
/* Create the dataset with compound array fields */
- dset = H5Dcreate(file, "Dataset1", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dset<0)
printf("dset<0!\n");
H5Dclose(dset);
@@ -142,7 +142,7 @@ main(void)
printf("type<0!\n");
/* Create the dataset with array datatype */
- dset = H5Dcreate(file, "Dataset2", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dset<0)
printf("dset<0!\n");
H5Dclose(dset);
diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c
index 8f0aa45..4ba85ad 100644
--- a/test/gen_new_fill.c
+++ b/test/gen_new_fill.c
@@ -39,40 +39,40 @@ main(void)
int fill_val1 = 4444, fill_val2=5555;
if((file=H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) <0) goto error;
- if((space=H5Screate_simple(2, cur_size, cur_size))<0) goto error;
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((space=H5Screate_simple(2, cur_size, cur_size)) < 0) goto error;
+ if((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* Create a dataset with space being allocated and fill value written */
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error;
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
- if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val1)<0) goto error;
- if((dset1 = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl))<0)
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val1) < 0) goto error;
+ if((dset1 = H5Dcreate2(file, "dset1", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dget_space_status(dset1, &allocation)<0) goto error;
- if (allocation == H5D_SPACE_STATUS_NOT_ALLOCATED) {
+ if(H5Dget_space_status(dset1, &allocation) < 0) goto error;
+ if(allocation == H5D_SPACE_STATUS_NOT_ALLOCATED) {
puts(" Got unallocated space instead of allocated.");
printf(" Got %d\n", allocation);
goto error;
}
- if(H5Dclose(dset1)<0) goto error;
+ if(H5Dclose(dset1) < 0) goto error;
/* Create a dataset with space allocation being delayed */
if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error;
if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
- if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val2)<0) goto error;
- if((dset2 = H5Dcreate(file, "dset2", H5T_NATIVE_INT, space, dcpl))<0)
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val2) < 0) goto error;
+ if((dset2 = H5Dcreate2(file, "dset2", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dget_space_status(dset2, &allocation)<0) goto error;
- if (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) {
+ if(H5Dget_space_status(dset2, &allocation) < 0) goto error;
+ if(allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) {
puts(" Got allocated space instead of unallocated.");
printf(" Got %d\n", allocation);
goto error;
}
- if(H5Dclose(dset2)<0) goto error;
+ if(H5Dclose(dset2) < 0) goto error;
- if(H5Sclose(space)<0) goto error;
- if(H5Pclose(dcpl)<0) goto error;
- if(H5Fclose(file)<0) goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+ if(H5Fclose(file) < 0) goto error;
return 0;
diff --git a/test/gen_new_group.c b/test/gen_new_group.c
index 18a5416..1a57b6f 100644
--- a/test/gen_new_group.c
+++ b/test/gen_new_group.c
@@ -80,11 +80,11 @@ int main(void)
if((gid = H5Gcreate2(fid, "links", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Create dataset in group */
- if((did = H5Dcreate(gid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) goto error;
+ if((did = H5Dcreate2(gid, "dset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did)<0) goto error;
/* Create second dataset in group */
- if((did = H5Dcreate(gid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) goto error;
+ if((did = H5Dcreate2(gid, "dset2", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
if(H5Dclose(did)<0) goto error;
/* Close dataspace */
diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c
index 6ff2635..d7a0f32 100644
--- a/test/gen_new_mtime.c
+++ b/test/gen_new_mtime.c
@@ -63,7 +63,7 @@ main(void)
printf("space<0!\n");
/* Create the dataset with compound array fields */
- dset = H5Dcreate(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dset<0)
printf("dset<0!\n");
diff --git a/test/gen_noencoder.c b/test/gen_noencoder.c
index 9204192..3266374 100644
--- a/test/gen_noencoder.c
+++ b/test/gen_noencoder.c
@@ -55,7 +55,7 @@ main(void)
H5Pset_fill_time(dcpl_id, H5D_FILL_TIME_ALLOC);
/* Create dataset noencoder_szip_dset.h5 */
- dset_id = H5Dcreate(file_id, "noencoder_szip_dset.h5", H5T_NATIVE_INT, space_id, dcpl_id);
+ dset_id = H5Dcreate2(file_id, "noencoder_szip_dset.h5", H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf);
@@ -71,7 +71,7 @@ main(void)
H5Pset_fill_time(dcpl_id, H5D_FILL_TIME_ALLOC);
/* Create dataset noencoder_szip_shuffle_fletcher_dset.h5 */
- dset_id = H5Dcreate(file_id, "noencoder_szip_shuffle_fletcher_dset.h5", H5T_NATIVE_INT, space_id, dcpl_id);
+ dset_id = H5Dcreate2(file_id, "noencoder_szip_shuffle_fletcher_dset.h5", H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf);
diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c
index 385564f..1c422df 100644
--- a/test/gen_nullspace.c
+++ b/test/gen_nullspace.c
@@ -51,7 +51,7 @@ main(void)
assert(sid>0);
/* Create dataset */
- did = H5Dcreate(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
+ did = H5Dcreate2(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(did>0);
/* Close the dataset */
diff --git a/test/gen_old_array.c b/test/gen_old_array.c
index 9163ac7..a4162f2 100644
--- a/test/gen_old_array.c
+++ b/test/gen_old_array.c
@@ -107,7 +107,7 @@ main(void)
printf("field 3 insert<0!\n");
/* Create the dataset with compound non-array fields */
- dset = H5Dcreate(file, "Dataset1", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dset<0)
printf("dset<0!\n");
H5Dclose(dset);
@@ -141,7 +141,7 @@ main(void)
printf("field 4 insert<0!\n");
/* Create the dataset with compound array fields */
- dset = H5Dcreate(file, "Dataset2", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dset<0)
printf("dset<0!\n");
H5Dclose(dset);
diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c
index 1533f8e..312ee58 100644
--- a/test/gen_old_layout.c
+++ b/test/gen_old_layout.c
@@ -82,7 +82,7 @@ main(void)
printf("H5Pset_alloc_time() failed!\n");
/* Create the dataset with deferred storage allocation */
- dset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, space, dcpl);
+ dset = H5Dcreate2(file, "Dataset", H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
if(dset<0)
printf("dset<0!\n");
diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c
index 999184c..ca6012a 100644
--- a/test/gen_old_mtime.c
+++ b/test/gen_old_mtime.c
@@ -63,7 +63,7 @@ main(void)
printf("space<0!\n");
/* Create the dataset with compound array fields */
- dset = H5Dcreate(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dset<0)
printf("dset<0!\n");
diff --git a/test/getname.c b/test/getname.c
index 670489f..685bfbf 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -181,17 +181,17 @@ test_main(hid_t file_id, hid_t fapl)
/*-------------------------------------------------------------------------
- * Test H5Iget_name with H5Dcreate
+ * Test H5Iget_name with H5Dcreate2
*-------------------------------------------------------------------------
*/
- TESTING("H5Iget_name with H5Dcreate");
+ TESTING("H5Iget_name with H5Dcreate2");
/* Create the dataspace */
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dataset_id = H5Dcreate2(file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Verify */
if(check_name(dataset_id, "/d1", "/d1") < 0) TEST_ERROR
@@ -203,7 +203,7 @@ test_main(hid_t file_id, hid_t fapl)
if((group_id = H5Gopen2(file_id, "g1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create a new dataset inside "g1" */
- if((dataset_id = H5Dcreate(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset_id = H5Dcreate2(group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Verify */
if(check_name(dataset_id, "/g1/d1", "/g1/d1") < 0) TEST_ERROR
@@ -265,7 +265,7 @@ test_main(hid_t file_id, hid_t fapl)
/* Create a dataset */
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
- if((dataset_id = H5Dcreate(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dataset_id = H5Dcreate2(group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close */
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
@@ -646,8 +646,8 @@ test_main(hid_t file_id, hid_t fapl)
/* Create two datasets "g11/d" and "g11/g/d"*/
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
- if((dataset_id = H5Dcreate(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((dataset2_id = H5Dcreate(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset_id = H5Dcreate2(group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset2_id = H5Dcreate2(group2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Delete */
if(H5Ldelete(file_id, "/g11/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -688,7 +688,7 @@ test_main(hid_t file_id, hid_t fapl)
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR
/* Create the dataset */
- if((dataset_id = H5Dcreate(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dataset_id = H5Dcreate2(file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close */
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
@@ -990,7 +990,7 @@ test_main(hid_t file_id, hid_t fapl)
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate(group_id , "d", type_id, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset_id = H5Dcreate2(group_id , "d", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Close */
if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
@@ -1064,10 +1064,10 @@ test_main(hid_t file_id, hid_t fapl)
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Delete */
if(H5Ldelete(file2_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -1105,10 +1105,10 @@ test_main(hid_t file_id, hid_t fapl)
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset_id = H5Dcreate2(file2_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create a new dataset */
- if((dataset2_id = H5Dcreate(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset2_id = H5Dcreate2(file3_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Delete */
if(H5Ldelete(file3_id, "/d", H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -1198,7 +1198,7 @@ test_main(hid_t file_id, hid_t fapl)
}
/* Close */
- H5Gclose(group_id);
+ if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR
PASSED();
@@ -1218,7 +1218,7 @@ test_main(hid_t file_id, hid_t fapl)
if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR
/* Create a new dataset */
- if((dataset_id = H5Dcreate(file_id , "d2", type_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dataset_id = H5Dcreate2(file_id , "d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
{
char name[NAME_BUF_SIZE]; /* Buffer to hold name and its size */
@@ -1235,9 +1235,9 @@ test_main(hid_t file_id, hid_t fapl)
}
/* Close */
- H5Dclose(dataset_id);
- H5Sclose(space_id);
- H5Tclose(type_id);
+ if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR
+ if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
+ if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR
PASSED();
@@ -1256,7 +1256,7 @@ test_main(hid_t file_id, hid_t fapl)
/* Also create a dataset and a datatype */
if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR
if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR
- if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset_id = H5Dcreate2(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
@@ -2394,13 +2394,13 @@ test_obj_ref(hid_t fapl)
/* Create a single dataset inside the second file, which will be mounted
* and used to mask objects in the first file */
- if((dataset = H5Dcreate(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(fid2, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0)
FAIL_STACK_ERROR
/* Create a dataset(inside Group1) */
- if((dataset = H5Dcreate(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32LE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Initialize data buffer */
@@ -2416,7 +2416,7 @@ test_obj_ref(hid_t fapl)
FAIL_STACK_ERROR
/* Create another dataset(inside Group1) */
- if((dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Close Dataset */
@@ -2451,7 +2451,7 @@ test_obj_ref(hid_t fapl)
FAIL_STACK_ERROR
/* Create dataset in that group */
- if((dataset = H5Dcreate(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(group2, "Dataset4", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Close Dataset */
@@ -2467,7 +2467,7 @@ test_obj_ref(hid_t fapl)
/* Open up that hard link and make a new dataset there */
if((group = H5Gopen2(fid1, "/Group1/Group2/Link", H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
- if((dataset = H5Dcreate(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(group, "Dataset5", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0)
@@ -2477,7 +2477,7 @@ test_obj_ref(hid_t fapl)
/* Create a dataset to store references */
- if((dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Create reference to dataset */
@@ -2674,7 +2674,7 @@ test_reg_ref(hid_t fapl)
TEST_ERROR
/* Create integer dataset */
- if((dsetv_id = H5Dcreate(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0)
+ if((dsetv_id = H5Dcreate2(file_id, REFREG_DSETNAMEV, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/* Write data to the dataset */
@@ -2684,7 +2684,7 @@ test_reg_ref(hid_t fapl)
TEST_ERROR
/* Dataset with references */
- if((dsetr_id = H5Dcreate(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT)) < 0)
+ if((dsetr_id = H5Dcreate2(file_id, REFREG_DSETNAMER, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR
/*
diff --git a/test/istore.c b/test/istore.c
index 657e150..dfe5c41 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -123,24 +123,24 @@ new_object(hid_t f, const char *name, int ndims, hsize_t dims[], hsize_t cdims[]
hid_t dcpl; /* Dataset creation property list ID */
/* Create the dataset creation property list */
- if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR;
+ if ((dcpl=H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
/* Set the chunk dimensions */
if(H5Pset_chunk(dcpl, ndims, cdims) < 0) TEST_ERROR;
/* Create the dataspace */
- if((space = H5Screate_simple(ndims, dims, NULL))<0) TEST_ERROR;
+ if((space = H5Screate_simple(ndims, dims, NULL)) < 0) TEST_ERROR;
/* Create the dataset */
- if((dataset = H5Dcreate (f, name, TEST_DATATYPE, space, dcpl))<0) TEST_ERROR;
+ if((dataset = H5Dcreate2(f, name, TEST_DATATYPE, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Clean up */
/* Close property lists */
- if(H5Pclose(dcpl)<0) TEST_ERROR;
+ if(H5Pclose(dcpl) < 0) TEST_ERROR;
/* Close dataspace */
- if(H5Sclose(space)<0) TEST_ERROR;
+ if(H5Sclose(space) < 0) TEST_ERROR;
return dataset;
@@ -187,7 +187,7 @@ test_create(hid_t f, const char *prefix)
return FAIL;
/* Close dataset created */
- if(H5Dclose(dataset)<0)
+ if(H5Dclose(dataset) < 0)
return FAIL;
}
@@ -268,7 +268,7 @@ test_extend(hid_t f, const char *prefix,
}
/* Get dataset's dataspace */
- if((fspace=H5Dget_space(dataset))<0) TEST_ERROR;
+ if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR;
for (ctr = 0;
H5V_vector_lt_u((unsigned)ndims, max_corner, whole_size);
@@ -316,13 +316,13 @@ test_extend(hid_t f, const char *prefix,
HDmemset(buf, (signed)(128+ctr), (size_t)nelmts);
/* Create dataspace for selection in memory */
- if((mspace=H5Screate_simple(1,&nelmts,NULL))<0) TEST_ERROR;
+ if((mspace=H5Screate_simple(1,&nelmts,NULL)) < 0) TEST_ERROR;
/* Select region in file dataspace */
- if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL)<0) TEST_ERROR;
+ if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR;
/* Write to disk */
- if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf)<0) {
+ if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
H5_FAILED();
fprintf(stderr," Write failed: ctr=%lu\n", (unsigned long)ctr);
goto error;
@@ -330,7 +330,7 @@ test_extend(hid_t f, const char *prefix,
/* Read from disk */
HDmemset(check, 0xff, (size_t)nelmts);
- if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check)<0) {
+ if (H5Dread(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, check) < 0) {
H5_FAILED();
fprintf(stderr," Read failed: ctr=%lu\n", (unsigned long)ctr);
goto error;
@@ -348,7 +348,7 @@ test_extend(hid_t f, const char *prefix,
}
/* Close memory dataspace */
- if(H5Sclose(mspace)<0) TEST_ERROR;
+ if(H5Sclose(mspace) < 0) TEST_ERROR;
/* Write to `whole' buffer for later checking */
H5V_hyper_copy((unsigned)ndims, size,
@@ -362,7 +362,7 @@ test_extend(hid_t f, const char *prefix,
/* Now read the entire array back out and check it */
HDmemset(buf, 0xff, nx * ny * nz);
- if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0) {
+ if (H5Dread(dataset, TEST_DATATYPE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
H5_FAILED();
fprintf(stderr," Read failed for whole array.\n");
goto error;
@@ -390,10 +390,10 @@ test_extend(hid_t f, const char *prefix,
}
/* Close dataset's dataspace */
- if(H5Sclose(fspace)<0) TEST_ERROR;
+ if(H5Sclose(fspace) < 0) TEST_ERROR;
/* Close dataset */
- if(H5Dclose(dataset)<0) TEST_ERROR;
+ if(H5Dclose(dataset) < 0) TEST_ERROR;
/* Free memory used */
HDfree(buf);
@@ -482,10 +482,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
}
/* Get dataset's dataspace */
- if((fspace=H5Dget_space(dataset))<0) TEST_ERROR;
+ if((fspace=H5Dget_space(dataset)) < 0) TEST_ERROR;
/* Create dataspace for memory buffer */
- if((mspace=H5Screate_simple(ndims,size,NULL))<0) TEST_ERROR;
+ if((mspace=H5Screate_simple(ndims,size,NULL)) < 0) TEST_ERROR;
for (ctr=0; ctr<nblocks; ctr++) {
offset[0] = (hsize_t)(HDrandom() % (TEST_SPARSE_SIZE-nx));
@@ -493,10 +493,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
offset[2] = (hsize_t)(HDrandom() % (TEST_SPARSE_SIZE-nz));
/* Select region in file dataspace */
- if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL)<0) TEST_ERROR;
+ if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL) < 0) TEST_ERROR;
/* write to disk */
- if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf)<0) {
+ if (H5Dwrite(dataset, TEST_DATATYPE, mspace, fspace, H5P_DEFAULT, buf) < 0) {
H5_FAILED();
printf(" Write failed: ctr=%lu\n", (unsigned long)ctr);
printf(" offset=(%lu", (unsigned long) (offset[0]));
@@ -521,13 +521,13 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
}
/* Close memory dataspace */
- if(H5Sclose(mspace)<0) TEST_ERROR;
+ if(H5Sclose(mspace) < 0) TEST_ERROR;
/* Close dataset's dataspace */
- if(H5Sclose(fspace)<0) TEST_ERROR;
+ if(H5Sclose(fspace) < 0) TEST_ERROR;
/* Close dataset */
- if(H5Dclose(dataset)<0) TEST_ERROR;
+ if(H5Dclose(dataset) < 0) TEST_ERROR;
HDfree(buf);
PASSED();
@@ -613,7 +613,7 @@ main(int argc, char *argv[])
/* Create the test file */
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
- if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl))<0) {
+ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
printf("Cannot create file %s; test aborted\n", filename);
exit(1);
}
@@ -628,7 +628,7 @@ main(int argc, char *argv[])
addr = 8 * ((uint64_t)1<<30); /*8 GB */
f=H5I_object(file);
- if (H5FDset_eoa(f->shared->lf, H5FD_MEM_DEFAULT, addr)<0) {
+ if (H5FDset_eoa(f->shared->lf, H5FD_MEM_DEFAULT, addr) < 0) {
printf("Cannot create large file family\n");
exit(1);
}
diff --git a/test/links.c b/test/links.c
index 487bcee..52d76cd 100644
--- a/test/links.c
+++ b/test/links.c
@@ -134,7 +134,7 @@ mklinks(hid_t fapl, hbool_t new_format)
if(H5Gclose(grp) < 0) TEST_ERROR
/* Create a dataset */
- if((d1 = H5Dcreate(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((d1 = H5Dcreate2(file, "d1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(d1) < 0) TEST_ERROR
/* Create a hard link */
@@ -208,8 +208,8 @@ new_links(hid_t fapl, hbool_t new_format)
if((grp2_b = H5Gcreate2(file_b, "grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create datasets */
- if((dset1 = H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
- if((dset2 = H5Dcreate(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset1 = H5Dcreate2(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset2 = H5Dcreate2(grp1_a, "dataset2", H5T_NATIVE_INT, scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create links within a file. Both of source and destination use
* H5L_SAME_LOC. Both hard and soft links should fail. */
@@ -3411,7 +3411,7 @@ external_link_closing(hid_t fapl, hbool_t new_format)
/* Test creating each kind of object */
if((gid = H5Gcreate2(fid1, "elink/elink/elink/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Tcommit2(fid1, "elink/elink/elink/type1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
- if((did = H5Dcreate(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid1, "elink/elink/elink/dataset1", tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Close objects */
if(H5Gclose(gid) < 0) TEST_ERROR
if(H5Tclose(tid) < 0) TEST_ERROR
@@ -5087,7 +5087,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format)
dims[0] = 2;
dims[1] = 2;
if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
- if((did = H5Dcreate(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
/* Close group */
@@ -5199,7 +5199,7 @@ linkinfo(hid_t fapl, hbool_t new_format)
if(H5Lcreate_soft("group", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if((sid = H5Screate(H5S_SCALAR)) < 0) TEST_ERROR
- if((did = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Lcreate_ud(fid, "ud_link", UD_PLIST_TYPE, NULL, (size_t)0, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
if(H5Lcreate_external("file_name", "obj_path", fid, "ext_link", H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR
diff --git a/test/mount.c b/test/mount.c
index 6330504..e5e0d0a 100644
--- a/test/mount.c
+++ b/test/mount.c
@@ -874,7 +874,7 @@ test_interlink(hid_t fapl)
if(H5Tcommit2(file1, "/type1", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
if((space = H5Screate_simple(1, cur_dims, NULL)) < 0) FAIL_STACK_ERROR
H5E_BEGIN_TRY {
- dset = H5Dcreate(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file1, "/mnt1/file2/dset", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if(dset >= 0) {
H5_FAILED();
@@ -1128,7 +1128,7 @@ test_mount_after_close(hid_t fapl)
if((gidX = H5Gcreate2(fid2, "/X", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if((gidXY = H5Gcreate2(gidX, "Y", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
- if((did = H5Dcreate(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((did = H5Dcreate2(gidXY, "D", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Soft link */
if(H5Lcreate_soft("./Y", gidX, "T", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR
diff --git a/test/mtime.c b/test/mtime.c
index d6eed1f..1969af2 100644
--- a/test/mtime.c
+++ b/test/mtime.c
@@ -77,7 +77,7 @@ main(void)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
TEST_ERROR;
if((space = H5Screate_simple(1, size, NULL)) < 0) TEST_ERROR;
- if((dset = H5Dcreate(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT)) < 0)
+ if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_SCHAR, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
now = HDtime(NULL);
if(H5Dclose(dset) < 0) TEST_ERROR;
diff --git a/test/ntypes.c b/test/ntypes.c
index 2535ce1..2f5dd5d 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -104,8 +104,8 @@ test_atomic_dtype(hid_t file)
/*------------------- Test data values ------------------------*/
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write the data to the dataset */
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2) < 0)
@@ -146,16 +146,14 @@ test_atomic_dtype(hid_t file)
TEST_ERROR;
/* Check that the values read are the same as the values written */
- for (i = 0; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++) {
+ for(i = 0; i < DIM0; i++)
+ for(j = 0; j < DIM1; j++)
if(ipoints2[i][j] != icheck2[i][j]) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
goto error;
- }
- }
- }
+ } /* end if */
if(H5Dclose(dataset) < 0) TEST_ERROR;
if(H5Tclose(native_type) < 0) TEST_ERROR;
@@ -164,12 +162,12 @@ test_atomic_dtype(hid_t file)
/*------------------ Test different data types ----------------*/
/* Create the dataset of H5T_STD_I64LE */
- if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_2, H5T_STD_I64LE, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_2, H5T_STD_I64LE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
- if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR;
+ if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR;
- if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
+ if((native_type = H5Tget_native_type(dtype, H5T_DIR_DEFAULT)) < 0)
TEST_ERROR;
/* Verify the datatype retrieved and converted */
@@ -186,12 +184,12 @@ test_atomic_dtype(hid_t file)
/* Create the dataset of H5T_STD_I8LE */
- if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_3, H5T_STD_I8LE, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_3, H5T_STD_I8LE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
- if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR;
+ if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR;
- if((native_type=H5Tget_native_type(dtype, H5T_DIR_ASCEND)) < 0)
+ if((native_type = H5Tget_native_type(dtype, H5T_DIR_ASCEND)) < 0)
TEST_ERROR;
/* Verify the datatype retrieved and converted */
@@ -208,12 +206,12 @@ test_atomic_dtype(hid_t file)
/* Create the dataset of H5T_IEEE_F32BE */
- if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
- if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR;
+ if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR;
- if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0)
+ if((native_type = H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0)
TEST_ERROR;
/* Verify the datatype retrieved and converted */
@@ -230,12 +228,12 @@ test_atomic_dtype(hid_t file)
/* Create the dataset of H5T_IEEE_F64BE */
- if((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
- if((dtype=H5Dget_type(dataset)) < 0) TEST_ERROR;
+ if((dtype = H5Dget_type(dataset)) < 0) TEST_ERROR;
- if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0)
+ if((native_type = H5Tget_native_type(dtype, H5T_DIR_DESCEND)) < 0)
TEST_ERROR;
/* Verify the datatype retrieved and converted */
@@ -243,7 +241,7 @@ test_atomic_dtype(hid_t file)
TEST_ERROR;
if(H5Tget_size(native_type) < H5Tget_size(H5T_IEEE_F64BE))
TEST_ERROR;
- if(H5T_FLOAT!=H5Tget_class(native_type))
+ if(H5T_FLOAT != H5Tget_class(native_type))
TEST_ERROR;
if(H5Dclose(dataset) < 0) TEST_ERROR;
@@ -343,9 +341,9 @@ test_compound_dtype2(hid_t file)
/* Insert and pack members */
if(H5Tinsert(tid2, "c2", 0, H5T_STD_I16BE) < 0) TEST_ERROR;
-#if H5_SIZEOF_LONG==4
+#if H5_SIZEOF_LONG == 4
if(H5Tinsert(tid2, "l2", 2, H5T_STD_I32LE) < 0) TEST_ERROR;
-#elif H5_SIZEOF_LONG==8
+#elif H5_SIZEOF_LONG == 8
if(H5Tinsert(tid2, "l2", 2, H5T_STD_I64LE) < 0) TEST_ERROR;
#else
#error "Unknown 'long' size"
@@ -354,21 +352,21 @@ test_compound_dtype2(hid_t file)
if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR;
if(H5Tinsert(tid, "i", 1, H5T_STD_I32LE) < 0) TEST_ERROR;
if(H5Tinsert(tid, "st", 5, tid2) < 0) TEST_ERROR;
-#if H5_SIZEOF_LONG==4
+#if H5_SIZEOF_LONG == 4
if(H5Tinsert(tid, "l", 11, H5T_STD_U64BE) < 0) TEST_ERROR;
-#elif H5_SIZEOF_LONG==8
+#elif H5_SIZEOF_LONG == 8
if(H5Tinsert(tid, "l", 15, H5T_STD_U64BE) < 0) TEST_ERROR;
#else
#error "Unknown 'long' size"
#endif
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_2, tid, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_2, tid, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create compound datatype for memory */
- if((tid_m2=H5Tcreate(H5T_COMPOUND, sizeof(s2))) < 0) TEST_ERROR;
- if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
+ if((tid_m2 = H5Tcreate(H5T_COMPOUND, sizeof(s2))) < 0) TEST_ERROR;
+ if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
/* Insert members */
if(H5Tinsert(tid_m2, "c2", HOFFSET(s2, c2), H5T_NATIVE_SHORT) < 0) TEST_ERROR;
@@ -558,17 +556,16 @@ test_compound_dtype(hid_t file)
/* Allocate space for the points & check arrays */
if((points=malloc(sizeof(s1)*DIM0*DIM1))==NULL)
TEST_ERROR;
- if((check=calloc(sizeof(s1),DIM0*DIM1))==NULL)
+ if((check = calloc(sizeof(s1), DIM0 * DIM1)) == NULL)
TEST_ERROR;
/* Initialize the dataset */
- for (i = n = 0, temp_point=points; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++,temp_point++) {
+ for(i = n = 0, temp_point=points; i < DIM0; i++)
+ for(j = 0; j < DIM1; j++,temp_point++) {
temp_point->c = 't';
temp_point->i = n++;
temp_point->l = (i*10+j*100)*n;
- }
- }
+ } /* end for */
/* Create the data space */
dims[0] = DIM0;
@@ -576,7 +573,7 @@ test_compound_dtype(hid_t file)
if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR;
/* Create compound datatype for disk storage */
- if((tid=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
+ if((tid = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
/* Insert members */
if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR;
@@ -584,11 +581,11 @@ test_compound_dtype(hid_t file)
if(H5Tinsert(tid, "l", 5, H5T_STD_I64BE) < 0) TEST_ERROR;
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME, tid, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME, tid, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create compound datatype for datatype in memory */
- if((tid2=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
+ if((tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
if(H5Tinsert(tid2, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR;
if(H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_UINT) < 0) TEST_ERROR;
if(H5Tinsert(tid2, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR;
@@ -736,14 +733,13 @@ test_compound_dtype3(hid_t file)
TEST_ERROR;
/* Initialize the dataset */
- for (i = n = 0, temp_point=points; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++,temp_point++) {
+ for(i = n = 0, temp_point=points; i < DIM0; i++)
+ for(j = 0; j < DIM1; j++,temp_point++) {
temp_point->c = 't';
temp_point->l = (i*10+j*100)*n;
- for (k = 0; k < 5; k++)
+ for(k = 0; k < 5; k++)
(temp_point->a)[k] = n++;
- }
- }
+ } /* end for */
/* Create the data space */
dims[0] = DIM0;
@@ -754,7 +750,7 @@ test_compound_dtype3(hid_t file)
if((tid2 = H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Create compound datatype for disk storage */
- if((tid=H5Tcreate(H5T_COMPOUND, 29)) < 0) TEST_ERROR;
+ if((tid = H5Tcreate(H5T_COMPOUND, 29)) < 0) TEST_ERROR;
/* Insert members */
if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR;
@@ -762,14 +758,14 @@ test_compound_dtype3(hid_t file)
if(H5Tinsert(tid, "l", 21, H5T_STD_I64BE) < 0) TEST_ERROR;
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_3, tid, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_3, tid, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create array datatype */
if((tid_m2 = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Create compound datatype for datatype in memory */
- if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
+ if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
if(H5Tinsert(tid_m, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR;
if(H5Tinsert(tid_m, "a", HOFFSET(s1, a), tid_m2) < 0) TEST_ERROR;
if(H5Tinsert(tid_m, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR;
@@ -935,14 +931,13 @@ test_compound_opaque(hid_t file)
TEST_ERROR;
/* Initialize the dataset */
- for (i = n = 0, temp_point=points; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++,temp_point++) {
+ for(i = n = 0, temp_point=points; i < DIM0; i++)
+ for(j = 0; j < DIM1; j++,temp_point++) {
temp_point->c = 't';
temp_point->l = (i*10+j*100)*n;
- for (k = 0; k < 5; k++)
+ for(k = 0; k < 5; k++)
(temp_point->o)[k] = n++;
- }
- }
+ } /* end for */
/* Create the data space */
dims[0] = DIM0;
@@ -950,11 +945,11 @@ test_compound_opaque(hid_t file)
if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR;
/* Create opaque datatype */
- if((tid2=H5Tcreate(H5T_OPAQUE, sizeof(temp_point->o))) < 0) TEST_ERROR;
+ if((tid2 = H5Tcreate(H5T_OPAQUE, sizeof(temp_point->o))) < 0) TEST_ERROR;
if(H5Tset_tag(tid2, "testing opaque field") < 0) TEST_ERROR;
/* Create compound datatype for disk storage */
- if((tid=H5Tcreate(H5T_COMPOUND, 14)) < 0) TEST_ERROR;
+ if((tid = H5Tcreate(H5T_COMPOUND, 14)) < 0) TEST_ERROR;
/* Insert members */
if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE) < 0) TEST_ERROR;
@@ -962,11 +957,11 @@ test_compound_opaque(hid_t file)
if(H5Tinsert(tid, "l", 6, H5T_STD_I64BE) < 0) TEST_ERROR;
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_4, tid, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_COMPOUND_NAME_4, tid, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create compound datatype for datatype in memory */
- if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
+ if((tid_m = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
if(H5Tinsert(tid_m, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR;
if(H5Tinsert(tid_m, "o", HOFFSET(s1, o), tid2) < 0) TEST_ERROR;
if(H5Tinsert(tid_m, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR;
@@ -1120,10 +1115,9 @@ test_enum_dtype(hid_t file)
TESTING("enum datatype");
/* Initialize the dataset */
- for (i = 0; i < DIM0; i++) {
- for (j=0, n=0; j < DIM1; j++, n++)
+ for(i = 0; i < DIM0; i++)
+ for(j = 0, n = 0; j < DIM1; j++, n++)
spoints2[i][j] = (i*10+j*100+n)%8;
- }
/* Create the data space */
dims[0] = DIM0;
@@ -1131,17 +1125,17 @@ test_enum_dtype(hid_t file)
if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR;
/* Construct enum type based on native type */
- if((tid=H5Tenum_create(H5T_STD_I16LE)) < 0) TEST_ERROR;
+ if((tid = H5Tenum_create(H5T_STD_I16LE)) < 0) TEST_ERROR;
- for (i = 0; i < 8; i++) {
- sub_colors[i*2]=i;
- sub_colors[i*2+1]=0;
+ for(i = 0; i < 8; i++) {
+ sub_colors[i * 2] = i;
+ sub_colors[i * 2 + 1] = 0;
if(H5Tenum_insert(tid, mname[i], &(sub_colors[i*2])) < 0) TEST_ERROR;
- }
+ } /* end for */
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_ENUM_NAME, tid, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_ENUM_NAME, tid, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Construct enum type based on native type in memory */
if((tid_m = H5Tenum_create(H5T_NATIVE_SHORT)) < 0) TEST_ERROR;
@@ -1149,7 +1143,7 @@ test_enum_dtype(hid_t file)
for(i = 0; i < 8; i++) {
colors[i] = i;
if(H5Tenum_insert(tid_m, mname[i], &(colors[i])) < 0) TEST_ERROR;
- }
+ } /* end for */
/* Write the data to the dataset */
if(H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, spoints2) < 0)
@@ -1266,7 +1260,7 @@ test_array_dtype(hid_t file)
if((space = H5Screate_simple(2, space_dims, NULL)) < 0) TEST_ERROR;
/* Create compound datatype for disk storage */
- if((tid2=H5Tcreate(H5T_COMPOUND, 13)) < 0) TEST_ERROR;
+ if((tid2 = H5Tcreate(H5T_COMPOUND, 13)) < 0) TEST_ERROR;
/* Insert members */
if(H5Tinsert(tid2, "c", 0, H5T_STD_U8BE) < 0) TEST_ERROR;
@@ -1277,11 +1271,11 @@ test_array_dtype(hid_t file)
if((tid = H5Tarray_create(tid2, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_ARRAY_NAME, tid, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_ARRAY_NAME, tid, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create compound datatype for datatype in memory */
- if((tid3=H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
+ if((tid3 = H5Tcreate(H5T_COMPOUND, sizeof(s1))) < 0) TEST_ERROR;
if(H5Tinsert(tid3, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR) < 0) TEST_ERROR;
if(H5Tinsert(tid3, "i", HOFFSET(s1, i), H5T_NATIVE_UINT) < 0) TEST_ERROR;
if(H5Tinsert(tid3, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG) < 0) TEST_ERROR;
@@ -1405,8 +1399,8 @@ test_array_dtype2(hid_t file)
if((tid = H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL)) < 0) TEST_ERROR;
/* Create the dataset */
- if((dataset = H5Dcreate(file, DSET_ARRAY2_NAME, tid, space,
- H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_ARRAY2_NAME, tid, space,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Create array datatype for memory */
if((tid_m = H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL)) < 0) TEST_ERROR;
@@ -1537,7 +1531,7 @@ test_vl_dtype(hid_t file)
if((tid = H5Tvlen_create(tid2)) < 0) TEST_ERROR
/* Create a dataset */
- if((dataset = H5Dcreate(file, DSET_VL_NAME, tid, space, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(file, DSET_VL_NAME, tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Create a base VL datatype for memory */
@@ -1682,10 +1676,10 @@ test_vlstr_dtype(hid_t file)
TEST_ERROR;
/* Create a dataset */
- if((dataset = H5Dcreate(file,DSET_VLSTR_NAME,tid1,sid1,H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_VLSTR_NAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write dataset to disk */
- if(H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata) < 0) TEST_ERROR;
+ if(H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0) TEST_ERROR;
/* Close Dataset */
if(H5Dclose(dataset) < 0) TEST_ERROR;
@@ -1791,7 +1785,7 @@ test_str_dtype(hid_t file)
if(H5T_STRING != H5Tget_class(tid1)) TEST_ERROR;
/* Create a dataset */
- if((dataset = H5Dcreate(file, DSET_STR_NAME, tid1, sid1, H5P_DEFAULT)) < 0) TEST_ERROR;
+ if((dataset = H5Dcreate2(file, DSET_STR_NAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write dataset to disk */
if(H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0) TEST_ERROR;
@@ -1934,7 +1928,7 @@ test_refer_dtype(hid_t file)
TEST_ERROR;
/* Create a dataset */
- if((dataset = H5Dcreate(file, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT)) < 0)
+ if((dataset = H5Dcreate2(file, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Create reference to named datatype */
@@ -2058,22 +2052,22 @@ test_refer_dtype2(hid_t file)
TESTING("dataset region reference");
/* Allocate write & read buffers */
- dwbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2);
- drbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2);
+ dwbuf = malloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2);
+ drbuf = calloc(sizeof(uint8_t), SPACE2_DIM1 * SPACE2_DIM2);
/* Create dataspace for datasets */
if((sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL)) < 0)
TEST_ERROR;
/* Create a dataset */
- if((dset2=H5Dcreate(file,"Dataset2",H5T_STD_U8LE,sid2,H5P_DEFAULT)) < 0)
+ if((dset2 = H5Dcreate2(file, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
- for(tu8=dwbuf,i=0; i<SPACE2_DIM1*SPACE2_DIM2; i++)
+ for(tu8 = dwbuf, i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++)
*tu8++=i*3;
/* Write selection to disk */
- if(H5Dwrite(dset2,H5T_STD_U8LE,H5S_ALL,H5S_ALL,H5P_DEFAULT,dwbuf) < 0)
+ if(H5Dwrite(dset2, H5T_STD_U8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf) < 0)
TEST_ERROR;
/* Close Dataset */
@@ -2086,7 +2080,7 @@ test_refer_dtype2(hid_t file)
TEST_ERROR;
/* Create a reference dataset */
- if((dset1 = H5Dcreate(file, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT)) < 0)
+ if((dset1 = H5Dcreate2(file, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Create references */
@@ -2244,7 +2238,7 @@ test_opaque_dtype(hid_t file)
if((type = H5Tcreate(H5T_OPAQUE, 1)) < 0 ||
H5Tset_tag(type, "testing 1-byte opaque type") < 0 ||
(space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset = H5Dcreate(file, DSET_OPAQUE_NAME, type, space, H5P_DEFAULT)) < 0)
+ (dset = H5Dcreate2(file, DSET_OPAQUE_NAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i = 0; i < sizeof(wbuf); i++)
@@ -2320,7 +2314,7 @@ test_bitfield_dtype(hid_t file)
nelmts = sizeof(wbuf);
if((type = H5Tcopy(H5T_STD_B8LE)) < 0 ||
(space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
- (dset = H5Dcreate(file, DSET_BITFIELD_NAME, type, space, H5P_DEFAULT)) < 0)
+ (dset = H5Dcreate2(file, DSET_BITFIELD_NAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i = 0; i < sizeof(wbuf); i++)
@@ -2415,7 +2409,7 @@ test_ninteger(void)
if((dcpl1 = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
/* create a dataset */
- if((did1 = H5Dcreate(fid1, "dset", H5T_NATIVE_INT, sid1, dcpl1)) < 0) goto error;
+ if((did1 = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, sid1, H5P_DEFAULT, dcpl1, H5P_DEFAULT)) < 0) goto error;
/* write */
if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
@@ -2467,36 +2461,36 @@ test_ninteger(void)
goto error;
/* create a file using default properties */
- if((fid2=H5Fcreate("tstint2.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT)) < 0)
+ if((fid2 = H5Fcreate("tstint2.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
/* create a dataset using the native type */
- if((did2 = H5Dcreate(fid2,"dset",nid1,sid1,dcpl1)) <0) goto error;
+ if((did2 = H5Dcreate2(fid2, "dset", nid1, sid1, H5P_DEFAULT, dcpl1, H5P_DEFAULT)) < 0) goto error;
/* write */
- if(H5Dwrite(did2,nid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,chk) < 0)
+ if(H5Dwrite(did2, nid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, chk) < 0)
goto error;
/* get dcpl */
- if((dcpl2=H5Dget_create_plist(did2)) < 0)
+ if((dcpl2 = H5Dget_create_plist(did2)) < 0)
goto error;
/* get file datatype */
- if((tid2=H5Dget_type (did2)) < 0)
+ if((tid2 = H5Dget_type(did2)) < 0)
goto error;
/* get native datatype */
- if((nid2=H5Tget_native_type(tid2,H5T_DIR_DEFAULT)) < 0)
+ if((nid2 = H5Tget_native_type(tid2, H5T_DIR_DEFAULT)) < 0)
goto error;
/* check */
- if(H5Tget_precision(nid1)!=H5Tget_precision(nid2)) {
+ if(H5Tget_precision(nid1) != H5Tget_precision(nid2)) {
printf(" Precision differ.\n");
goto error;
}
/* compare dataset creation property lists */
- if(H5Pequal(dcpl1,dcpl2)<=0) {
+ if(H5Pequal(dcpl1, dcpl2) <= 0) {
printf(" Property lists differ.\n");
goto error;
}
diff --git a/test/objcopy.c b/test/objcopy.c
index d35db59..88fee57 100755
--- a/test/objcopy.c
+++ b/test/objcopy.c
@@ -248,9 +248,9 @@ attach_ref_attr(hid_t file_id, hid_t loc_id)
/* creates two simple datasets */
if((sid = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
if((sid_ref = H5Screate_simple(1, dims_ref, NULL)) < 0) TEST_ERROR
- if((did1 = H5Dcreate(file_id, dsetname1, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did1 = H5Dcreate2(file_id, dsetname1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data1) < 0) TEST_ERROR
- if((did2 = H5Dcreate(file_id, dsetname2, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did2 = H5Dcreate2(file_id, dsetname2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data2) < 0) TEST_ERROR
/* create an attribute with two object references */
@@ -316,7 +316,7 @@ attach_reg_ref_attr(hid_t file_id, hid_t loc_id)
/* create a 2D dataset */
if((space_id = H5Screate_simple(rank, dims, NULL)) < 0) TEST_ERROR
if((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0) TEST_ERROR
- if((dsetv_id = H5Dcreate(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data) < 0) TEST_ERROR
/* create reg_ref of block selection */
@@ -397,9 +397,9 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id)
if((space_id = H5Screate_simple(rank, dims, NULL)) < 0) TEST_ERROR
if((spacer_id = H5Screate_simple(rankr, dimsr, NULL)) < 0) TEST_ERROR
- if((dsetv_id = H5Dcreate(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dsetv_id = H5Dcreate2(file_id, dsetnamev, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(dsetv_id, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT,data) < 0) TEST_ERROR
- if((dsetr_id = H5Dcreate(loc_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dsetr_id = H5Dcreate2(loc_id, dsetnamer, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
start[0] = 0;
start[1] = 3;
@@ -417,7 +417,7 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id)
if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR
- if((dsetr_id = H5Dcreate(loc_id, dsetnamer1, H5T_STD_REF_DSETREG, spacer_id, pid)) < 0) TEST_ERROR
+ if((dsetr_id = H5Dcreate2(loc_id, dsetnamer1, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Pclose(pid) < 0) TEST_ERROR
if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref) < 0) TEST_ERROR
if(H5Dclose(dsetr_id) < 0) TEST_ERROR
@@ -427,7 +427,7 @@ create_reg_ref_dataset(hid_t file_id, hid_t loc_id)
if(H5Pset_chunk(pid, 1, &chunk_size) < 0) TEST_ERROR
if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR
- if((dsetr_id = H5Dcreate(loc_id, dsetnamer2, H5T_STD_REF_DSETREG, spacer_id, pid)) < 0) TEST_ERROR
+ if((dsetr_id = H5Dcreate2(loc_id, dsetnamer2, H5T_STD_REF_DSETREG, spacer_id, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Pclose(pid) < 0) TEST_ERROR
if(H5Dwrite(dsetr_id, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT,ref) < 0) TEST_ERROR
if(H5Dclose(dsetr_id) < 0) TEST_ERROR
@@ -1165,8 +1165,8 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf)
/* Check raw data read in against data written out */
if(wbuf) {
- if(!compare_data(did, 0, pid, tid, (size_t)nelmts, wbuf, rbuf, did) ) TEST_ERROR
- if(!compare_data(did2, 0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2) ) TEST_ERROR
+ if(!compare_data(did, 0, pid, tid, (size_t)nelmts, wbuf, rbuf, did)) TEST_ERROR
+ if(!compare_data(did2, 0, pid, tid2, (size_t)nelmts, wbuf, rbuf2, did2)) TEST_ERROR
} /* end if */
/* Don't have written data, just compare data between the two datasets */
else
@@ -1712,7 +1712,7 @@ test_copy_dataset_simple(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* create 2D int dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -1822,7 +1822,7 @@ test_copy_dataset_simple_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* create 2D int dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close dataspace */
if(H5Sclose(sid) < 0) TEST_ERROR
@@ -1946,7 +1946,7 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Tinsert(tid, "double_name", HOFFSET(comp_t, d), H5T_NATIVE_DOUBLE) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate(fid_src, NAME_DATASET_COMPOUND, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_COMPOUND, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -2074,7 +2074,7 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
@@ -2194,7 +2194,7 @@ test_copy_dataset_chunked_empty(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
@@ -2322,7 +2322,7 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 2, chunk_dim2d) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
@@ -2462,7 +2462,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
@@ -2590,7 +2590,7 @@ test_copy_dataset_compact(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate(fid_src, NAME_DATASET_COMPACT, H5T_NATIVE_FLOAT, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_COMPACT, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
@@ -2720,7 +2720,7 @@ test_copy_dataset_external(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_external(pid, FILE_EXT, (off_t)0, size) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_EXTERNAL, H5T_NATIVE_INT, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_EXTERNAL, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -2841,7 +2841,7 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close the datatype */
if(H5Tclose(tid) < 0) TEST_ERROR
@@ -2966,7 +2966,7 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((H5Tcommit2(gid, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create first dataset at SRC file */
- if((did = H5Dcreate(gid, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -2975,7 +2975,7 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Dclose(did) < 0) TEST_ERROR
/* create second dataset at SRC file */
- if((did = H5Dcreate(gid, NAME_DATASET_NAMED_DTYPE2, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, NAME_DATASET_NAMED_DTYPE2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -3105,7 +3105,7 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create first dataset at SRC file */
- if((did = H5Dcreate(gid, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, NAME_DATASET_NAMED_DTYPE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -3114,7 +3114,7 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t
if(H5Dclose(did) < 0) TEST_ERROR
/* create second dataset at SRC file */
- if((did = H5Dcreate(gid, NAME_DATASET_NAMED_DTYPE2, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, NAME_DATASET_NAMED_DTYPE2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -3239,13 +3239,13 @@ test_copy_dataset_multi_ohdr_chunks(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR
/* create first dataset at SRC file */
- if((did = H5Dcreate(gid, NAME_DATASET_MULTI_OHDR, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, NAME_DATASET_MULTI_OHDR, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
/* create second dataset at SRC file */
- if((did2 = H5Dcreate(gid, NAME_DATASET_MULTI_OHDR2, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did2 = H5Dcreate2(gid, NAME_DATASET_MULTI_OHDR2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -3377,13 +3377,13 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create first dataset at SRC file */
- if((did = H5Dcreate(gid, NAME_DATASET_MULTI_OHDR, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, NAME_DATASET_MULTI_OHDR, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
/* create second dataset at SRC file */
- if((did2 = H5Dcreate(gid, NAME_DATASET_MULTI_OHDR2, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did2 = H5Dcreate2(gid, NAME_DATASET_MULTI_OHDR2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -3518,7 +3518,7 @@ test_copy_dataset_contig_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -3653,7 +3653,7 @@ test_copy_dataset_chunked_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
@@ -3790,7 +3790,7 @@ test_copy_dataset_compact_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -3910,7 +3910,7 @@ test_copy_attribute_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* create 2D int dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* close dataspace */
if(H5Sclose(sid) < 0) TEST_ERROR
@@ -4053,7 +4053,7 @@ test_copy_dataset_compressed_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR
/* create dataset */
- if((did = H5Dcreate(fid_src, NAME_DATASET_CHUNKED, tid, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_CHUNKED, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* close chunk plist */
if(H5Pclose(pid) < 0) TEST_ERROR
@@ -4286,7 +4286,7 @@ test_copy_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* add a dataset to the group */
- if((did = H5Dcreate(fid_src, NAME_GROUP_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_GROUP_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
/* close dataspace */
@@ -4420,7 +4420,7 @@ test_copy_root_group(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* add a dataset to the group */
- if((did = H5Dcreate(fid_src, NAME_GROUP_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_GROUP_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
/* close dataspace */
@@ -4564,7 +4564,7 @@ test_copy_group_deep(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
sprintf(objname, "Dataset #%d", k);
/* add a dataset to the group */
- if((did = H5Dcreate(gid_sub2, objname, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid_sub2, objname, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
} /* end for */
@@ -4933,7 +4933,7 @@ test_copy_group_links(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* add a dataset to the group */
- if((did = H5Dcreate(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
/* close dataspace */
@@ -5068,7 +5068,7 @@ test_copy_soft_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* add a dataset to the group */
- if((did = H5Dcreate(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
/* close dataspace */
@@ -5195,7 +5195,7 @@ test_copy_ext_link(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* add a dataset to the group */
- if((did = H5Dcreate(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_LINK_DATASET, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
/* close dataspace */
@@ -5322,7 +5322,7 @@ test_copy_exist(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* create 2D int dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -5431,7 +5431,7 @@ test_copy_path(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* create 2D int dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -5739,7 +5739,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -5882,7 +5882,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -6027,7 +6027,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -6177,7 +6177,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl
if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL, tid, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL, tid, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -6336,7 +6336,7 @@ test_copy_dataset_compact_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_layout(pid, H5D_COMPACT) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL_VL, tid2, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -6490,7 +6490,7 @@ test_copy_dataset_contig_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -6645,7 +6645,7 @@ test_copy_dataset_chunked_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_chunk(pid, 1, chunk_dim1d) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL_VL, tid2, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -6802,7 +6802,7 @@ test_copy_dataset_compressed_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl)
if(H5Pset_deflate(pid, 9) < 0) TEST_ERROR
/* create dataset at SRC file */
- if((did = H5Dcreate(fid_src, NAME_DATASET_VL_VL, tid2, sid, pid)) < 0) TEST_ERROR
+ if((did = H5Dcreate2(fid_src, NAME_DATASET_VL_VL, tid2, sid, H5P_DEFAULT, pid, H5P_DEFAULT)) < 0) TEST_ERROR
/* write data into file */
if(H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
@@ -6942,7 +6942,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo
if((sid = H5Screate_simple(2, dim2d, NULL)) < 0) TEST_ERROR
/* add a dataset to the top group */
- if((did = H5Dcreate(gid, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -6950,7 +6950,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo
if((gid_sub = H5Gcreate2(fid_src, NAME_GROUP_SUB, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* add a dataset to the sub group */
- if((did = H5Dcreate(gid_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
if(H5Dclose(did) < 0) TEST_ERROR
@@ -6958,7 +6958,7 @@ test_copy_option(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl, unsigned flag, hboo
if((gid_sub_sub = H5Gcreate2(gid_sub, NAME_GROUP_SUB_SUB2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* add a dataset to the sub sub group */
- if((did = H5Dcreate(gid_sub_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT) ) < 0) TEST_ERROR
+ if((did = H5Dcreate2(gid_sub_sub, NAME_DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR
/* close dataset */
diff --git a/test/reserved.c b/test/reserved.c
index f719545..eeab056 100755
--- a/test/reserved.c
+++ b/test/reserved.c
@@ -76,7 +76,7 @@ rsrv_heap(void)
sprintf(dset_name, "Dset %d", i);
H5E_BEGIN_TRY {
- dataset_id = H5Dcreate(file_id, dset_name, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT);
+ dataset_id = H5Dcreate2(file_id, dset_name, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY
if(dataset_id < 0)
@@ -174,28 +174,27 @@ rsrv_ohdr(void)
fcpl = H5Pcreate(H5P_FILE_CREATE);
if(fcpl < 0) TEST_ERROR;
- if( H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
+ if(H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
- if( file_id < 0) TEST_ERROR;
+ if(file_id < 0) TEST_ERROR;
/* Create the data space for the dataset. */
dims[0] = 4;
dims[1] = 6;
dataspace_id = H5Screate_simple(2, dims, NULL);
- if( dataspace_id < 0) TEST_ERROR;
+ if(dataspace_id < 0) TEST_ERROR;
/* Create the dataset. */
- dataset_id = H5Dcreate(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT);
- if( dataset_id < 0) TEST_ERROR;
+ dataset_id = H5Dcreate2(file_id, "/dset", H5T_STD_I32BE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dataset_id < 0) TEST_ERROR;
- for(i=0; i<6; i++)
- {
+ for(i = 0; i < 6; i++) {
attrval[0][i] = 0;
attrval[1][i] = 1;
attrval[2][i] = 2;
attrval[3][i] = 3;
- }
+ } /* end for */
for(i = 0; i < 2000; i++) {
sprintf(attrname, "attr %d", i);
@@ -208,7 +207,7 @@ rsrv_ohdr(void)
if(status < 0)
break;
- }
+ } /* end for */
/* The loop should have broken before completing--the file should not have had
* enough address space to hold 2000 attributes (or this test needs to be updated
@@ -302,43 +301,41 @@ rsrv_vlen(void)
/* Make file address space very small */
fcpl = H5Pcreate(H5P_FILE_CREATE);
- if( fcpl < 0) TEST_ERROR;
- if( H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
+ if(fcpl < 0) TEST_ERROR;
+ if(H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
- if( file_id < 0) TEST_ERROR;
+ if(file_id < 0) TEST_ERROR;
/* Create the data space for the dataset. */
dims[0] = 2000;
dataspace_id = H5Screate_simple(1, dims, NULL);
- if( dataspace_id < 0) TEST_ERROR;
+ if(dataspace_id < 0) TEST_ERROR;
/* Create a variable length type */
type_id = H5Tvlen_create(H5T_NATIVE_INT);
- if( type_id < 0) TEST_ERROR;
+ if(type_id < 0) TEST_ERROR;
/* Create the dataset. */
- dataset_id = H5Dcreate(file_id, "/dset", type_id, dataspace_id, H5P_DEFAULT);
- if( dataset_id < 0) TEST_ERROR;
+ dataset_id = H5Dcreate2(file_id, "/dset", type_id, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dataset_id < 0) TEST_ERROR;
/* Create some data to write */
- for (i = 0; i < 20; i++)
- write_buf[i] = i+1;
+ for(i = 0; i < 20; i++)
+ write_buf[i] = i + 1;
vlen_data.p = write_buf;
/* Create a memory dataspace for writing */
dims[0] = 1;
mem_space_id = H5Screate_simple(1, dims, NULL);
- if( mem_space_id < 0) TEST_ERROR;
+ if(mem_space_id < 0) TEST_ERROR;
/* Create a selection to write to */
start[0] = 0;
count[0] = 1;
- if( H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET,
- start, NULL, count, NULL) < 0) TEST_ERROR;
+ if(H5Sselect_hyperslab(dataspace_id, H5S_SELECT_SET, start, NULL, count, NULL) < 0) TEST_ERROR;
- for (i = 0; i< 2000; i++)
- {
+ for(i = 0; i< 2000; i++) {
vlen_data.len = (i%20) + 1;
offset[0] = i;
@@ -350,7 +347,7 @@ rsrv_vlen(void)
if(status < 0)
break;
- }
+ } /* end for */
/* The loop should have broken before completing--the file should not have had
* enough address space to hold 2000 attributes (or this test needs to be updated!).
diff --git a/test/set_extent.c b/test/set_extent.c
index 40beda4..aa94b82 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -68,17 +68,17 @@ int main( void )
/* Create a new file using default properties. */
- if ((file_id = H5Fcreate( "set_extent_create.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT )) < 0) TEST_ERROR;
+ if((file_id = H5Fcreate("set_extent_create.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR;
TESTING("extend dataset create with fill value");
/* Create the data space with unlimited dimensions. */
- if ((space_id = H5Screate_simple( RANK, dims, maxdims )) < 0) TEST_ERROR;
+ if((space_id = H5Screate_simple(RANK, dims, maxdims)) < 0) TEST_ERROR;
/* Modify dataset creation properties, i.e. enable chunking. */
- if ((plist_id = H5Pcreate (H5P_DATASET_CREATE )) < 0) TEST_ERROR;
- if (H5Pset_chunk( plist_id, RANK, dims_chunk ) < 0) TEST_ERROR;
- if (H5Pset_fill_value( plist_id, H5T_NATIVE_INT, &fillvalue ) < 0) TEST_ERROR;
+ if((plist_id = H5Pcreate (H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+ if(H5Pset_chunk(plist_id, RANK, dims_chunk) < 0) TEST_ERROR;
+ if(H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue) < 0) TEST_ERROR;
/*-------------------------------------------------------------------------
@@ -87,10 +87,10 @@ int main( void )
*/
/* Create a new dataset */
- if ((dataset_id = H5Dcreate( file_id , "Dataset1", H5T_NATIVE_INT, space_id, plist_id )) < 0) TEST_ERROR;
+ if((dataset_id = H5Dcreate2(file_id , "Dataset1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write the data. */
- if (H5Dwrite( dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data ) < 0) TEST_ERROR;
+ if(H5Dwrite(dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR;
/*-------------------------------------------------------------------------
* Set new dimensions for the array; shrink it
@@ -98,16 +98,16 @@ int main( void )
*/
/* Set new dimensions for the array. */
- if (H5Dset_extent( dataset_id , dims_new ) < 0) TEST_ERROR;
+ if(H5Dset_extent(dataset_id , dims_new) < 0) TEST_ERROR;
/* Get the space. */
- if ((space_id = H5Dget_space( dataset_id )) < 0) TEST_ERROR;
+ if((space_id = H5Dget_space(dataset_id)) < 0) TEST_ERROR;
/* Get dimensions. */
- if (H5Sget_simple_extent_dims( space_id, dims_out, NULL ) < 0) TEST_ERROR;
+ if(H5Sget_simple_extent_dims(space_id, dims_out, NULL) < 0) TEST_ERROR;
- if ( dims_out[0] != dims_new[0] ) TEST_ERROR;
- if ( dims_out[1] != dims_new[1] ) TEST_ERROR;
+ if(dims_out[0] != dims_new[0]) TEST_ERROR;
+ if(dims_out[1] != dims_new[1]) TEST_ERROR;
/*-------------------------------------------------------------------------
@@ -175,20 +175,20 @@ int main( void )
*-------------------------------------------------------------------------
*/
- H5Dclose( dataset_id );
- H5Sclose( space_id );
- H5Pclose( plist_id );
+ if(H5Dclose(dataset_id) < 0) TEST_ERROR
+ if(H5Sclose(space_id) < 0) TEST_ERROR
+ if(H5Pclose(plist_id) < 0) TEST_ERROR
PASSED();
TESTING("extend dataset create without fill value");
/* Create the data space with unlimited dimensions. */
- if ((space_id = H5Screate_simple( RANK, dims, maxdims )) < 0) TEST_ERROR;
+ if((space_id = H5Screate_simple(RANK, dims, maxdims)) < 0) TEST_ERROR;
/* Modify dataset creation properties, i.e. enable chunking. */
- if ((plist_id = H5Pcreate (H5P_DATASET_CREATE )) < 0) TEST_ERROR;
- if (H5Pset_chunk( plist_id, RANK, dims_chunk ) < 0) TEST_ERROR;
- if (H5Pset_fill_time( plist_id, H5D_FILL_TIME_ALLOC) < 0) TEST_ERROR;
+ if((plist_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR;
+ if(H5Pset_chunk(plist_id, RANK, dims_chunk) < 0) TEST_ERROR;
+ if(H5Pset_fill_time(plist_id, H5D_FILL_TIME_ALLOC) < 0) TEST_ERROR;
/*-------------------------------------------------------------------------
* Create and write one dataset
@@ -196,10 +196,10 @@ int main( void )
*/
/* Create a new dataset */
- if ((dataset_id = H5Dcreate( file_id , "Dataset2", H5T_NATIVE_INT, space_id, plist_id )) < 0) TEST_ERROR;
+ if((dataset_id = H5Dcreate2(file_id , "Dataset2", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write the data. */
- if (H5Dwrite( dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data ) < 0) TEST_ERROR;
+ if(H5Dwrite(dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR;
/*-------------------------------------------------------------------------
* Set new dimensions for the array; shrink it
@@ -207,15 +207,15 @@ int main( void )
*/
/* Set new dimensions for the array. */
- if (H5Dset_extent( dataset_id , dims_new ) < 0) TEST_ERROR;
+ if(H5Dset_extent(dataset_id , dims_new) < 0) TEST_ERROR;
/* Get the space. */
- if ((space_id = H5Dget_space( dataset_id )) < 0) TEST_ERROR;
+ if((space_id = H5Dget_space(dataset_id)) < 0) TEST_ERROR;
/* Get dimensions. */
- if (H5Sget_simple_extent_dims( space_id, dims_out, NULL ) < 0) TEST_ERROR;
+ if(H5Sget_simple_extent_dims(space_id, dims_out, NULL) < 0) TEST_ERROR;
- if ( dims_out[0] != dims_new[0] ) TEST_ERROR;
+ if(dims_out[0] != dims_new[0]) TEST_ERROR;
/*-------------------------------------------------------------------------
@@ -298,7 +298,7 @@ int main( void )
if(H5Pset_istore_k(fcpl,ISTORE_IK) < 0) TEST_ERROR;
/* Create a new file using properties. */
- if ((file_id = H5Fcreate( "set_extent_read.h5", H5F_ACC_TRUNC, fcpl, H5P_DEFAULT )) < 0) TEST_ERROR;
+ if((file_id = H5Fcreate("set_extent_read.h5", H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Close property list */
if(H5Pclose(fcpl) < 0) TEST_ERROR;
@@ -314,7 +314,7 @@ int main( void )
if(H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue) < 0) TEST_ERROR;
/* Create a new dataset within the file using cparms creation properties. */
- if((dataset_id = H5Dcreate(file_id , "Dataset1", H5T_NATIVE_INT, space_id, plist_id)) < 0) TEST_ERROR;
+ if((dataset_id = H5Dcreate2(file_id , "Dataset1", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write the data. */
if(H5Dwrite(dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR;
@@ -406,7 +406,7 @@ int main( void )
if(H5Pset_fill_time(plist_id, H5D_FILL_TIME_ALLOC) < 0) TEST_ERROR;
/* Create a new dataset within the file using cparms creation properties. */
- if((dataset_id = H5Dcreate(file_id , "Dataset2", H5T_NATIVE_INT, space_id, plist_id)) < 0) TEST_ERROR;
+ if((dataset_id = H5Dcreate2(file_id , "Dataset2", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT)) < 0) TEST_ERROR;
/* Write the data. */
if(H5Dwrite(dataset_id , H5T_NATIVE_INT, space_id, H5S_ALL, H5P_DEFAULT, data) < 0) TEST_ERROR;
diff --git a/test/space_overflow.c b/test/space_overflow.c
index dc3d4ec..f0e5e1d 100644
--- a/test/space_overflow.c
+++ b/test/space_overflow.c
@@ -53,15 +53,15 @@ main(void)
int i;
file = H5Fcreate("th5s.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- if(file<0)
+ if(file < 0)
printf("file<0!\n");
- for (i=0; i<H5S_MAX_RANK; i++)
+ for(i = 0; i < H5S_MAX_RANK; i++)
cur_dim[i] = 1;
space = H5Screate_simple(H5S_MAX_RANK, cur_dim, NULL);
- if(space<0)
+ if(space < 0)
printf("space<0!\n");
- dset = H5Dcreate(file, "dset", H5T_NATIVE_UCHAR, space, H5P_DEFAULT);
- if(dset<0)
+ dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dset < 0)
printf("dset<0!\n");
H5Sclose(space);
H5Dclose(dset);
diff --git a/test/stream_test.c b/test/stream_test.c
index 7cd8267..8fbdc72 100644
--- a/test/stream_test.c
+++ b/test/stream_test.c
@@ -226,16 +226,15 @@ static int sender (void)
* Create a new dataset within the file using defined dataspace and
* default dataset creation properties.
*/
- dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_INT, dataspace,
- H5P_DEFAULT);
- if (dataset < 0)
- {
- fprintf (stderr, "sender: couldn't create dataset '%s'\n", DATASETNAME);
- free (data);
- H5Fclose (file);
- H5Sclose (dataspace);
- H5Pclose (fapl);
- return (-8);
+ dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, dataspace,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dataset < 0) {
+ fprintf(stderr, "sender: couldn't create dataset '%s'\n", DATASETNAME);
+ free(data);
+ H5Fclose(file);
+ H5Sclose(dataspace);
+ H5Pclose(fapl);
+ return(-8);
}
/*
diff --git a/test/tarray.c b/test/tarray.c
index a0e2b10..b4ec846 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -97,8 +97,8 @@ test_array_atomic_1d(void)
CHECK(tid1, FAIL, "H5Tarray_create");
/* Create a dataset */
- dataset = H5Dcreate(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -276,8 +276,8 @@ test_array_atomic_3d(void)
CHECK(tid, FAIL, "H5Tarray_create");
/* Create a dataset */
- dataset = H5Dcreate(fid, "Dataset1", tid, sid, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, "Dataset1", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -408,8 +408,8 @@ test_array_array_atomic(void)
CHECK(tid1, FAIL, "H5Tarray_create");
/* Create a dataset */
- dataset = H5Dcreate(fid, "Dataset1", tid1, sid, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, "Dataset1", tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -579,8 +579,8 @@ test_array_compound_atomic(void)
CHECK(ret, FAIL, "H5Tclose");
/* Create a dataset */
- dataset = H5Dcreate(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -775,11 +775,11 @@ test_array_compound_array(void)
CHECK(tid3, FAIL, "H5Tarray_create");
/* Insert float array field */
- ret = H5Tinsert (tid2, "f", HOFFSET(s1_t,f), tid3);
+ ret = H5Tinsert(tid2, "f", HOFFSET(s1_t, f), tid3);
CHECK(ret, FAIL, "H5Tinsert");
/* Close array of floats field datatype */
- ret=H5Tclose(tid3);
+ ret = H5Tclose(tid3);
CHECK(ret, FAIL, "H5Tclose");
/* Create an array datatype to refer to */
@@ -787,15 +787,15 @@ test_array_compound_array(void)
CHECK(tid1, FAIL, "H5Tarray_create");
/* Close compound datatype */
- ret=H5Tclose(tid2);
+ ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -1070,15 +1070,15 @@ test_array_vlen_atomic(void)
CHECK(tid1, FAIL, "H5Tarray_create");
/* Close VL datatype */
- ret=H5Tclose(tid2);
+ ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -1282,7 +1282,7 @@ test_array_vlen_array(void)
CHECK(tid2, FAIL, "H5Tcreate");
/* Close nested array datatype */
- ret=H5Tclose(tid3);
+ ret = H5Tclose(tid3);
CHECK(ret, FAIL, "H5Tclose");
/* Create an array datatype to refer to */
@@ -1290,15 +1290,15 @@ test_array_vlen_array(void)
CHECK(tid1, FAIL, "H5Tarray_create");
/* Close VL datatype */
- ret=H5Tclose(tid2);
+ ret = H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -1605,8 +1605,8 @@ test_array_bkg(void)
/* Create the dataset */
/* ------------------ */
- dataset = H5Dcreate(fid, FIELDNAME, type, space, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, FIELDNAME, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write data to the dataset */
/* ------------------------- */
diff --git a/test/tattr.c b/test/tattr.c
index 4f1e211..b391836 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -183,8 +183,8 @@ test_attr_basic_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset=H5Dcreate(fid1,DSET1_NAME,H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL);
@@ -497,8 +497,8 @@ test_attr_flush(hid_t fapl)
spc = H5Screate(H5S_SCALAR);
CHECK(spc, FAIL, "H5Screate");
- set = H5Dcreate(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT);
- CHECK(set, FAIL, "H5Dcreate");
+ set = H5Dcreate2(fil, DSET1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(set, FAIL, "H5Dcreate2");
att = H5Acreate2(set, ".", ATTR1_NAME, H5T_NATIVE_DOUBLE, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(att, FAIL, "H5Acreate2");
@@ -568,8 +568,8 @@ test_attr_plist(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset=H5Dcreate(fid1,DSET1_NAME,H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
sid2 = H5Screate_simple(ATTR1_RANK, dims2, NULL);
@@ -681,25 +681,24 @@ test_attr_compound_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset=H5Dcreate(fid1,DSET1_NAME,H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset's dataspace */
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
/* Create the attribute datatype. */
- tid1 = H5Tcreate (H5T_COMPOUND, sizeof(struct attr4_struct));
+ tid1 = H5Tcreate(H5T_COMPOUND, sizeof(struct attr4_struct));
CHECK(tid1, FAIL, "H5Tcreate");
- attr4_field1_off=HOFFSET(struct attr4_struct, i);
+ attr4_field1_off = HOFFSET(struct attr4_struct, i);
ret = H5Tinsert(tid1, ATTR4_FIELDNAME1, attr4_field1_off, H5T_NATIVE_INT);
CHECK(ret, FAIL, "H5Tinsert");
- attr4_field2_off=HOFFSET(struct attr4_struct, d);
+ attr4_field2_off = HOFFSET(struct attr4_struct, d);
ret = H5Tinsert(tid1, ATTR4_FIELDNAME2, attr4_field2_off, H5T_NATIVE_DOUBLE);
CHECK(ret, FAIL, "H5Tinsert");
- attr4_field3_off=HOFFSET(struct attr4_struct, c);
- ret = H5Tinsert(tid1, ATTR4_FIELDNAME3, attr4_field3_off,
- H5T_NATIVE_SCHAR);
+ attr4_field3_off = HOFFSET(struct attr4_struct, c);
+ ret = H5Tinsert(tid1, ATTR4_FIELDNAME3, attr4_field3_off, H5T_NATIVE_SCHAR);
CHECK(ret, FAIL, "H5Tinsert");
/* Create dataspace for 1st attribute */
@@ -917,8 +916,8 @@ test_attr_scalar_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Create dataspace for attribute */
sid2 = H5Screate_simple(ATTR5_RANK, NULL, NULL);
@@ -1057,8 +1056,8 @@ test_attr_mult_write(hid_t fapl)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset = H5Dcreate(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, DSET1_NAME, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset's dataspace */
ret = H5Sclose(sid1);
@@ -1435,8 +1434,8 @@ test_attr_iterate(hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create a new dataset */
- dataset = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -1660,13 +1659,13 @@ test_attr_dtype_shared(hid_t fapl)
CHECK(space_id, FAIL, "H5Screate");
/* Create dataset */
- dset_id = H5Dcreate(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, DSET1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
/* Check reference count on named datatype */
ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Oget_info");
- VERIFY(oinfo.rc, 2, "H5Dcreate");
+ VERIFY(oinfo.rc, 2, "H5Oget_info");
/* Create attribute on dataset */
attr_id = H5Acreate2(dset_id, ".", ATTR1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -1899,8 +1898,8 @@ test_attr_dense_create(hid_t fcpl, hid_t fapl)
CHECK(dcpl, FAIL, "H5Pcreate");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -2034,8 +2033,8 @@ test_attr_dense_open(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pset_attr_creation_order");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -2174,8 +2173,8 @@ test_attr_dense_delete(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pset_attr_creation_order");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -2349,8 +2348,8 @@ test_attr_dense_rename(hid_t fcpl, hid_t fapl)
CHECK(dcpl, FAIL, "H5Pcreate");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -2508,8 +2507,8 @@ test_attr_dense_unlink(hid_t fcpl, hid_t fapl)
CHECK(dcpl, FAIL, "H5Pcreate");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &max_compact, &min_dense);
@@ -2642,8 +2641,8 @@ test_attr_dense_limits(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pget_attr_phase_change");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Retrieve limits for compact/dense attribute storage */
ret = H5Pget_attr_phase_change(dcpl, &rmax_compact, &rmin_dense);
@@ -2822,8 +2821,8 @@ test_attr_big(hid_t fcpl, hid_t fapl)
CHECK(ret, FAIL, "H5Pget_latest_format");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close property list */
ret = H5Pclose(dcpl);
@@ -3072,8 +3071,8 @@ test_attr_null_space(hid_t fcpl, hid_t fapl)
CHECK(null_sid, FAIL, "H5Screate");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Add attribute with 'null' dataspace */
@@ -3265,8 +3264,8 @@ test_attr_deprec(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Add attribute to dataset */
@@ -3484,8 +3483,8 @@ test_attr_corder_create_basic(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataspace */
ret = H5Sclose(sid);
@@ -3596,12 +3595,12 @@ test_attr_corder_create_compact(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -3796,12 +3795,12 @@ test_attr_corder_create_dense(hid_t fcpl, hid_t fapl)
CHECK(sid, FAIL, "H5Screate");
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -4135,12 +4134,12 @@ test_attr_corder_transition(hid_t fcpl, hid_t fapl)
* that size after everything is deleted -QAK
*/
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -4565,12 +4564,12 @@ test_attr_corder_delete(hid_t fcpl, hid_t fapl)
CHECK(fid, FAIL, "H5Fopen");
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -4895,12 +4894,12 @@ test_attr_info_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end if */
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -5135,12 +5134,12 @@ test_attr_delete_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end if */
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -5952,12 +5951,12 @@ test_attr_iterate2(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end if */
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -6278,12 +6277,12 @@ test_attr_open_by_idx(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end if */
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -6562,12 +6561,12 @@ test_attr_open(hbool_t new_format, hid_t fcpl, hid_t fapl)
} /* end if */
/* Create datasets */
- dset1 = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset1, FAIL, "H5Dcreate");
- dset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset2, FAIL, "H5Dcreate");
- dset3 = H5Dcreate(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
+ dset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
+ dset3 = H5Dcreate2(fid, DSET3_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
/* Work on all the datasets */
for(curr_dset = 0; curr_dset < NUM_DSETS; curr_dset++) {
@@ -6845,10 +6844,10 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl)
CHECK(dcpl, FAIL, "H5Pcreate");
/* Create datasets */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
- dataset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset2, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+ dataset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset2, FAIL, "H5Dcreate2");
/* Check on dataset's message storage status */
if(test_shared != 0) {
@@ -7171,10 +7170,10 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl)
CHECK(dcpl, FAIL, "H5Pcreate");
/* Create datasets */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
- dataset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset2, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+ dataset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset2, FAIL, "H5Dcreate2");
/* Check on dataset's message storage status */
if(test_shared != 0) {
@@ -7612,10 +7611,10 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl)
CHECK(dcpl, FAIL, "H5Pcreate");
/* Create datasets */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
- dataset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset2, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+ dataset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset2, FAIL, "H5Dcreate2");
/* Check on dataset's message storage status */
if(test_shared != 0) {
@@ -7976,10 +7975,10 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl)
CHECK(dcpl, FAIL, "H5Pcreate");
/* Create datasets */
- dataset = H5Dcreate(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
- dataset2 = H5Dcreate(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, dcpl);
- CHECK(dataset2, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid, DSET1_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
+ dataset2 = H5Dcreate2(fid, DSET2_NAME, H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset2, FAIL, "H5Dcreate2");
/* Check on dataset's message storage status */
if(test_shared != 0) {
diff --git a/test/testmeta.c b/test/testmeta.c
index 7d67af2..9aa4972 100644
--- a/test/testmeta.c
+++ b/test/testmeta.c
@@ -64,8 +64,8 @@ int main(void)
dataspace_id = H5Screate(H5S_SCALAR);
/* Create dataset */
- dataset_id = H5Dcreate(file_id, "/NumDataObj",
- H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT);
+ dataset_id = H5Dcreate2(file_id, "/NumDataObj",
+ H5T_NATIVE_UINT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write value to NumDataObj dataset */
status = H5Dwrite(dataset_id, H5T_NATIVE_UINT, H5S_ALL,
@@ -90,8 +90,8 @@ int main(void)
{
/* Create dataset */
sprintf(name, "/ExtArray%06d", i);
- dataset_id = H5Dcreate(file_id, name,
- H5T_NATIVE_FLOAT, dataspace_id, prop_id);
+ dataset_id = H5Dcreate2(file_id, name,
+ H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, prop_id, H5P_DEFAULT);
/* Close the identifier */
status = H5Dclose(dataset_id);
@@ -131,8 +131,8 @@ int main(void)
/* Create dataset */
sprintf(name, "DataArray%06d", i);
- dataset_id = H5Dcreate(group_id, name,
- H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT);
+ dataset_id = H5Dcreate2(group_id, name,
+ H5T_NATIVE_FLOAT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if(dataset_id < 0) {
fprintf(stderr, "Failed to create DataArray dataset.\n");
status = H5Fclose(file_id);
diff --git a/test/tfile.c b/test/tfile.c
index a940277..d89686f 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -233,12 +233,12 @@ test_file_create(void)
CHECK(dataspace_id, FAIL, "H5Screate_simple");
/* Create the dataset. */
- dataset_id = H5Dcreate(fid2, F2_DSET, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT);
- CHECK(dataset_id, FAIL, "H5Dcreate");
+ dataset_id = H5Dcreate2(fid2, F2_DSET, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
- for(i=0; i<F2_DIM0; i++)
- for(j=0; j<F2_DIM1; j++)
- data[i][j]=i*10+j;
+ for(i = 0; i < F2_DIM0; i++)
+ for(j = 0; j < F2_DIM1; j++)
+ data[i][j] = i * 10 + j;
/* Write data to the new dataset */
ret = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
@@ -804,13 +804,12 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
CHECK(dataspace_id, FAIL, "H5Screate_simple");
/* Create the dataset. */
- dataset_id = H5Dcreate(fid1, "/dset", H5T_NATIVE_INT, dataspace_id,
- H5P_DEFAULT);
- CHECK(dataset_id, FAIL, "H5Dcreate");
+ dataset_id = H5Dcreate2(fid1, "/dset", H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
- for(i=0; i<F2_DIM0; i++)
- for(j=0; j<F2_DIM1; j++)
- data[i][j]=i*10+j;
+ for(i = 0; i < F2_DIM0; i++)
+ for(j = 0; j < F2_DIM1; j++)
+ data[i][j] = i * 10 + j;
/* Write data to the new dataset */
ret = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
@@ -941,9 +940,8 @@ test_get_file_id(void)
dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
CHECK(dataspace_id, FAIL, "H5Screate_simple");
- dataset_id = H5Dcreate(group_id, DSET_NAME, H5T_NATIVE_INT, dataspace_id,
- H5P_DEFAULT);
- CHECK(dataset_id, FAIL, "H5Dcreate");
+ dataset_id = H5Dcreate2(group_id, DSET_NAME, H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
/* Test H5Iget_file_id() */
check_file_id(fid, dataset_id);
@@ -1149,8 +1147,8 @@ test_file_perm(void)
CHECK(file, FAIL, "H5Fcreate");
/* Create a dataset with the read-write file handle */
- dset = H5Dcreate(file, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT);
- CHECK(dset, FAIL, "H5Dcreate");
+ dset = H5Dcreate2(file, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
@@ -1162,9 +1160,9 @@ test_file_perm(void)
/* Create a dataset with the read-only file handle (should fail) */
H5E_BEGIN_TRY {
- dset = H5Dcreate(filero, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT);
+ dset = H5Dcreate2(filero, F2_DSET, H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
- VERIFY(dset, FAIL, "H5Dcreate");
+ VERIFY(dset, FAIL, "H5Dcreate2");
if(dset!=FAIL) {
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
@@ -1228,8 +1226,8 @@ test_file_freespace(void)
/* Create datasets in file */
for(u = 0; u < 10; u++) {
sprintf(name, "Dataset %u", u);
- dset = H5Dcreate(file, name, H5T_STD_U32LE, dspace, dcpl);
- CHECK(dset, FAIL, "H5Dcreate");
+ dset = H5Dcreate2(file, name, H5T_STD_U32LE, dspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
@@ -1380,15 +1378,15 @@ test_file_open_dot(void)
/* Create a dataset with no name using the file ID */
H5E_BEGIN_TRY {
- did = H5Dcreate(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ did = H5Dcreate2(fid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
- VERIFY(did, FAIL, "H5Dcreate");
+ VERIFY(did, FAIL, "H5Dcreate2");
/* Create a dataset with no name using the group ID */
H5E_BEGIN_TRY {
- did = H5Dcreate(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ did = H5Dcreate2(gid, ".", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
- VERIFY(did, FAIL, "H5Dcreate");
+ VERIFY(did, FAIL, "H5Dcreate2");
/* Open a dataset with no name using the file ID */
H5E_BEGIN_TRY {
@@ -1512,8 +1510,8 @@ test_file_open_overlap(void)
CHECK(sid, FAIL, "H5Screate");
/* Create dataset in group w/first file ID */
- did1 = H5Dcreate(gid, DSET1, H5T_NATIVE_INT, sid, H5P_DEFAULT);
- CHECK(did1, FAIL, "H5Dcreate");
+ did1 = H5Dcreate2(gid, DSET1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did1, FAIL, "H5Dcreate2");
/* Check number of objects opened in first file */
nobjs = H5Fget_obj_count(fid1, H5F_OBJ_LOCAL|H5F_OBJ_ALL);
@@ -1533,8 +1531,8 @@ test_file_open_overlap(void)
/* Create dataset with second file ID */
- did2 = H5Dcreate(fid2, DSET2, H5T_NATIVE_INT, sid, H5P_DEFAULT);
- CHECK(did2, FAIL, "H5Dcreate");
+ did2 = H5Dcreate2(fid2, DSET2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did2, FAIL, "H5Dcreate2");
/* Check number of objects opened in first file */
nobjs = H5Fget_obj_count(fid2, H5F_OBJ_ALL);
@@ -1612,8 +1610,8 @@ test_file_getname(void)
VERIFY(name_len, FAIL, "H5Fget_name");
/* Create a new dataset */
- dataset_id = H5Dcreate(file_id, TESTA_DSETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
- CHECK(dataset_id, FAIL, "H5Dcreate");
+ dataset_id = H5Dcreate2(file_id, TESTA_DSETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
/* Get and verify file name */
name_len = H5Fget_name(dataset_id, name, (size_t)TESTA_NAME_BUF_SIZE);
@@ -1775,8 +1773,8 @@ test_file_double_dataset_open(void)
space_id = H5Screate(H5S_SCALAR);
CHECK(space_id, FAIL, "H5Screate");
- dset1_id = H5Dcreate(file1_id, DSET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
- CHECK(dset1_id, FAIL, "H5Dcreate");
+ dset1_id = H5Dcreate2(file1_id, DSET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset1_id, FAIL, "H5Dcreate2");
dset2_id = H5Dopen2(file2_id, DSET_NAME, H5P_DEFAULT);
CHECK(dset2_id, FAIL, "H5Dopen2");
diff --git a/test/tgenprop.c b/test/tgenprop.c
index ba60cee..aad0db8 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -1360,9 +1360,9 @@ test_genprop_list_addprop(void)
/* Insert temporary property into class (with no callbacks) */
#ifdef H5_WANT_H5_V1_6_COMPAT
- ret = H5Pinsert(pid,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pinsert(pid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL);
#else /* H5_WANT_H5_V1_6_COMPAT */
- ret = H5Pinsert(pid,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pinsert(pid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL);
#endif /* H5_WANT_H5_V1_6_COMPAT */
CHECK_I(ret, "H5Pinsert");
@@ -1376,15 +1376,15 @@ test_genprop_list_addprop(void)
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
/* Create a dataset */
- did=H5Dcreate(fid,"Dataset1",H5T_NATIVE_INT,sid,pid);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check existence of added property (after using property list) */
- ret = H5Pexist(pid,PROP1_NAME);
+ ret = H5Pexist(pid, PROP1_NAME);
VERIFY(ret, 1, "H5Pexist");
/* Check values of property (set with default value) (after using property list) */
- ret = H5Pget(pid,PROP1_NAME,&prop1_value);
+ ret = H5Pget(pid, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
@@ -1443,9 +1443,9 @@ test_genprop_class_addprop(void)
/* Insert first property into class (with no callbacks) */
#ifdef H5_WANT_H5_V1_6_COMPAT
- ret = H5Pregister(cid,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL);
#else /* H5_WANT_H5_V1_6_COMPAT */
- ret = H5Pregister(cid,PROP1_NAME,PROP1_SIZE,PROP1_DEF_VALUE,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+ ret = H5Pregister(cid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#endif /* H5_WANT_H5_V1_6_COMPAT */
CHECK_I(ret, "H5Pregister");
@@ -1454,28 +1454,28 @@ test_genprop_class_addprop(void)
CHECK(pid, FAIL, "H5Pcreate");
/* Check existence of an original property */
- ret = H5Pexist(pid,H5D_CRT_DATA_PIPELINE_NAME);
+ ret = H5Pexist(pid, H5D_CRT_DATA_PIPELINE_NAME);
VERIFY(ret, 1, "H5Pexist");
/* Check existence of added property */
- ret = H5Pexist(pid,PROP1_NAME);
+ ret = H5Pexist(pid, PROP1_NAME);
VERIFY(ret, 1, "H5Pexist");
/* Check values of property (set with default value) */
- ret = H5Pget(pid,PROP1_NAME,&prop1_value);
+ ret = H5Pget(pid, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
/* Create a dataset */
- did=H5Dcreate(fid,"Dataset1",H5T_NATIVE_INT,sid,pid);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check existence of added property (after using property list) */
- ret = H5Pexist(pid,PROP1_NAME);
+ ret = H5Pexist(pid, PROP1_NAME);
VERIFY(ret, 1, "H5Pexist");
/* Check values of property (set with default value) (after using property list) */
- ret = H5Pget(pid,PROP1_NAME,&prop1_value);
+ ret = H5Pget(pid, PROP1_NAME, &prop1_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop1_value, *PROP1_DEF_VALUE, "H5Pget");
diff --git a/test/th5o.c b/test/th5o.c
index eb18515..f6e6f0b 100644
--- a/test/th5o.c
+++ b/test/th5o.c
@@ -77,8 +77,8 @@ test_h5o_open(void)
CHECK(dspace, FAIL, "H5Screate_simple");
/* Create the dataset. */
- dset = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT);
- CHECK(dset, FAIL, "H5Dcreate");
+ dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Sclose(dspace);
@@ -183,8 +183,8 @@ test_h5o_close(void)
CHECK(dspace, FAIL, "H5Screate_simple");
/* Create the dataset. */
- dset = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT);
- CHECK(dset, FAIL, "H5Dcreate");
+ dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
ret = H5Oclose(dset);
CHECK(ret, FAIL, "H5Oclose");
@@ -279,8 +279,8 @@ test_h5o_open_by_addr(void)
CHECK(dspace, FAIL, "H5Screate_simple");
/* Create the dataset. */
- dset = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT);
- CHECK(dset, FAIL, "H5Dcreate");
+ dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
ret = H5Dclose(dset);
CHECK(ret, FAIL, "H5Dclose");
ret = H5Sclose(dspace);
@@ -404,8 +404,8 @@ test_h5o_refcount(void)
CHECK(dspace, FAIL, "H5Screate_simple");
/* Create the dataset. */
- dset = H5Dcreate(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT);
- CHECK(dset, FAIL, "H5Dcreate");
+ dset = H5Dcreate2(fid, "dataset", H5T_NATIVE_INT, dspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
ret = H5Sclose(dspace);
CHECK(ret, FAIL, "H5Sclose");
diff --git a/test/th5s.c b/test/th5s.c
index 3c872ca..196e777 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -243,12 +243,12 @@ test_h5s_basic(void)
/* This dataset's space has no extent; it should not be created */
H5E_BEGIN_TRY {
- dset1 = H5Dcreate(fid1, BASICDATASET, H5T_NATIVE_INT, sid1, H5P_DEFAULT);
+ dset1 = H5Dcreate2(fid1, BASICDATASET, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY
- VERIFY(dset1, FAIL, "H5Dcreate");
+ VERIFY(dset1, FAIL, "H5Dcreate2");
- dset1 = H5Dcreate(fid1, BASICDATASET2, H5T_NATIVE_INT, sid2, H5P_DEFAULT);
- CHECK(dset1, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid1, BASICDATASET2, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset1, FAIL, "H5Dcreate2");
/* Try some writes with the bad dataspace (sid1) */
H5E_BEGIN_TRY {
@@ -383,8 +383,8 @@ test_h5s_null(void)
VERIFY(ret, FAIL, "H5Sselect_elements");
/* Create first dataset */
- did = H5Dcreate(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Write "nothing" to the dataset */
ret = H5Dwrite(did, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &uval);
@@ -738,8 +738,8 @@ test_h5s_scalar_write(void)
VERIFY(ext_type, H5S_SCALAR, "H5Sget_simple_extent_type");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UINT,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
ret = H5Dwrite(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space3_data);
CHECK(ret, FAIL, "H5Dwrite");
@@ -882,8 +882,8 @@ test_h5s_compound_scalar_write(void)
VERIFY(rank, 0, "H5Sget_simple_extent_dims");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &space4_data);
CHECK(ret, FAIL, "H5Dwrite");
@@ -996,7 +996,7 @@ test_h5s_chunk(void)
hsize_t csize[2];
int i,j;
- fileID = H5Fcreate(DATAFILE,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);
+ fileID = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fileID, FAIL, "H5Fcreate");
plist_id = H5Pcreate(H5P_DATASET_CREATE);
@@ -1013,24 +1013,24 @@ test_h5s_chunk(void)
space_id = H5Screate_simple(2, dims, NULL);
CHECK(space_id, FAIL, "H5Screate_simple");
- dsetID = H5Dcreate(fileID,"coords",H5T_NATIVE_FLOAT,space_id,plist_id);
- CHECK(dsetID, FAIL, "H5Dcreate");
+ dsetID = H5Dcreate2(fileID, "coords", H5T_NATIVE_FLOAT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ CHECK(dsetID, FAIL, "H5Dcreate2");
/* Initialize float array */
- for(i=0; i<50000; i++)
- for(j=0; j<3; j++)
- chunk_data_flt[i][j]=(float)((i+1)*2.5-j*100.3);
+ for(i = 0; i < 50000; i++)
+ for(j = 0; j < 3; j++)
+ chunk_data_flt[i][j] = (float)((i + 1) * 2.5 - j * 100.3);
- status= H5Dwrite(dsetID,H5T_NATIVE_FLOAT,H5S_ALL,H5S_ALL,H5P_DEFAULT,chunk_data_flt);
+ status = H5Dwrite(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt);
CHECK(status, FAIL, "H5Dwrite");
- status=H5Pclose(plist_id);
+ status = H5Pclose(plist_id);
CHECK(status, FAIL, "H5Pclose");
- status=H5Sclose(space_id);
+ status = H5Sclose(space_id);
CHECK(status, FAIL, "H5Sclose");
- status=H5Dclose(dsetID);
+ status = H5Dclose(dsetID);
CHECK(status, FAIL, "H5Dclose");
- status=H5Fclose(fileID);
+ status = H5Fclose(fileID);
CHECK(status, FAIL, "H5Fclose");
/* Reset/initialize the data arrays to read in */
diff --git a/test/titerate.c b/test/titerate.c
index 9aef367..72038d9 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -157,8 +157,8 @@ test_iter_group(hid_t fapl, hbool_t new_format)
for(i=0; i< NDATASETS; i++) {
sprintf(name,"Dataset %d",i);
- dataset = H5Dcreate(file, name, datatype, filespace, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Keep a copy of the dataset names around for later */
lnames[i] = HDstrdup(name);
@@ -403,8 +403,8 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format)
filespace = H5Screate(H5S_SCALAR);
CHECK(filespace, FAIL, "H5Screate");
- dataset = H5Dcreate(file, "Dataset", H5T_NATIVE_INT, filespace, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, "Dataset", H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
for(i = 0; i < NATTR; i++) {
sprintf(name, "Attribute %02d", i);
@@ -624,8 +624,8 @@ test_iter_group_large(hid_t fapl)
} /* end for */
/* Create a dataset */
- dataset = H5Dcreate(file, "Dataset1", H5T_STD_U32LE, sid, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, "Dataset1", H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Add the name to the list of objects in the root group */
HDstrcpy(names[ITER_NGROUPS].name, "Dataset1");
@@ -717,13 +717,13 @@ static void test_grp_memb_funcs(hid_t fapl)
datatype = H5Tcopy(H5T_NATIVE_INT);
CHECK(datatype, FAIL, "H5Tcopy");
- filespace=H5Screate(H5S_SCALAR);
+ filespace = H5Screate(H5S_SCALAR);
CHECK(filespace, FAIL, "H5Screate");
- for(i = 0; i< NDATASETS; i++) {
- sprintf(name,"Dataset %d",i);
- dataset = H5Dcreate(file, name, datatype, filespace, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ for(i = 0; i < NDATASETS; i++) {
+ sprintf(name, "Dataset %d", i);
+ dataset = H5Dcreate2(file, name, datatype, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Keep a copy of the dataset names around for later */
dnames[i] = HDstrdup(name);
diff --git a/test/tmisc.c b/test/tmisc.c
index 41feb80..88c73b4 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -319,8 +319,8 @@ test_misc1(void)
CHECK(dataspace, FAIL, "H5Screate");
/* Write the dataset the first time. */
- dataset = H5Dcreate(file, MISC1_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, MISC1_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
i = MISC1_VAL;
ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &i);
@@ -334,8 +334,8 @@ test_misc1(void)
CHECK(ret, FAIL, "H5Ldelete");
/* Write the dataset for the second time with a different value. */
- dataset = H5Dcreate(file, MISC1_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, MISC1_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
i = MISC1_VAL2;
ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &i);
@@ -578,8 +578,8 @@ test_misc3(void)
CHECK(dcpl, FAIL, "H5Pset_fill_value");
/* Create the dataset */
- dataset = H5Dcreate(file, MISC3_DSET_NAME, H5T_NATIVE_INT, dataspace, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, MISC3_DSET_NAME, H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Read from the dataset (should be fill-values) */
ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &read_buf);
@@ -871,45 +871,45 @@ test_misc5(void)
MESSAGE(5, ("Testing several level deep nested compound & VL datatypes \n"));
/* Write the dataset out */
- loc_id=H5Fcreate(MISC5_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(loc_id,FAIL,"H5Fcreate");
+ loc_id = H5Fcreate(MISC5_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(loc_id, FAIL, "H5Fcreate");
/* Create the memory structure to write */
- str1hndl=create_struct1();
- CHECK(str1hndl,NULL,"create_struct1");
+ str1hndl = create_struct1();
+ CHECK(str1hndl, NULL, "create_struct1");
/* Create the dataspace */
- dims[0]=MISC5_NELMTOPLVL;
- space_id=H5Screate_simple(MISC5_DSETRANK, dims, NULL);
- CHECK(space_id,FAIL,"H5Screate_simple");
+ dims[0] = MISC5_NELMTOPLVL;
+ space_id = H5Screate_simple(MISC5_DSETRANK, dims, NULL);
+ CHECK(space_id, FAIL, "H5Screate_simple");
/* Create the dataset */
- dataset_id=H5Dcreate(loc_id, MISC5_DSETNAME, str1hndl->st1h_id, space_id, H5P_DEFAULT);
- CHECK(dataset_id,FAIL,"H5Dcreate");
+ dataset_id = H5Dcreate2(loc_id, MISC5_DSETNAME, str1hndl->st1h_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
/* Create the variable-length buffer */
- buf.len=MISC5_DBGNELM1;
- buf.p=malloc((buf.len)*sizeof(misc5_struct1));
- CHECK(buf.p,NULL,"malloc");
+ buf.len = MISC5_DBGNELM1;
+ buf.p = malloc((buf.len) * sizeof(misc5_struct1));
+ CHECK(buf.p, NULL, "malloc");
/* Create the top-level VL information */
- for(i=0; i<MISC5_DBGNELM1; i++)
- set_struct1(&(((misc5_struct1 *) (buf.p))[i]));
+ for(i = 0; i < MISC5_DBGNELM1; i++)
+ set_struct1(&(((misc5_struct1 *)(buf.p))[i]));
/* Write the data out */
- ret=H5Dwrite(dataset_id, str1hndl->st1h_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf);
- CHECK(ret,FAIL,"H5Dwrite");
+ ret = H5Dwrite(dataset_id, str1hndl->st1h_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf);
+ CHECK(ret, FAIL, "H5Dwrite");
/* Release the top-level VL information */
- for(j=0; j<MISC5_DBGNELM1; j++)
- clear_struct1(&((( misc5_struct1 *)(buf.p))[j]));
+ for(j = 0; j < MISC5_DBGNELM1; j++)
+ clear_struct1(&(((misc5_struct1 *)(buf.p))[j]));
/* Free the variable-length buffer */
free(buf.p);
/* Close dataset */
- ret=H5Dclose(dataset_id);
- CHECK(ret,FAIL,"H5Dclose");
+ ret = H5Dclose(dataset_id);
+ CHECK(ret, FAIL, "H5Dclose");
/* Close dataspace */
ret=H5Sclose(space_id);
@@ -998,28 +998,28 @@ test_misc6(void)
MESSAGE(5, ("Testing object header continuation code \n"));
/* Create the file */
- loc_id=H5Fcreate(MISC6_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(loc_id,FAIL,"H5Fcreate");
+ loc_id = H5Fcreate(MISC6_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(loc_id, FAIL, "H5Fcreate");
/* Create the dataspace */
- space_id=H5Screate(H5S_SCALAR);
- CHECK(space_id,FAIL,"H5Screate");
+ space_id = H5Screate(H5S_SCALAR);
+ CHECK(space_id, FAIL, "H5Screate");
/* Create the first dataset */
- dataset_id=H5Dcreate(loc_id, MISC6_DSETNAME1, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
- CHECK(dataset_id,FAIL,"H5Dcreate");
+ dataset_id = H5Dcreate2(loc_id, MISC6_DSETNAME1, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
/* Close dataset */
- ret=H5Dclose(dataset_id);
- CHECK(ret,FAIL,"H5Dclose");
+ ret = H5Dclose(dataset_id);
+ CHECK(ret, FAIL, "H5Dclose");
/* Create the second dataset */
- dataset_id=H5Dcreate(loc_id, MISC6_DSETNAME2, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
- CHECK(dataset_id,FAIL,"H5Dcreate");
+ dataset_id = H5Dcreate2(loc_id, MISC6_DSETNAME2, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate2");
/* Close dataset */
- ret=H5Dclose(dataset_id);
- CHECK(ret,FAIL,"H5Dclose");
+ ret = H5Dclose(dataset_id);
+ CHECK(ret, FAIL, "H5Dclose");
/* Close file */
ret = H5Fclose(loc_id);
@@ -1115,8 +1115,8 @@ test_misc7(void)
VERIFY(ret, FAIL, "H5Tcommit2");
/* Attempt to use empty compound datatype to create dataset */
- did = H5Dcreate(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT);
- VERIFY(ret, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(ret, FAIL, "H5Dcreate2");
/* Add a field to the compound datatype */
ret = H5Tinsert(tid, "a", (size_t)0, H5T_NATIVE_INT);
@@ -1127,8 +1127,8 @@ test_misc7(void)
CHECK(ret, FAIL, "H5Tcommit2");
/* Attempt to use compound datatype to create dataset now - should work */
- did = H5Dcreate(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Close dataset */
ret = H5Dclose(did);
@@ -1147,20 +1147,20 @@ test_misc7(void)
VERIFY(ret, FAIL, "H5Tcommit2");
/* Attempt to use empty enum datatype to create dataset */
- did = H5Dcreate(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT);
- VERIFY(did,FAIL,"H5Dcreate");
+ did = H5Dcreate2(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VERIFY(did, FAIL, "H5Dcreate2");
/* Add a member to the enum datatype */
ret = H5Tenum_insert(tid, "a", &enum_value);
- CHECK(ret,FAIL,"H5Tenum_insert");
+ CHECK(ret, FAIL, "H5Tenum_insert");
/* Attempt to commit the enum datatype now - should work */
ret = H5Tcommit2(fid, MISC7_TYPENAME2, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(ret, FAIL, "H5Tcommit2");
/* Attempt to use enum datatype to create dataset now - should work */
- did = H5Dcreate(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Close dataset */
ret = H5Dclose(did);
@@ -1252,14 +1252,14 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Pclose");
/* Create a simple dataspace */
- sid = H5Screate_simple(rank,dims,NULL);
+ sid = H5Screate_simple(rank, dims, NULL);
CHECK(sid, FAIL, "H5Screate_simple");
/* Select a hyperslab which coincides with chunk boundaries */
/* (For later use) */
- start[0]=1; start[1]=1;
- count[0]=(MISC8_CHUNK_DIM0*2)-1; count[1]=(MISC8_CHUNK_DIM1*2)-1;
- ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,NULL,count,NULL);
+ start[0] = 1; start[1] = 1;
+ count[0] = (MISC8_CHUNK_DIM0 * 2) - 1; count[1] = (MISC8_CHUNK_DIM1 * 2) - 1;
+ ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL);
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Create a dataset creation property list */
@@ -1272,17 +1272,17 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Pset_layout");
/* Set the space allocation time to early */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a contiguous dataset, with space allocation early */
- did = H5Dcreate(fid, MISC8_DSETNAME1, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1294,11 +1294,11 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a contiguous dataset, with space allocation late */
- did = H5Dcreate(fid, MISC8_DSETNAME2, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size before data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
VERIFY(storage_size, 0, "H5Dget_storage_size");
/* Write data */
@@ -1306,24 +1306,24 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Check the storage size after data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
/* Set the space allocation time to incremental */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a contiguous dataset, with space allocation late */
- did = H5Dcreate(fid, MISC8_DSETNAME3, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size before data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
VERIFY(storage_size, 0, "H5Dget_storage_size");
/* Write data */
@@ -1331,9 +1331,9 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Check the storage size after data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1345,39 +1345,39 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Pset_layout");
/* Set the space allocation time to late */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a contiguous dataset, with space allocation late */
/* Should fail */
- did = H5Dcreate(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, dcpl);
- VERIFY(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ VERIFY(did, FAIL, "H5Dcreate2");
/* Set the space allocation time to incremental */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a contiguous dataset, with space allocation incremental */
/* Should fail */
- did = H5Dcreate(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, dcpl);
- VERIFY(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ VERIFY(did, FAIL, "H5Dcreate2");
/* Set the space allocation time to early */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Set the fill time to allocation */
- ret = H5Pset_fill_time(dcpl,H5D_FILL_TIME_ALLOC);
+ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a contiguous dataset, with space allocation early */
- did = H5Dcreate(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1390,21 +1390,21 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Pset_layout");
/* Set the space allocation time to early */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Use chunked storage for this dataset */
- ret = H5Pset_chunk(dcpl,rank,chunk_dims);
+ ret = H5Pset_chunk(dcpl, rank, chunk_dims);
CHECK(ret, FAIL, "H5Pset_chunk");
/* Create a chunked dataset, with space allocation early */
- did = H5Dcreate(fid, MISC8_DSETNAME5, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME5, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size after data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
@@ -1412,19 +1412,19 @@ test_misc8(void)
#ifndef H5_HAVE_PARALLEL
/* Set the space allocation time to late */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Use chunked storage for this dataset */
- ret = H5Pset_chunk(dcpl,rank,chunk_dims);
+ ret = H5Pset_chunk(dcpl, rank, chunk_dims);
CHECK(ret, FAIL, "H5Pset_chunk");
/* Create a chunked dataset, with space allocation late */
- did = H5Dcreate(fid, MISC8_DSETNAME6, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME6, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size after dataset is created */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
VERIFY(storage_size, 0, "H5Dget_storage_size");
/* Write part of the dataset */
@@ -1432,24 +1432,24 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Check the storage size after data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
- VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ VERIFY(storage_size, MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
/* Close dataset ID */
ret = H5Dclose(did);
CHECK(ret, FAIL, "H5Dclose");
/* Set the space allocation time to incremental */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a chunked dataset, with space allocation incremental */
- did = H5Dcreate(fid, MISC8_DSETNAME7, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME7, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size before data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
VERIFY(storage_size, 0, "H5Dget_storage_size");
/* Write part of the dataset */
@@ -1457,8 +1457,8 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Check the storage size after only four chunks are written */
- storage_size=H5Dget_storage_size(did);
- VERIFY(storage_size, 4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
+ storage_size = H5Dget_storage_size(did);
+ VERIFY(storage_size, 4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
/* Write entire dataset */
ret = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -1479,7 +1479,7 @@ test_misc8(void)
#endif /* VERIFY_DATA */
/* Check the storage size after data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
VERIFY(storage_size, MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT), "H5Dget_storage_size");
@@ -1499,21 +1499,21 @@ test_misc8(void)
#endif /* end H5_HAVE_FILTER_DEFLATE */
/* Create a chunked dataset, with space allocation early */
- did = H5Dcreate(fid, MISC8_DSETNAME8, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME8, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Write part of the dataset */
ret = H5Dwrite(did, H5T_NATIVE_INT, sid, sid, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Check the storage size after data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
#ifdef H5_HAVE_FILTER_DEFLATE
- if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT)))
+ if(storage_size >= (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)))
TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size);
#else /* Compression is not configured */
- if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT)))
+ if(storage_size != (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)))
TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size);
#endif /* H5_HAVE_FILTER_DEFLATE */
@@ -1523,15 +1523,15 @@ test_misc8(void)
#ifndef H5_HAVE_PARALLEL
/* Set the space allocation time to late */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a chunked dataset, with space allocation late */
- did = H5Dcreate(fid, MISC8_DSETNAME9, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME9, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size before data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
VERIFY(storage_size, 0, "H5Dget_storage_size");
/* Write part of the dataset */
@@ -1539,13 +1539,13 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Check the storage size after only four chunks are written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
#ifdef H5_HAVE_FILTER_DEFLATE
- if(storage_size>=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT)))
+ if(storage_size >= (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)))
TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size);
#else /* Compression is not configured */
- if(storage_size!=(MISC8_DIM0*MISC8_DIM1*H5Tget_size(H5T_NATIVE_INT)))
+ if(storage_size != (MISC8_DIM0 * MISC8_DIM1 * H5Tget_size(H5T_NATIVE_INT)))
TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size);
#endif /* H5_HAVE_FILTER_DEFLATE */
@@ -1583,15 +1583,15 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Dclose");
/* Set the space allocation time to incremental */
- ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create a chunked dataset, with space allocation incremental */
- did = H5Dcreate(fid, MISC8_DSETNAME10, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC8_DSETNAME10, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the storage size before data is written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
VERIFY(storage_size, 0, "H5Dget_storage_size");
/* Write part of the dataset */
@@ -1599,13 +1599,13 @@ test_misc8(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Check the storage size after only four chunks are written */
- storage_size=H5Dget_storage_size(did);
+ storage_size = H5Dget_storage_size(did);
CHECK(storage_size, 0, "H5Dget_storage_size");
#ifdef H5_HAVE_FILTER_DEFLATE
- if(storage_size>=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT)))
+ if(storage_size >= (4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT)))
TestErrPrintf("Error on line %d: data wasn't compressed! storage_size=%u\n",__LINE__,(unsigned)storage_size);
#else /* Compression is not configured */
- if(storage_size!=(4*MISC8_CHUNK_DIM0*MISC8_CHUNK_DIM1*H5Tget_size(H5T_NATIVE_INT)))
+ if(storage_size != (4 * MISC8_CHUNK_DIM0 * MISC8_CHUNK_DIM1 * H5Tget_size(H5T_NATIVE_INT)))
TestErrPrintf("Error on line %d: wrong storage size! storage_size=%u\n",__LINE__,(unsigned)storage_size);
#endif /* H5_HAVE_FILTER_DEFLATE */
@@ -1716,11 +1716,11 @@ test_misc10(void)
MESSAGE(5, ("Testing using old dataset creation property list\n"));
/* Generate the correct name for the test file, by prepending the source path */
- if (srcdir && ((strlen(srcdir) + strlen(MISC10_FILE_OLD) + 1) < sizeof(testfile))) {
- strcpy(testfile, srcdir);
- strcat(testfile, "/");
+ if(srcdir && ((HDstrlen(srcdir) + HDstrlen(MISC10_FILE_OLD) + 1) < sizeof(testfile))) {
+ HDstrcpy(testfile, srcdir);
+ HDstrcat(testfile, "/");
}
- strcat(testfile, MISC10_FILE_OLD);
+ HDstrcat(testfile, MISC10_FILE_OLD);
/*
* Open the old file and the dataset and get old settings.
@@ -1743,29 +1743,29 @@ test_misc10(void)
file_new = H5Fcreate(MISC10_FILE_NEW, H5F_ACC_TRUNC , fcpl, H5P_DEFAULT);
CHECK(file_new, FAIL, "H5Fcreate");
- dataset_new = H5Dcreate(file_new, MISC10_DSETNAME, type, space, dcpl);
- CHECK(dataset_new, FAIL, "H5Dcreate");
+ dataset_new = H5Dcreate2(file_new, MISC10_DSETNAME, type, space, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset_new, FAIL, "H5Dcreate2");
/* Close new dataset & file */
- ret=H5Dclose(dataset_new);
+ ret = H5Dclose(dataset_new);
CHECK(ret, FAIL, "H5Dclose");
- ret=H5Fclose(file_new);
+ ret = H5Fclose(file_new);
CHECK(ret, FAIL, "H5Fclose");
/* Close old dataset information */
- ret=H5Tclose(type);
+ ret = H5Tclose(type);
CHECK(ret, FAIL, "H5Tclose");
- ret=H5Sclose(space);
+ ret = H5Sclose(space);
CHECK(ret, FAIL, "H5Sclose");
- ret=H5Dclose(dataset);
+ ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
- ret=H5Pclose(dcpl);
+ ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
/* Close old file information */
- ret=H5Fclose(file);
+ ret = H5Fclose(file);
CHECK(ret, FAIL, "H5Fclose");
- ret=H5Pclose(fcpl);
+ ret = H5Pclose(fcpl);
CHECK(ret, FAIL, "H5Pclose");
} /* end test_misc10() */
@@ -1992,8 +1992,8 @@ test_misc12(void)
CHECK(ret, FAIL, "H5Pset_chunk");
/* Create a dataset */
- dataset = H5Dcreate(fid1, MISC12_DSET_NAME, tid1, sid1, cparms);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, MISC12_DSET_NAME, tid1, sid1, H5P_DEFAULT, cparms, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -2017,7 +2017,7 @@ test_misc12(void)
CHECK(ret, FAIL, "H5Dwrite");
/* Read all data back */
- ret= H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
for(i = 0; i < MISC12_SPACE1_DIM1; i++)
@@ -2083,14 +2083,14 @@ create_dataset(hid_t loc_id, const char *name, hid_t dcpl)
herr_t ret; /* Generic return value */
/* Create dataspace for use with dataset */
- dims[0]=MISC13_DIM1;
- dims[1]=MISC13_DIM2;
- sid=H5Screate_simple(MISC13_RANK, dims, NULL);
+ dims[0] = MISC13_DIM1;
+ dims[1] = MISC13_DIM2;
+ sid = H5Screate_simple(MISC13_RANK, dims, NULL);
CHECK(sid, FAIL, "H5Screate_simple");
/* Create contiguous dataset in root group */
- dsid = H5Dcreate(loc_id, name, H5T_NATIVE_UINT, sid, dcpl);
- CHECK(dsid, FAIL, "H5Dcreate");
+ dsid = H5Dcreate2(loc_id, name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dsid, FAIL, "H5Dcreate2");
/* Write some data to dataset */
ret = H5Dwrite(dsid, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT, m13_data);
@@ -2435,10 +2435,10 @@ test_misc14(void)
/* Increase the metadata block size */
/* (This makes certain that all the data blocks are allocated together) */
- fapl=H5Pcreate(H5P_FILE_ACCESS);
+ fapl = H5Pcreate(H5P_FILE_ACCESS);
CHECK(fapl, FAIL, "H5Pcreate");
- ret=H5Pset_meta_block_size(fapl,(hsize_t)MISC14_METADATA_SIZE);
+ ret = H5Pset_meta_block_size(fapl, (hsize_t)MISC14_METADATA_SIZE);
CHECK(ret, FAIL, "H5Pset_meta_block_size");
/* Create dataspace to use */
@@ -2450,15 +2450,15 @@ test_misc14(void)
CHECK(file_id, FAIL, "H5Fcreate");
/* Create first dataset & write data */
- Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT);
- CHECK(Dataset1, FAIL, "H5Dcreate");
+ Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(Dataset1, FAIL, "H5Dcreate2");
ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1);
CHECK(ret, FAIL, "H5Dwrite");
/* Create second dataset (to be unlinked). */
- Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT);
- CHECK(Dataset2, FAIL, "H5Dcreate");
+ Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(Dataset2, FAIL, "H5Dcreate2");
ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2);
CHECK(ret, FAIL, "H5Dwrite");
@@ -2466,7 +2466,7 @@ test_misc14(void)
/* Check data from first dataset */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
- if(!DBL_ABS_EQUAL(rdata,data1))
+ if(!DBL_ABS_EQUAL(rdata, data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Unlink second dataset */
@@ -2498,15 +2498,15 @@ test_misc14(void)
CHECK(file_id, FAIL, "H5Fcreate");
/* Create first dataset & write data */
- Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT);
- CHECK(Dataset1, FAIL, "H5Dcreate");
+ Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(Dataset1, FAIL, "H5Dcreate2");
ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1);
CHECK(ret, FAIL, "H5Dwrite");
/* Create second dataset */
- Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT);
- CHECK(Dataset2, FAIL, "H5Dcreate");
+ Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(Dataset2, FAIL, "H5Dcreate2");
ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2);
CHECK(ret, FAIL, "H5Dwrite");
@@ -2546,22 +2546,22 @@ test_misc14(void)
CHECK(file_id, FAIL, "H5Fcreate");
/* Create first dataset & write data */
- Dataset1 = H5Dcreate(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT);
- CHECK(Dataset1, FAIL, "H5Dcreate");
+ Dataset1 = H5Dcreate2(file_id, MISC14_DSET1_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(Dataset1, FAIL, "H5Dcreate2");
ret = H5Dwrite(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data1);
CHECK(ret, FAIL, "H5Dwrite");
/* Create second dataset */
- Dataset2 = H5Dcreate(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT);
- CHECK(Dataset2, FAIL, "H5Dcreate");
+ Dataset2 = H5Dcreate2(file_id, MISC14_DSET2_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(Dataset2, FAIL, "H5Dcreate2");
ret = H5Dwrite(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data2);
CHECK(ret, FAIL, "H5Dwrite");
/* Create third dataset */
- Dataset3 = H5Dcreate(file_id, MISC14_DSET3_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT);
- CHECK(Dataset2, FAIL, "H5Dcreate");
+ Dataset3 = H5Dcreate2(file_id, MISC14_DSET3_NAME, H5T_NATIVE_DOUBLE, DataSpace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(Dataset2, FAIL, "H5Dcreate2");
ret = H5Dwrite(Dataset3, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data3);
CHECK(ret, FAIL, "H5Dwrite");
@@ -2709,24 +2709,24 @@ test_misc16(void)
CHECK(ret, FAIL, "H5Tset_strpad");*/
/* Create a dataset */
- dataset=H5Dcreate(file,MISC16_DSET_NAME,tid,sid,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, MISC16_DSET_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Read dataset from disk */
- ret=H5Dread(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Compare data read in */
- for(i=0; i<MISC16_SPACE_DIM; i++) {
- if(HDstrlen(wdata[i])!=strlen(rdata[i])) {
+ for(i = 0; i < MISC16_SPACE_DIM; i++) {
+ if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
continue;
} /* end if */
- if( HDstrcmp(wdata[i],rdata[i]) != 0 ) {
+ if(HDstrcmp(wdata[i], rdata[i]) != 0 ) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
continue;
} /* end if */
@@ -2785,24 +2785,24 @@ test_misc17(void)
CHECK(ret, FAIL, "H5Tset_strpad");
/* Create a dataset */
- dataset=H5Dcreate(file,MISC17_DSET_NAME,tid,sid,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, MISC17_DSET_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Read dataset from disk */
- ret=H5Dread(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Compare data in the way of strings. */
- for(i=0; i<MISC17_SPACE_DIM1; i++) {
- if(HDstrlen(wdata[i])!=strlen(rdata[i])) {
+ for(i = 0; i < MISC17_SPACE_DIM1; i++) {
+ if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
continue;
} /* end if */
- if( HDstrcmp(wdata[i],rdata[i]) != 0 ) {
+ if(HDstrcmp(wdata[i], rdata[i]) != 0 ) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
continue;
} /* end if */
@@ -2851,8 +2851,8 @@ test_misc18(void)
CHECK(sid, FAIL, "H5Screate");
/* Create first dataset */
- did1 = H5Dcreate(fid, MISC18_DSET1_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT);
- CHECK(did1, FAIL, "H5Dcreate");
+ did1 = H5Dcreate2(fid, MISC18_DSET1_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did1, FAIL, "H5Dcreate2");
/* Get object information */
ret = H5Oget_info(fid, MISC18_DSET1_NAME, &oinfo, H5P_DEFAULT);
@@ -2864,8 +2864,8 @@ test_misc18(void)
VERIFY(oinfo.num_attrs, 0, "H5Oget_info");
/* Create second dataset */
- did2 = H5Dcreate(fid, MISC18_DSET2_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT);
- CHECK(did2, FAIL, "H5Screate_simple");
+ did2 = H5Dcreate2(fid, MISC18_DSET2_NAME, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did2, FAIL, "H5Dcreate2");
/* Get object information */
ret = H5Oget_info(fid, MISC18_DSET2_NAME, &oinfo, H5P_DEFAULT);
@@ -2877,9 +2877,9 @@ test_misc18(void)
VERIFY(oinfo.num_attrs, 0, "H5Oget_info");
/* Loop creating attributes on each dataset, flushing them to the file each time */
- for(u=0; u<10; u++) {
+ for(u = 0; u < 10; u++) {
/* Set up attribute name */
- sprintf(attr_name,"Attr %u",u);
+ sprintf(attr_name, "Attr %u", u);
/* Create & close attribute on first dataset */
aid = H5Acreate2(did1, ".", attr_name, H5T_STD_U32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -3127,8 +3127,8 @@ test_misc19(void)
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset */
- did = H5Dcreate(fid,MISC19_DSET_NAME,H5T_NATIVE_INT,sid,H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC19_DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Check the reference count */
rc = H5Iget_ref(did);
@@ -3418,8 +3418,8 @@ test_misc20(void)
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create dataset with big dataspace */
- did = H5Dcreate(fid, MISC20_DSET_NAME, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC20_DSET_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Close datasset */
ret = H5Dclose(did);
@@ -3434,8 +3434,8 @@ test_misc20(void)
CHECK(sid, FAIL, "H5Screate_simple");
/* Create dataset with big dataspace */
- did = H5Dcreate(fid, MISC20_DSET2_NAME, H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, MISC20_DSET2_NAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Close datasset */
ret = H5Dclose(did);
@@ -3565,45 +3565,45 @@ test_misc21(void)
MESSAGE(5, ("Testing late allocation time w/chunks & filters\n"));
/* Allocate space for the buffer */
- buf = (char *)HDcalloc(MISC21_SPACE_DIM0*MISC21_SPACE_DIM1,1);
+ buf = (char *)HDcalloc(MISC21_SPACE_DIM0 * MISC21_SPACE_DIM1, 1);
CHECK(buf, NULL, "HDcalloc");
/* Create the file */
- fid = H5Fcreate (MISC21_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(MISC21_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
CHECK(fid, FAIL, "H5Fcreate");
/* Create the DCPL */
- dcpl = H5Pcreate (H5P_DATASET_CREATE);
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* Set custom DCPL properties */
- ret = H5Pset_chunk (dcpl, MISC21_SPACE_RANK, chunk_size);
+ ret = H5Pset_chunk(dcpl, MISC21_SPACE_RANK, chunk_size);
CHECK(ret, FAIL, "H5Pset_chunk");
- ret = H5Pset_szip (dcpl, H5_SZIP_NN_OPTION_MASK, 8);
+ ret = H5Pset_szip(dcpl, H5_SZIP_NN_OPTION_MASK, 8);
CHECK(ret, FAIL, "H5Pset_deflate");
- ret = H5Pset_alloc_time (dcpl, H5D_ALLOC_TIME_LATE);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
CHECK(ret, FAIL, "H5Pset_alloc_time");
/* Create the dataspace for the dataset */
- sid = H5Screate_simple (MISC21_SPACE_RANK, dims, NULL);
+ sid = H5Screate_simple(MISC21_SPACE_RANK, dims, NULL);
CHECK(ret, FAIL, "H5Screate_simple");
/* Create the dataset */
- dsid = H5Dcreate (fid, MISC21_DSET_NAME, H5T_NATIVE_UINT8, sid, dcpl);
- CHECK(dsid, FAIL, "H5Dwrite");
+ dsid = H5Dcreate2(fid, MISC21_DSET_NAME, H5T_NATIVE_UINT8, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dsid, FAIL, "H5Dcreate2");
/* Write out the whole dataset */
- ret = H5Dwrite (dsid, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ ret = H5Dwrite(dsid, H5T_NATIVE_UINT8, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
CHECK(ret, FAIL, "H5Dwrite");
/* Close everything */
- ret = H5Dclose (dsid);
+ ret = H5Dclose(dsid);
CHECK(ret, FAIL, "H5Dclose");
- ret = H5Sclose (sid);
+ ret = H5Sclose(sid);
CHECK(ret, FAIL, "H5Sclose");
- ret = H5Pclose (dcpl);
+ ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
- ret = H5Fclose (fid);
+ ret = H5Fclose(fid);
CHECK(ret, FAIL, "H5Fclose");
HDfree(buf);
@@ -3689,19 +3689,20 @@ test_misc22(void)
CHECK(ret, FAIL, "H5Tset_precision");
/* compute the correct PPB that should be set by SZIP */
- if (offsets[k] == 0) {
- correct=prec[j];
- } else {
- correct=H5Tget_size(idts[i])*8;
- }
- if (correct > 24) {
- if (correct <= 32) correct=32;
- else if (correct <= 64) correct=64;
- }
+ if(offsets[k] == 0)
+ correct = prec[j];
+ else
+ correct = H5Tget_size(idts[i]) * 8;
+ if(correct > 24) {
+ if(correct <= 32)
+ correct = 32;
+ else if(correct <= 64)
+ correct = 64;
+ } /* end if */
/* Create the dataset */
- dsid = H5Dcreate(fid, MISC22_DSET_NAME, dtype, sid, dcpl);
- CHECK(dsid, FAIL, "H5Dwrite");
+ dsid = H5Dcreate2(fid, MISC22_DSET_NAME, dtype, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dsid, FAIL, "H5Dcreate2");
/* Write out the whole dataset */
ret = H5Dwrite(dsid, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -3721,7 +3722,7 @@ test_misc22(void)
dcpl2 = H5Dget_create_plist(dsid);
CHECK(dcpl2, FAIL, "H5Dget_create_plist");
- ret= H5Pget_filter_by_id(dcpl2, H5Z_FILTER_SZIP, &flags,
+ ret = H5Pget_filter_by_id(dcpl2, H5Z_FILTER_SZIP, &flags,
&cd_nelmts, cd_values, 0, NULL , NULL);
CHECK(ret, FAIL, "H5Pget_filter_by_id");
@@ -3789,38 +3790,40 @@ test_misc23(void)
CHECK(type_id, FAIL, "H5Tcopy");
+#ifndef H5_NO_DEPRECATED_SYMBOLS
/**********************************************************************
- * test the old APIs
- **********************************************************************/
+ * test the old APIs
+ **********************************************************************/
H5E_BEGIN_TRY {
- tmp_id = H5Gcreate2(file_id, "/A/B00a/grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ tmp_id = H5Gcreate1(file_id, "/A/B00a/grp", (size_t)0);
} H5E_END_TRY;
- VERIFY(tmp_id, FAIL, "H5Gcreate2");
+ VERIFY(tmp_id, FAIL, "H5Gcreate1");
- tmp_id = H5Gcreate2(file_id, "/A/grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- CHECK(tmp_id, FAIL, "H5Gcreate2");
+ tmp_id = H5Gcreate1(file_id, "/A/grp", (size_t)0);
+ CHECK(tmp_id, FAIL, "H5Gcreate1");
status = H5Gclose(tmp_id);
CHECK(status, FAIL, "H5Gclose");
H5E_BEGIN_TRY {
- tmp_id = H5Dcreate(file_id, "/A/B00c/dset", type_id, space_id, create_id);
+ tmp_id = H5Dcreate1(file_id, "/A/B00c/dset", type_id, space_id, create_id);
} H5E_END_TRY;
- VERIFY(tmp_id, FAIL, "H5Dcreate");
+ VERIFY(tmp_id, FAIL, "H5Dcreate1");
- tmp_id = H5Dcreate(file_id, "/A/dset", type_id, space_id, create_id);
- CHECK(tmp_id, FAIL, "H5Dcreate");
+ tmp_id = H5Dcreate1(file_id, "/A/dset", type_id, space_id, create_id);
+ CHECK(tmp_id, FAIL, "H5Dcreate1");
status = H5Dclose(tmp_id);
CHECK(status, FAIL, "H5Dclose");
+#endif /* H5_NO_DEPRECATED_SYMBOLS */
/**********************************************************************
- * test H5Gcreate2()
- **********************************************************************/
+ * test H5Gcreate2()
+ **********************************************************************/
/* Create link creation property list */
create_id = H5Pcreate(H5P_LINK_CREATE);
@@ -3887,8 +3890,8 @@ test_misc23(void)
/**********************************************************************
- * test H5Dcreate2()
- **********************************************************************/
+ * test H5Dcreate2()
+ **********************************************************************/
/* Create link creation property list */
create_id = H5Pcreate(H5P_LINK_CREATE);
@@ -4044,8 +4047,8 @@ test_misc24(void)
group_id = H5Gcreate2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK(group_id, FAIL, "H5Gcreate2");
- dset_id = H5Dcreate(file_id, MISC24_DATASET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, MISC24_DATASET_NAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
type_id = H5Tcopy(H5T_NATIVE_INT);
CHECK(type_id, FAIL, "H5Tcopy");
@@ -4624,8 +4627,8 @@ test_misc25c(void)
CHECK(sid, FAIL, "H5Screate");
/* Create the dataset */
- did = H5Dcreate(gid, MISC25C_DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(gid, MISC25C_DSETNAME, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Create an extra group */
gid2 = H5Gcreate2(fid, MISC25C_GRPNAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -4763,18 +4766,18 @@ test_misc26(void)
sid = H5Screate_simple(1, dims, dims);
CHECK(sid, FAIL, "H5Screate_simple");
- did = H5Dcreate(fid, "dataset1", H5T_NATIVE_FLOAT, sid, dcpl1);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, "dataset1", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl1, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
ret = H5Dclose(did);
CHECK_I(ret, "H5Dclose");
- did = H5Dcreate(fid, "dataset2", H5T_NATIVE_FLOAT, sid, dcpl2);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, "dataset2", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl2, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
ret = H5Dclose(did);
CHECK_I(ret, "H5Dclose");
- did = H5Dcreate(fid, "dataset3", H5T_NATIVE_FLOAT, sid, dcpl3);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, "dataset3", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl3, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
ret = H5Dclose(did);
CHECK_I(ret, "H5Dclose");
diff --git a/test/trefer.c b/test/trefer.c
index baa0bcd..6c88a60 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -115,8 +115,8 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Oset_comment");
/* Create a dataset (inside Group1) */
- dataset = H5Dcreate(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
for(tu32 = (unsigned *)wbuf, i = 0; i < SPACE1_DIM1; i++)
*tu32++=i*3;
@@ -130,8 +130,8 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Dclose");
/* Create another dataset (inside Group1) */
- dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -164,8 +164,8 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Gclose");
/* Create a dataset */
- dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dcreate2");
/* Create reference to dataset */
ret = H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1);
@@ -354,8 +354,8 @@ test_reference_region(void)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create a dataset */
- dset2 = H5Dcreate(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT);
- CHECK(dset2, FAIL, "H5Dcreate");
+ dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset2, FAIL, "H5Dcreate2");
for(tu8 = dwbuf, i = 0; i < (SPACE2_DIM1 * SPACE2_DIM2); i++)
*tu8++ = i * 3;
@@ -373,8 +373,8 @@ test_reference_region(void)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dset1 = H5Dcreate(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dcreate2");
/* Create references */
@@ -626,8 +626,8 @@ test_reference_region_1D(void)
CHECK(sid3, FAIL, "H5Screate_simple");
/* Create a dataset */
- dset3 = H5Dcreate(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT);
- CHECK(dset3, FAIL, "H5Dcreate");
+ dset3 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8LE, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset3, FAIL, "H5Dcreate2");
for(tu8 = dwbuf, i = 0; i < SPACE3_DIM1; i++)
*tu8++ = i * 3;
@@ -645,8 +645,8 @@ test_reference_region_1D(void)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dset1 = H5Dcreate(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate");
+ dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dcreate2");
/* Create references */
@@ -877,16 +877,16 @@ test_reference_obj_deleted(void)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset to reference (deleted later) */
- dataset = H5Dcreate(fid1, "Dataset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
/* Create a dataset */
- dataset = H5Dcreate(fid1, "Dataset2", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset2", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Create reference to dataset */
ret = H5Rcreate(&oref, fid1, "/Dataset1", H5R_OBJECT, -1);
@@ -1031,7 +1031,7 @@ test_reference_group(void)
CHECK(ret, FAIL, "H5Gclose");
/* Create bottom dataset */
- did = H5Dcreate(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ did = H5Dcreate2(gid, DSETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(did > 0);
ret = H5Dclose(did);
assert(ret >= 0);
@@ -1040,8 +1040,8 @@ test_reference_group(void)
CHECK(ret, FAIL, "H5Gclose");
/* Create dataset */
- did = H5Dcreate(fid, DSETNAME, H5T_STD_REF_OBJ, sid, H5P_DEFAULT);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2(fid, DSETNAME, H5T_STD_REF_OBJ, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Create reference to group */
ret = H5Rcreate(&wref, fid, GROUPNAME, H5R_OBJECT, -1);
@@ -1166,16 +1166,16 @@ test_reference_compat(void)
CHECK(group, FAIL, "H5Gcreate2");
/* Create a dataset (inside Group1) */
- dataset = H5Dcreate(group, "Dataset1", H5T_NATIVE_UINT, sid2, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(group, "Dataset1", H5T_NATIVE_UINT, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
/* Create another dataset (inside Group1) */
- dataset = H5Dcreate(group, "Dataset2", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(group, "Dataset2", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -1209,8 +1209,8 @@ test_reference_compat(void)
/* Create a dataset with object reference datatype */
- dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dcreate2");
/* Create reference to dataset */
ret = H5Rcreate(&wbuf_obj[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1);
@@ -1238,8 +1238,8 @@ test_reference_compat(void)
/* Create a dataset with region reference datatype */
- dataset = H5Dcreate(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset4", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dcreate2");
/* Select 6x6 hyperslab for first reference */
start[0] = 2; start[1] = 2;
diff --git a/test/tselect.c b/test/tselect.c
index a6b885f..fd577ca 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -283,7 +283,7 @@ test_select_hyper(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf);
@@ -543,7 +543,7 @@ test_select_point(hid_t xfer_plist)
HDmemcpy(pi.coord,coord2,sizeof(coord2));
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf);
@@ -713,7 +713,7 @@ test_select_all(hid_t xfer_plist)
VERIFY(ext_type, H5S_SIMPLE, "H5Sget_simple_extent_type");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,xfer_plist,wbuf);
@@ -812,7 +812,7 @@ test_select_all_hyper(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,xfer_plist,wbuf);
@@ -957,7 +957,7 @@ test_select_combo(void)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -1115,7 +1115,7 @@ test_select_hyper_stride(hid_t xfer_plist)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf);
@@ -1240,7 +1240,7 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf);
@@ -1365,7 +1365,7 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf);
@@ -1489,7 +1489,7 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist)
CHECK(ret, FAIL, "H5Sselect_hyperslab");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",dset_type,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_USHORT,sid2,sid1,xfer_plist,wbuf);
@@ -1633,7 +1633,7 @@ test_select_hyper_copy(void)
CHECK(sid3, FAIL, "H5Scopy");
/* Create a dataset */
- data1=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT);
+ data1=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(data1,H5T_STD_U16LE,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -1644,7 +1644,7 @@ test_select_hyper_copy(void)
CHECK(ret, FAIL, "H5Sclose");
/* Create another dataset */
- data2=H5Dcreate(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT);
+ data2=H5Dcreate2(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(data2,H5T_STD_U16LE,sid3,sid1,H5P_DEFAULT,wbuf);
@@ -1802,7 +1802,7 @@ test_select_point_copy(void)
CHECK(sid3, FAIL, "H5Scopy");
/* Create a dataset */
- data1=H5Dcreate(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT);
+ data1=H5Dcreate2(fid1,"Dataset1",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(data1,H5T_STD_U16LE,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -1813,7 +1813,7 @@ test_select_point_copy(void)
CHECK(ret, FAIL, "H5Sclose");
/* Create another dataset */
- data2=H5Dcreate(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT);
+ data2=H5Dcreate2(fid1,"Dataset2",H5T_STD_U16LE,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(data2,H5T_STD_U16LE,sid3,sid1,H5P_DEFAULT,wbuf);
@@ -1990,7 +1990,7 @@ test_select_hyper_offset(void)
VERIFY(valid, TRUE, "H5Sselect_valid");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -2123,7 +2123,7 @@ test_select_hyper_offset2(void)
VERIFY(valid, TRUE, "H5Sselect_valid");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -2273,7 +2273,7 @@ test_select_point_offset(void)
VERIFY(valid, TRUE, "H5Sselect_valid");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -2425,7 +2425,7 @@ test_select_hyper_union(void)
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -2518,7 +2518,7 @@ test_select_hyper_union(void)
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset2",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset2",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -2603,7 +2603,7 @@ test_select_hyper_union(void)
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset3",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset3",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -2692,8 +2692,8 @@ test_select_hyper_union(void)
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset=H5Dcreate2(fid1,"Dataset4",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
xfer = H5Pcreate (H5P_DATASET_XFER);
CHECK(xfer, FAIL, "H5Pcreate");
@@ -2789,7 +2789,7 @@ test_select_hyper_union(void)
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset5",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset5",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -2911,8 +2911,8 @@ test_select_hyper_union_stagger(void)
CHECK(dataspace, FAIL, "H5Screate_simple");
/* Create File Dataset */
- dset_id=H5Dcreate(file_id,"IntArray",H5T_NATIVE_INT,dataspace,H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id=H5Dcreate2(file_id,"IntArray",H5T_NATIVE_INT,dataspace,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
/* Write File Dataset */
error=H5Dwrite(dset_id,H5T_NATIVE_INT,dataspace,dataspace,H5P_DEFAULT,data);
@@ -3138,7 +3138,7 @@ test_select_hyper_union_3d(void)
VERIFY(npoints, 15*26, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,tmp2_space,sid1,H5P_DEFAULT,wbuf);
@@ -3282,7 +3282,7 @@ test_select_hyper_and_2d(void)
VERIFY(npoints, 5*5, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -3408,7 +3408,7 @@ test_select_hyper_xor_2d(void)
VERIFY(npoints, 150, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -3536,7 +3536,7 @@ test_select_hyper_notb_2d(void)
VERIFY(npoints, 75, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -3663,7 +3663,7 @@ test_select_hyper_nota_2d(void)
VERIFY(npoints, 75, "H5Sget_select_npoints");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write selection to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_UCHAR,sid2,sid1,H5P_DEFAULT,wbuf);
@@ -3789,8 +3789,8 @@ test_select_hyper_union_random_5d(hid_t read_plist)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_INT,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write entire dataset to disk */
ret=H5Dwrite(dataset,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf);
@@ -3997,8 +3997,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist)
CHECK(plist, FAIL, "H5Pcreate");
status = H5Pset_chunk (plist, RANK_F, chunk_dimsf);
CHECK(status, FAIL, "H5Pset_chunk");
- dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, plist);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2 (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, plist, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/*
* Define hyperslab in the dataset.
@@ -4225,8 +4225,8 @@ test_select_point_chunk(void)
CHECK(dcpl, FAIL, "H5Pcreate");
ret = H5Pset_chunk (dcpl, SPACE7_RANK, chunk_dimsf);
CHECK(ret, FAIL, "H5Pset_chunk");
- dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2 (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Create 1st point selection */
pnt1_space = H5Scopy (dataspace);
@@ -4384,8 +4384,8 @@ test_select_scalar_chunk(void)
sid = H5Screate_simple(1, dims, maxdims);
CHECK(sid, FAIL, "H5Screate_simple");
- dsid = H5Dcreate(file_id, "dset", H5T_NATIVE_UINT, sid, dcpl);
- CHECK(dsid, FAIL, "H5Dcreate");
+ dsid = H5Dcreate2(file_id, "dset", H5T_NATIVE_UINT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dsid, FAIL, "H5Dcreate2");
/* Select scalar area (offset 0, count 1) */
ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, offset, NULL, count, NULL);
@@ -5468,8 +5468,8 @@ test_select_none(void)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Make "none" selection in both disk and memory datasets */
ret = H5Sselect_none(sid1);
@@ -5571,8 +5571,8 @@ test_scalar_select(void)
CHECK(sid2, FAIL, "H5Screate_simple");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset=H5Dcreate2(fid1,"Dataset1",H5T_NATIVE_UCHAR,sid1,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Select one element in memory with a point selection */
coord1[0]=0; coord1[1]= 2;
@@ -7305,8 +7305,8 @@ test_select_hyper_chunk_offset(void)
CHECK(sid, FAIL, "H5Screate_simple");
/* Create the dataset */
- did = H5Dcreate (fid, "fooData", H5T_NATIVE_INT, sid, dcpl);
- CHECK(did, FAIL, "H5Dcreate");
+ did = H5Dcreate2 (fid, "fooData", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(did, FAIL, "H5Dcreate2");
/* Close the dataspace */
ret = H5Sclose(sid);
@@ -7500,8 +7500,8 @@ test_select_hyper_chunk_offset2(void)
CHECK(status, FAIL, "H5Pset_chunk");
/* Create dataset */
- dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_UINT, dataspace, dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_UINT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close DCPL */
status = H5Pclose(dcpl);
diff --git a/test/tsohm.c b/test/tsohm.c
index c0b9848..e99a1f1 100644
--- a/test/tsohm.c
+++ b/test/tsohm.c
@@ -586,7 +586,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
dim1[0] = 1;
if((space_id=H5Screate_simple(1,dim1,NULL)) < 0) TEST_ERROR
- if((dset_id = H5Dcreate(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file,DSETNAME[0],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Test writing and reading */
if(H5Dwrite(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata) < 0) TEST_ERROR
@@ -606,7 +606,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
}
/* Create more datasets with the same datatype */
- if((dset_id = H5Dcreate(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file,DSETNAME[1],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
/* Close and re-open the file if requested*/
@@ -614,7 +614,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR
}
- if((dset_id = H5Dcreate(file,DSETNAME[2],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file,DSETNAME[2],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
/* Close and re-open the file if requested*/
@@ -622,7 +622,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR
}
- if((dset_id = H5Dcreate(file,DSETNAME[3],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file,DSETNAME[3],dtype1_id,space_id,H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
/* Write data to dataset 3 for later */
if(H5Dwrite(dset_id, dtype1_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata) < 0) TEST_ERROR
@@ -658,7 +658,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos
/* Create several copies of the dataset (this increases the amount of space saved by sharing the datatype message) */
for(x = 0; x < SOHM_HELPER_NUM_EX_DSETS; x++) {
- if((dset_id = H5Dcreate(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset_id = H5Dcreate2(file, EXTRA_DSETNAME[x], dtype1_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
if(H5Dclose(dset_id) < 0) TEST_ERROR
/* Close and re-open the file if requested*/
@@ -1477,8 +1477,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
* and filter pipeline.
*/
for(x = 0; x < NUM_DATASETS; ++x) {
- dset_id = H5Dcreate(file_id, DSETNAME[x], dtype1_id, dspace1_id, dcpl1_id);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(attr_id, "H5Acreate2");
@@ -1526,8 +1526,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
/* Create NUM_DATASETS datasets in the new group */
for(x=0; x<NUM_DATASETS; ++x)
{
- dset_id = H5Dcreate(group_id, DSETNAME[x], dtype2_id, dspace2_id, dcpl2_id);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype2_id, dspace2_id, H5P_DEFAULT, dcpl2_id, H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(attr_id, "H5Acreate2");
@@ -1567,8 +1567,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
/* Create NUM_DATASETS datasets in the new group */
for(x=0; x<NUM_DATASETS; x+=2)
{
- dset_id = H5Dcreate(group_id, DSETNAME[x], dtype1_id, dspace1_id, dcpl1_id);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(group_id, DSETNAME[x], dtype1_id, dspace1_id, H5P_DEFAULT, dcpl1_id, H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(attr_id, "H5Acreate2");
@@ -1580,8 +1580,8 @@ size2_helper(hid_t fcpl_id, int test_file_closing, size2_helper_struct *ret_size
ret = H5Aclose(attr_id);
CHECK_I(ret, "H5Aclose");
- dset_id = H5Dcreate(group_id, DSETNAME[x+1], dtype2_id, dspace2_id, dcpl2_id);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(group_id, DSETNAME[x+1], dtype2_id, dspace2_id, H5P_DEFAULT, dcpl2_id, H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
attr_id = H5Acreate2(dset_id, ".", "attr_name", attr_type_id, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
CHECK_I(attr_id, "H5Acreate2");
@@ -2559,8 +2559,8 @@ static void delete_helper_write(hid_t file_id, hid_t *dspace_id, hid_t *dcpl_id,
herr_t ret;
/* Create dataset */
- dset_id = H5Dcreate(file_id, DSETNAME[x], H5T_NATIVE_CHAR, dspace_id[x], dcpl_id[x]);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, DSETNAME[x], H5T_NATIVE_CHAR, dspace_id[x], H5P_DEFAULT, dcpl_id[x], H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
/* Write data to dataset */
wdata = x + 'a';
@@ -2910,8 +2910,8 @@ test_sohm_delete_revert_helper(hid_t fcpl_id)
file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
CHECK_I(file_id, "H5Fcreate");
- dset_id = H5Dcreate(file_id, "dset", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
/* Close the dataset and delete it */
ret = H5Dclose(dset_id);
@@ -2932,14 +2932,14 @@ test_sohm_delete_revert_helper(hid_t fcpl_id)
CHECK_I(file_id, "H5Fcreate");
/* Create and close the first dataset */
- dset_id = H5Dcreate(file_id, "dset", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, "dset", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
ret = H5Dclose(dset_id);
CHECK_I(ret, "H5Dclose");
/* Create and close the second. These messages should be shared */
- dset_id = H5Dcreate(file_id, "dset2", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, "dset2", H5T_NATIVE_SHORT, dspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
ret = H5Dclose(dset_id);
CHECK_I(ret, "H5Dclose");
@@ -3084,8 +3084,8 @@ static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id)
/* Create a dataset through the external link */
space_id = H5Screate_simple(2, dims, dims);
CHECK_I(space_id, "H5Screate_simple");
- dset_id = H5Dcreate(src_file_id, "ext_link/dataset", H5T_NATIVE_FLOAT, space_id, H5P_DEFAULT);
- CHECK_I(dset_id, "H5Dcreate");
+ dset_id = H5Dcreate2(src_file_id, "ext_link/dataset", H5T_NATIVE_FLOAT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK_I(dset_id, "H5Dcreate2");
/* Close the dataset and both files to make sure everything gets flushed
* out of memory
@@ -3199,8 +3199,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
/* Create a dataspace and a dataset*/
orig_space_id = H5Screate_simple(EXTEND_NDIMS, dims1, max_dims);
CHECK_I(orig_space_id, "H5Screate_simple");
- dset1_id = H5Dcreate(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, dcpl_id);
- CHECK_I(dset1_id, "H5Dcreate");
+ dset1_id = H5Dcreate2(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ CHECK_I(dset1_id, "H5Dcreate2");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
@@ -3216,8 +3216,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
}
/* Create another dataset starting with the same dataspace */
- dset2_id = H5Dcreate(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, dcpl_id);
- CHECK_I(dset2_id, "H5Dcreate");
+ dset2_id = H5Dcreate2(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ CHECK_I(dset2_id, "H5Dcreate2");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
@@ -3237,8 +3237,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
}
/* Create a third dataset with the same dataspace */
- dset3_id = H5Dcreate(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, dcpl_id);
- CHECK_I(dset3_id, "H5Dcreate");
+ dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ CHECK_I(dset3_id, "H5Dcreate2");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
@@ -3465,8 +3465,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
*/
file_id = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT);
CHECK_I(file_id, "H5Fcreate");
- dset1_id = H5Dcreate(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, dcpl_id);
- CHECK_I(dset1_id, "H5Dcreate");
+ dset1_id = H5Dcreate2(file_id, "dataset", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ CHECK_I(dset1_id, "H5Dcreate2");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
@@ -3499,8 +3499,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
/* Create the second dataset. Its dataspace will be unshared and then
* become shared when extended.
*/
- dset2_id = H5Dcreate(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, dcpl_id);
- CHECK_I(dset2_id, "H5Dcreate");
+ dset2_id = H5Dcreate2(file_id, "dataset2", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ CHECK_I(dset2_id, "H5Dcreate2");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
@@ -3541,8 +3541,8 @@ test_sohm_extend_dset_helper(hid_t fcpl_id, hbool_t close_reopen)
/* Create the third dataset. Its dataspace will be unshared and then
* become shared when extended.
*/
- dset3_id = H5Dcreate(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, dcpl_id);
- CHECK_I(dset3_id, "H5Dcreate");
+ dset3_id = H5Dcreate2(file_id, "dataset3", H5T_NATIVE_LONG, orig_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT);
+ CHECK_I(dset3_id, "H5Dcreate2");
if(close_reopen) {
/* If requested, close all open IDs and reopen them */
ret = H5Dclose(dset1_id);
diff --git a/test/ttime.c b/test/ttime.c
index 87e57dc..4762656 100644
--- a/test/ttime.c
+++ b/test/ttime.c
@@ -150,8 +150,8 @@ test_time_io(void)
CHECK(sid, FAIL, "H5Screate");
/* Create a dataset with a time datatype */
- dsid = H5Dcreate(fid, DATASETNAME, H5T_UNIX_D32LE, sid, H5P_DEFAULT);
- CHECK(dsid, FAIL, "H5Dcreate");
+ dsid = H5Dcreate2(fid, DATASETNAME, H5T_UNIX_D32LE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dsid, FAIL, "H5Dcreate2");
/* Initialize time data value */
timenow = HDtime(NULL);
diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c
index 6409bb1..c9dd64d 100644
--- a/test/ttsafe_acreate.c
+++ b/test/ttsafe_acreate.c
@@ -100,13 +100,13 @@ void tts_acreate(void)
H5Tset_order(datatype, H5T_ORDER_LE);
/* create a new dataset within the file */
- dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace, H5P_DEFAULT);
- assert(dataset>=0);
+ dataset = H5Dcreate2(file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(dataset >= 0);
/* initialize data for dataset and write value to dataset */
data = NUM_THREADS;
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &data);
+ assert(ret >= 0);
/*
* Simultaneously create a large number of attributes to be associated
diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c
index 92eff41..1cc2e8c 100644
--- a/test/ttsafe_cancel.c
+++ b/test/ttsafe_cancel.c
@@ -30,7 +30,7 @@
* ttsafe_cancel.h5
*
* HDF5 APIs exercised in thread:
- * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dclose,
+ * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dclose,
* H5Dwrite, H5Dread, H5Diterate, H5Tclose, H5Sclose.
*
* Created: May 15 2000
@@ -130,18 +130,18 @@ void *tts_cancel_thread(void UNUSED *arg)
/* define dataspace for dataset */
dimsf[0] = 1;
- dataspace = H5Screate_simple(1,dimsf,NULL);
- assert(dataspace>=0);
+ dataspace = H5Screate_simple(1, dimsf, NULL);
+ assert(dataspace >= 0);
/* define datatype for the data using native little endian integers */
datatype = H5Tcopy(H5T_NATIVE_INT);
- assert(datatype>=0);
- ret=H5Tset_order(datatype, H5T_ORDER_LE);
- assert(ret>=0);
+ assert(datatype >= 0);
+ ret = H5Tset_order(datatype, H5T_ORDER_LE);
+ assert(ret >= 0);
/* create a new dataset within the file */
- dataset = H5Dcreate(cancel_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT);
- assert(dataset>=0);
+ dataset = H5Dcreate2(cancel_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(dataset >= 0);
/* If thread is cancelled, make cleanup call */
cleanup_structure = (cancel_cleanup_t*)malloc(sizeof(cancel_cleanup_t));
diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c
index 4faf2bc..35453ad 100644
--- a/test/ttsafe_dcreate.c
+++ b/test/ttsafe_dcreate.c
@@ -26,7 +26,7 @@
* ttsafe_dcreate.h5
*
* HDF5 APIs exercised in thread:
- * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dwrite, H5Dclose,
+ * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dwrite, H5Dclose,
* H5Tclose, H5Sclose.
*
* Created: Apr 28 2000
@@ -163,39 +163,40 @@ void tts_dcreate(void)
void *tts_dcreate_creator(void *_thread_data)
{
- hid_t dataspace, dataset;
- herr_t ret;
- hsize_t dimsf[1]; /* dataset dimensions */
- struct thread_info thread_data;
-
- memcpy(&thread_data,_thread_data,sizeof(struct thread_info));
-
- /* define dataspace for dataset */
- dimsf[0] = 1;
- dataspace = H5Screate_simple(1,dimsf,NULL);
- assert(dataspace>=0);
-
- /* create a new dataset within the file */
- dataset = H5Dcreate(thread_data.file, thread_data.dsetname,
- H5T_NATIVE_INT, dataspace, H5P_DEFAULT);
- assert(dataset>=0);
-
- /* initialize data for dataset and write value to dataset */
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, &thread_data.id);
- assert(ret>=0);
-
- /* close dataset and dataspace resources */
- ret=H5Dclose(dataset);
- assert(ret>=0);
- ret=H5Sclose(dataspace);
- assert(ret>=0);
-
- return NULL;
+ hid_t dataspace, dataset;
+ herr_t ret;
+ hsize_t dimsf[1]; /* dataset dimensions */
+ struct thread_info thread_data;
+
+ memcpy(&thread_data, _thread_data, sizeof(struct thread_info));
+
+ /* define dataspace for dataset */
+ dimsf[0] = 1;
+ dataspace = H5Screate_simple(1, dimsf, NULL);
+ assert(dataspace >= 0);
+
+ /* create a new dataset within the file */
+ dataset = H5Dcreate2(thread_data.file, thread_data.dsetname,
+ H5T_NATIVE_INT, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ assert(dataset >= 0);
+
+ /* initialize data for dataset and write value to dataset */
+ ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, &thread_data.id);
+ assert(ret >= 0);
+
+ /* close dataset and dataspace resources */
+ ret = H5Dclose(dataset);
+ assert(ret >= 0);
+ ret = H5Sclose(dataspace);
+ assert(ret >= 0);
+
+ return NULL;
}
void cleanup_dcreate(void)
{
- HDunlink(FILENAME);
+ HDunlink(FILENAME);
}
#endif /*H5_HAVE_THREADSAFE*/
+
diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c
index 3989e73..7659a3e 100644
--- a/test/ttsafe_error.c
+++ b/test/ttsafe_error.c
@@ -29,7 +29,7 @@
*
* HDF5 APIs exercised in thread:
*
- * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate, H5Dclose,
+ * H5Screate_simple, H5Tcopy, H5Tset_order, H5Dcreate2, H5Dclose,
* H5Tclose, H5Sclose.
*
* Created: Apr 28 2000
@@ -176,26 +176,26 @@ void *tts_error_thread(void UNUSED *arg)
/* define dataspace for dataset */
dimsf[0] = 1;
- dataspace = H5Screate_simple(1,dimsf,NULL);
- assert(dataspace>=0);
+ dataspace = H5Screate_simple(1, dimsf, NULL);
+ assert(dataspace >= 0);
/* define datatype for the data using native little endian integers */
datatype = H5Tcopy(H5T_NATIVE_INT);
- assert(datatype>=0);
+ assert(datatype >= 0);
H5Tset_order(datatype, H5T_ORDER_LE);
/* create a new dataset within the file */
- dataset = H5Dcreate(error_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT);
- if (dataset >= 0) { /* not an error */
+ dataset = H5Dcreate2(error_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ if(dataset >= 0) { /* not an error */
value = WRITE_NUMBER;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
H5Dclose(dataset);
- }
+ } /* end if */
- ret=H5Tclose(datatype);
- assert(ret>=0);
- ret=H5Sclose(dataspace);
- assert(ret>=0);
+ ret = H5Tclose(datatype);
+ assert(ret >= 0);
+ ret = H5Sclose(dataspace);
+ assert(ret >= 0);
/* turn our error stack handler off */
H5Eset_auto2(H5E_DEFAULT, old_error_cb, old_error_client_data);
diff --git a/test/tunicode.c b/test/tunicode.c
index f34e19f..873918a 100644
--- a/test/tunicode.c
+++ b/test/tunicode.c
@@ -68,7 +68,7 @@ void dump_string(const char * string);
void test_fl_string(hid_t fid, const char *string)
{
hid_t dtype_id, space_id, dset_id;
- hsize_t dims=1;
+ hsize_t dims = 1;
char read_buf[MAX_STRING_LENGTH];
H5T_cset_t cset;
herr_t ret;
@@ -80,19 +80,20 @@ void test_fl_string(hid_t fid, const char *string)
CHECK(dtype_id, FAIL, "H5Tcopy");
ret = H5Tset_size(dtype_id, (size_t)MAX_STRING_LENGTH);
CHECK(ret, FAIL, "H5Tset_size");
- cset=H5Tget_cset(dtype_id);
+ cset = H5Tget_cset(dtype_id);
VERIFY(cset, H5T_CSET_ASCII, "H5Tget_cset");
- ret=H5Tset_cset(dtype_id, H5T_CSET_UTF8);
+ ret = H5Tset_cset(dtype_id, H5T_CSET_UTF8);
CHECK(ret, FAIL, "H5Tset_cset");
- cset=H5Tget_cset(dtype_id);
+ cset = H5Tget_cset(dtype_id);
VERIFY(cset, H5T_CSET_UTF8, "H5Tget_cset");
/* Create dataspace for a dataset */
space_id = H5Screate_simple(RANK, &dims, NULL);
CHECK(space_id, FAIL, "H5Screate_simple");
+
/* Create a dataset */
- dset_id=H5Dcreate(fid, DSET1_NAME, dtype_id, space_id, H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(fid, DSET1_NAME, dtype_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
/* Write UTF-8 string to dataset */
ret = H5Dwrite(dset_id, dtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, string);
@@ -102,15 +103,15 @@ void test_fl_string(hid_t fid, const char *string)
ret = H5Dread(dset_id, dtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf);
CHECK(ret, FAIL, "H5Dread");
- VERIFY(strcmp(string, read_buf), 0, "strcmp");
+ VERIFY(HDstrcmp(string, read_buf), 0, "strcmp");
/* Close all */
- ret=H5Dclose(dset_id);
+ ret = H5Dclose(dset_id);
CHECK(ret, FAIL, "H5Dclose");
- ret=H5Tclose(dtype_id);
+ ret = H5Tclose(dtype_id);
CHECK(ret, FAIL, "H5Tclose");
- ret=H5Sclose(space_id);
+ ret = H5Sclose(space_id);
CHECK(ret, FAIL, "H5Sclose");
}
@@ -322,7 +323,7 @@ void test_strpad(hid_t UNUSED fid, const char *string)
void test_vl_string(hid_t fid, const char *string)
{
hid_t type_id, space_id, dset_id;
- hsize_t dims=1;
+ hsize_t dims = 1;
hsize_t size; /* Number of bytes used */
char *read_buf[1];
herr_t ret;
@@ -338,27 +339,27 @@ void test_vl_string(hid_t fid, const char *string)
CHECK(ret, FAIL, "H5Tset_size");
/* Create a dataset */
- dset_id=H5Dcreate(fid, VL_DSET1_NAME, type_id, space_id, H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(fid, VL_DSET1_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &string);
+ ret = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, &string);
CHECK(ret, FAIL, "H5Dwrite");
/* Make certain the correct amount of memory will be used */
- ret=H5Dvlen_get_buf_size(dset_id, type_id, space_id, &size);
+ ret = H5Dvlen_get_buf_size(dset_id, type_id, space_id, &size);
CHECK(ret, FAIL, "H5Dvlen_get_buf_size");
- VERIFY(size, (hsize_t)strlen(string) + 1, "H5Dvlen_get_buf_size");
+ VERIFY(size, (hsize_t)HDstrlen(string) + 1, "H5Dvlen_get_buf_size");
/* Read dataset from disk */
- ret=H5Dread(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf);
+ ret = H5Dread(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf);
CHECK(ret, FAIL, "H5Dread");
/* Compare data read in */
- VERIFY(strcmp(string, read_buf[0]), 0, "strcmp");
+ VERIFY(HDstrcmp(string, read_buf[0]), 0, "strcmp");
/* Reclaim the read VL data */
- ret=H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, read_buf);
+ ret = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, read_buf);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Close all */
@@ -405,7 +406,7 @@ void test_objnames(hid_t fid, const char* string)
ret = H5Gclose(grp_id);
CHECK(ret, FAIL, "H5Gclose");
- VERIFY(strcmp(string, read_buf), 0, "strcmp");
+ VERIFY(HDstrcmp(string, read_buf), 0, "strcmp");
/* Create a new dataset with a UTF-8 name */
grp1_id = H5Gcreate2(fid, GROUP1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -413,8 +414,8 @@ void test_objnames(hid_t fid, const char* string)
space_id = H5Screate_simple(RANK, &dims, NULL);
CHECK(space_id, FAIL, "H5Screate_simple");
- dset_id = H5Dcreate(grp1_id, string, H5T_NATIVE_INT, space_id, H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(grp1_id, string, H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
/* Make sure that dataset can be opened again */
ret = H5Dclose(dset_id);
@@ -450,8 +451,8 @@ void test_objnames(hid_t fid, const char* string)
space_id = H5Screate_simple(RANK, &dims, NULL);
CHECK(space_id, FAIL, "H5Screate_simple");
- dset_id=H5Dcreate(grp2_id, DSET3_NAME, H5T_STD_REF_OBJ, space_id, H5P_DEFAULT);
- CHECK(ret, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(grp2_id, DSET3_NAME, H5T_STD_REF_OBJ, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Dcreate2");
/* Create reference to named datatype */
ret = H5Rcreate(&obj_ref, grp2_id, string, H5R_OBJECT, -1);
@@ -599,8 +600,8 @@ void test_compound(hid_t fid, const char * string)
CHECK(ret, FAIL, "H5Tinsert");
/* Check that the field name was stored correctly */
- readbuf=H5Tget_member_name(s1_tid, 0);
- ret = strcmp(readbuf, string);
+ readbuf = H5Tget_member_name(s1_tid, 0);
+ ret = HDstrcmp(readbuf, string);
VERIFY(ret, 0, "strcmp");
free(readbuf);
@@ -621,8 +622,8 @@ void test_compound(hid_t fid, const char * string)
/* Create the dataspace and dataset. */
space_id = H5Screate_simple(1, &dim, NULL);
CHECK(space_id, FAIL, "H5Screate_simple");
- dset_id = H5Dcreate(fid, DSET4_NAME, s1_tid, space_id, H5P_DEFAULT);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(fid, DSET4_NAME, s1_tid, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
/* Write data to the dataset. */
ret = H5Dwrite(dset_id, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &s1);
diff --git a/test/tvlstr.c b/test/tvlstr.c
index b1ba48e..a6d3851 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -152,29 +152,29 @@ test_vlstrings_basic(void)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a datatype to refer to */
- tid1 = H5Tcopy (H5T_C_S1);
+ tid1 = H5Tcopy(H5T_C_S1);
CHECK(tid1, FAIL, "H5Tcopy");
- ret = H5Tset_size (tid1,H5T_VARIABLE);
+ ret = H5Tset_size(tid1,H5T_VARIABLE);
CHECK(ret, FAIL, "H5Tset_size");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
dataspace = H5Screate(H5S_SCALAR);
- dataset2=H5Dcreate(fid1,"Dataset2",tid1,dataspace,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset2 = H5Dcreate2(fid1, "Dataset2", tid1, dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
wdata2 = (char*)HDcalloc((size_t)65534, sizeof(char));
HDmemset(wdata2, 'A', (size_t)65533);
- ret=H5Dwrite(dataset2,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata2);
+ ret = H5Dwrite(dataset2, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, &wdata2);
CHECK(ret, FAIL, "H5Dwrite");
H5Sclose(dataspace);
@@ -182,7 +182,7 @@ test_vlstrings_basic(void)
HDfree(wdata2);
/* Change to the custom memory allocation routines for reading VL string */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid = H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
ret=H5Pset_vlen_mem_manager(xfer_pid,test_vlstr_alloc_custom,&mem_used,test_vlstr_free_custom,&mem_used);
@@ -281,51 +281,51 @@ test_vlstrings_special(void)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a datatype to refer to */
- tid1 = H5Tcopy (H5T_C_S1);
+ tid1 = H5Tcopy(H5T_C_S1);
CHECK(tid1, FAIL, "H5Tcopy");
- ret = H5Tset_size (tid1,H5T_VARIABLE);
+ ret = H5Tset_size(tid1,H5T_VARIABLE);
CHECK(ret, FAIL, "H5Tset_size");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset3",tid1,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset3", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Read from dataset before writing data */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++)
- if(rdata[i]!=NULL)
+ for(i = 0; i < SPACE1_DIM1; i++)
+ if(rdata[i] != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Read dataset from disk */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Compare data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(HDstrlen(wdata[i])!=strlen(rdata[i])) {
+ for(i = 0; i < SPACE1_DIM1; i++) {
+ if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
continue;
} /* end if */
- if((wdata[i]==NULL && rdata[i]!=NULL) || (rdata[i]==NULL && wdata[i]!=NULL)) {
+ if((wdata[i] == NULL && rdata[i] != NULL) || (rdata[i] == NULL && wdata[i] != NULL)) {
TestErrPrintf("VL data values don't match!\n");
continue;
} /* end if */
- if( HDstrcmp(wdata[i],rdata[i]) != 0 ) {
+ if(HDstrcmp(wdata[i], rdata[i]) != 0 ) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
continue;
} /* end if */
} /* end for */
/* Reclaim the read VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,rdata);
+ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Close Dataset */
@@ -333,41 +333,41 @@ test_vlstrings_special(void)
CHECK(ret, FAIL, "H5Dclose");
/* Create another dataset to test nil strings */
- dcpl=H5Pcreate(H5P_DATASET_CREATE);
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* Set the fill value for the second dataset */
- fill=NULL;
- ret=H5Pset_fill_value(dcpl, tid1, &fill);
+ fill = NULL;
+ ret = H5Pset_fill_value(dcpl, tid1, &fill);
CHECK(ret, FAIL, "H5Pset_fill_value");
- dataset=H5Dcreate(fid1,"Dataset4",tid1,sid1,dcpl);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset4", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset creation property list */
ret = H5Pclose(dcpl);
CHECK(ret, FAIL, "H5Pclose");
/* Read from dataset before writing data */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++)
- if(rdata[i]!=NULL)
+ for(i = 0; i < SPACE1_DIM1; i++)
+ if(rdata[i] != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
/* Try to write nil strings to disk. */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2);
CHECK(ret, FAIL, "H5Dwrite");
/* Read nil strings back from disk */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++)
- if(rdata[i]!=NULL)
+ for(i = 0; i < SPACE1_DIM1; i++)
+ if(rdata[i] != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
/* Close Dataset */
@@ -518,31 +518,31 @@ test_compact_vlstring(void)
CHECK(ret, FAIL, "H5Pset_layout");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset5",tid1,sid1,plist);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset5", tid1, sid1, H5P_DEFAULT, plist, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Read dataset from disk */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Compare data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(HDstrlen(wdata[i])!=strlen(rdata[i])) {
+ for(i = 0; i < SPACE1_DIM1; i++) {
+ if(HDstrlen(wdata[i]) != HDstrlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
continue;
} /* end if */
- if( HDstrcmp(wdata[i],rdata[i]) != 0 ) {
+ if(HDstrcmp(wdata[i], rdata[i]) != 0) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
continue;
} /* end if */
} /* end for */
/* Reclaim the read VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,rdata);
+ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Close Dataset */
@@ -728,8 +728,8 @@ static void write_scalar_dset(hid_t file, hid_t type, hid_t space, char *name, c
hid_t dset;
herr_t ret;
- dset = H5Dcreate(file, name, type, space, H5P_DEFAULT);
- CHECK(dset, FAIL, "H5Dcreate");
+ dset = H5Dcreate2(file, name, type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dset, FAIL, "H5Dcreate2");
ret = H5Dwrite(dset, type, space, space, H5P_DEFAULT, &data);
CHECK(ret, FAIL, "H5Dwrite");
diff --git a/test/tvltypes.c b/test/tvltypes.c
index eeadc45..1ea0eaa 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -130,22 +130,22 @@ test_vltypes_dataset_create(void)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Create a datatype to refer to */
- tid1 = H5Tvlen_create (H5T_NATIVE_UINT);
+ tid1 = H5Tvlen_create(H5T_NATIVE_UINT);
CHECK(tid1, FAIL, "H5Tvlen_create");
/* Create dataset property list */
- dcpl=H5Pcreate(H5P_DATASET_CREATE);
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl, FAIL, "H5Pcreate");
/* Set fill value writting time to be NEVER */
- ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
+ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
CHECK(ret, FAIL, "H5Pset_fill_time");
/* Create a dataset, supposed to fail */
H5E_BEGIN_TRY {
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,dcpl);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, dcpl, H5P_DEFAULT);
} H5E_END_TRY;
- VERIFY(dataset, FAIL, "H5Dcreate");
+ VERIFY(dataset, FAIL, "H5Dcreate2");
/* Close datatype */
ret = H5Tclose(tid1);
@@ -277,33 +277,33 @@ test_vltypes_vlen_atomic(void)
CHECK(tid1, FAIL, "H5Tvlen_create");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Read from dataset before writing data */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++)
- if(rdata[i].len!=0 || rdata[i].p!=NULL)
+ for(i = 0; i < SPACE1_DIM1; i++)
+ if(rdata[i].len != 0 || rdata[i].p != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p);
/* Write "nil" data to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2);
CHECK(ret, FAIL, "H5Dwrite");
/* Read from dataset with "nil" data */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++)
- if(rdata[i].len!=0 || rdata[i].p!=NULL)
+ for(i = 0; i < SPACE1_DIM1; i++)
+ if(rdata[i].len != 0 || rdata[i].p != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -311,42 +311,42 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dclose");
/* Create second dataset, with fill value */
- dcpl_pid=H5Pcreate(H5P_DATASET_CREATE);
+ dcpl_pid = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl_pid, FAIL, "H5Pcreate");
/* Set the fill value for the second dataset */
- fill.p=NULL; fill.len=0;
- ret=H5Pset_fill_value(dcpl_pid, tid1, &fill);
+ fill.p = NULL; fill.len = 0;
+ ret = H5Pset_fill_value(dcpl_pid, tid1, &fill);
CHECK(ret, FAIL, "H5Pset_fill_value");
/* Create a second dataset */
- dataset=H5Dcreate(fid1,"Dataset2",tid1,sid1,dcpl_pid);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset2", tid1, sid1, H5P_DEFAULT, dcpl_pid, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset creation property list */
ret = H5Pclose(dcpl_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Read from dataset before writing data */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++)
- if(rdata[i].len!=0 || rdata[i].p!=NULL)
+ for(i = 0; i < SPACE1_DIM1; i++)
+ if(rdata[i].len != 0 || rdata[i].p != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p);
/* Write "nil" data to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata2);
CHECK(ret, FAIL, "H5Dwrite");
/* Read from dataset with "nil" data */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
for(i=0; i<SPACE1_DIM1; i++)
- if(rdata[i].len!=0 || rdata[i].p!=NULL)
+ if(rdata[i].len != 0 || rdata[i].p != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p);
/* Write data to disk */
@@ -753,39 +753,39 @@ test_vltypes_vlen_compound(void)
CHECK(tid2, FAIL, "H5Tcreate");
/* Insert fields */
- ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
CHECK(ret, FAIL, "H5Tinsert");
- ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT);
+ ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT);
CHECK(ret, FAIL, "H5Tinsert");
/* Create a datatype to refer to */
- tid1 = H5Tvlen_create (tid2);
+ tid1 = H5Tvlen_create(tid2);
CHECK(tid1, FAIL, "H5Tvlen_create");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid = H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
- ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
+ ret = H5Pset_vlen_mem_manager(xfer_pid, test_vltypes_alloc_custom, &mem_used, test_vltypes_free_custom, &mem_used);
CHECK(ret, FAIL, "H5Pset_vlen_mem_manager");
/* Make certain the correct amount of memory will be used */
- ret=H5Dvlen_get_buf_size(dataset,tid1,sid1,&size);
+ ret = H5Dvlen_get_buf_size(dataset, tid1, sid1, &size);
CHECK(ret, FAIL, "H5Dvlen_get_buf_size");
/* 10 elements allocated = 1 + 2 + 3 + 4 elements for each array position */
- VERIFY(size,((SPACE1_DIM1*(SPACE1_DIM1+1))/2)*sizeof(s1),"H5Dvlen_get_buf_size");
+ VERIFY(size, ((SPACE1_DIM1 * (SPACE1_DIM1 + 1)) / 2) * sizeof(s1), "H5Dvlen_get_buf_size");
/* Read dataset from disk */
- ret=H5Dread(dataset,tid1,H5S_ALL,H5S_ALL,xfer_pid,rdata);
+ ret = H5Dread(dataset, tid1, H5S_ALL, H5S_ALL, xfer_pid, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Make certain the correct amount of memory has been used */
@@ -1063,8 +1063,8 @@ test_vltypes_compound_vlen_vlen(void)
CHECK(ret, FAIL, "H5Tinsert");
/* Create a dataset */
- dataset = H5Dcreate(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -1268,8 +1268,8 @@ test_vltypes_compound_vlstr(void)
CHECK(ret, FAIL, "H5Pset_chunk");
/* Create a dataset */
- dataset = H5Dcreate(fid1, "Dataset1", tid2, sid1, cparms);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, cparms, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Extend the dataset. This call assures that dataset is 4.*/
ret = H5Dset_extent(dataset, size);
@@ -1508,37 +1508,37 @@ test_vltypes_compound_vlen_atomic(void)
CHECK(tid2, FAIL, "H5Tcreate");
/* Insert fields */
- ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
+ ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
CHECK(ret, FAIL, "H5Tinsert");
- ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT);
+ ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT);
CHECK(ret, FAIL, "H5Tinsert");
- ret=H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1);
+ ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1);
CHECK(ret, FAIL, "H5Tinsert");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Change to the custom memory allocation routines for reading VL data */
- xfer_pid=H5Pcreate(H5P_DATASET_XFER);
+ xfer_pid = H5Pcreate(H5P_DATASET_XFER);
CHECK(xfer_pid, FAIL, "H5Pcreate");
- ret=H5Pset_vlen_mem_manager(xfer_pid,test_vltypes_alloc_custom,&mem_used,test_vltypes_free_custom,&mem_used);
+ ret = H5Pset_vlen_mem_manager(xfer_pid, test_vltypes_alloc_custom, &mem_used, test_vltypes_free_custom, &mem_used);
CHECK(ret, FAIL, "H5Pset_vlen_mem_manager");
/* Make certain the correct amount of memory will be used */
- ret=H5Dvlen_get_buf_size(dataset,tid2,sid1,&size);
+ ret = H5Dvlen_get_buf_size(dataset, tid2, sid1, &size);
CHECK(ret, FAIL, "H5Dvlen_get_buf_size");
/* 10 elements allocated = 1 + 2 + 3 + 4 elements for each array position */
- VERIFY(size,((SPACE1_DIM1*(SPACE1_DIM1+1))/2)*sizeof(unsigned int),"H5Dvlen_get_buf_size");
+ VERIFY(size, ((SPACE1_DIM1 * (SPACE1_DIM1 + 1)) / 2) * sizeof(unsigned int), "H5Dvlen_get_buf_size");
/* Read dataset from disk */
- ret=H5Dread(dataset,tid2,H5S_ALL,H5S_ALL,xfer_pid,rdata);
+ ret = H5Dread(dataset, tid2, H5S_ALL, H5S_ALL, xfer_pid, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Make certain the correct amount of memory has been used */
@@ -1568,52 +1568,52 @@ test_vltypes_compound_vlen_atomic(void)
} /* end for */
/* Reclaim the VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,xfer_pid,rdata);
+ ret = H5Dvlen_reclaim(tid2, sid1, xfer_pid, rdata);
CHECK(ret, FAIL, "H5Dvlen_reclaim");
/* Make certain the VL memory has been freed */
- VERIFY(mem_used,0,"H5Dvlen_reclaim");
+ VERIFY(mem_used, 0, "H5Dvlen_reclaim");
/* Close Dataset */
ret = H5Dclose(dataset);
CHECK(ret, FAIL, "H5Dclose");
/* Create a second dataset, with a fill value */
- dcpl_pid=H5Pcreate(H5P_DATASET_CREATE);
+ dcpl_pid = H5Pcreate(H5P_DATASET_CREATE);
CHECK(dcpl_pid, FAIL, "H5Pcreate");
/* Set the fill value for the second dataset */
- HDmemset(&fill,0,sizeof(s1));
- ret=H5Pset_fill_value(dcpl_pid, tid2, &fill);
+ HDmemset(&fill, 0, sizeof(s1));
+ ret = H5Pset_fill_value(dcpl_pid, tid2, &fill);
CHECK(ret, FAIL, "H5Pset_fill_value");
- dataset=H5Dcreate(fid1,"Dataset2",tid2,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset2", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Close dataset creation property list */
ret = H5Pclose(dcpl_pid);
CHECK(ret, FAIL, "H5Pclose");
/* Read from dataset before writing data */
- ret=H5Dread(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++)
- if(rdata[i].i!=0 || !FLT_ABS_EQUAL(rdata[i].f,0.0) || rdata[i].v.len!=0 || rdata[i].v.p!=NULL)
+ for(i = 0; i < SPACE1_DIM1; i++)
+ if(rdata[i].i != 0 || !FLT_ABS_EQUAL(rdata[i].f, 0.0) || rdata[i].v.len != 0 || rdata[i].v.p != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].i=%d, rdata[%d].f=%f, rdata[%d].v.len=%u, rdata[%d].v.p=%p\n",(int)i,rdata[i].i,(int)i,rdata[i].f,(int)i,(unsigned)rdata[i].v.len,(int)i,rdata[i].v.p);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Read dataset from disk */
- ret=H5Dread(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata);
+ ret = H5Dread(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
CHECK(ret, FAIL, "H5Dread");
/* Compare data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(wdata[i].i!=rdata[i].i) {
+ for(i = 0; i < SPACE1_DIM1; i++) {
+ if(wdata[i].i != rdata[i].i) {
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
@@ -1905,11 +1905,11 @@ test_vltypes_vlen_vlen_atomic(void)
CHECK(tid2, FAIL, "H5Tvlen_create");
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT);
- CHECK(dataset, FAIL, "H5Dcreate");
+ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(dataset, FAIL, "H5Dcreate2");
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
CHECK(ret, FAIL, "H5Dwrite");
/* Close Dataset */
@@ -2608,8 +2608,8 @@ test_vltypes_fill_value(void)
} /* end switch */
/* Create first data set with default setting - no space is allocated */
- dset_id = H5Dcreate(file_id, dset_name1, dtype1_id, dset_dspace_id, tmp_dcpl_id);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, dset_name1, dtype1_id, dset_dspace_id, H5P_DEFAULT, tmp_dcpl_id, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
ret = H5Dclose(dset_id);
CHECK(ret, FAIL, "H5Dclose");
@@ -2622,8 +2622,8 @@ test_vltypes_fill_value(void)
ret = H5Pset_alloc_time(tmp_dcpl_id, H5D_ALLOC_TIME_EARLY);
CHECK(ret, FAIL, "H5Pset_alloc_time");
- dset_id = H5Dcreate(file_id, dset_name2, dtype1_id, dset_dspace_id, tmp_dcpl_id);
- CHECK(dset_id, FAIL, "H5Dcreate");
+ dset_id = H5Dcreate2(file_id, dset_name2, dtype1_id, dset_dspace_id, H5P_DEFAULT, tmp_dcpl_id, H5P_DEFAULT);
+ CHECK(dset_id, FAIL, "H5Dcreate2");
ret = H5Dclose(dset_id);
CHECK(ret, FAIL, "H5Dclose");
diff --git a/test/unlink.c b/test/unlink.c
index 1248063..e1fc7f4 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -612,7 +612,7 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create a single dataset to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
/* Remove the dataset */
@@ -637,7 +637,7 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create a single dataset to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
/* Remove the dataset */
@@ -662,7 +662,7 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create a single dataset to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, late_chunk_dcpl)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, late_chunk_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
/* Remove the dataset */
@@ -687,7 +687,7 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create a single dataset to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, early_chunk_dcpl)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, early_chunk_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
/* Remove the dataset */
@@ -712,7 +712,7 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create a single dataset to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, comp_dcpl)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, comp_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
/* Remove the dataset */
@@ -740,7 +740,7 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_nocache)) < 0) FAIL_STACK_ERROR
/* Create a single dataset to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, comp_dcpl)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, comp_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Alternate re-writing dataset with compressible & random data */
for(u = 0; u < FILESPACE_REWRITE; u++) {
@@ -784,7 +784,7 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create a single dataset to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, compact_dcpl)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, compact_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
/* Remove the dataset */
@@ -812,8 +812,8 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create datasets to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR
- if((dataset2 = H5Dcreate(file, DATASET2NAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset2 = H5Dcreate2(file, DATASET2NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create a dataspace for the attributes */
if((attr_space = H5Screate_simple(FILESPACE_ATTR_NDIMS, attr_dims, NULL)) < 0) FAIL_STACK_ERROR
@@ -1011,7 +1011,7 @@ test_filespace(hid_t fapl)
for(w = 0; w < FILESPACE_NDATASETS; w++) {
/* Create & close a dataset */
sprintf(objname, "%s %u", DATASETNAME, w);
- if((dataset = H5Dcreate(group2, objname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(group2, objname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
} /* end for */
@@ -1079,12 +1079,12 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create a single dataset to remove */
- if((dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Dclose(dataset) < 0) FAIL_STACK_ERROR
/* Create another dataset with same name */
H5E_BEGIN_TRY {
- dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
} H5E_END_TRY;
if(dataset >= 0) {
H5Dclose(dataset);
@@ -1185,7 +1185,7 @@ test_filespace(hid_t fapl)
if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create datasets to remove */
- if((dataset = H5Dcreate(file, DATASETNAME, H5T_NATIVE_INT, space, contig_dcpl)) < 0) FAIL_STACK_ERROR
+ if((dataset = H5Dcreate2(file, DATASETNAME, H5T_NATIVE_INT, space, H5P_DEFAULT, contig_dcpl, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Create a dataspace for the attributes */
if((attr_space = H5Screate_simple(FILESPACE_ATTR_NDIMS, attr_dims, NULL)) < 0) FAIL_STACK_ERROR
@@ -1853,7 +1853,7 @@ test_resurrect_dataset(hid_t fapl)
/* Create a dataset in the file */
if((s = H5Screate(H5S_SCALAR)) < 0) FAIL_STACK_ERROR
- if((d = H5Dcreate(f, DATASETNAME, H5T_NATIVE_INT, s, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
+ if((d = H5Dcreate2(f, DATASETNAME, H5T_NATIVE_INT, s, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if(H5Sclose(s) < 0) FAIL_STACK_ERROR
/* Unlink the dataset while it's open (will mark it for deletion when closed) */
@@ -2065,19 +2065,19 @@ test_unlink_chunked_dataset(hid_t fapl)
if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR
/* Create the dataspace */
- if((space_id = H5Screate_simple(FILESPACE_NDIMS,dims,max_dims)) < 0) FAIL_STACK_ERROR
+ if((space_id = H5Screate_simple(FILESPACE_NDIMS, dims, max_dims)) < 0) FAIL_STACK_ERROR
/* Create the dataset creation filter */
if((dcpl_id = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR
/* Set to chunked storage */
- if(H5Pset_chunk(dcpl_id,FILESPACE_NDIMS,chunk_dims) < 0) FAIL_STACK_ERROR
+ if(H5Pset_chunk(dcpl_id, FILESPACE_NDIMS, chunk_dims) < 0) FAIL_STACK_ERROR
/* Set to early space allocation */
- if(H5Pset_alloc_time(dcpl_id,H5D_ALLOC_TIME_EARLY) < 0) FAIL_STACK_ERROR
+ if(H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY) < 0) FAIL_STACK_ERROR
/* Create the dataset */
- if((dset_id = H5Dcreate(file_id,DATASETNAME,H5T_NATIVE_INT,space_id,dcpl_id)) < 0) FAIL_STACK_ERROR
+ if((dset_id = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_INT, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
/* Close the dataspace */
if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR
diff --git a/test/vfd.c b/test/vfd.c
index a8e90c6..4ae4fc1 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -243,7 +243,7 @@ test_direct(void)
TEST_ERROR;
/* Create the dset1 */
- if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
+ if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
@@ -278,7 +278,7 @@ test_direct(void)
TEST_ERROR;
/* Create the dset2 */
- if((dset2 = H5Dcreate(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT)) < 0)
+ if((dset2 = H5Dcreate2(file, DSET2_NAME, H5T_NATIVE_INT, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
@@ -438,7 +438,7 @@ test_core(void)
TEST_ERROR;
/* Create the dset1 */
- if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
+ if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
@@ -482,7 +482,7 @@ test_core(void)
TEST_ERROR;
/* Create the dset1 */
- if((dset1 = H5Dcreate(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT)) < 0)
+ if((dset1 = H5Dcreate2(file, DSET1_NAME, H5T_NATIVE_INT, space1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
/* Write the data to the dset1 */
@@ -706,7 +706,7 @@ test_family(void)
if (H5Pclose(access_fapl) < 0)
TEST_ERROR;
- if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0)
+ if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i=0; i<FAMILY_NUMBER; i++)
@@ -1013,7 +1013,7 @@ test_multi(void)
if(file_size < HADDR_MAX/4 || file_size > HADDR_MAX/2)
TEST_ERROR;
- if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT)) < 0)
+ if((dset=H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
TEST_ERROR;
for(i=0; i<MULTI_SIZE; i++)
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c
index e496a58..5d02822 100644
--- a/testpar/t_chunk_alloc.c
+++ b/testpar/t_chunk_alloc.c
@@ -126,46 +126,34 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
VRFY((file_id >= 0), "H5Fcreate");
/* Modify dataset creation properties, i.e. enable chunking */
- cparms = H5Pcreate (H5P_DATASET_CREATE);
+ cparms = H5Pcreate(H5P_DATASET_CREATE);
VRFY((cparms >= 0), "");
hrc = H5Pset_alloc_time(cparms, H5D_ALLOC_TIME_EARLY);
VRFY((hrc >= 0), "");
- hrc = H5Pset_chunk ( cparms, 1, chunk_dims);
+ hrc = H5Pset_chunk(cparms, 1, chunk_dims);
VRFY((hrc >= 0), "");
/* Create a new dataset within the file using cparms creation properties. */
- dataset = H5Dcreate (file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, cparms);
+ dataset = H5Dcreate2(file_id, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, H5P_DEFAULT, cparms, H5P_DEFAULT);
VRFY((dataset >= 0), "");
- switch (write_pattern) {
-
- /* writes only the second to last chunk */
- case sec_last:
-
- memset(buffer, 100, CHUNKSIZE);
-
- count[0] = 1;
- stride[0] = 1;
- block[0] = chunk_dims[0];
- offset[0] = (nchunks-2)*chunk_dims[0];
-
- hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
- VRFY((hrc >= 0), "");
+ if(write_pattern == sec_last) {
+ HDmemset(buffer, 100, CHUNKSIZE);
- /* Write sec_last chunk */
- hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
- VRFY((hrc >= 0), "H5Dwrite");
+ count[0] = 1;
+ stride[0] = 1;
+ block[0] = chunk_dims[0];
+ offset[0] = (nchunks-2)*chunk_dims[0];
- break;
-
-
- /* doesn't write anything */
- case none:
+ hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
+ VRFY((hrc >= 0), "");
- break;
- }
+ /* Write sec_last chunk */
+ hrc = H5Dwrite(dataset, H5T_NATIVE_UCHAR, memspace, dataspace, H5P_DEFAULT, buffer);
+ VRFY((hrc >= 0), "H5Dwrite");
+ } /* end if */
/* Close resources */
hrc = H5Dclose (dataset);
@@ -187,7 +175,7 @@ create_chunked_dataset(const char *filename, int nchunks, write_type write_patte
/* verify file size */
filesize = get_filesize(filename);
- est_filesize = nchunks*CHUNKSIZE*sizeof(unsigned char);
+ est_filesize = nchunks * CHUNKSIZE * sizeof(unsigned char);
VRFY((filesize >= est_filesize), "file size check");
}
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index 46dfff1..7886066 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -598,14 +598,14 @@ coll_chunktest(const char* filename,
/* allocate memory for data buffer */
- data_array1 = (int *)malloc(dims[0]*dims[1]*sizeof(int));
+ data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* set up dimensions of the slab this process accesses */
ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor);
file_dataspace = H5Screate_simple(2, dims, NULL);
- VRFY((file_dataspace >= 0),"file dataspace created succeeded");
+ VRFY((file_dataspace >= 0), "file dataspace created succeeded");
crp_plist = H5Pcreate(H5P_DATASET_CREATE);
VRFY((crp_plist >= 0),"");
@@ -619,29 +619,29 @@ coll_chunktest(const char* filename,
status = H5Pset_chunk(crp_plist, 2, chunk_dims);
VRFY((status >= 0),"chunk creation property list succeeded");
- dataset = H5Dcreate(file,DSET_COLLECTIVE_CHUNK_NAME,H5T_NATIVE_INT,
- file_dataspace,crp_plist);
+ dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT,
+ file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT);
VRFY((dataset >= 0),"dataset created succeeded");
status = H5Pclose(crp_plist);
- VRFY((status >= 0),"");
+ VRFY((status >= 0), "");
/*put some trivial data in the data array */
- ccdataset_fill(start, stride,count,block, data_array1);
+ ccdataset_fill(start, stride, count,block, data_array1);
MESG("data_array initialized");
- status=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
+ status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride,
count, block);
VRFY((status >= 0),"hyperslab selection succeeded");
/* set up the collective transfer property list */
xfer_plist = H5Pcreate(H5P_DATASET_XFER);
- VRFY((xfer_plist >= 0),"");
+ VRFY((xfer_plist >= 0), "");
status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((status>= 0),"MPIO collective transfer property succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- status = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
+ status = H5Pset_dxpl_mpio_collective_opt(xfer_plist, H5FD_MPIO_INDIVIDUAL_IO);
VRFY((status>= 0),"set independent IO collectively succeeded");
}
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 2d02cdb..c8dd00e 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -58,7 +58,7 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
count[1] = 1;
start[0] = mpi_rank*block[0];
start[1] = 0;
-if (VERBOSE_MED) printf("slab_set BYROW\n");
+if(VERBOSE_MED) printf("slab_set BYROW\n");
break;
case BYCOL:
/* Each process takes a block of columns. */
@@ -70,7 +70,7 @@ if (VERBOSE_MED) printf("slab_set BYROW\n");
count[1] = 1;
start[0] = 0;
start[1] = mpi_rank*block[1];
-if (VERBOSE_MED) printf("slab_set BYCOL\n");
+if(VERBOSE_MED) printf("slab_set BYCOL\n");
break;
case ZROW:
/* Similar to BYROW except process 0 gets 0 row */
@@ -82,7 +82,7 @@ if (VERBOSE_MED) printf("slab_set BYCOL\n");
count[1] = 1;
start[0] = (mpi_rank? mpi_rank*block[0] : 0);
start[1] = 0;
-if (VERBOSE_MED) printf("slab_set ZROW\n");
+if(VERBOSE_MED) printf("slab_set ZROW\n");
break;
case ZCOL:
/* Similar to BYCOL except process 0 gets 0 column */
@@ -94,7 +94,7 @@ if (VERBOSE_MED) printf("slab_set ZROW\n");
count[1] = 1;
start[0] = 0;
start[1] = (mpi_rank? mpi_rank*block[1] : 0);
-if (VERBOSE_MED) printf("slab_set ZCOL\n");
+if(VERBOSE_MED) printf("slab_set ZCOL\n");
break;
default:
/* Unknown mode. Set it to cover the whole dataset. */
@@ -107,10 +107,10 @@ if (VERBOSE_MED) printf("slab_set ZCOL\n");
count[1] = 1;
start[0] = 0;
start[1] = 0;
-if (VERBOSE_MED) printf("slab_set wholeset\n");
+if(VERBOSE_MED) printf("slab_set wholeset\n");
break;
}
-if (VERBOSE_MED){
+if(VERBOSE_MED){
printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
(unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
@@ -176,7 +176,7 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
int vrfyerrs;
/* print it if VERBOSE_MED */
- if (VERBOSE_MED) {
+ if(VERBOSE_MED) {
printf("dataset_vrfy dumping:::\n");
printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
(unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
@@ -190,8 +190,8 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
vrfyerrs = 0;
for (i=0; i < block[0]; i++){
for (j=0; j < block[1]; j++){
- if (*dataset != *original){
- if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
+ if(*dataset != *original){
+ if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
(unsigned long)i, (unsigned long)j,
(unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
@@ -202,9 +202,9 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
}
}
}
- if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
+ if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
- if (vrfyerrs)
+ if(vrfyerrs)
printf("%d errors found in dataset_vrfy\n", vrfyerrs);
return(vrfyerrs);
}
@@ -247,7 +247,7 @@ dataset_writeInd(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Independent write test on file %s\n", filename);
/* set up MPI parameters */
@@ -266,11 +266,11 @@ dataset_writeInd(void)
VRFY((acc_tpl >= 0), "");
/* create the file collectively */
- fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
@@ -286,14 +286,14 @@ dataset_writeInd(void)
/* create a dataset collectively */
- dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid,
- H5P_DEFAULT);
- VRFY((dataset1 >= 0), "H5Dcreate succeeded");
+ dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
/* create another dataset collectively */
- dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid,
- H5P_DEFAULT);
- VRFY((dataset2 >= 0), "H5Dcreate succeeded");
+ dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset2 >= 0), "H5Dcreate2 succeeded");
/*
@@ -312,7 +312,7 @@ dataset_writeInd(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* create a memory dataspace independently */
@@ -329,18 +329,18 @@ dataset_writeInd(void)
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to write with zero rows for process 0 */
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("writeInd by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
- if (MAINPROCESS){
- ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ if(MAINPROCESS){
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeInd by some with zero row");
-if ((mpi_rank/2)*2 != mpi_rank){
+if((mpi_rank/2)*2 != mpi_rank){
ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
H5P_DEFAULT, data_array1);
VRFY((ret >= 0), "H5Dwrite dataset1 by ZROW succeeded");
@@ -353,9 +353,9 @@ MPI_Barrier(MPI_COMM_WORLD);
H5Sclose(file_dataspace);
/* close dataset collectively */
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose1 succeeded");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "H5Dclose2 succeeded");
/* release all IDs created */
@@ -365,7 +365,7 @@ MPI_Barrier(MPI_COMM_WORLD);
H5Fclose(fid);
/* release data buffers */
- if (data_array1) free(data_array1);
+ if(data_array1) free(data_array1);
}
/* Example of using the parallel HDF5 library to read a dataset */
@@ -393,7 +393,7 @@ dataset_readInd(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Independent read test on file %s\n", filename);
/* set up MPI parameters */
@@ -415,7 +415,7 @@ dataset_readInd(void)
VRFY((fid >= 0), "");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
/* open the dataset1 collectively */
@@ -433,7 +433,7 @@ dataset_readInd(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "");
/* create a memory dataspace independently */
@@ -450,7 +450,7 @@ dataset_readInd(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
- if (ret) nerrors++;
+ if(ret) nerrors++;
/* read data independently */
ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace,
@@ -459,12 +459,12 @@ dataset_readInd(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
- if (ret) nerrors++;
+ if(ret) nerrors++;
/* close dataset collectively */
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "");
/* release all IDs created */
@@ -474,8 +474,8 @@ dataset_readInd(void)
H5Fclose(fid);
/* release data buffers */
- if (data_array1) free(data_array1);
- if (data_origin1) free(data_origin1);
+ if(data_array1) free(data_array1);
+ if(data_origin1) free(data_origin1);
}
@@ -519,7 +519,7 @@ dataset_writeAll(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Collective write test on file %s\n", filename);
/* set up MPI parameters */
@@ -538,11 +538,11 @@ dataset_writeAll(void)
VRFY((acc_tpl >= 0), "");
/* create the file collectively */
- fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
@@ -558,20 +558,20 @@ dataset_writeAll(void)
/* create a dataset collectively */
- dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT);
- VRFY((dataset1 >= 0), "H5Dcreate succeeded");
+ dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
/* create another dataset collectively */
datatype = H5Tcopy(H5T_NATIVE_INT);
ret = H5Tset_order(datatype, H5T_ORDER_LE);
VRFY((ret >= 0), "H5Tset_order succeeded");
- dataset2 = H5Dcreate(fid, DATASETNAME2, datatype, sid, H5P_DEFAULT);
- VRFY((dataset2 >= 0), "H5Dcreate 2 succeeded");
+ dataset2 = H5Dcreate2(fid, DATASETNAME2, datatype, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset2 >= 0), "H5Dcreate2 2 succeeded");
/* create a third dataset collectively */
- dataset3 = H5Dcreate(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT);
- VRFY((dataset3 >= 0), "H5Dcreate succeeded");
+ dataset3 = H5Dcreate2(fid, DATASETNAME3, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset3 >= 0), "H5Dcreate2 succeeded");
/* release 2-D space ID created */
H5Sclose(sid);
@@ -581,8 +581,8 @@ dataset_writeAll(void)
VRFY((sid >= 0), "H5Screate succeeded");
/* create a fourth dataset collectively */
- dataset4 = H5Dcreate(fid, DATASETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT);
- VRFY((dataset4 >= 0), "H5Dcreate succeeded");
+ dataset4 = H5Dcreate2(fid, DATASETNAME4, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset4 >= 0), "H5Dcreate2 succeeded");
/* release scalar space ID created */
H5Sclose(sid);
@@ -597,7 +597,7 @@ dataset_writeAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* create a memory dataspace independently */
@@ -607,7 +607,7 @@ dataset_writeAll(void)
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -615,7 +615,7 @@ dataset_writeAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -630,14 +630,14 @@ dataset_writeAll(void)
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
/* setup dimensions again to writeAll with zero rows for process 0 */
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("writeAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
- if (MAINPROCESS){
- ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ if(MAINPROCESS){
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeAll by some with zero row");
@@ -658,7 +658,7 @@ dataset_writeAll(void)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -666,7 +666,7 @@ dataset_writeAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* create a memory dataspace independently */
@@ -676,7 +676,7 @@ dataset_writeAll(void)
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -684,7 +684,7 @@ dataset_writeAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -698,14 +698,14 @@ dataset_writeAll(void)
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to writeAll with zero columns for process 0 */
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("writeAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
- if (MAINPROCESS){
- ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ if(MAINPROCESS){
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("writeAll by some with zero col");
@@ -727,27 +727,27 @@ dataset_writeAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset3);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- if (MAINPROCESS) {
- ret=H5Sselect_none(file_dataspace);
+ if(MAINPROCESS) {
+ ret = H5Sselect_none(file_dataspace);
VRFY((ret >= 0), "H5Sselect_none file_dataspace succeeded");
} /* end if */
else {
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded");
} /* end else */
/* create a memory dataspace independently */
mem_dataspace = H5Screate_simple (RANK, block, NULL);
VRFY((mem_dataspace >= 0), "");
- if (MAINPROCESS) {
- ret=H5Sselect_none(mem_dataspace);
+ if(MAINPROCESS) {
+ ret = H5Sselect_none(mem_dataspace);
VRFY((ret >= 0), "H5Sselect_none mem_dataspace succeeded");
} /* end if */
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED) {
+ if(VERBOSE_MED) {
MESG("data_array created");
dataset_print(start, block, data_array1);
} /* end if */
@@ -755,7 +755,7 @@ dataset_writeAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -788,31 +788,31 @@ dataset_writeAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset4);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- if (MAINPROCESS) {
- ret=H5Sselect_none(file_dataspace);
+ if(MAINPROCESS) {
+ ret = H5Sselect_none(file_dataspace);
VRFY((ret >= 0), "H5Sselect_all file_dataspace succeeded");
} /* end if */
else {
- ret=H5Sselect_all(file_dataspace);
+ ret = H5Sselect_all(file_dataspace);
VRFY((ret >= 0), "H5Sselect_none succeeded");
} /* end else */
/* create a memory dataspace independently */
mem_dataspace = H5Screate(H5S_SCALAR);
VRFY((mem_dataspace >= 0), "");
- if (MAINPROCESS) {
- ret=H5Sselect_none(mem_dataspace);
+ if(MAINPROCESS) {
+ ret = H5Sselect_none(mem_dataspace);
VRFY((ret >= 0), "H5Sselect_all mem_dataspace succeeded");
} /* end if */
else {
- ret=H5Sselect_all(mem_dataspace);
+ ret = H5Sselect_all(mem_dataspace);
VRFY((ret >= 0), "H5Sselect_none succeeded");
} /* end else */
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED) {
+ if(VERBOSE_MED) {
MESG("data_array created");
dataset_print(start, block, data_array1);
} /* end if */
@@ -820,7 +820,7 @@ dataset_writeAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -849,20 +849,20 @@ dataset_writeAll(void)
/*
* All writes completed. Close datasets collectively
*/
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose1 succeeded");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "H5Dclose2 succeeded");
- ret=H5Dclose(dataset3);
+ ret = H5Dclose(dataset3);
VRFY((ret >= 0), "H5Dclose3 succeeded");
- ret=H5Dclose(dataset4);
+ ret = H5Dclose(dataset4);
VRFY((ret >= 0), "H5Dclose3 succeeded");
/* close the file collectively */
H5Fclose(fid);
/* release data buffers */
- if (data_array1) free(data_array1);
+ if(data_array1) free(data_array1);
}
/*
@@ -899,7 +899,7 @@ dataset_readAll(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Collective read test on file %s\n", filename);
/* set up MPI parameters */
@@ -924,7 +924,7 @@ dataset_readAll(void)
VRFY((fid >= 0), "H5Fopen succeeded");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
@@ -949,7 +949,7 @@ dataset_readAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* create a memory dataspace independently */
@@ -959,7 +959,7 @@ dataset_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_origin1);
}
@@ -967,7 +967,7 @@ dataset_readAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -982,17 +982,17 @@ dataset_readAll(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
- if (ret) nerrors++;
+ if(ret) nerrors++;
/* setup dimensions again to readAll with zero columns for process 0 */
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("readAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
- if (MAINPROCESS){
- ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ if(MAINPROCESS){
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("readAll by some with zero col");
@@ -1002,7 +1002,7 @@ dataset_readAll(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
- if (ret) nerrors++;
+ if(ret) nerrors++;
/* release all temporary handles. */
/* Could have used them for dataset2 but it is cleaner */
@@ -1017,7 +1017,7 @@ dataset_readAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* create a memory dataspace independently */
@@ -1027,7 +1027,7 @@ dataset_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_origin1);
}
@@ -1035,7 +1035,7 @@ dataset_readAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -1050,17 +1050,17 @@ dataset_readAll(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
- if (ret) nerrors++;
+ if(ret) nerrors++;
/* setup dimensions again to readAll with zero rows for process 0 */
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("readAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* need to make mem_dataspace to match for process 0 */
- if (MAINPROCESS){
- ret=H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ if(MAINPROCESS){
+ ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab mem_dataspace succeeded");
}
MESG("readAll by some with zero row");
@@ -1070,7 +1070,7 @@ dataset_readAll(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
- if (ret) nerrors++;
+ if(ret) nerrors++;
/* release all temporary handles. */
H5Sclose(file_dataspace);
@@ -1081,17 +1081,17 @@ dataset_readAll(void)
/*
* All reads completed. Close datasets collectively
*/
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose1 succeeded");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "H5Dclose2 succeeded");
/* close the file collectively */
H5Fclose(fid);
/* release data buffers */
- if (data_array1) free(data_array1);
- if (data_origin1) free(data_origin1);
+ if(data_array1) free(data_array1);
+ if(data_origin1) free(data_origin1);
}
@@ -1137,7 +1137,7 @@ extend_writeInd(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
@@ -1169,19 +1169,19 @@ extend_writeInd(void)
size_t rdcc_nbytes;
double rdcc_w0;
- ret=H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0);
+ ret = H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0);
VRFY((ret >= 0), "H5Pget_cache succeeded");
mdc_nelmts=4;
- ret=H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0);
+ ret = H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0);
VRFY((ret >= 0), "H5Pset_cache succeeded");
}
/* create the file collectively */
- fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
@@ -1190,7 +1190,7 @@ extend_writeInd(void)
* ------------------------------------------------------------- */
/* set up dataset storage chunk sizes and creation property list */
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
@@ -1204,12 +1204,12 @@ extend_writeInd(void)
VRFY((sid >= 0), "H5Screate_simple succeeded");
/* create an extendible dataset collectively */
- dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl);
- VRFY((dataset1 >= 0), "H5Dcreate succeeded");
+ dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT);
+ VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
/* create another extendible dataset collectively */
- dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl);
- VRFY((dataset2 >= 0), "H5Dcreate succeeded");
+ dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT);
+ VRFY((dataset2 >= 0), "H5Dcreate2 succeeded");
/* release resource */
H5Sclose(sid);
@@ -1226,7 +1226,7 @@ extend_writeInd(void)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED) {
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1244,7 +1244,7 @@ extend_writeInd(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently */
@@ -1266,7 +1266,7 @@ extend_writeInd(void)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1283,7 +1283,7 @@ extend_writeInd(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently. Should fail. */
@@ -1304,7 +1304,7 @@ extend_writeInd(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently */
@@ -1313,23 +1313,23 @@ extend_writeInd(void)
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
- ret=H5Sclose(file_dataspace);
+ ret = H5Sclose(file_dataspace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Sclose(mem_dataspace);
+ ret = H5Sclose(mem_dataspace);
VRFY((ret >= 0), "H5Sclose succeeded");
/* close dataset collectively */
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose1 succeeded");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "H5Dclose2 succeeded");
/* close the file collectively */
H5Fclose(fid);
/* release data buffers */
- if (data_array1) free(data_array1);
+ if(data_array1) free(data_array1);
}
/*
@@ -1361,7 +1361,7 @@ extend_writeInd2(void)
herr_t ret; /* Generic return value */
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Extend independent write test #2 on file %s\n", filename);
/* set up MPI parameters */
@@ -1376,11 +1376,11 @@ extend_writeInd2(void)
VRFY((fapl >= 0), "create_faccess_plist succeeded");
/* create the file collectively */
- fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,fapl);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Release file-access template */
- ret=H5Pclose(fapl);
+ ret = H5Pclose(fapl);
VRFY((ret >= 0), "H5Pclose succeeded");
@@ -1399,11 +1399,11 @@ extend_writeInd2(void)
VRFY((fs >= 0), "H5Screate_simple succeeded");
/* create an extendible dataset collectively */
- dataset = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, fs, dcpl);
- VRFY((dataset >= 0), "H5Dcreate succeeded");
+ dataset = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, fs, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ VRFY((dataset >= 0), "H5Dcreat2e succeeded");
/* release resource */
- ret=H5Pclose(dcpl);
+ ret = H5Pclose(dcpl);
VRFY((ret >= 0), "H5Pclose succeeded");
@@ -1415,12 +1415,12 @@ extend_writeInd2(void)
VRFY((ms >= 0), "H5Screate_simple succeeded");
/* put some trivial data in the data_array */
- for (i=0; i<(int)orig_size; i++)
+ for(i = 0; i < (int)orig_size; i++)
written[i] = i;
MESG("data array initialized");
- if (VERBOSE_MED) {
+ if(VERBOSE_MED) {
MESG("writing at offset zero: ");
- for (i=0; i<(int)orig_size; i++)
+ for(i = 0; i < (int)orig_size; i++)
printf("%s%d", i?", ":"", written[i]);
printf("\n");
}
@@ -1438,7 +1438,7 @@ extend_writeInd2(void)
i,written[i], i,retrieved[i]);
nerrors++;
}
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("read at offset zero: ");
for (i=0; i<(int)orig_size; i++)
printf("%s%d", i?", ":"", retrieved[i]);
@@ -1461,7 +1461,7 @@ extend_writeInd2(void)
for (i=0; i<(int)orig_size; i++)
written[i] = orig_size + i;
MESG("data array re-initialized");
- if (VERBOSE_MED) {
+ if(VERBOSE_MED) {
MESG("writing at offset 10: ");
for (i=0; i<(int)orig_size; i++)
printf("%s%d", i?", ":"", written[i]);
@@ -1483,7 +1483,7 @@ extend_writeInd2(void)
i,written[i], i,retrieved[i]);
nerrors++;
}
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("read at offset 10: ");
for (i=0; i<(int)orig_size; i++)
printf("%s%d", i?", ":"", retrieved[i]);
@@ -1492,7 +1492,7 @@ extend_writeInd2(void)
/* Close dataset collectively */
- ret=H5Dclose(dataset);
+ ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose succeeded");
/* Close the file collectively */
@@ -1527,7 +1527,7 @@ extend_readInd(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
@@ -1554,7 +1554,7 @@ extend_readInd(void)
VRFY((fid >= 0), "");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
/* open the dataset1 collectively */
@@ -1590,7 +1590,7 @@ extend_readInd(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "");
/* create a memory dataspace independently */
@@ -1599,7 +1599,7 @@ extend_readInd(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1612,7 +1612,7 @@ extend_readInd(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
VRFY((ret == 0), "dataset1 read verified correct");
- if (ret) nerrors++;
+ if(ret) nerrors++;
H5Sclose(mem_dataspace);
H5Sclose(file_dataspace);
@@ -1625,7 +1625,7 @@ extend_readInd(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
VRFY((file_dataspace >= 0), "");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "");
/* create a memory dataspace independently */
@@ -1634,7 +1634,7 @@ extend_readInd(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1647,15 +1647,15 @@ extend_readInd(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
VRFY((ret == 0), "dataset2 read verified correct");
- if (ret) nerrors++;
+ if(ret) nerrors++;
H5Sclose(mem_dataspace);
H5Sclose(file_dataspace);
/* close dataset collectively */
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "");
@@ -1663,9 +1663,9 @@ extend_readInd(void)
H5Fclose(fid);
/* release data buffers */
- if (data_array1) free(data_array1);
- if (data_array2) free(data_array2);
- if (data_origin1) free(data_origin1);
+ if(data_array1) free(data_array1);
+ if(data_array2) free(data_array2);
+ if(data_origin1) free(data_origin1);
}
/*
@@ -1711,7 +1711,7 @@ extend_writeAll(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
@@ -1743,19 +1743,19 @@ extend_writeAll(void)
size_t rdcc_nbytes;
double rdcc_w0;
- ret=H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0);
+ ret = H5Pget_cache(acc_tpl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0);
VRFY((ret >= 0), "H5Pget_cache succeeded");
mdc_nelmts=4;
- ret=H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0);
+ ret = H5Pset_cache(acc_tpl,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0);
VRFY((ret >= 0), "H5Pset_cache succeeded");
}
/* create the file collectively */
- fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
@@ -1764,7 +1764,7 @@ extend_writeAll(void)
* ------------------------------------------------------------- */
/* set up dataset storage chunk sizes and creation property list */
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
@@ -1778,12 +1778,12 @@ extend_writeAll(void)
VRFY((sid >= 0), "H5Screate_simple succeeded");
/* create an extendible dataset collectively */
- dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl);
- VRFY((dataset1 >= 0), "H5Dcreate succeeded");
+ dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT);
+ VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
/* create another extendible dataset collectively */
- dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl);
- VRFY((dataset2 >= 0), "H5Dcreate succeeded");
+ dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT);
+ VRFY((dataset2 >= 0), "H5Dcreate2 succeeded");
/* release resource */
H5Sclose(sid);
@@ -1800,7 +1800,7 @@ extend_writeAll(void)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED) {
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1818,13 +1818,13 @@ extend_writeAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -1852,7 +1852,7 @@ extend_writeAll(void)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1864,7 +1864,7 @@ extend_writeAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -1880,7 +1880,7 @@ extend_writeAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently. Should fail. */
@@ -1901,7 +1901,7 @@ extend_writeAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* write data independently */
@@ -1910,25 +1910,25 @@ extend_writeAll(void)
VRFY((ret >= 0), "H5Dwrite succeeded");
/* release resource */
- ret=H5Sclose(file_dataspace);
+ ret = H5Sclose(file_dataspace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Sclose(mem_dataspace);
+ ret = H5Sclose(mem_dataspace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Pclose(xfer_plist);
+ ret = H5Pclose(xfer_plist);
VRFY((ret >= 0), "H5Pclose succeeded");
/* close dataset collectively */
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose1 succeeded");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "H5Dclose2 succeeded");
/* close the file collectively */
H5Fclose(fid);
/* release data buffers */
- if (data_array1) free(data_array1);
+ if(data_array1) free(data_array1);
}
/* Example of using the parallel HDF5 library to read an extendible dataset */
@@ -1959,7 +1959,7 @@ extend_readAll(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
@@ -1986,7 +1986,7 @@ extend_readAll(void)
VRFY((fid >= 0), "");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
/* open the dataset1 collectively */
@@ -2022,7 +2022,7 @@ extend_readAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "");
/* create a memory dataspace independently */
@@ -2031,7 +2031,7 @@ extend_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -2039,7 +2039,7 @@ extend_readAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -2055,7 +2055,7 @@ extend_readAll(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
VRFY((ret == 0), "dataset1 read verified correct");
- if (ret) nerrors++;
+ if(ret) nerrors++;
H5Sclose(mem_dataspace);
H5Sclose(file_dataspace);
@@ -2069,7 +2069,7 @@ extend_readAll(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
VRFY((file_dataspace >= 0), "");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "");
/* create a memory dataspace independently */
@@ -2078,7 +2078,7 @@ extend_readAll(void)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -2086,7 +2086,7 @@ extend_readAll(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -2102,16 +2102,16 @@ extend_readAll(void)
/* verify the read data with original expected data */
ret = dataset_vrfy(start, count, stride, block, data_array1, data_origin1);
VRFY((ret == 0), "dataset2 read verified correct");
- if (ret) nerrors++;
+ if(ret) nerrors++;
H5Sclose(mem_dataspace);
H5Sclose(file_dataspace);
H5Pclose(xfer_plist);
/* close dataset collectively */
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "");
@@ -2119,9 +2119,9 @@ extend_readAll(void)
H5Fclose(fid);
/* release data buffers */
- if (data_array1) free(data_array1);
- if (data_array2) free(data_array2);
- if (data_origin1) free(data_origin1);
+ if(data_array1) free(data_array1);
+ if(data_array2) free(data_array2);
+ if(data_origin1) free(data_origin1);
}
/*
@@ -2152,7 +2152,7 @@ compress_readAll(void)
herr_t ret; /* Generic return value */
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Collective chunked dataset read test on file %s\n", filename);
/* Retrieve MPI parameters */
@@ -2181,15 +2181,15 @@ compress_readAll(void)
dcpl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dcpl > 0), "H5Pcreate succeeded");
- ret=H5Pset_layout(dcpl, H5D_CHUNKED);
+ ret = H5Pset_layout(dcpl, H5D_CHUNKED);
VRFY((ret >= 0), "H5Pset_layout succeeded");
/* Use eight chunks */
- chunk_dim=dim/8;
- ret=H5Pset_chunk(dcpl, rank, &chunk_dim);
+ chunk_dim = dim / 8;
+ ret = H5Pset_chunk(dcpl, rank, &chunk_dim);
VRFY((ret >= 0), "H5Pset_chunk succeeded");
- ret=H5Pset_deflate(dcpl, 9);
+ ret = H5Pset_deflate(dcpl, 9);
VRFY((ret >= 0), "H5Pset_deflate succeeded");
/* Create dataspace */
@@ -2197,21 +2197,21 @@ compress_readAll(void)
VRFY((dataspace > 0), "H5Screate_simple succeeded");
/* Create dataset */
- dataset = H5Dcreate(fid, "compressed_data", H5T_NATIVE_INT, dataspace, dcpl);
- VRFY((dataset > 0), "H5Screate_simple succeeded");
+ dataset = H5Dcreate2(fid, "compressed_data", H5T_NATIVE_INT, dataspace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ VRFY((dataset > 0), "H5Dcreate2 succeeded");
/* Write compressed data */
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_orig);
+ ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_orig);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* Close objects */
- ret=H5Pclose(dcpl);
+ re = =H5Pclose(dcpl);
VRFY((ret >= 0), "H5Pclose succeeded");
- ret=H5Sclose(dataspace);
+ ret = H5Sclose(dataspace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Dclose(dataset);
+ ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose succeeded");
- ret=H5Fclose(fid);
+ ret = H5Fclose(fid);
VRFY((ret >= 0), "H5Fclose succeeded");
}
@@ -2231,7 +2231,7 @@ compress_readAll(void)
VRFY((fid > 0), "H5Fopen succeeded");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "H5Pclose succeeded");
@@ -2245,7 +2245,7 @@ compress_readAll(void)
xfer_plist = H5Pcreate(H5P_DATASET_XFER);
VRFY((xfer_plist > 0), "H5Pcreate succeeded");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO);
@@ -2254,7 +2254,7 @@ compress_readAll(void)
/* Try reading the data */
- ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read);
+ ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
/* Verify data read */
@@ -2267,22 +2267,22 @@ compress_readAll(void)
/* Writing to the compressed, chunked dataset in parallel should fail */
H5E_BEGIN_TRY {
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read);
+ ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer_plist, data_read);
} H5E_END_TRY;
VRFY((ret < 0), "H5Dwrite failed");
- ret=H5Pclose(xfer_plist);
+ ret = H5Pclose(xfer_plist);
VRFY((ret >= 0), "H5Pclose succeeded");
- ret=H5Dclose(dataset);
+ ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose succeeded");
} /* end if */
- ret=H5Fclose(fid);
+ ret = H5Fclose(fid);
VRFY((ret >= 0), "H5Fclose succeeded");
/* release data buffers */
- if (data_read) HDfree(data_read);
- if (data_orig) HDfree(data_orig);
+ if(data_read) HDfree(data_read);
+ if(data_orig) HDfree(data_orig);
}
#endif /* H5_HAVE_FILTER_DEFLATE */
@@ -2329,7 +2329,7 @@ none_selection_chunk(void)
MPI_Info info = MPI_INFO_NULL;
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
@@ -2348,11 +2348,11 @@ none_selection_chunk(void)
VRFY((acc_tpl >= 0), "");
/* create the file collectively */
- fid=H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_tpl);
+ fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl);
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Release file-access template */
- ret=H5Pclose(acc_tpl);
+ ret = H5Pclose(acc_tpl);
VRFY((ret >= 0), "");
/* --------------------------------------------------------------
@@ -2360,7 +2360,7 @@ none_selection_chunk(void)
* ------------------------------------------------------------- */
/* set up dataset storage chunk sizes and creation property list */
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
@@ -2370,16 +2370,16 @@ none_selection_chunk(void)
/* setup dimensionality object */
dims[0] = dim0;
dims[1] = dim1;
- sid = H5Screate_simple (RANK, dims, NULL);
+ sid = H5Screate_simple(RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
/* create an extendible dataset collectively */
- dataset1 = H5Dcreate(fid, DATASETNAME1, H5T_NATIVE_INT, sid, dataset_pl);
- VRFY((dataset1 >= 0), "H5Dcreate succeeded");
+ dataset1 = H5Dcreate2(fid, DATASETNAME1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT);
+ VRFY((dataset1 >= 0), "H5Dcreate2 succeeded");
/* create another extendible dataset collectively */
- dataset2 = H5Dcreate(fid, DATASETNAME2, H5T_NATIVE_INT, sid, dataset_pl);
- VRFY((dataset2 >= 0), "H5Dcreate succeeded");
+ dataset2 = H5Dcreate2(fid, DATASETNAME2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dataset_pl, H5P_DEFAULT);
+ VRFY((dataset2 >= 0), "H5Dcreate2 succeeded");
/* release resource */
H5Sclose(sid);
@@ -2393,7 +2393,7 @@ none_selection_chunk(void)
/* allocate memory for data buffer. Only allocate enough buffer for
* each processor's data. */
- if (mpi_rank) {
+ if(mpi_rank) {
data_origin = (DATATYPE *)malloc(block[0]*block[1]*sizeof(DATATYPE));
VRFY((data_origin != NULL), "data_origin malloc succeeded");
@@ -2404,7 +2404,7 @@ none_selection_chunk(void)
mstart[0] = mstart[1] = 0;
dataset_fill(mstart, block, data_origin);
MESG("data_array initialized");
- if (VERBOSE_MED){
+ if(VERBOSE_MED){
MESG("data_array created");
dataset_print(mstart, block, data_origin);
}
@@ -2415,7 +2415,7 @@ none_selection_chunk(void)
VRFY((mem_dataspace >= 0), "");
/* Process 0 has no selection */
- if (!mpi_rank) {
+ if(!mpi_rank) {
ret = H5Sselect_none(mem_dataspace);
VRFY((ret >= 0), "H5Sselect_none succeeded");
}
@@ -2423,11 +2423,11 @@ none_selection_chunk(void)
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
- ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
+ ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded");
/* Process 0 has no selection */
- if (!mpi_rank) {
+ if(!mpi_rank) {
ret = H5Sselect_none(file_dataspace);
VRFY((ret >= 0), "H5Sselect_none succeeded");
}
@@ -2435,7 +2435,7 @@ none_selection_chunk(void)
/* set up the collective transfer properties list */
xfer_plist = H5Pcreate (H5P_DATASET_XFER);
VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded");
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
/* write data collectively */
@@ -2449,15 +2449,15 @@ none_selection_chunk(void)
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
- if (mpi_rank) {
+ if(mpi_rank) {
ret = dataset_vrfy(mstart, count, stride, block, data_array, data_origin);
- if (ret) nerrors++;
+ if(ret) nerrors++;
}
/* -------------------------
* Test independent writing to dataset2
* -------------------------*/
- ret=H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT);
+ ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_INDEPENDENT);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
/* write data collectively */
@@ -2471,30 +2471,30 @@ none_selection_chunk(void)
VRFY((ret >= 0), "");
/* verify the read data with original expected data */
- if (mpi_rank) {
+ if(mpi_rank) {
ret = dataset_vrfy(mstart, count, stride, block, data_array, data_origin);
- if (ret) nerrors++;
+ if(ret) nerrors++;
}
/* release resource */
- ret=H5Sclose(file_dataspace);
+ ret = H5Sclose(file_dataspace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Sclose(mem_dataspace);
+ ret = H5Sclose(mem_dataspace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Pclose(xfer_plist);
+ ret = H5Pclose(xfer_plist);
VRFY((ret >= 0), "H5Pclose succeeded");
/* close dataset collectively */
- ret=H5Dclose(dataset1);
+ ret = H5Dclose(dataset1);
VRFY((ret >= 0), "H5Dclose1 succeeded");
- ret=H5Dclose(dataset2);
+ ret = H5Dclose(dataset2);
VRFY((ret >= 0), "H5Dclose2 succeeded");
/* close the file collectively */
H5Fclose(fid);
/* release data buffers */
- if (data_origin) free(data_origin);
- if (data_array) free(data_array);
+ if(data_origin) free(data_origin);
+ if(data_array) free(data_array);
}
diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c
index e255c73..e2d39c3 100644
--- a/testpar/t_filter_read.c
+++ b/testpar/t_filter_read.c
@@ -86,35 +86,33 @@ filter_read_internal(const char *filename, hid_t dcpl,
VRFY(sid>=0, "H5Screate_simple");
/* Create buffers */
- points = (int *)HDmalloc(size[0]*size[1]*sizeof(int));
+ points = (int *)HDmalloc(size[0] * size[1] * sizeof(int));
VRFY(points!=NULL, "HDmalloc");
- check = (int *)HDmalloc(hs_size[0]*hs_size[1]*sizeof(int));
+ check = (int *)HDmalloc(hs_size[0] * hs_size[1] * sizeof(int));
VRFY(check!=NULL, "HDmalloc");
/* Initialize writing buffer with random data */
- for (i=0; i<size[0]; i++) {
- for (j=0; j<size[1]; j++) {
- points[i*size[1]+j] = (int)(i+j+7);
- }
- }
+ for(i = 0; i < size[0]; i++)
+ for(j = 0; j < size[1]; j++)
+ points[i * size[1]+j] = (int)(i+j+7);
VRFY(H5Pall_filters_avail(dcpl), "Incorrect filter availability");
/* Serial write phase */
- if (MAINPROCESS){
+ if(MAINPROCESS) {
file = H5Fcreate(h5_rmprefix(filename), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
VRFY(file>=0, "H5Fcreate");
/* Create the dataset */
- dataset = H5Dcreate(file, name, H5T_NATIVE_INT, sid, dcpl);
- VRFY(dataset>=0, "H5Dcreate");
+ dataset = H5Dcreate2(file, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ VRFY(dataset>=0, "H5Dcreate2");
hrc = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, points);
VRFY(hrc>=0, "H5Dwrite");
- *dset_size=H5Dget_storage_size(dataset);
+ *dset_size = H5Dget_storage_size(dataset);
VRFY(*dset_size>0, "H5Dget_storage_size");
hrc = H5Dclose (dataset);
@@ -153,7 +151,7 @@ filter_read_internal(const char *filename, hid_t dcpl,
/* Check that the values read are the same as the values written */
for (i=0; i<hs_size[0]; i++) {
for (j=0; j<hs_size[1]; j++) {
- if (points[i*size[1]+(size_t)hs_offset[1]+j] !=
+ if(points[i*size[1]+(size_t)hs_offset[1]+j] !=
check[i*hs_size[1]+j]) {
fprintf(stderr," Read different values than written.\n");
fprintf(stderr," At index %lu,%lu\n",
@@ -235,13 +233,13 @@ test_filter_read(void)
hsize_t shuffle_size; /* Size of dataset with shuffle filter */
#endif /* H5_HAVE_FILTER_SHUFFLE */
-#if (defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
+#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
hsize_t combo_size; /* Size of dataset with shuffle+deflate filter */
#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
filename = GetTestParameters();
- if (VERBOSE_MED)
+ if(VERBOSE_MED)
printf("Parallel reading of dataset written with filters %s\n", filename);
/*----------------------------------------------------------
@@ -312,7 +310,7 @@ test_filter_read(void)
*----------------------------------------------------------
*/
#ifdef H5_HAVE_FILTER_SZIP
- if ( h5_szip_can_encode() == 1) {
+ if(h5_szip_can_encode() == 1) {
dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0, "H5Pcreate");
@@ -424,7 +422,7 @@ test_filter_read(void)
VRFY(hrc>=0, "H5Pset_shuffle");
/* Make sure encoding is enabled */
- if ( h5_szip_can_encode() == 1) {
+ if(h5_szip_can_encode() == 1) {
hrc = H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block);
VRFY(hrc>=0, "H5Pset_szip");
@@ -437,7 +435,7 @@ test_filter_read(void)
/* Testing shuffle+szip(with encoder)+checksum filters(checksum last) */
/* Make sure encoding is enabled */
- if ( h5_szip_can_encode() == 1) {
+ if(h5_szip_can_encode() == 1) {
dc = H5Pcreate(H5P_DATASET_CREATE);
VRFY(dc>=0, "H5Pcreate");
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 2fb2aef..b2ae824 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -50,12 +50,12 @@ int get_size(void)
int mpi_size;
int size = SIZE;
- MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); /* needed for VRFY */
- MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* needed for VRFY */
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
- if ( mpi_size > size ) {
+ if(mpi_size > size ) {
- if ( (mpi_size % 2) == 0 ) {
+ if((mpi_size % 2) == 0 ) {
size = mpi_size;
@@ -105,59 +105,59 @@ void multiple_dset_write(void)
size = get_size();
- MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
- MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
outme = HDmalloc((size_t)(size * size * sizeof(double)));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs);
VRFY((plist>=0), "create_faccess_plist succeeded");
- iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
+ iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
VRFY((iof>=0), "H5Fcreate succeeded");
- ret = H5Pclose (plist);
+ ret = H5Pclose(plist);
VRFY((ret>=0), "H5Pclose succeeded");
/* decide the hyperslab according to process number. */
get_slab(chunk_origin, chunk_dims, count, file_dims, size);
- memspace = H5Screate_simple (DIM, chunk_dims, NULL);
- filespace = H5Screate_simple (DIM, file_dims, NULL);
- ret = H5Sselect_hyperslab (filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims);
+ memspace = H5Screate_simple(DIM, chunk_dims, NULL);
+ filespace = H5Screate_simple(DIM, file_dims, NULL);
+ ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims);
VRFY((ret>=0), "mdata hyperslab selection");
/* Create a dataset creation property list */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dcpl>=0), "dataset creation property list succeeded");
- ret=H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill);
+ ret = H5Pset_fill_value(dcpl, H5T_NATIVE_DOUBLE, &fill);
VRFY((ret>=0), "set fill-value succeeded");
- for (n = 0; n < ndatasets; n++) {
- sprintf (dname, "dataset %d", n);
- dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl);
+ for(n = 0; n < ndatasets; n++) {
+ sprintf(dname, "dataset %d", n);
+ dataset = H5Dcreate2(iof, dname, H5T_NATIVE_DOUBLE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((dataset > 0), dname);
/* calculate data to write */
- for (i = 0; i < size; i++)
- for (j = 0; j < size; j++)
+ for(i = 0; i < size; i++)
+ for(j = 0; j < size; j++)
outme [(i * size) + j] = n*1000 + mpi_rank;
- H5Dwrite (dataset, H5T_NATIVE_DOUBLE, memspace, filespace, H5P_DEFAULT, outme);
+ H5Dwrite(dataset, H5T_NATIVE_DOUBLE, memspace, filespace, H5P_DEFAULT, outme);
- H5Dclose (dataset);
+ H5Dclose(dataset);
#ifdef BARRIER_CHECKS
- if (! ((n+1) % 10)) {
+ if(!((n+1) % 10)) {
printf("created %d datasets\n", n+1);
MPI_Barrier(MPI_COMM_WORLD);
}
#endif /* BARRIER_CHECKS */
}
- H5Sclose (filespace);
- H5Sclose (memspace);
- H5Pclose (dcpl);
- H5Fclose (iof);
+ H5Sclose(filespace);
+ H5Sclose(memspace);
+ H5Pclose(dcpl);
+ H5Fclose(iof);
HDfree(outme);
}
@@ -185,13 +185,11 @@ void compact_dataset(void)
size = get_size();
- for ( i = 0; i < DIM; i++ )
- {
+ for(i = 0; i < DIM; i++ )
file_dims[i] = size;
- }
- MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
- MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
outme = HDmalloc((size_t)(size * size * sizeof(double)));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
@@ -203,46 +201,46 @@ void compact_dataset(void)
VRFY((mpi_size <= size), "mpi_size <= size");
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs);
- iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
+ iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
/* Define data space */
- filespace = H5Screate_simple (DIM, file_dims, NULL);
+ filespace = H5Screate_simple(DIM, file_dims, NULL);
/* Create a compact dataset */
dcpl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dcpl>=0), "dataset creation property list succeeded");
- ret=H5Pset_layout(dcpl, H5D_COMPACT);
+ ret = H5Pset_layout(dcpl, H5D_COMPACT);
VRFY((dcpl >= 0), "set property list for compact dataset");
- ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
VRFY((ret >= 0), "set space allocation time for compact dataset");
- dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl);
- VRFY((dataset >= 0), "H5Dcreate succeeded");
+ dataset = H5Dcreate2(iof, dname, H5T_NATIVE_DOUBLE, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ VRFY((dataset >= 0), "H5Dcreate2 succeeded");
/* set up the collective transfer properties list */
- dxpl = H5Pcreate (H5P_DATASET_XFER);
+ dxpl = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl >= 0), "");
- ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
+ ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO);
VRFY((ret>= 0),"set independent IO collectively succeeded");
}
/* Recalculate data to write. Each process writes the same data. */
- for (i = 0; i < size; i++)
- for (j = 0; j < size; j++)
- outme[(i * size) + j] = (i+j)*1000;
+ for(i = 0; i < size; i++)
+ for(j = 0; j < size; j++)
+ outme[(i * size) + j] =(i + j) * 1000;
- ret=H5Dwrite (dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, dxpl, outme);
+ ret = H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, dxpl, outme);
VRFY((ret >= 0), "H5Dwrite succeeded");
- H5Pclose (dcpl);
- H5Pclose (plist);
- H5Dclose (dataset);
- H5Sclose (filespace);
- H5Fclose (iof);
+ H5Pclose(dcpl);
+ H5Pclose(plist);
+ H5Dclose(dataset);
+ H5Sclose(filespace);
+ H5Fclose(iof);
/* Open the file and dataset, read and compare the data. */
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs);
@@ -250,9 +248,9 @@ void compact_dataset(void)
VRFY((iof >= 0), "H5Fopen succeeded");
/* set up the collective transfer properties list */
- dxpl = H5Pcreate (H5P_DATASET_XFER);
+ dxpl = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl >= 0), "");
- ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
@@ -267,9 +265,9 @@ void compact_dataset(void)
VRFY((ret >= 0), "H5Dread succeeded");
/* Verify data value */
- for (i = 0; i < size; i++)
- for (j = 0; j < size; j++)
- if ( inme[(i * size) + j] != outme[(i * size) + j])
+ for(i = 0; i < size; i++)
+ for(j = 0; j < size; j++)
+ if(inme[(i * size) + j] != outme[(i * size) + j])
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
printf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]);
@@ -306,54 +304,54 @@ void null_dataset(void)
herr_t ret;
const char *filename;
- MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
- MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
filename = GetTestParameters();
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL,
facc_type, use_gpfs);
- iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
+ iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist);
/* Define data space */
sid = H5Screate(H5S_NULL);
/* Check that the null dataspace actually has 0 elements */
nelem = H5Sget_simple_extent_npoints(sid);
- VRFY((nelem== 0), "H5Sget_simple_extent_npoints");
+ VRFY((nelem == 0), "H5Sget_simple_extent_npoints");
/* Create a compact dataset */
- dataset = H5Dcreate (iof, dname, H5T_NATIVE_UINT, sid, H5P_DEFAULT);
- VRFY((dataset >= 0), "H5Dcreate succeeded");
+ dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset >= 0), "H5Dcreate2 succeeded");
/* set up the collective transfer properties list */
- dxpl = H5Pcreate (H5P_DATASET_XFER);
+ dxpl = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl >= 0), "");
- ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
+ ret = H5Pset_dxpl_mpio_collective_opt(dxpl, H5FD_MPIO_INDIVIDUAL_IO);
VRFY((ret>= 0),"set independent IO collectively succeeded");
}
- /* Write "nothing" to the dataset (with type conversion) */
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, &uval);
+ /* Write "nothing" to the dataset(with type conversion) */
+ ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, &uval);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* Create an attribute for the group */
attr = H5Acreate2(dataset, ".", attr_name, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((attr >= 0), "H5Acreate2");
- /* Write "nothing" to the attribute (with type conversion) */
+ /* Write "nothing" to the attribute(with type conversion) */
ret = H5Awrite(attr, H5T_NATIVE_INT, &val);
VRFY((ret >= 0), "H5Awrite");
- H5Aclose (attr);
- H5Dclose (dataset);
- H5Pclose (plist);
- H5Sclose (sid);
- H5Fclose (iof);
+ H5Aclose(attr);
+ H5Dclose(dataset);
+ H5Pclose(plist);
+ H5Sclose(sid);
+ H5Fclose(iof);
/* Open the file and dataset, read and compare the data. */
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs);
@@ -361,9 +359,9 @@ void null_dataset(void)
VRFY((iof >= 0), "H5Fopen succeeded");
/* set up the collective transfer properties list */
- dxpl = H5Pcreate (H5P_DATASET_XFER);
+ dxpl = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl >= 0), "");
- ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pcreate xfer succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
@@ -374,7 +372,7 @@ void null_dataset(void)
dataset = H5Dopen2(iof, dname, H5P_DEFAULT);
VRFY((dataset >= 0), "H5Dopen2 succeeded");
- /* Try reading from the dataset (make certain our buffer is unmodified) */
+ /* Try reading from the dataset(make certain our buffer is unmodified) */
ret = H5Dread(dataset, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, dxpl, &uval);
VRFY((ret>=0), "H5Dread");
VRFY((uval==2), "H5Dread");
@@ -383,20 +381,20 @@ void null_dataset(void)
attr = H5Aopen(dataset, ".", attr_name, H5P_DEFAULT, H5P_DEFAULT);
VRFY((attr >= 0), "H5Aopen");
- /* Try reading from the attribute (make certain our buffer is unmodified) */ ret = H5Aread(attr, H5T_NATIVE_INT, &val);
+ /* Try reading from the attribute(make certain our buffer is unmodified) */ ret = H5Aread(attr, H5T_NATIVE_INT, &val);
VRFY((ret>=0), "H5Aread");
VRFY((val==1), "H5Aread");
H5Pclose(plist);
H5Pclose(dxpl);
- H5Aclose (attr);
+ H5Aclose(attr);
H5Dclose(dataset);
H5Fclose(iof);
}
-/* Example of using PHDF5 to create "large" datasets. (>2GB, >4GB, >8GB)
+/* Example of using PHDF5 to create "large" datasets. (>2GB, >4GB, >8GB)
* Actual data is _not_ written to these datasets. Dataspaces are exact
- * sizes (2GB, 4GB, etc.), but the metadata for the file pushes the file over
+ * sizes(2GB, 4GB, etc.), but the metadata for the file pushes the file over
* the boundary of interest.
*
* Changes: Removed the assert that mpi_size <= the SIZE #define.
@@ -421,11 +419,11 @@ void big_dataset(void)
herr_t ret; /* Generic return value */
const char *filename;
- MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
- MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
/* Verify MPI_Offset can handle larger than 2GB sizes */
- VRFY((sizeof(MPI_Offset)>4), "sizeof(MPI_Offset)>4");
+ VRFY((sizeof(MPI_Offset) > 4), "sizeof(MPI_Offset)>4");
filename = GetTestParameters();
@@ -435,7 +433,7 @@ void big_dataset(void)
/*
* Create >2GB HDF5 file
*/
- iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
VRFY((iof >= 0), "H5Fcreate succeeded");
/* Define dataspace for 2GB dataspace */
@@ -443,30 +441,30 @@ void big_dataset(void)
file_dims[1]= 1024;
file_dims[2]= 1024;
file_dims[3]= 1024;
- filespace = H5Screate_simple (4, file_dims, NULL);
+ filespace = H5Screate_simple(4, file_dims, NULL);
VRFY((filespace >= 0), "H5Screate_simple succeeded");
- dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT);
- VRFY((dataset >= 0), "H5Dcreate succeeded");
+ dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset >= 0), "H5Dcreate2 succeeded");
/* Close all file objects */
- ret=H5Dclose (dataset);
+ ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose succeeded");
- ret=H5Sclose (filespace);
+ ret = H5Sclose(filespace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Fclose (iof);
+ ret = H5Fclose(iof);
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
file_size=h5_get_file_size(filename);
#ifndef _WIN32
- VRFY((file_size == 2147485696ULL), "File is correct size (~2GB)");
+ VRFY((file_size == 2147485696ULL), "File is correct size(~2GB)");
#endif
/*
* Create >4GB HDF5 file
*/
- iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
VRFY((iof >= 0), "H5Fcreate succeeded");
/* Define dataspace for 4GB dataspace */
@@ -474,30 +472,30 @@ void big_dataset(void)
file_dims[1]= 1024;
file_dims[2]= 1024;
file_dims[3]= 1024;
- filespace = H5Screate_simple (4, file_dims, NULL);
+ filespace = H5Screate_simple(4, file_dims, NULL);
VRFY((filespace >= 0), "H5Screate_simple succeeded");
- dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT);
- VRFY((dataset >= 0), "H5Dcreate succeeded");
+ dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset >= 0), "H5Dcreate2 succeeded");
/* Close all file objects */
- ret=H5Dclose (dataset);
+ ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose succeeded");
- ret=H5Sclose (filespace);
+ ret = H5Sclose(filespace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Fclose (iof);
+ ret = H5Fclose(iof);
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
file_size=h5_get_file_size(filename);
#ifndef _WIN32
- VRFY((file_size == 4294969344ULL), "File is correct size (~4GB)");
+ VRFY((file_size == 4294969344ULL), "File is correct size(~4GB)");
#endif
/*
* Create >8GB HDF5 file
*/
- iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
VRFY((iof >= 0), "H5Fcreate succeeded");
/* Define dataspace for 8GB dataspace */
@@ -505,28 +503,28 @@ void big_dataset(void)
file_dims[1]= 1024;
file_dims[2]= 1024;
file_dims[3]= 1024;
- filespace = H5Screate_simple (4, file_dims, NULL);
+ filespace = H5Screate_simple(4, file_dims, NULL);
VRFY((filespace >= 0), "H5Screate_simple succeeded");
- dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT);
- VRFY((dataset >= 0), "H5Dcreate succeeded");
+ dataset = H5Dcreate2(iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset >= 0), "H5Dcreate2 succeeded");
/* Close all file objects */
- ret=H5Dclose (dataset);
+ ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose succeeded");
- ret=H5Sclose (filespace);
+ ret = H5Sclose(filespace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Fclose (iof);
+ ret = H5Fclose(iof);
VRFY((ret >= 0), "H5Fclose succeeded");
/* Check that file of the correct size was created */
file_size=h5_get_file_size(filename);
#ifndef _WIN32
- VRFY((file_size == 8589936640ULL), "File is correct size (~8GB)");
+ VRFY((file_size == 8589936640ULL), "File is correct size(~8GB)");
#endif
/* Close fapl */
- ret=H5Pclose (fapl);
+ ret = H5Pclose(fapl);
VRFY((ret >= 0), "H5Pclose succeeded");
}
@@ -566,8 +564,8 @@ void dataset_fillvalue(void)
herr_t ret; /* Generic return value */
const char *filename;
- MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
- MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
filename = GetTestParameters();
@@ -588,14 +586,14 @@ void dataset_fillvalue(void)
/*
* Create HDF5 file
*/
- iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
+ iof = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
VRFY((iof >= 0), "H5Fcreate succeeded");
filespace = H5Screate_simple(4, dset_dims, NULL);
VRFY((filespace >= 0), "File H5Screate_simple succeeded");
- dataset = H5Dcreate(iof, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT);
- VRFY((dataset >= 0), "H5Dcreate succeeded");
+ dataset = H5Dcreate2(iof, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dataset >= 0), "H5Dcreate2 succeeded");
memspace = H5Screate_simple(4, dset_dims, NULL);
VRFY((memspace >= 0), "Memory H5Screate_simple succeeded");
@@ -606,19 +604,19 @@ void dataset_fillvalue(void)
/* set entire read buffer with the constant 2 */
HDmemset(rdata,2,(size_t)(dset_size*sizeof(int)));
/* Independently read the entire dataset back */
- ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
VRFY((ret >= 0), "H5Dread succeeded");
/* Verify all data read are the fill value 0 */
- trdata=rdata;
- err_num=0;
- for (i=0; i<(int)dset_dims[0]; i++)
- for (j=0; j<(int)dset_dims[1]; j++)
- for (k=0; k<(int)dset_dims[2]; k++)
- for (l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++)
- if( *trdata != 0)
+ trdata = rdata;
+ err_num = 0;
+ for(i = 0; i < (int)dset_dims[0]; i++)
+ for(j = 0; j < (int)dset_dims[1]; j++)
+ for(k = 0; k < (int)dset_dims[2]; k++)
+ for(l = 0; l < (int)dset_dims[3]; l++, twdata++, trdata++)
+ if(*trdata != 0)
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata);
+ printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i, j, k, l, *trdata);
if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
if(err_num){
@@ -634,16 +632,16 @@ void dataset_fillvalue(void)
*/
/* Create hyperslabs in memory and file dataspaces */
req_start[0]=mpi_rank;
- ret=H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL);
+ ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace");
- ret=H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL);
+ ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace");
/* Create DXPL for collective I/O */
- dxpl = H5Pcreate (H5P_DATASET_XFER);
+ dxpl = H5Pcreate(H5P_DATASET_XFER);
VRFY((dxpl >= 0), "H5Pcreate succeeded");
- ret=H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
+ ret = H5Pset_dxpl_mpio(dxpl, H5FD_MPIO_COLLECTIVE);
VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
ret = H5Pset_dxpl_mpio_collective_opt(dxpl,H5FD_MPIO_INDIVIDUAL_IO);
@@ -653,14 +651,14 @@ void dataset_fillvalue(void)
/* Fill write buffer with some values */
twdata=wdata;
- for (i=0, acc=0; i<(int)dset_dims[0]; i++)
- for (j=0; j<(int)dset_dims[1]; j++)
- for (k=0; k<(int)dset_dims[2]; k++)
- for (l=0; l<(int)dset_dims[3]; l++)
+ for(i=0, acc=0; i<(int)dset_dims[0]; i++)
+ for(j=0; j<(int)dset_dims[1]; j++)
+ for(k=0; k<(int)dset_dims[2]; k++)
+ for(l=0; l<(int)dset_dims[3]; l++)
*twdata++ = acc++;
/* Collectively write a hyperslab of data to the dataset */
- ret=H5Dwrite(dataset, H5T_NATIVE_INT, memspace, filespace, dxpl, wdata);
+ ret = H5Dwrite(dataset, H5T_NATIVE_INT, memspace, filespace, dxpl, wdata);
VRFY((ret >= 0), "H5Dwrite succeeded");
/* Barrier here, to allow MPI-posix I/O to sync */
@@ -672,24 +670,24 @@ void dataset_fillvalue(void)
/* set entire read buffer with the constant 2 */
HDmemset(rdata,2,(size_t)(dset_size*sizeof(int)));
/* Independently read the entire dataset back */
- ret=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
+ ret = H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rdata);
VRFY((ret >= 0), "H5Dread succeeded");
/* Verify correct data read */
twdata=wdata;
trdata=rdata;
err_num=0;
- for (i=0; i<(int)dset_dims[0]; i++)
- for (j=0; j<(int)dset_dims[1]; j++)
- for (k=0; k<(int)dset_dims[2]; k++)
- for (l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++)
+ for(i=0; i<(int)dset_dims[0]; i++)
+ for(j=0; j<(int)dset_dims[1]; j++)
+ for(k=0; k<(int)dset_dims[2]; k++)
+ for(l=0; l<(int)dset_dims[3]; l++, twdata++, trdata++)
if(i<mpi_size) {
- if( *twdata != *trdata )
+ if(*twdata != *trdata )
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
printf("Dataset Verify failed at [%d][%d][%d][%d]: expect %d, got %d\n", i,j,k,l, *twdata, *trdata);
} /* end if */
else {
- if( *trdata != 0)
+ if(*trdata != 0)
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
printf("Dataset Verify failed at [%d][%d][%d][%d]: expect 0, got %d\n", i,j,k,l, *trdata);
} /* end else */
@@ -701,23 +699,23 @@ void dataset_fillvalue(void)
}
/* Close all file objects */
- ret=H5Dclose (dataset);
+ ret = H5Dclose(dataset);
VRFY((ret >= 0), "H5Dclose succeeded");
- ret=H5Sclose (filespace);
+ ret = H5Sclose(filespace);
VRFY((ret >= 0), "H5Sclose succeeded");
- ret=H5Fclose (iof);
+ ret = H5Fclose(iof);
VRFY((ret >= 0), "H5Fclose succeeded");
/* Close memory dataspace */
- ret=H5Sclose (memspace);
+ ret = H5Sclose(memspace);
VRFY((ret >= 0), "H5Sclose succeeded");
/* Close dxpl */
- ret=H5Pclose (dxpl);
+ ret = H5Pclose(dxpl);
VRFY((ret >= 0), "H5Pclose succeeded");
/* Close fapl */
- ret=H5Pclose (fapl);
+ ret = H5Pclose(fapl);
VRFY((ret >= 0), "H5Pclose succeeded");
/* free the buffers */
@@ -759,8 +757,8 @@ void collective_group_write(void)
size = get_size();
- chunk_size[0] = (hsize_t)(size / 2);
- chunk_size[1] = (hsize_t)(size / 2);
+ chunk_size[0] =(hsize_t)(size / 2);
+ chunk_size[1] =(hsize_t)(size / 2);
outme = HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
@@ -786,7 +784,7 @@ void collective_group_write(void)
VRFY((ret2>=0), "mgroup filespace selection");
dcpl = H5Pcreate(H5P_DATASET_CREATE);
- ret1 = H5Pset_chunk (dcpl, 2, chunk_size);
+ ret1 = H5Pset_chunk(dcpl, 2, chunk_size);
VRFY((dcpl>=0), "dataset creation property");
VRFY((ret1>=0), "set chunk for dataset creation property");
@@ -798,12 +796,12 @@ void collective_group_write(void)
VRFY((gid > 0), gname);
sprintf(dname, "dataset%d", m);
- did = H5Dcreate(gid, dname, H5T_NATIVE_INT, filespace, dcpl);
+ did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, dcpl, H5P_DEFAULT);
VRFY((did > 0), dname);
- for(i=0; i < size; i++)
- for(j=0; j < size; j++)
- outme[(i * size) + j] = (i+j)*1000 + mpi_rank;
+ for(i = 0; i < size; i++)
+ for(j = 0; j < size; j++)
+ outme[(i * size) + j] =(i + j) * 1000 + mpi_rank;
H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT,
outme);
@@ -812,7 +810,7 @@ void collective_group_write(void)
H5Gclose(gid);
#ifdef BARRIER_CHECKS
- if(! ((m+1) % 10)) {
+ if(!((m+1) % 10)) {
printf("created %d groups\n", m+1);
MPI_Barrier(MPI_COMM_WORLD);
}
@@ -885,10 +883,10 @@ void group_dataset_read(hid_t fid, int mpi_rank, int m)
size = get_size();
- indata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
VRFY((indata != NULL), "HDmalloc succeeded for indata");
- outdata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
VRFY((outdata != NULL), "HDmalloc succeeded for outdata");
/* open every group under root group. */
@@ -906,7 +904,7 @@ void group_dataset_read(hid_t fid, int mpi_rank, int m)
/* this is the original value */
for(i=0; i<size; i++)
for(j=0; j<size; j++) {
- outdata[(i * size) + j] = (i+j)*1000 + mpi_rank;
+ outdata[(i * size) + j] =(i+j)*1000 + mpi_rank;
}
/* compare the original value(outdata) to the value in file(indata).*/
@@ -1012,7 +1010,7 @@ void multiple_group_write(void)
H5Gclose(gid);
#ifdef BARRIER_CHECKS
- if(! ((m+1) % 10)) {
+ if(!((m+1) % 10)) {
printf("created %d groups\n", m+1);
MPI_Barrier(MPI_COMM_WORLD);
}
@@ -1059,18 +1057,16 @@ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
outme = HDmalloc((size_t)(size * size * sizeof(double)));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
- for(n=0; n < NDATASET; n++) {
+ for(n = 0; n < NDATASET; n++) {
sprintf(dname, "dataset%d", n);
- did = H5Dcreate(gid, dname, H5T_NATIVE_INT, filespace,
- H5P_DEFAULT);
+ did = H5Dcreate2(gid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((did > 0), dname);
- for(i=0; i < size; i++)
- for(j=0; j < size; j++)
- outme[(i * size) + j] = n*1000 + mpi_rank;
+ for(i = 0; i < size; i++)
+ for(j = 0; j < size; j++)
+ outme[(i * size) + j] = n * 1000 + mpi_rank;
- H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT,
- outme);
+ H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme);
/* create attribute for these datasets.*/
write_attribute(did, is_dset, n);
@@ -1094,7 +1090,7 @@ void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid,
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
#ifdef BARRIER_CHECKS
- if(! ((counter+1) % 10)) {
+ if(!((counter+1) % 10)) {
printf("created %dth child groups\n", counter+1);
MPI_Barrier(MPI_COMM_WORLD);
}
@@ -1107,7 +1103,7 @@ void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid,
/* write datasets in parallel. */
write_dataset(memspace, filespace, gid);
- if( counter < GROUP_DEPTH )
+ if(counter < GROUP_DEPTH )
create_group_recursive(memspace, filespace, child_gid, counter+1);
H5Gclose(child_gid);
@@ -1168,12 +1164,12 @@ void multiple_group_read(void)
/* check the data. */
if(m != 0)
- if( (error_num = read_dataset(memspace, filespace, gid))>0)
+ if((error_num = read_dataset(memspace, filespace, gid))>0)
nerrors += error_num;
/* check attribute.*/
error_num = 0;
- if( (error_num = read_attribute(gid, is_group, m))>0 )
+ if((error_num = read_attribute(gid, is_group, m))>0 )
nerrors += error_num;
H5Gclose(gid);
@@ -1218,10 +1214,10 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
size = get_size();
- indata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
VRFY((indata != NULL), "HDmalloc succeeded for indata");
- outdata = (DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
VRFY((outdata != NULL), "HDmalloc succeeded for outdata");
for(n=0; n<NDATASET; n++) {
@@ -1244,7 +1240,7 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
vrfy_errors = check_value(indata, outdata, size);
/* check attribute.*/
- if( (attr_errors = read_attribute(did, is_dset, n))>0 )
+ if((attr_errors = read_attribute(did, is_dset, n))>0 )
vrfy_errors += attr_errors;
H5Dclose(did);
@@ -1273,10 +1269,10 @@ void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid,
MPI_Barrier(MPI_COMM_WORLD);
#endif /* BARRIER_CHECKS */
- if( (err_num = read_dataset(memspace, filespace, gid)) )
+ if((err_num = read_dataset(memspace, filespace, gid)) )
nerrors += err_num;
- if( counter < GROUP_DEPTH ) {
+ if(counter < GROUP_DEPTH ) {
sprintf(gname, "%dth_child_group", counter+1);
child_gid = H5Gopen2(gid, gname, H5P_DEFAULT);
VRFY((child_gid>0), gname);
@@ -1377,9 +1373,9 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
outdata += chunk_origin[0]*size;
for(i=chunk_origin[0]; i<(chunk_origin[0]+chunk_dims[0]); i++)
for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) {
- if( *indata != *outdata )
+ if(*indata != *outdata )
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)i, (unsigned long)j, *outdata, *indata);
+ printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n",(unsigned long)i,(unsigned long)j,(unsigned long)i,(unsigned long)j, *outdata, *indata);
}
if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
@@ -1409,7 +1405,7 @@ void get_slab(hsize_t chunk_origin[],
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
if(chunk_origin != NULL) {
- chunk_origin[0] = mpi_rank * (size/mpi_size);
+ chunk_origin[0] = mpi_rank *(size/mpi_size);
chunk_origin[1] = 0;
}
if(chunk_dims != NULL) {
@@ -1424,7 +1420,7 @@ void get_slab(hsize_t chunk_origin[],
/*
* This function is based on bug demonstration code provided by Thomas
- * Guignon (thomas.guignon@ifp.fr), and is intended to verify the
+ * Guignon(thomas.guignon@ifp.fr), and is intended to verify the
* correctness of my fix for that bug.
*
* In essence, the bug appeared when at least one process attempted to
@@ -1495,115 +1491,98 @@ void io_mode_confusion(void)
* Set up file access property list with parallel I/O access
*/
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Setting up property list.\n",
mpi_rank, fcn_name);
plist_id = H5Pcreate(H5P_FILE_ACCESS);
-
VRFY((plist_id != -1), "H5Pcreate() failed");
status = H5Pset_fapl_mpio(plist_id, MPI_COMM_WORLD, MPI_INFO_NULL);
-
- VRFY(( status >= 0 ), "H5Pset_fapl_mpio() failed");
+ VRFY((status >= 0 ), "H5Pset_fapl_mpio() failed");
/*
* Create a new file collectively and release property list identifier.
*/
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Creating new file.\n", mpi_rank, fcn_name);
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist_id);
-
- VRFY(( file_id >= 0 ), "H5Fcreate() failed");
+ VRFY((file_id >= 0 ), "H5Fcreate() failed");
status = H5Pclose(plist_id);
-
- VRFY(( status >= 0 ), "H5Pclose() failed");
+ VRFY((status >= 0 ), "H5Pclose() failed");
/*
* Create the dataspace for the dataset.
*/
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Creating the dataspace for the dataset.\n",
mpi_rank, fcn_name);
dimsf[0] = N;
-
filespace = H5Screate_simple(rank, dimsf, NULL);
-
- VRFY(( filespace >= 0 ), "H5Screate_simple() failed.");
+ VRFY((filespace >= 0 ), "H5Screate_simple() failed.");
/*
* Create the dataset with default properties and close filespace.
*/
- if ( verbose )
+ if(verbose )
HDfprintf(stdout,
"%0d:%s: Creating the dataset, and closing filespace.\n",
mpi_rank, fcn_name);
- dset_id = H5Dcreate(file_id, dataset_name, H5T_NATIVE_INT, filespace,
- H5P_DEFAULT);
-
- VRFY(( dset_id >= 0 ), "H5Dcreate() failed");
+ dset_id = H5Dcreate2(file_id, dataset_name, H5T_NATIVE_INT, filespace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ VRFY((dset_id >= 0 ), "H5Dcreate2() failed");
status = H5Sclose(filespace);
-
- VRFY(( status >= 0 ), "H5Sclose() failed");
+ VRFY((status >= 0 ), "H5Sclose() failed");
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling H5Screate_simple().\n",
- mpi_rank, fcn_name);
+ mpi_rank, fcn_name);
memspace = H5Screate_simple(rank, dimsf, NULL);
-
- VRFY(( memspace >= 0 ), "H5Screate_simple() failed.");
+ VRFY((memspace >= 0 ), "H5Screate_simple() failed.");
- if( mpi_rank == 0 ) {
-
- if ( verbose )
+ if(mpi_rank == 0 ) {
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling H5Sselect_all(memspace).\n",
mpi_rank, fcn_name);
status = H5Sselect_all(memspace);
-
- VRFY(( status >= 0 ), "H5Sselect_all() failed");
-
+ VRFY((status >= 0 ), "H5Sselect_all() failed");
} else {
-
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling H5Sselect_none(memspace).\n",
mpi_rank, fcn_name);
status = H5Sselect_none(memspace);
-
- VRFY(( status >= 0 ), "H5Sselect_none() failed");
-
+ VRFY((status >= 0 ), "H5Sselect_none() failed");
}
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n",
mpi_rank, fcn_name);
MPI_Barrier(MPI_COMM_WORLD);
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling H5Dget_space().\n",
mpi_rank, fcn_name);
filespace = H5Dget_space(dset_id);
-
- VRFY(( filespace >= 0 ), "H5Dget_space() failed");
+ VRFY((filespace >= 0 ), "H5Dget_space() failed");
start[0] = 0L;
@@ -1611,102 +1590,90 @@ void io_mode_confusion(void)
count[0] = 1;
block[0] = N;
- if ( mpi_rank == 0 ) {
-
- /* select all */
-
- if ( verbose )
+ /* select all */
+ if(mpi_rank == 0 ) {
+ if(verbose )
HDfprintf(stdout,
"%0d:%s: Calling H5Sselect_elements() -- set up hang?\n",
mpi_rank, fcn_name);
status = H5Sselect_elements(filespace, H5S_SELECT_SET, N,
- (const hsize_t **)&coord);
-
- VRFY(( status >= 0 ), "H5Sselect_elements() failed");
-
- } else {
-
- /* select nothing */
-
- if ( verbose )
+ (const hsize_t **)&coord);
+ VRFY((status >= 0 ), "H5Sselect_elements() failed");
+ } else { /* select nothing */
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling H5Sselect_none().\n",
mpi_rank, fcn_name);
status = H5Sselect_none(filespace);
-
- VRFY(( status >= 0 ), "H5Sselect_none() failed");
-
+ VRFY((status >= 0 ), "H5Sselect_none() failed");
}
-
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n",
mpi_rank, fcn_name);
MPI_Barrier(MPI_COMM_WORLD);
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling H5Pcreate().\n", mpi_rank, fcn_name);
plist_id = H5Pcreate(H5P_DATASET_XFER);
-
- VRFY(( plist_id != -1 ), "H5Pcreate() failed");
+ VRFY((plist_id != -1 ), "H5Pcreate() failed");
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling H5Pset_dxpl_mpio().\n",
mpi_rank, fcn_name);
status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);
- VRFY(( status >= 0 ), "H5Pset_dxpl_mpio() failed");
+ VRFY((status >= 0 ), "H5Pset_dxpl_mpio() failed");
if(dxfer_coll_type == DXFER_INDEPENDENT_IO) {
- status = H5Pset_dxpl_mpio_collective_opt(plist_id,H5FD_MPIO_INDIVIDUAL_IO);
+ status = H5Pset_dxpl_mpio_collective_opt(plist_id, H5FD_MPIO_INDIVIDUAL_IO);
VRFY((status>= 0),"set independent IO collectively succeeded");
}
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Calling H5Dwrite() -- hang here?.\n",
mpi_rank, fcn_name);
status = H5Dwrite(dset_id, H5T_NATIVE_INT, memspace, filespace,
plist_id, data);
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Returned from H5Dwrite(), status=%d.\n",
mpi_rank, fcn_name, status);
-
- VRFY(( status >= 0 ), "H5Dwrite() failed");
+ VRFY((status >= 0 ), "H5Dwrite() failed");
/*
* Close/release resources.
*/
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Cleaning up from test.\n",
mpi_rank, fcn_name);
status = H5Dclose(dset_id);
- VRFY(( status >= 0 ), "H5Dclose() failed");
+ VRFY((status >= 0 ), "H5Dclose() failed");
status = H5Sclose(filespace);
- VRFY(( status >= 0 ), "H5Dclose() failed");
+ VRFY((status >= 0 ), "H5Dclose() failed");
status = H5Sclose(memspace);
- VRFY(( status >= 0 ), "H5Sclose() failed");
+ VRFY((status >= 0 ), "H5Sclose() failed");
status = H5Pclose(plist_id);
- VRFY(( status >= 0 ), "H5Pclose() failed");
+ VRFY((status >= 0 ), "H5Pclose() failed");
status = H5Fclose(file_id);
- VRFY(( status >= 0 ), "H5Fclose() failed");
+ VRFY((status >= 0 ), "H5Fclose() failed");
- if ( verbose )
+ if(verbose )
HDfprintf(stdout, "%0d:%s: Done.\n", mpi_rank, fcn_name);
return;
@@ -1718,3 +1685,4 @@ void io_mode_confusion(void)
/*=============================================================================
* End of t_mdset.c
*===========================================================================*/
+
diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c
index e35ac2c..8734bfb 100644
--- a/testpar/t_pflush1.c
+++ b/testpar/t_pflush1.c
@@ -59,13 +59,13 @@ hid_t create_file(char* name, hid_t fapl)
- if ((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error;
+ if((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error;
/* Create a chunked dataset */
- if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk(dcpl, 2, ch_size)<0) goto error;
- if ((space=H5Screate_simple(2, ds_size, NULL))<0) goto error;
- if ((dset=H5Dcreate(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT))<0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_chunk(dcpl, 2, ch_size) < 0) goto error;
+ if((space = H5Screate_simple(2, ds_size, NULL)) < 0) goto error;
+ if((dset = H5Dcreate2(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
plist = H5Pcreate(H5P_DATASET_XFER);
@@ -73,15 +73,14 @@ hid_t create_file(char* name, hid_t fapl)
/* Write some data */
- for (i=0; i<ds_size[0]; i++) {
+ for(i = 0; i < ds_size[0]; i++) {
/*
* The extra cast in the following statement is a bug workaround
* for the Win32 version 5.0 compiler.
* 1998-11-06 ptl
*/
- for (j=0; j<ds_size[1]; j++) {
+ for(j = 0; j < ds_size[1]; j++)
the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1);
- }
}
if(H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, plist, the_data) < 0) goto error;
@@ -93,12 +92,10 @@ hid_t create_file(char* name, hid_t fapl)
if(H5Gclose(grp) < 0) goto error;
}
-
return file;
error:
- HD_exit(1);
-
+ HD_exit(1);
}
/*-------------------------------------------------------------------------
@@ -142,14 +139,14 @@ main(int argc, char* argv[])
if(mpi_rank == 0)
TESTING("H5Fflush (part1)");
envval = HDgetenv("HDF5_DRIVER");
- if (envval == NULL)
+ if(envval == NULL)
envval = "nomatch";
- if (HDstrcmp(envval, "split")) {
+ if(HDstrcmp(envval, "split")) {
/* Create the file */
h5_fixname(FILENAME[0], fapl, name, sizeof name);
file1 = create_file(name, fapl);
/* Flush and exit without closing the library */
- if (H5Fflush(file1, H5F_SCOPE_GLOBAL)<0) goto error;
+ if(H5Fflush(file1, H5F_SCOPE_GLOBAL) < 0) goto error;
/* Create the other file which will not be flushed */
h5_fixname(FILENAME[1], fapl, name, sizeof name);
@@ -179,20 +176,20 @@ main(int argc, char* argv[])
*/
/* close file1 */
- if (H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p)<0){
+ if(H5Fget_vfd_handle(file1, fapl, (void **)&mpifh_p) < 0){
printf("H5Fget_vfd_handle for file1 failed\n");
goto error;
}
- if (MPI_File_close(mpifh_p)!=MPI_SUCCESS){
+ if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){
printf("MPI_File_close for file1 failed\n");
goto error;
}
/* close file2 */
- if (H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p)<0){
+ if(H5Fget_vfd_handle(file2, fapl, (void **)&mpifh_p) < 0){
printf("H5Fget_vfd_handle for file2 failed\n");
goto error;
}
- if (MPI_File_close(mpifh_p)!=MPI_SUCCESS){
+ if(MPI_File_close(mpifh_p)!=MPI_SUCCESS){
printf("MPI_File_close for file2 failed\n");
goto error;
}
@@ -208,3 +205,4 @@ error:
MPI_Finalize();
HD_exit(1);
}
+
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index 3a5bc2e..71d526b 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -312,8 +312,8 @@ void coll_write_test(int chunk_factor)
VRFY((ret >= 0),"Fill value creation property list succeeded");
if(chunk_factor != 0) {
- chunk_dims[0] = fsdim[0]/chunk_factor;
- chunk_dims[1] = fsdim[1]/chunk_factor;
+ chunk_dims[0] = fsdim[0] / chunk_factor;
+ chunk_dims[1] = fsdim[1] / chunk_factor;
ret = H5Pset_chunk(dcrt_plist, 2, chunk_dims);
VRFY((ret >= 0),"chunk creation property list succeeded");
}
@@ -333,10 +333,10 @@ void coll_write_test(int chunk_factor)
* Create dataset in the file. Notice that creation
* property list dcrt_plist is used.
*/
- datasetc = H5Dcreate(file, "collect_write", H5T_NATIVE_INT, fspaceid, dcrt_plist);
+ datasetc = H5Dcreate2(file, "collect_write", H5T_NATIVE_INT, fspaceid, H5P_DEFAULT, dcrt_plist, H5P_DEFAULT);
VRFY((datasetc >= 0),"dataset created succeeded");
- dataseti = H5Dcreate(file, "independ_write", H5T_NATIVE_INT, fspaceid, dcrt_plist);
+ dataseti = H5Dcreate2(file, "independ_write", H5T_NATIVE_INT, fspaceid, H5P_DEFAULT, dcrt_plist, H5P_DEFAULT);
VRFY((dataseti >= 0),"dataset created succeeded");
/* The First selection for FILE
@@ -349,7 +349,7 @@ void coll_write_test(int chunk_factor)
*/
start[0] = FHSTART0;
- start[1] = FHSTART1+mpi_rank*FHSTRIDE1*FHCOUNT1;
+ start[1] = FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1;
stride[0] = FHSTRIDE0;
stride[1] = FHSTRIDE1;
count[0] = FHCOUNT0;
diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c
index 6d07ae7..52467d7 100644
--- a/tools/h5copy/h5copygentest.c
+++ b/tools/h5copy/h5copygentest.c
@@ -49,7 +49,7 @@ static void gent_simple(hid_t loc_id)
sid = H5Screate_simple(1, dims, NULL);
/* create dataset */
- did = H5Dcreate(loc_id, DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ did = H5Dcreate2(loc_id, DATASET_SIMPLE, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* write */
H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -81,7 +81,7 @@ static void gent_chunked(hid_t loc_id)
H5Pset_chunk(pid, 1, chunk_dims);
/* create dataset */
- did = H5Dcreate(loc_id, DATASET_CHUNK, H5T_NATIVE_INT, sid, pid);
+ did = H5Dcreate2(loc_id, DATASET_CHUNK, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT);
/* write */
H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -114,7 +114,7 @@ static void gent_compact(hid_t loc_id)
H5Pset_layout (pid,H5D_COMPACT);
/* create dataset */
- did = H5Dcreate(loc_id, DATASET_COMPACT, H5T_NATIVE_INT, sid, pid);
+ did = H5Dcreate2(loc_id, DATASET_COMPACT, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT);
/* write */
H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -156,7 +156,7 @@ static void gent_compound(hid_t loc_id)
H5Tinsert(tid_c, "str2", HOFFSET(s_t,str2), tid_s);
/* create dataset */
- did = H5Dcreate(loc_id, DATASET_COMPOUND, tid_c, sid, H5P_DEFAULT);
+ did = H5Dcreate2(loc_id, DATASET_COMPOUND, tid_c, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* write */
H5Dwrite(did, tid_c, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -195,7 +195,7 @@ static void gent_compressed(hid_t loc_id)
#endif
/* create dataset */
- did = H5Dcreate(loc_id, DATASET_COMPRESSED, H5T_NATIVE_INT, sid, pid);
+ did = H5Dcreate2(loc_id, DATASET_COMPRESSED, H5T_NATIVE_INT, sid, H5P_DEFAULT, pid, H5P_DEFAULT);
/* write */
H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -239,7 +239,7 @@ static void gent_named_vl(hid_t loc_id)
H5Tcommit2(loc_id, "vl", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* create dataset */
- did = H5Dcreate(loc_id, DATASET_NAMED_VL, tid, sid, H5P_DEFAULT);
+ did = H5Dcreate2(loc_id, DATASET_NAMED_VL, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* write */
H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
@@ -292,7 +292,7 @@ static void gent_nested_vl(hid_t loc_id)
tid2 = H5Tvlen_create(tid1);
/* create dataset */
- did = H5Dcreate(loc_id, DATASET_NESTED_VL, tid2, sid, H5P_DEFAULT);
+ did = H5Dcreate2(loc_id, DATASET_NESTED_VL, tid2, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* write */
H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index ba8b222..436e7fd 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -618,14 +618,14 @@ int test_attributes(const char *file,
herr_t status;
/* Create a file */
- if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
/* Create a 1D dataset */
- sid = H5Screate_simple(1,dims,NULL);
- did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT);
- status = H5Sclose(sid);
- assert(status>=0);
+ sid = H5Screate_simple(1, dims, NULL);
+ did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Sclose(sid);
+ assert(status >= 0);
/* Create groups */
gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -643,15 +643,15 @@ int test_attributes(const char *file,
/* Close */
status = H5Dclose(did);
- assert(status>=0);
+ assert(status >= 0);
status = H5Gclose(gid);
- assert(status>=0);
+ assert(status >= 0);
status = H5Gclose(root_id);
- assert(status>=0);
+ assert(status >= 0);
/* Close file */
status = H5Fclose(fid);
- assert(status>=0);
+ assert(status >= 0);
return status;
}
@@ -678,19 +678,19 @@ int test_datasets(const char *file,
herr_t status;
int buf[2]={1,2};
- if (make_diffs)
- memset(buf,0,sizeof buf);
+ if(make_diffs)
+ memset(buf, 0, sizeof buf);
/* Create a file */
- if ((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((fid = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
return -1;
/* Create a 1D dataset */
- sid = H5Screate_simple(1,dims,NULL);
- did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT);
- status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf);
- status = H5Sclose(sid);
- assert(status>=0);
+ sid = H5Screate_simple(1, dims, NULL);
+ did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
+ status = H5Sclose(sid);
+ assert(status >= 0);
/* Create a group */
gid = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -704,13 +704,13 @@ int test_datasets(const char *file,
/* Close */
status = H5Dclose(did);
- assert(status>=0);
+ assert(status >= 0);
status = H5Gclose(gid);
- assert(status>=0);
+ assert(status >= 0);
/* Close file */
status = H5Fclose(fid);
- assert(status>=0);
+ assert(status >= 0);
return status;
}
@@ -1916,20 +1916,19 @@ void write_dset_in(hid_t loc_id,
((int *)buf5[1].p)[0]=2;
((int *)buf5[1].p)[1]=3;
- if (make_diffs)
- {
- ((int *)buf5[0].p)[0]=0;
- ((int *)buf5[1].p)[0]=0;
+ if(make_diffs) {
+ ((int *)buf5[0].p)[0] = 0;
+ ((int *)buf5[1].p)[0] = 0;
((int *)buf5[1].p)[1]=0;
}
- sid = H5Screate_simple(1,dims,NULL);
+ sid = H5Screate_simple(1, dims, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- did = H5Dcreate(loc_id,"vlen",tid,sid,H5P_DEFAULT);
- status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf5);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf5);
- assert(status>=0);
+ did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -2063,25 +2062,27 @@ void write_dset_in(hid_t loc_id,
*/
/* Allocate and initialize VL dataset to write */
- n=0;
- for (i = 0; i < 3; i++) {
- for (j = 0; j < 2; j++) {
+ n = 0;
+ for(i = 0; i < 3; i++)
+ for(j = 0; j < 2; j++) {
int l;
+
buf52[i][j].p = malloc((i + 1) * sizeof(int));
buf52[i][j].len = i + 1;
- for (l = 0; l < i + 1; l++)
- if (make_diffs)((int *)buf52[i][j].p)[l] = 0;
- else ((int *)buf52[i][j].p)[l] = n++;
+ for(l = 0; l < i + 1; l++)
+ if (make_diffs)
+ ((int *)buf52[i][j].p)[l] = 0;
+ else
+ ((int *)buf52[i][j].p)[l] = n++;
}
- }
- sid = H5Screate_simple(2,dims2,NULL);
+ sid = H5Screate_simple(2, dims2, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- did = H5Dcreate(loc_id,"vlen2D",tid,sid,H5P_DEFAULT);
- status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf52);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf52);
- assert(status>=0);
+ did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -2107,18 +2108,17 @@ void write_dset_in(hid_t loc_id,
*/
- if (make_diffs)
- {
- memset(buf72,0,sizeof buf72);
- memset(buf82,0,sizeof buf82);
+ if (make_diffs) {
+ memset(buf72, 0, sizeof buf72);
+ memset(buf82, 0, sizeof buf82);
}
dcpl = H5Pcreate(H5P_DATASET_CREATE);
status = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue);
- sid = H5Screate_simple(2,dims2,NULL);
- did = H5Dcreate(loc_id,"integer2D",H5T_NATIVE_INT,sid,dcpl);
- status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf72);
+ sid = H5Screate_simple(2, dims2, NULL);
+ did = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72);
status = H5Pclose(dcpl);
status = H5Dclose(did);
status = H5Sclose(sid);
@@ -2243,26 +2243,27 @@ void write_dset_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
n=0;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ for(i = 0; i < 4; i++)
+ for(j = 0; j < 3; j++)
+ for(k = 0; k < 2; k++) {
int l;
+
buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
buf53[i][j][k].len = i + 1;
- for (l = 0; l < i + 1; l++)
- if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0;
- else ((int *)buf53[i][j][k].p)[l] = n++;
+ for(l = 0; l < i + 1; l++)
+ if(make_diffs)
+ ((int *)buf53[i][j][k].p)[l] = 0;
+ else
+ ((int *)buf53[i][j][k].p)[l] = n++;
}
- }
- }
- sid = H5Screate_simple(3,dims3,NULL);
+ sid = H5Screate_simple(3, dims3, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- did = H5Dcreate(loc_id,"vlen3D",tid,sid,H5P_DEFAULT);
- status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf53);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf53);
- assert(status>=0);
+ did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -2339,41 +2340,38 @@ void gen_datareg(hid_t fid,
int i;
/* allocate the buffer for write the references */
- rbuf=calloc(2,sizeof(hdset_reg_ref_t));
+ rbuf = calloc(2, sizeof(hdset_reg_ref_t));
/* allocate the buffer for write the data dataset */
- buf=malloc(10*10*sizeof(int));
+ buf = malloc(10 * 10 * sizeof(int));
- for (i=0; i<10*10; i++)
- {
- buf[i]=i;
- }
+ for(i = 0; i < 10 * 10; i++)
+ buf[i] = i;
/* create the data dataset */
- sid1 = H5Screate_simple(2,dims1,NULL);
- did1 = H5Dcreate(fid,"dsetref",H5T_NATIVE_INT,sid1,H5P_DEFAULT);
- status = H5Dwrite(did1,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf);
+ sid1 = H5Screate_simple(2, dims1, NULL);
+ did1 = H5Dcreate2(fid, "dsetref", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
/* create the reference dataset */
- sid2 = H5Screate_simple(1,dims2,NULL);
- did2 = H5Dcreate(fid,"refreg",H5T_STD_REF_DSETREG,sid2,H5P_DEFAULT);
+ sid2 = H5Screate_simple(1, dims2, NULL);
+ did2 = H5Dcreate2(fid, "refreg", H5T_STD_REF_DSETREG, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* create the references */
/* select hyperslab for first reference */
- start[0]=2; start[1]=2;
- count[0]=6; count[1]=6;
- if (make_diffs)
- {
- start[0]=0; start[1]=0;
- count[0]=3; count[1]=3;
+ start[0] = 2; start[1] = 2;
+ count[0] = 6; count[1] = 6;
+ if(make_diffs) {
+ start[0] = 0; start[1] = 0;
+ count[0] = 3; count[1] = 3;
}
- status = H5Sselect_hyperslab(sid1,H5S_SELECT_SET,start,NULL,count,NULL);
+ status = H5Sselect_hyperslab(sid1, H5S_SELECT_SET, start, NULL, count, NULL);
H5Sget_select_npoints(sid1);
/* store first dataset region */
- status = H5Rcreate(&rbuf[0],fid,"dsetref",H5R_DATASET_REGION,sid1);
+ status = H5Rcreate(&rbuf[0], fid, "dsetref", H5R_DATASET_REGION, sid1);
/* select sequence of five points for second reference */
coord[0][0]=6; coord[0][1]=9;
@@ -2437,43 +2435,39 @@ int test_hyperslab(const char *fname,
char c;
/* create */
- fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue) < 0)
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_CHAR, &fillvalue) < 0)
goto out;
if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0)
goto out;
- if ((f_sid = H5Screate_simple(1,dims,NULL)) < 0)
+ if((f_sid = H5Screate_simple(1, dims, NULL)) < 0)
goto out;
- if ((did = H5Dcreate(fid,"big",H5T_NATIVE_CHAR,f_sid,dcpl)) < 0)
+ if((did = H5Dcreate2(fid, "big", H5T_NATIVE_CHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto out;
- if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0)
+ if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0)
goto out;
- if ((tid = H5Dget_type(did)) < 0)
+ if((tid = H5Dget_type(did)) < 0)
goto out;
- if ((size = H5Tget_size(tid))<=0)
+ if((size = H5Tget_size(tid)) <= 0)
goto out;
/* create a evenly divided buffer from 0 to 127 */
- buf=(char *) HDmalloc((unsigned)(nelmts*size));
- s = 1024*1024 / 127;
- for (i=0, j=0, c=0; i<1024*1024; j++, i++)
- {
- if ( j==s)
- {
+ buf = (char *)HDmalloc((unsigned)(nelmts * size));
+ s = 1024 * 1024 / 127;
+ for(i = 0, j = 0, c = 0; i < 1024 * 1024; j++, i++) {
+ if(j == s) {
c++;
- j=0;
- };
+ j = 0;
+ }
/* set the hyperslab values */
HDmemset(buf, c, nelmts);
/* make a different hyperslab at this position */
- if (make_diffs && i==512*512)
- {
+ if(make_diffs && i == 512 * 512)
HDmemset(buf, 0, nelmts);
- }
hs_start[0] = i * GBLL/(1024*1024);
if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size, NULL) < 0)
@@ -2573,32 +2567,29 @@ int write_dset( hid_t loc_id,
hid_t tid,
void *buf )
{
- hid_t did;
- hid_t sid;
+ hid_t did;
+ hid_t sid;
- /* create a space */
- if (( sid = H5Screate_simple(rank,dims,NULL)) < 0 )
- goto out;
+ /* create a space */
+ if((sid = H5Screate_simple(rank, dims, NULL)) < 0)
+ goto out;
- /* create the dataset */
- if (( did = H5Dcreate(loc_id,name,tid,sid,H5P_DEFAULT)) < 0 )
- goto out;
+ /* create the dataset */
+ if((did = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto out;
- /* write */
- if ( buf )
- {
- if ( H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 )
- goto out;
- }
+ /* write */
+ if(buf)
+ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto out;
- /* close */
- H5Dclose(did);
- H5Sclose(sid);
+ /* close */
+ H5Dclose(did);
+ H5Sclose(sid);
- return SUCCEED;
+ return SUCCEED;
out:
-
- return FAIL;
+ return FAIL;
}
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 101e230..0a6b607 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -288,11 +288,11 @@ gent_dataset(void)
/* dset1 */
dims[0] = 10; dims[1] = 20;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- for (j = 0; j < 20; j++)
- dset1[i][j] = j+i;
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 20; j++)
+ dset1[i][j] = j + i;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
H5Sclose(space);
@@ -301,11 +301,11 @@ gent_dataset(void)
/* dset2 */
dims[0] = 30; dims[1] = 20;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 30; i++)
- for (j = 0; j < 20; j++)
- dset2[i][j] = 0.0001*j+i;
+ for(i = 0; i < 30; i++)
+ for(j = 0; j < 20; j++)
+ dset2[i][j] = 0.0001 * j + i;
H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
@@ -333,10 +333,10 @@ gent_dataset2(void)
dims[0] = 10; dims[1] = 20;
maxdims[0] = H5S_UNLIMITED; maxdims[1] = 20;
space = H5Screate_simple(2, dims, maxdims);
- dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, create_plist);
+ dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- for (j = 0; j < 20; j++)
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 20; j++)
dset1[i][j] = j;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
@@ -347,10 +347,10 @@ gent_dataset2(void)
dims[0] = 30; dims[1] = 10;
maxdims[0] = 30; maxdims[1] = H5S_UNLIMITED;
space = H5Screate_simple(2, dims, maxdims);
- dataset = H5Dcreate(fid, "/dset2", H5T_IEEE_F64BE, space, create_plist);
+ dataset = H5Dcreate2(fid, "/dset2", H5T_IEEE_F64BE, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
- for (i = 0; i < 30; i++)
- for (j = 0; j < 10; j++)
+ for(i = 0; i < 30; i++)
+ for(j = 0; j < 10; j++)
dset2[i][j] = j;
H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
@@ -390,7 +390,7 @@ gent_attribute(void)
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(root, ".", "attr2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 10; i++) data[i] = i+1;
+ for(i = 0; i < 10; i++) data[i] = i+1;
H5Awrite(attr, H5T_NATIVE_INT, data);
H5Sclose(space);
@@ -401,7 +401,7 @@ gent_attribute(void)
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(root, ".", "attr3", H5T_IEEE_F64BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 10; i++) d[i] = 0.1 * i;
+ for(i = 0; i < 10; i++) d[i] = 0.1 * i;
H5Awrite(attr, H5T_NATIVE_DOUBLE, d);
H5Sclose(space);
@@ -463,9 +463,9 @@ static void gent_hardlink(void)
fid = H5Fcreate(FILE5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
space = H5Screate_simple(1, &dim, NULL);
- dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 5; i++) dset[i] = i;
+ for(i = 0; i < 5; i++) dset[i] = i;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset);
H5Sclose(space);
@@ -567,7 +567,7 @@ static void gent_compound_dt(void) { /* test compound data type */
hsize_t dset3_dim[2];
- for (i = 0; i < (int)sdim; i++) {
+ for(i = 0; i < (int)sdim; i++) {
dset1[i].a = i;
dset1[i].b = (float)(i*i);
dset1[i].c = (float)(1./(i+1));
@@ -595,7 +595,7 @@ static void gent_compound_dt(void) { /* test compound data type */
H5Tinsert(type2, "a_name", HOFFSET(dset1_t, a), H5T_NATIVE_INT);
H5Tinsert(type2, "b_name", HOFFSET(dset1_t, b), H5T_NATIVE_FLOAT);
H5Tinsert(type2, "c_name", HOFFSET(dset1_t, c), H5T_NATIVE_DOUBLE);
- dataset = H5Dcreate(fid, "/dset1", type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/dset1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
H5Tclose(type2);
H5Tclose(type);
@@ -611,7 +611,7 @@ static void gent_compound_dt(void) { /* test compound data type */
H5Tinsert(type2, "float_name", HOFFSET(dset2_t, b), H5T_NATIVE_FLOAT);
group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset2", type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "dset2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
H5Tclose(type2);
H5Tclose(type);
@@ -647,16 +647,15 @@ static void gent_compound_dt(void) { /* test compound data type */
dset3_dim[0] = 3; dset3_dim[1] = 6;
space3 = H5Screate_simple(2, dset3_dim, NULL);
- dataset = H5Dcreate(group, "dset3", type, space3, H5P_DEFAULT);
- for (i = 0; i < (int)dset3_dim[0]; i++) {
- for (j = 0; j < (int)dset3_dim[1]; j++) {
- for (k = 0; k < 4; k++)
- dset3[i][j].a[k] = k+j+i;
- for (k = 0; k < 5; k++)
- for (l = 0; l < 6; l++)
- dset3[i][j].b[k][l] = (float)((k+1)+l+j+i);
+ dataset = H5Dcreate2(group, "dset3", type, space3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < (int)dset3_dim[0]; i++)
+ for(j = 0; j < (int)dset3_dim[1]; j++) {
+ for(k = 0; k < 4; k++)
+ dset3[i][j].a[k] = k + j + i;
+ for(k = 0; k < 5; k++)
+ for(l = 0; l < 6; l++)
+ dset3[i][j].b[k][l] = (float)((k + 1) + l + j + i);
}
- }
H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3);
H5Sclose(space3);
H5Tclose(type);
@@ -671,7 +670,7 @@ static void gent_compound_dt(void) { /* test compound data type */
H5Tcommit2(group, "type3", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Tinsert(type2, "int", HOFFSET(dset4_t, a), H5T_NATIVE_INT);
H5Tinsert(type2, "float", HOFFSET(dset4_t, b), H5T_NATIVE_FLOAT);
- dataset = H5Dcreate(group, "dset4", type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "dset4", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset4);
H5Tclose(type);
@@ -690,7 +689,7 @@ static void gent_compound_dt(void) { /* test compound data type */
type2 = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t));
H5Tinsert(type2, "int", HOFFSET(dset5_t, a), H5T_NATIVE_INT);
H5Tinsert(type2, "float", HOFFSET(dset5_t, b), H5T_NATIVE_FLOAT);
- dataset = H5Dcreate(group, "dset5", type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "dset5", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset5);
H5Ldelete(group, "type4", H5P_DEFAULT);
@@ -753,7 +752,7 @@ static void gent_compound_dt2(void) { /* test compound data type */
hsize_t sdim, maxdim;
sdim = 10;
- for (i = 0; i < (int)sdim; i++) {
+ for(i = 0; i < (int)sdim; i++) {
dset1[i].a = i;
dset1[i].b = (float)(i*i);
dset1[i].c = (float)(1./(i+1));
@@ -786,7 +785,7 @@ static void gent_compound_dt2(void) { /* test compound data type */
H5Tinsert(type, "b_name", HOFFSET(dset1_t, b), H5T_IEEE_F32BE);
H5Tinsert(type, "c_name", HOFFSET(dset1_t, c), H5T_IEEE_F64BE);
- dataset = H5Dcreate(fid, "/dset1", type, space, create_plist);
+ dataset = H5Dcreate2(fid, "/dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0]));
@@ -814,7 +813,7 @@ static void gent_compound_dt2(void) { /* test compound data type */
group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset2", type, space, create_plist);
+ dataset = H5Dcreate2(group, "dset2", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t));
H5Tinsert(type2, "int_name", HOFFSET(dset2_t, a), H5T_NATIVE_INT);
@@ -848,7 +847,7 @@ static void gent_compound_dt2(void) { /* test compound data type */
H5Tinsert(type, "float", HOFFSET(dset4_t, b), H5T_IEEE_F32BE);
H5Tcommit2(group, "type3", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset4", type, space, create_plist);
+ dataset = H5Dcreate2(group, "dset4", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset4_t));
H5Tinsert(type2, "int", HOFFSET(dset4_t, a), H5T_NATIVE_INT);
@@ -868,7 +867,7 @@ static void gent_compound_dt2(void) { /* test compound data type */
H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE);
H5Tinsert(type, "float", HOFFSET(dset5_t, b), H5T_IEEE_F32BE);
H5Tcommit2(group, "type4", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset5", type, space, create_plist);
+ dataset = H5Dcreate2(group, "dset5", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
type2 = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t));
H5Tinsert(type2, "int", HOFFSET(dset5_t, a), H5T_NATIVE_INT);
H5Tinsert(type2, "float", HOFFSET(dset5_t, b), H5T_NATIVE_FLOAT);
@@ -952,10 +951,10 @@ static void gent_all(void)
/* dset1.1.1 */
dims[0] = 10; dims[1] = 10;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- for (j = 0; j < 10; j++)
- dset1[i][j] = j*i;
+ dataset = H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 10; j++)
+ dset1[i][j] = j * i;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1);
H5Sclose(space);
@@ -981,8 +980,8 @@ static void gent_all(void)
/* dset1.1.2 */
dims[0] = 20;
space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT);
- for (i = 0; i < 20; i++)
+ dataset = H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 20; i++)
dset2[i] = i;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
H5Sclose(space);
@@ -1003,9 +1002,9 @@ static void gent_all(void)
/* dset2.1 */
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- dset2_1[i] = (float)(i*0.1+1);
+ dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 10; i++)
+ dset2_1[i] = (float)(i * 0.1 + 1);
H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1);
H5Sclose(space);
H5Dclose(dataset);
@@ -1013,10 +1012,10 @@ static void gent_all(void)
/* dset2.2 */
dims[0] = 3; dims[1] = 5;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT);
- for (i = 0; i < 3; i++)
- for (j = 0; j < 5; j++)
- dset2_2[i][j] = (float)((i+1)*j*0.1);
+ dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 3; i++)
+ for(j = 0; j < 5; j++)
+ dset2_2[i][j] = (float)((i + 1) * j * 0.1);
H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_2);
H5Sclose(space);
H5Dclose(dataset);
@@ -1160,7 +1159,7 @@ static void gent_many(void)
sdim = 6;
maxdim = H5S_UNLIMITED;
space = H5Screate_simple(1, &sdim, &maxdim);
- dataset = H5Dcreate(group, "dset1", type, space, create_plist);
+ dataset = H5Dcreate2(group, "dset1", type, space, H5P_DEFAULT, create_plist, H5P_DEFAULT);
/* add attributes to dset1 */
dims[0] = 10;
@@ -1182,17 +1181,17 @@ static void gent_many(void)
dims[0] = 10;
space2 = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, ".", "attr3", H5T_IEEE_F64BE, space2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
+ for(i = 0; i < 10; i++)
d[i] = 0.1 * i;
H5Awrite(attr, H5T_NATIVE_DOUBLE, d);
H5Sclose(space2);
H5Aclose(attr);
- for (j=0; j<(int)sdim; j++) {
- for (i3 = 0; i3 < 2; i3++) {
- for (i2 = 0; i2 < 2; i2++) {
- for (i1 = 0; i1 < 2; i1++) {
- for (i0 = 0; i0 < 2; i0++) {
+ for(j=0; j<(int)sdim; j++) {
+ for(i3 = 0; i3 < 2; i3++) {
+ for(i2 = 0; i2 < 2; i2++) {
+ for(i1 = 0; i1 < 2; i1++) {
+ for(i0 = 0; i0 < 2; i0++) {
dset1[j].a[i3][i2][i1][i0] = i0+j;
dset1[j].b[i3][i2][i1][i0] = (double)(i0+j);
#ifdef _WIN32
@@ -1232,9 +1231,9 @@ static void gent_many(void)
dims[0] = 10; dims[1] = 10;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(group, "dset2", H5T_STD_I32BE, space, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- for (j = 0; j < 10; j++)
+ dataset = H5Dcreate2(group, "dset2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 10; j++)
dset2[i][j] = j;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
@@ -1255,9 +1254,9 @@ static void gent_many(void)
dims[0] = 10; dims[1] = 10;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(group, "dset3", H5T_STD_I32BE, space, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- for (j = 0; j < 10; j++)
+ dataset = H5Dcreate2(group, "dset3", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 10; j++)
dset3[i][j] = i;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset3);
@@ -1294,9 +1293,9 @@ static void gent_many(void)
static hid_t mkstr(int size, H5T_str_t pad) {
hid_t type;
- if ((type=H5Tcopy(H5T_C_S1))<0) return -1;
- if (H5Tset_size(type, (size_t)size)<0) return -1;
- if (H5Tset_strpad(type, pad)<0) return -1;
+ if((type=H5Tcopy(H5T_C_S1)) < 0) return -1;
+ if(H5Tset_size(type, (size_t)size) < 0) return -1;
+ if(H5Tset_strpad(type, pad) < 0) return -1;
return type;
}
@@ -1345,7 +1344,7 @@ static void gent_str(void) {
space = H5Screate_simple(2, dims1, NULL);
f_type = mkstr(5, H5T_STR_NULLTERM);
m_type = mkstr(3, H5T_STR_NULLTERM);
- dataset = H5Dcreate(fid, "/string1", f_type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/string1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string1);
H5Tclose(m_type);
H5Tclose(f_type);
@@ -1356,7 +1355,7 @@ static void gent_str(void) {
space = H5Screate_simple(1, dims2, NULL);
f_type = mkstr(11, H5T_STR_SPACEPAD);
m_type = mkstr(10, H5T_STR_NULLTERM);
- dataset = H5Dcreate(fid, "/string2", f_type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/string2", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string2);
H5Tclose(m_type);
H5Tclose(f_type);
@@ -1367,7 +1366,7 @@ static void gent_str(void) {
space = H5Screate_simple(1, dims3, NULL);
f_type = mkstr(8, H5T_STR_NULLPAD);
m_type = mkstr(6, H5T_STR_NULLTERM);
- dataset = H5Dcreate(fid, "/string3", f_type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/string3", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string3);
H5Tclose(m_type);
H5Tclose(f_type);
@@ -1378,7 +1377,7 @@ static void gent_str(void) {
space = H5Screate_simple(1, dims4, NULL);
f_type = mkstr(168, H5T_STR_SPACEPAD);
m_type = mkstr(21, H5T_STR_NULLTERM);
- dataset = H5Dcreate(fid, "/string4", f_type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/string4", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, m_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, string4);
H5Tclose(m_type);
H5Tclose(f_type);
@@ -1414,16 +1413,16 @@ static void gent_str(void) {
H5Tclose(array_dt);
H5Tclose(str_type);
- for (i = 0; i < 3; i++)
- for (j = 0; j < 6; j++) {
- for (k = 0 ; k < 8; k++)
- for (l = 0; l < 10; l++)
- comp1[i][j].a[k][l] = (l+j+k) * (l+j+k);
- for (k = 0 ; k < 12; k++)
+ for(i = 0; i < 3; i++)
+ for(j = 0; j < 6; j++) {
+ for(k = 0 ; k < 8; k++)
+ for(l = 0; l < 10; l++)
+ comp1[i][j].a[k][l] = (l + j + k) * (l + j + k);
+ for(k = 0 ; k < 12; k++)
strcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678");
}
- dataset = H5Dcreate(fid, "/comp1", f_type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/comp1", f_type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1);
H5Tclose(f_type);
@@ -1478,7 +1477,7 @@ hsize_t sdim;
/* dset1 */
group = H5Gcreate2(fid, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset1", fxdlenstr, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "dset1", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* add attributes to dset1 */
@@ -1502,25 +1501,25 @@ hsize_t sdim;
count[0]=1;
block[0]=1;
- for (i = 0; (hsize_t)i < sdim; i++) {
- start[0] = i;
- sprintf(buf,"This is row %1d of type H5T_STR_NULLTERM of",i);
- H5Tset_size(memtype, HDstrlen(buf)+1);
- H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
- H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
+ for(i = 0; (hsize_t)i < sdim; i++) {
+ start[0] = i;
+ sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i);
+ H5Tset_size(memtype, HDstrlen(buf)+1);
+ H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
+ H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
}
H5Dclose(dataset);
H5Gclose(group);
group = H5Gcreate2(fid, "/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset2", fxdlenstr, space, H5P_DEFAULT);
-
- for (i = 0; (hsize_t)i < sdim; i++) {
- start[0] = i;
- sprintf(buf,"This is row %1d of type H5T_STR_NULLTERM of string array",i);
- H5Tset_size(memtype, HDstrlen(buf)+1);
- H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
- H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
+ dataset = H5Dcreate2(group, "dset2", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ for(i = 0; (hsize_t)i < sdim; i++) {
+ start[0] = i;
+ sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i);
+ H5Tset_size(memtype, HDstrlen(buf)+1);
+ H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
+ H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
}
H5Dclose(dataset);
H5Gclose(group);
@@ -1533,28 +1532,28 @@ hsize_t sdim;
H5Tset_strpad(fxdlenstr, H5T_STR_NULLPAD);
group = H5Gcreate2(fid, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset3", fxdlenstr, space, H5P_DEFAULT);
-
- for (i = 0;(hsize_t) i < sdim; i++) {
- start[0] = i;
- sprintf(buf,"This is row %1d of type H5T_STR_NULLPAD of",i);
- H5Tset_size(memtype, HDstrlen(buf)+1);
- H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
- H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
+ dataset = H5Dcreate2(group, "dset3", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ for(i = 0;(hsize_t) i < sdim; i++) {
+ start[0] = i;
+ sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i);
+ H5Tset_size(memtype, HDstrlen(buf)+1);
+ H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
+ H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
}
H5Dclose(dataset);
H5Gclose(group);
group = H5Gcreate2(fid, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset4", fxdlenstr, space, H5P_DEFAULT);
-
- for (i = 0; (hsize_t)i < sdim; i++) {
- start[0] = i;
- sprintf(buf,"This is row %1d of type H5T_STR_NULLPAD of string array",i);
- H5Tset_size(memtype, HDstrlen(buf)+1);
- H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
- H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
+ dataset = H5Dcreate2(group, "dset4", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ for(i = 0; (hsize_t)i < sdim; i++) {
+ start[0] = i;
+ sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i);
+ H5Tset_size(memtype, HDstrlen(buf)+1);
+ H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
+ H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
}
H5Dclose(dataset);
H5Gclose(group);
@@ -1566,28 +1565,28 @@ hsize_t sdim;
H5Tset_strpad(fxdlenstr, H5T_STR_SPACEPAD);
group = H5Gcreate2(fid, "/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset5", fxdlenstr, space, H5P_DEFAULT);
-
- for (i = 0; (hsize_t)i < sdim; i++) {
- start[0] = i;
- sprintf(buf,"This is row %1d of type H5T_STR_SPACEPAD of",i);
- H5Tset_size(memtype, HDstrlen(buf)+1);
- H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
- H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
+ dataset = H5Dcreate2(group, "dset5", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ for(i = 0; (hsize_t)i < sdim; i++) {
+ start[0] = i;
+ sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i);
+ H5Tset_size(memtype, HDstrlen(buf) + 1);
+ H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
+ H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
}
H5Dclose(dataset);
H5Gclose(group);
group = H5Gcreate2(fid, "/g6", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- dataset = H5Dcreate(group, "dset6", fxdlenstr, space, H5P_DEFAULT);
-
- for (i = 0; (hsize_t)i < sdim; i++) {
- start[0] = i;
- sprintf(buf,"This is row %1d of type H5T_STR_SPACEPAD of string array",i);
- H5Tset_size(memtype, HDstrlen(buf)+1);
- H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
- H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
+ dataset = H5Dcreate2(group, "dset6", fxdlenstr, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+
+ for(i = 0; (hsize_t)i < sdim; i++) {
+ start[0] = i;
+ sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i);
+ H5Tset_size(memtype, HDstrlen(buf) + 1);
+ H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
+ H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
}
H5Dclose(dataset);
@@ -1623,8 +1622,8 @@ static void gent_enum(void)
H5Tcommit2(file, "enum normal", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
space = H5Screate_simple(1,size,NULL);
- dset = H5Dcreate(file,"table",type, space, H5P_DEFAULT);
- H5Dwrite(dset,type,space,space,H5P_DEFAULT,data);
+ dset = H5Dcreate2(file,"table",type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dset, type, space, space, H5P_DEFAULT, data);
H5Dclose(dset);
H5Sclose(space);
@@ -1666,7 +1665,7 @@ static void gent_objref(void)
H5Oset_comment(group, ".", write_comment, H5P_DEFAULT);
/* Create a dataset (inside Group1) */
- dataset = H5Dcreate(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "Dataset1", H5T_STD_U32BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for(tu32 = (uint32_t *)((void*)wbuf), i = 0; i < SPACE1_DIM1; i++)
*tu32++ = i * 3;
@@ -1678,7 +1677,7 @@ static void gent_objref(void)
H5Dclose(dataset);
/* Create another dataset (inside Group1) */
- dataset = H5Dcreate(group, "Dataset2", H5T_STD_U8BE, sid1, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "Dataset2", H5T_STD_U8BE, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Close Dataset */
H5Dclose(dataset);
@@ -1703,7 +1702,7 @@ static void gent_objref(void)
H5Gclose(group);
/* Create a dataset */
- dataset = H5Dcreate(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Create reference to dataset */
H5Rcreate(&wbuf[0], fid1, "/Group1/Dataset1", H5R_OBJECT, -1);
@@ -1771,13 +1770,13 @@ static void gent_datareg(void)
sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL);
/* Create a dataset */
- dset2=H5Dcreate(fid1,"Dataset2",H5T_STD_U8BE,sid2,H5P_DEFAULT);
+ dset2 = H5Dcreate2(fid1, "Dataset2", H5T_STD_U8BE, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for(tu8=dwbuf,i=0; i<SPACE2_DIM1*SPACE2_DIM2; i++)
+ for(tu8 = dwbuf, i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++)
*tu8++=i*3;
/* Write selection to disk */
- H5Dwrite(dset2,H5T_NATIVE_UCHAR,H5S_ALL,H5S_ALL,H5P_DEFAULT,dwbuf);
+ H5Dwrite(dset2, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf);
/* Close Dataset */
H5Dclose(dset2);
@@ -1786,21 +1785,21 @@ static void gent_datareg(void)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
/* Create a dataset */
- dset1=H5Dcreate(fid1,"Dataset1",H5T_STD_REF_DSETREG,sid1,H5P_DEFAULT);
+ dset1 = H5Dcreate2(fid1, "Dataset1", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Create references */
/* Select 6x6 hyperslab for first reference */
- start[0]=2; start[1]=2;
- stride[0]=1; stride[1]=1;
- count[0]=6; count[1]=6;
- block[0]=1; block[1]=1;
- H5Sselect_hyperslab(sid2,H5S_SELECT_SET,start,stride,count,block);
+ start[0] = 2; start[1] = 2;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 6; count[1] = 6;
+ block[0] = 1; block[1] = 1;
+ H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
H5Sget_select_npoints(sid2);
/* Store first dataset region */
- H5Rcreate(&wbuf[0],fid1,"/Dataset2",H5R_DATASET_REGION,sid2);
+ H5Rcreate(&wbuf[0], fid1, "/Dataset2", H5R_DATASET_REGION, sid2);
/* Select sequence of ten points for second reference */
coord1[0][0]=6; coord1[0][1]=9;
@@ -1878,7 +1877,7 @@ static void gent_nestcomp(void)
/*
* Initialize the data
*/
- for (i = 0; i< 10; i++) {
+ for(i = 0; i< 10; i++) {
s1[i].a = i;
s1[i].b = (float)(i*i);
s1[i].c = 1./(i+1);
@@ -1925,14 +1924,14 @@ static void gent_nestcomp(void)
/*
* Create the dataset.
*/
- dataset = H5Dcreate(file, datasetname, s2_tid, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, datasetname, s2_tid, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Wtite data to the dataset;
*/
status = H5Dwrite(dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1);
- if (status < 0)
- fprintf(stderr, "gent_nestcomp H5Dwrite failed\n");
+ if(status < 0)
+ fprintf(stderr, "gent_nestcomp H5Dwrite failed\n");
/*
* Release resources
@@ -1952,7 +1951,7 @@ static void gent_opaque(void)
int x;
hsize_t dim = 2;
- for (x = 0; x < 100; x++){
+ for(x = 0; x < 100; x++){
test[x][0] = x;
test[x][1] = 99 - x;
}
@@ -1970,13 +1969,13 @@ static void gent_opaque(void)
/*
* Create the memory datatype.
*/
- type = H5Tcreate (H5T_OPAQUE, sizeof(char)*100*2);
+ type = H5Tcreate(H5T_OPAQUE, sizeof(char) * 100 * 2);
H5Tset_tag(type, "test opaque type");
/*
* Create the dataset.
*/
- dataset = H5Dcreate(file, "opaque test", type, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(file, "opaque test", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/*
* Write data to the dataset;
@@ -2002,31 +2001,33 @@ static void gent_bitfields(void)
/* bitfield_1 */
nelmts = sizeof(buf);
- if ((type=H5Tcopy(H5T_STD_B8LE))<0 ||
- (space=H5Screate_simple(1, &nelmts, NULL))<0 ||
- (dset=H5Dcreate(grp, "bitfield_1", type, space, H5P_DEFAULT))<0)
- goto error;
-
- for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
- if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
- goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Tclose(type)<0) goto error;
- if (H5Dclose(dset)<0) goto error;
+ if((type = H5Tcopy(H5T_STD_B8LE)) < 0 ||
+ (space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
+ (dset = H5Dcreate2(grp, "bitfield_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ for(i = 0; i < sizeof buf; i++)
+ buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
/* bitfield_2 */
nelmts = sizeof(buf)/2;
- if ((type=H5Tcopy(H5T_STD_B16LE))<0 ||
- (space=H5Screate_simple(1, &nelmts, NULL))<0 ||
- (dset=H5Dcreate(grp, "bitfield_2", type, space, H5P_DEFAULT))<0)
- goto error;
- for (i=0; i<sizeof buf; i++) buf[i] = (unsigned char)0xff ^ (unsigned char)i;
- if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0)
- goto error;
- if (H5Sclose(space)<0) goto error;
- if (H5Tclose(type)<0) goto error;
- if (H5Dclose(dset)<0) goto error;
- if (H5Gclose(grp)<0) goto error;
+ if((type = H5Tcopy(H5T_STD_B16LE)) < 0 ||
+ (space = H5Screate_simple(1, &nelmts, NULL)) < 0 ||
+ (dset = H5Dcreate2(grp, "bitfield_2", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+ for(i = 0; i < sizeof buf; i++)
+ buf[i] = (unsigned char)0xff ^ (unsigned char)i;
+ if(H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto error;
+ if(H5Sclose(space) < 0) goto error;
+ if(H5Tclose(type) < 0) goto error;
+ if(H5Dclose(dset) < 0) goto error;
+ if(H5Gclose(grp) < 0) goto error;
H5Fclose(file);
error:
@@ -2050,82 +2051,82 @@ static void gent_vldatatypes(void)
/* Allocate and initialize VL dataset to write */
for(i = 0; i < SPACE1_DIM1; i++) {
- int j;
+ int j;
wdata[i].p = malloc((i + 1) * sizeof(int));
wdata[i].len = i + 1;
- for (j = 0; j < i + 1; j++)
+ for(j = 0; j < i + 1; j++)
((int *)wdata[i].p)[j] = i * 10 + j;
}
/* write out the integers in little-endian format */
space = H5Screate_simple(SPACE1_RANK, dims, NULL);
type = H5Tvlen_create(H5T_NATIVE_INT);
- dset = H5Dcreate(file, "Dataset1.0", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Dclose(dset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(type);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(space);
- assert(ret>=0);
+ assert(ret >= 0);
/* Allocate and initialize VL dataset to write */
for(i = 0; i < SPACE1_DIM1; i++) {
- int j;
+ int j;
wdata[i].p = malloc((i + 1) * sizeof(float));
wdata[i].len = i + 1;
- for (j = 0; j < i + 1; j++)
+ for(j = 0; j < i + 1; j++)
((float *)wdata[i].p)[j] = (float)(i * 10 + ((float)j) / 10.0);
}
/* write out the floats in little-endian format */
space = H5Screate_simple(SPACE1_RANK, dims, NULL);
type = H5Tvlen_create(H5T_NATIVE_FLOAT);
- dset = H5Dcreate(file, "Dataset2.0", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset2.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Dclose(dset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(type);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(space);
- assert(ret>=0);
+ assert(ret >= 0);
/* Allocate and initialize a scalar VL dataset to write */
adata.p = malloc(37 * sizeof(int));
adata.len = 37;
- for (i = 0; i < 37; i++)
+ for(i = 0; i < 37; i++)
((int *)adata.p)[i] = i * 2;
/* write out scalar VL dataset in little-endian format */
space = H5Screate_simple(0, NULL, NULL);
type = H5Tvlen_create(H5T_NATIVE_INT);
- dset = H5Dcreate(file, "Dataset3.0", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset3.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &adata);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &adata);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Dclose(dset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(type);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(space);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(file);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_vldatatypes2(void)
@@ -2167,33 +2168,33 @@ static void gent_vldatatypes2(void)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
/* Create a VL datatype to refer to */
- tid1 = H5Tvlen_create (H5T_NATIVE_UINT);
+ tid1 = H5Tvlen_create(H5T_NATIVE_UINT);
/* Create the base VL type */
- tid2 = H5Tvlen_create (tid1);
+ tid2 = H5Tvlen_create(tid1);
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid2);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
@@ -2230,41 +2231,41 @@ static void gent_vldatatypes3(void)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
/* Create a VL datatype to refer to */
- tid1 = H5Tvlen_create (H5T_NATIVE_UINT);
+ tid1 = H5Tvlen_create(H5T_NATIVE_UINT);
/* Create the base compound type */
tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1));
/* Insert fields */
- ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
- assert(ret>=0);
- ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT);
- assert(ret>=0);
- ret=H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1);
- assert(ret>=0);
+ ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
+ assert(ret >= 0);
+ ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT);
+ assert(ret >= 0);
+ ret = H5Tinsert(tid2, "v", HOFFSET(s1, v), tid1);
+ assert(ret >= 0);
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid2,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid2, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid2,sid1,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid2);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_vldatatypes4(void)
@@ -2302,36 +2303,36 @@ static void gent_vldatatypes4(void)
tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s1));
/* Insert fields */
- ret=H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
- assert(ret>=0);
- ret=H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT);
- assert(ret>=0);
+ ret = H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_INT);
+ assert(ret >= 0);
+ ret = H5Tinsert(tid2, "f", HOFFSET(s1, f), H5T_NATIVE_FLOAT);
+ assert(ret >= 0);
/* Create a datatype to refer to */
- tid1 = H5Tvlen_create (tid2);
+ tid1 = H5Tvlen_create(tid2);
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid2);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
/* Generate a variable-length dataset with NULL values in it */
@@ -2361,38 +2362,38 @@ static void gent_vldatatypes5(void)
} /* end for */
/* Create file */
- fid1 = H5Fcreate (FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid1 = H5Fcreate(FILE43, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
assert(fid1>0);
/* Create dataspace for datasets */
- sid1 = H5Screate_simple (SPACE1_RANK, dims1, NULL);
+ sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
assert(sid1>0);
/* Create a datatype to refer to */
- tid1 = H5Tvlen_create (H5T_NATIVE_UINT);
+ tid1 = H5Tvlen_create(H5T_NATIVE_UINT);
assert(tid1>0);
/* Create a dataset */
- dataset = H5Dcreate (fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, F43_DSETNAME, tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(dataset>0);
- ret = H5Dwrite (dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
- ret = H5Dclose (dataset);
- assert(ret>=0);
+ ret = H5Dclose(dataset);
+ assert(ret >= 0);
- ret = H5Dvlen_reclaim (tid1, sid1, H5P_DEFAULT, wdata);
- assert(ret>=0);
+ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
- ret = H5Tclose (tid1);
- assert(ret>=0);
+ ret = H5Tclose(tid1);
+ assert(ret >= 0);
ret = H5Sclose (sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose (fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_array1(void)
@@ -2422,21 +2423,21 @@ static void gent_array1(void)
tid1 = H5Tarray_create(H5T_NATIVE_INT, ARRAY1_RANK, tdims1, NULL);
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_array2(void)
@@ -2468,21 +2469,21 @@ static void gent_array2(void)
tid = H5Tarray_create(H5T_NATIVE_INT, ARRAY2_RANK, tdims2, NULL);
/* Create a dataset */
- dataset=H5Dcreate(fid,"Dataset1",tid,sid,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "Dataset1", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_array3(void)
@@ -2519,23 +2520,23 @@ static void gent_array3(void)
tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
/* Create a dataset */
- dataset=H5Dcreate(fid,"Dataset1",tid1,sid,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "Dataset1", tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid2);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_array4(void)
@@ -2572,36 +2573,36 @@ static void gent_array4(void)
tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s2_t));
/* Insert integer field */
- ret = H5Tinsert (tid2, "i", HOFFSET(s2_t,i), H5T_NATIVE_INT);
- assert(ret>=0);
+ ret = H5Tinsert(tid2, "i", HOFFSET(s2_t, i), H5T_NATIVE_INT);
+ assert(ret >= 0);
/* Insert float field */
- ret = H5Tinsert (tid2, "f", HOFFSET(s2_t,f), H5T_NATIVE_FLOAT);
- assert(ret>=0);
+ ret = H5Tinsert(tid2, "f", HOFFSET(s2_t, f), H5T_NATIVE_FLOAT);
+ assert(ret >= 0);
/* Create an array datatype to refer to */
tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
/* Close compound datatype */
- ret=H5Tclose(tid2);
- assert(ret>=0);
+ ret = H5Tclose(tid2);
+ assert(ret >= 0);
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_array5(void)
@@ -2641,42 +2642,42 @@ static void gent_array5(void)
/* Insert integer field */
ret = H5Tinsert (tid2, "i", HOFFSET(s2_t,i), H5T_NATIVE_INT);
- assert(ret>=0);
+ assert(ret >= 0);
/* Create an array of floats datatype */
tid3 = H5Tarray_create(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1, NULL);
/* Insert float array field */
ret = H5Tinsert (tid2, "f", HOFFSET(s2_t,f), tid3);
- assert(ret>=0);
+ assert(ret >= 0);
/* Close array of floats field datatype */
- ret=H5Tclose(tid3);
- assert(ret>=0);
+ ret = H5Tclose(tid3);
+ assert(ret >= 0);
/* Create an array datatype to refer to */
tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
/* Close compound datatype */
- ret=H5Tclose(tid2);
- assert(ret>=0);
+ ret = H5Tclose(tid2);
+ assert(ret >= 0);
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_array6(void)
@@ -2714,29 +2715,29 @@ static void gent_array6(void)
tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
/* Close VL datatype */
- ret=H5Tclose(tid2);
- assert(ret>=0);
+ ret = H5Tclose(tid2);
+ assert(ret >= 0);
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_array7(void)
@@ -2776,36 +2777,36 @@ static void gent_array7(void)
tid2 = H5Tvlen_create(tid3);
/* Close nested array datatype */
- ret=H5Tclose(tid3);
- assert(ret>=0);
+ ret = H5Tclose(tid3);
+ assert(ret >= 0);
/* Create an array datatype to refer to */
tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL);
/* Close VL datatype */
- ret=H5Tclose(tid2);
- assert(ret>=0);
+ ret = H5Tclose(tid2);
+ assert(ret >= 0);
/* Create a dataset */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write dataset to disk */
- ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Reclaim the write VL data */
- ret=H5Dvlen_reclaim(tid1,sid1,H5P_DEFAULT,wdata);
- assert(ret>=0);
+ ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ assert(ret >= 0);
/* Close Dataset */
ret = H5Dclose(dataset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(sid1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(fid1);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void gent_empty(void)
@@ -2825,51 +2826,51 @@ static void gent_empty(void)
/* write out an empty vlen dataset */
type = H5Tvlen_create(H5T_NATIVE_INT);
- dset = H5Dcreate(file, "Dataset1.0", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Don't write any data */
ret = H5Dclose(dset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(type);
- assert(ret>=0);
+ assert(ret >= 0);
/* write out an empty native integer dataset dataset */
- dset = H5Dcreate(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset2.0", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Don't write any data */
ret = H5Dclose(dset);
- assert(ret>=0);
+ assert(ret >= 0);
/* write out an empty native floating-point dataset dataset */
- dset = H5Dcreate(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset3.0", H5T_NATIVE_FLOAT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Don't write any data */
ret = H5Dclose(dset);
- assert(ret>=0);
+ assert(ret >= 0);
/* write out an empty array dataset */
type = H5Tarray_create(H5T_NATIVE_INT, SPACE1_RANK, dims, NULL);
- dset = H5Dcreate(file, "Dataset4.0", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset4.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Don't write any data */
ret = H5Dclose(dset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(type);
- assert(ret>=0);
+ assert(ret >= 0);
/* write out an empty compound dataset */
type = H5Tcreate(H5T_COMPOUND,sizeof(empty_struct));
H5Tinsert(type, "a", HOFFSET(empty_struct, a),H5T_NATIVE_INT);
H5Tinsert(type, "b", HOFFSET(empty_struct, b),H5T_NATIVE_FLOAT);
H5Tinsert(type, "c", HOFFSET(empty_struct, c),H5T_NATIVE_CHAR);
- dset = H5Dcreate(file, "Dataset5.0", type, space, H5P_DEFAULT);
+ dset = H5Dcreate2(file, "Dataset5.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Don't write any data */
ret = H5Dclose(dset);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(type);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Sclose(space);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Fclose(file);
- assert(ret>=0);
+ assert(ret >= 0);
}
static void
@@ -2960,10 +2961,10 @@ void gent_split_file(void)
dims[0] = 10;
dims[1] = 15;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- for (j = 0; j < 15; j++)
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 15; j++)
dset[i][j] = i + j;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset);
@@ -2992,10 +2993,10 @@ void gent_family(void)
dims[0] = 10;
dims[1] = 15;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- for (j = 0; j < 15; j++)
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 15; j++)
dset[i][j] = i + j;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset);
@@ -3030,7 +3031,7 @@ void gent_multi(void)
assert(HDstrlen(multi_letters) == H5FD_MEM_NTYPES);
- for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
+ for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
memb_fapl[mt] = H5P_DEFAULT;
memb_map[mt] = mt;
sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
@@ -3049,10 +3050,10 @@ void gent_multi(void)
dims[0] = 10;
dims[1] = 15;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < 10; i++)
- for (j = 0; j < 15; j++)
+ for(i = 0; i < 10; i++)
+ for(j = 0; j < 15; j++)
dset[i][j] = i + j;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset);
@@ -3105,11 +3106,11 @@ static void gent_vlstr(void)
/* Create a VL string datatype to refer to */
tid1 = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid1,H5T_VARIABLE);
+ H5Tset_size (tid1, H5T_VARIABLE);
/* Create a dataset and write VL string to it. */
- dataset=H5Dcreate(fid1,"Dataset1",tid1,sid1,H5P_DEFAULT);
- H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
+ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite(dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
H5Dclose(dataset);
/* Create a named VL string type. Change padding of datatype */
@@ -3153,7 +3154,7 @@ static void gent_char(void)
sid1 = H5Screate_simple(1, dims1, NULL);
/* Create a dataset */
- dataset = H5Dcreate(fid1, "Dataset1", H5T_NATIVE_CHAR, sid1, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid1, "Dataset1", H5T_NATIVE_CHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write some characters to it. */
H5Dwrite(dataset, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
@@ -3287,7 +3288,7 @@ static void write_attr_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
/* Create references to dataset */
- if (dset_name)
+ if(dset_name)
{
status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1);
status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1);
@@ -3392,10 +3393,10 @@ static void write_attr_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
/* Create references to dataset */
- if (dset_name)
+ if(dset_name)
{
- for (i = 0; i < 3; i++) {
- for (j = 0; j < 2; j++) {
+ for(i = 0; i < 3; i++) {
+ for(j = 0; j < 2; j++) {
status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1);
}
}
@@ -3477,9 +3478,9 @@ static void write_attr_in(hid_t loc_id,
*/
n=1;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ for(i = 0; i < 4; i++) {
+ for(j = 0; j < 3; j++) {
+ for(k = 0; k < 2; k++) {
buf23[i][j][k]=n++;
}
}
@@ -3503,9 +3504,9 @@ static void write_attr_in(hid_t loc_id,
*/
n=1;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ for(i = 0; i < 4; i++) {
+ for(j = 0; j < 3; j++) {
+ for(k = 0; k < 2; k++) {
buf33[i][j][k].a=n++;
buf33[i][j][k].b=n++;
}
@@ -3522,11 +3523,11 @@ static void write_attr_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
/* Create references to dataset */
- if (dset_name)
+ if(dset_name)
{
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++)
+ for(i = 0; i < 4; i++) {
+ for(j = 0; j < 3; j++) {
+ for(k = 0; k < 2; k++)
status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1);
}
}
@@ -3579,8 +3580,8 @@ static void write_attr_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
n=1;
- for (i = 0; i < 24; i++) {
- for (j = 0; j < (int)dimarray[0]; j++) {
+ for(i = 0; i < 24; i++) {
+ for(j = 0; j < (int)dimarray[0]; j++) {
buf63[i][j]=n++;
}
}
@@ -3594,9 +3595,9 @@ static void write_attr_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
n=1; f=1;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ for(i = 0; i < 4; i++) {
+ for(j = 0; j < 3; j++) {
+ for(k = 0; k < 2; k++) {
buf73[i][j][k]=n++;
buf83[i][j][k]=f++;
}
@@ -3731,7 +3732,7 @@ static void write_dset_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
/* Create references to dataset */
- if (dset_name)
+ if(dset_name)
{
status=H5Rcreate(&buf4[0],fid,dset_name,H5R_OBJECT,-1);
status=H5Rcreate(&buf4[1],fid,dset_name,H5R_OBJECT,-1);
@@ -3763,13 +3764,13 @@ static void write_dset_in(hid_t loc_id,
((int *)buf5[1].p)[0]=2;
((int *)buf5[1].p)[1]=3;
- sid = H5Screate_simple(1,dims,NULL);
+ sid = H5Screate_simple(1, dims, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- did = H5Dcreate(loc_id,"vlen",tid,sid,H5P_DEFAULT);
- status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf5);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf5);
- assert(status>=0);
+ did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -3836,10 +3837,10 @@ static void write_dset_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
/* Create references to dataset */
- if (dset_name)
+ if(dset_name)
{
- for (i = 0; i < 3; i++) {
- for (j = 0; j < 2; j++) {
+ for(i = 0; i < 3; i++) {
+ for(j = 0; j < 2; j++) {
status=H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1);
}
}
@@ -3863,23 +3864,23 @@ static void write_dset_in(hid_t loc_id,
/* Allocate and initialize VL dataset to write */
n=0;
- for (i = 0; i < 3; i++) {
- for (j = 0; j < 2; j++) {
+ for(i = 0; i < 3; i++)
+ for(j = 0; j < 2; j++) {
int l;
+
buf52[i][j].p = malloc((i + 1) * sizeof(int));
buf52[i][j].len = i + 1;
- for (l = 0; l < i + 1; l++)
- ((int *)buf52[i][j].p)[l] = n++;
+ for(l = 0; l < i + 1; l++)
+ ((int *)buf52[i][j].p)[l] = n++;
}
- }
- sid = H5Screate_simple(2,dims2,NULL);
+ sid = H5Screate_simple(2, dims2, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- did = H5Dcreate(loc_id,"vlen2D",tid,sid,H5P_DEFAULT);
- status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf52);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf52);
- assert(status>=0);
+ did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -3889,7 +3890,7 @@ static void write_dset_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL);
- write_dset(loc_id,2,dims2,"array2D",tid,buf62);
+ write_dset(loc_id, 2, dims2, "array2D", tid, buf62);
status = H5Tclose(tid);
/*-------------------------------------------------------------------------
@@ -3898,9 +3899,9 @@ static void write_dset_in(hid_t loc_id,
*/
plist_id = H5Pcreate(H5P_DATASET_CREATE);
status = H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue);
- sid = H5Screate_simple(2,dims2,NULL);
- did = H5Dcreate(loc_id,"integer2D",H5T_NATIVE_INT,sid,plist_id);
- status = H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf72);
+ sid = H5Screate_simple(2, dims2, NULL);
+ did = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, sid, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ status = H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72);
status = H5Pclose(plist_id);
status = H5Dclose(did);
status = H5Sclose(sid);
@@ -3910,7 +3911,7 @@ static void write_dset_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
- write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82);
+ write_dset(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82);
/*-------------------------------------------------------------------------
@@ -3933,9 +3934,9 @@ static void write_dset_in(hid_t loc_id,
*/
n=1;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ for(i = 0; i < 4; i++) {
+ for(j = 0; j < 3; j++) {
+ for(k = 0; k < 2; k++) {
buf23[i][j][k]=n++;
}
}
@@ -3959,9 +3960,9 @@ static void write_dset_in(hid_t loc_id,
*/
n=1;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ for(i = 0; i < 4; i++) {
+ for(j = 0; j < 3; j++) {
+ for(k = 0; k < 2; k++) {
buf33[i][j][k].a=n++;
buf33[i][j][k].b=n++;
}
@@ -3978,11 +3979,11 @@ static void write_dset_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
/* Create references to dataset */
- if (dset_name)
+ if(dset_name)
{
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++)
+ for(i = 0; i < 4; i++) {
+ for(j = 0; j < 3; j++) {
+ for(k = 0; k < 2; k++)
status=H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1);
}
}
@@ -4005,26 +4006,25 @@ static void write_dset_in(hid_t loc_id,
*/
/* Allocate and initialize VL dataset to write */
- n=0;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ n = 0;
+ for(i = 0; i < 4; i++)
+ for(j = 0; j < 3; j++)
+ for(k = 0; k < 2; k++) {
int l;
+
buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
buf53[i][j][k].len = i + 1;
- for (l = 0; l < i + 1; l++)
- ((int *)buf53[i][j][k].p)[l] = n++;
+ for(l = 0; l < i + 1; l++)
+ ((int *)buf53[i][j][k].p)[l] = n++;
}
- }
- }
- sid = H5Screate_simple(3,dims3,NULL);
+ sid = H5Screate_simple(3, dims3, NULL);
tid = H5Tvlen_create(H5T_NATIVE_INT);
- did = H5Dcreate(loc_id,"vlen3D",tid,sid,H5P_DEFAULT);
- status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf53);
- assert(status>=0);
- status = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf53);
- assert(status>=0);
+ did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
status = H5Sclose(sid);
@@ -4034,8 +4034,8 @@ static void write_dset_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
n=1;
- for (i = 0; i < 24; i++) {
- for (j = 0; j < (int)dimarray[0]; j++) {
+ for(i = 0; i < 24; i++) {
+ for(j = 0; j < (int)dimarray[0]; j++) {
buf63[i][j]=n++;
}
}
@@ -4049,9 +4049,9 @@ static void write_dset_in(hid_t loc_id,
*-------------------------------------------------------------------------
*/
n=1; f=1;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ for(i = 0; i < 4; i++) {
+ for(j = 0; j < 3; j++) {
+ for(k = 0; k < 2; k++) {
buf73[i][j][k]=n++;
buf83[i][j][k]=f++;
}
@@ -4086,17 +4086,17 @@ static void gent_attr_all(void)
hid_t group2_id;
hid_t root_id;
hid_t sid;
- hsize_t dims[1]={2};
+ hsize_t dims[1] = {2};
herr_t status;
/* Create a file and a dataset */
- fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
/* Create a 1D dataset */
sid = H5Screate_simple(1,dims,NULL);
- did = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,H5P_DEFAULT);
- status = H5Sclose(sid);
- assert(status>=0);
+ did = H5Dcreate2(fid, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Sclose(sid);
+ assert(status >= 0);
/* Create groups */
group_id = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
@@ -4121,17 +4121,17 @@ static void gent_attr_all(void)
/* Close */
status = H5Dclose(did);
- assert(status>=0);
+ assert(status >= 0);
status = H5Gclose(group_id);
- assert(status>=0);
+ assert(status >= 0);
status = H5Gclose(group2_id);
- assert(status>=0);
+ assert(status >= 0);
status = H5Gclose(root_id);
- assert(status>=0);
+ assert(status >= 0);
/* Close file */
status = H5Fclose(fid);
- assert(status>=0);
+ assert(status >= 0);
}
@@ -4190,26 +4190,25 @@ static
int write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name,
hid_t tid, void *buf )
{
- hid_t did;
- hid_t sid;
- herr_t status;
-
- /* Create a buf space */
- sid = H5Screate_simple(rank,dims,NULL);
+ hid_t did;
+ hid_t sid;
+ herr_t status;
- /* Create a dataset */
- did = H5Dcreate(loc_id,dset_name,tid,sid,H5P_DEFAULT);
+ /* Create a buf space */
+ sid = H5Screate_simple(rank, dims, NULL);
- /* Write the buf */
- if ( buf )
- status = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf);
+ /* Create a dataset */
+ did = H5Dcreate2(loc_id, dset_name, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- /* Close */
- status = H5Dclose(did);
- status = H5Sclose(sid);
+ /* Write the buf */
+ if(buf)
+ status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
- return status;
+ /* Close */
+ status = H5Dclose(did);
+ status = H5Sclose(sid);
+ return status;
}
@@ -4256,26 +4255,26 @@ static void gent_compound_complex(void)
int m, n, o; /* Array init loop vars */
/* Initialize the data in the arrays/datastructure */
- for (m = 0; m< F41_LENGTH; m++) {
+ for(m = 0; m< F41_LENGTH; m++) {
Array1[m].a = m;
- for (n = 0; n < F41_DIMb; n++) {
+ for(n = 0; n < F41_DIMb; n++) {
Array1[m].b[n] = quote[n];
}
- for (n = 0; n < F41_ARRAY_DIMc; n++) {
+ for(n = 0; n < F41_ARRAY_DIMc; n++) {
Array1[m].c[n] = chararray[n];
}
- for (n = 0; n < F41_ARRAY_DIMd1; n++) {
- for (o = 0; o < F41_ARRAY_DIMd2; o++){
+ for(n = 0; n < F41_ARRAY_DIMd1; n++) {
+ for(o = 0; o < F41_ARRAY_DIMd2; o++){
Array1[m].d[n][o] = m + n + o;
}
}
Array1[m].e = (float)( m * .96 );
- for (n = 0; n < F41_ARRAY_DIMf; n++) {
+ for(n = 0; n < F41_ARRAY_DIMf; n++) {
Array1[m].f[n] = ( m * 1024.9637 );
}
@@ -4284,110 +4283,110 @@ static void gent_compound_complex(void)
/* Create the dataspace */
dataspace = H5Screate_simple(F41_RANK, dim, NULL);
- assert (dataspace >= 0);
+ assert(dataspace >= 0);
/* Create the file */
datafile = H5Fcreate(FILE41, H5F_ACC_TRUNC, H5P_DEFAULT,
H5P_DEFAULT);
- assert (datafile >= 0);
+ assert(datafile >= 0);
/* Copy the array data type for the string array */
array_tid = H5Tcopy (H5T_C_S1);
- assert (array_tid >= 0);
+ assert(array_tid >= 0);
/* Set the string array size to Variable */
status = H5Tset_size (array_tid,H5T_VARIABLE);
- assert (status >= 0);
+ assert(status >= 0);
/* Create the array data type for the string array */
str_array_id = H5Tarray_create(array_tid, F41_ARRAY_RANK, array_dimb, NULL);
- assert (str_array_id >= 0);
+ assert(str_array_id >= 0);
/* Copy the array data type for the character array */
array1_tid = H5Tcopy (H5T_C_S1);
- assert (array1_tid >= 0);
+ assert(array1_tid >= 0);
/* Set the character array size */
status = H5Tset_size (array1_tid, F41_ARRAY_DIMc);
- assert (status >= 0);
+ assert(status >= 0);
/* Create the array data type for the character array */
array2_tid = H5Tarray_create(H5T_NATIVE_SHORT, F41_ARRAY_RANKd, array_dimd, NULL);
- assert (array2_tid >= 0);
+ assert(array2_tid >= 0);
/* Create the array data type for the character array */
array4_tid = H5Tarray_create(H5T_NATIVE_DOUBLE, F41_ARRAY_RANK, array_dimf, NULL);
- assert (array4_tid >= 0);
+ assert(array4_tid >= 0);
/* Create the memory data type */
Array1Structid = H5Tcreate (H5T_COMPOUND, sizeof(Array1Struct));
- assert (Array1Structid >= 0);
+ assert(Array1Structid >= 0);
/* Insert the arrays and variables into the structure */
status = H5Tinsert(Array1Structid, "a_name",
HOFFSET(Array1Struct, a), H5T_NATIVE_INT);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tinsert(Array1Structid, "b_name",
HOFFSET(Array1Struct, b), str_array_id);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tinsert(Array1Structid, "c_name",
HOFFSET(Array1Struct, c), array1_tid);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tinsert(Array1Structid, "d_name",
HOFFSET(Array1Struct, d), array2_tid);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tinsert(Array1Structid, "e_name",
HOFFSET(Array1Struct, e), H5T_NATIVE_FLOAT);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tinsert(Array1Structid, "f_name",
HOFFSET(Array1Struct, f), array4_tid);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tinsert(Array1Structid, "g_name",
HOFFSET(Array1Struct, g), H5T_NATIVE_CHAR);
- assert (status >= 0);
+ assert(status >= 0);
/* Create the dataset */
- dataset = H5Dcreate(datafile, F41_DATASETNAME, Array1Structid,
- dataspace, H5P_DEFAULT);
+ dataset = H5Dcreate2(datafile, F41_DATASETNAME, Array1Structid,
+ dataspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Write data to the dataset */
status = H5Dwrite(dataset, Array1Structid, H5S_ALL, H5S_ALL,
H5P_DEFAULT, Array1);
- assert (status >= 0);
+ assert(status >= 0);
/* Release resources */
status = H5Tclose(Array1Structid);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tclose(array_tid);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tclose(array1_tid);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tclose(array2_tid);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tclose(array4_tid);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Tclose(str_array_id);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Sclose(dataspace);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Dclose(dataset);
- assert (status >= 0);
+ assert(status >= 0);
status = H5Fclose(datafile);
- assert (status >= 0);
+ assert(status >= 0);
}
@@ -4437,7 +4436,7 @@ static void gent_named_dtype_attr(void)
*/
/* Create dataset */
- did = H5Dcreate(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT);
+ did = H5Dcreate2(fid, F42_DSETNAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
assert(did > 0);
/* Create attribute on dataset */
@@ -4471,24 +4470,24 @@ static void gent_named_dtype_attr(void)
*/
/* Close attribute */
- ret=H5Aclose(aid);
- assert(ret>=0);
+ ret = H5Aclose(aid);
+ assert(ret >= 0);
/* Close dataset */
- ret=H5Dclose(did);
- assert(ret>=0);
+ ret = H5Dclose(did);
+ assert(ret >= 0);
/* Close dataspace */
- ret=H5Sclose(sid);
- assert(ret>=0);
+ ret = H5Sclose(sid);
+ assert(ret >= 0);
/* Close datatype */
- ret=H5Tclose(tid);
- assert(ret>=0);
+ ret = H5Tclose(tid);
+ assert(ret >= 0);
/* Close file */
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
}
@@ -4511,7 +4510,7 @@ static void gent_null_space(void)
space = H5Screate(H5S_NULL);
/* dataset */
- dataset = H5Dcreate(fid, "dset", H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(fid, "dset", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* nothing should be written */
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf);
@@ -4543,26 +4542,27 @@ int make_dset(hid_t loc_id,
hid_t dcpl,
void *buf)
{
- hid_t dsid;
+ hid_t dsid;
- /* create the dataset */
- if((dsid = H5Dcreate (loc_id,name,tid,sid,dcpl))<0)
- return -1;
+ /* create the dataset */
+ if((dsid = H5Dcreate2(loc_id, name, tid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ return -1;
- /* write */
- if(H5Dwrite(dsid,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
- goto out;
+ /* write */
+ if(H5Dwrite(dsid, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto out;
- /* close */
- if(H5Dclose(dsid)<0)
- return -1;
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ return -1;
- return 0;
- out:
- H5E_BEGIN_TRY {
- H5Dclose(dsid);
- } H5E_END_TRY;
- return -1;
+ return 0;
+
+out:
+ H5E_BEGIN_TRY {
+ H5Dclose(dsid);
+ } H5E_END_TRY;
+ return -1;
}
@@ -4588,27 +4588,27 @@ make_external(hid_t fid)
cur_size[0] = max_size[0] = 100;
size = (max_size[0]*sizeof(int)/2);
- dcpl=H5Pcreate(H5P_DATASET_CREATE);
- ret=H5Pset_external(dcpl,"ext1.bin",(off_t)0,size);
- assert(ret>=0);
+ dcpl = H5Pcreate(H5P_DATASET_CREATE);
+ ret = H5Pset_external(dcpl, "ext1.bin", (off_t)0, size);
+ assert(ret >= 0);
- ret=H5Pset_external(dcpl,"ext2.bin",(off_t)0,size);
- assert(ret>=0);
+ ret = H5Pset_external(dcpl, "ext2.bin", (off_t)0, size);
+ assert(ret >= 0);
- sid=H5Screate_simple(1, cur_size, max_size);
- assert(ret>=0);
+ sid = H5Screate_simple(1, cur_size, max_size);
+ assert(ret >= 0);
- dsid=H5Dcreate(fid, "external", H5T_NATIVE_INT, sid, dcpl);
- assert(ret>=0);
+ dsid = H5Dcreate2(fid, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ assert(ret >= 0);
H5Dclose(dsid);
- assert(ret>=0);
+ assert(ret >= 0);
H5Sclose(sid);
- assert(ret>=0);
+ assert(ret >= 0);
H5Pclose(dcpl);
- assert(ret>=0);
+ assert(ret >= 0);
}
/*-------------------------------------------------------------------------
@@ -4633,8 +4633,8 @@ static void gent_filters(void)
int buf1[DIM1][DIM2];
int i, j, n, ret;
- for (i=n=0; i<DIM1; i++){
- for (j=0; j<DIM2; j++){
+ for(i=n=0; i<DIM1; i++){
+ for(j=0; j<DIM2; j++){
buf1[i][j]=n++;
}
}
@@ -4654,32 +4654,32 @@ static void gent_filters(void)
* add a comment to the datasets
*-------------------------------------------------------------------------
*/
- ret=H5Pset_layout(dcpl, H5D_COMPACT);
- assert(ret>=0);
+ ret = H5Pset_layout(dcpl, H5D_COMPACT);
+ assert(ret >= 0);
ret=make_dset(fid,"compact",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Oset_comment(fid, "compact", "This is a dataset with compact storage", H5P_DEFAULT);
assert(ret >= 0);
- ret=H5Pset_layout(dcpl, H5D_CONTIGUOUS);
- assert(ret>=0);
+ ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS);
+ assert(ret >= 0);
ret=make_dset(fid,"contiguous",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Oset_comment(fid, "contiguous", "This is a dataset with contiguous storage", H5P_DEFAULT);
assert(ret >= 0);
- ret=H5Pset_layout(dcpl, H5D_CHUNKED);
- assert(ret>=0);
+ ret = H5Pset_layout(dcpl, H5D_CHUNKED);
+ assert(ret >= 0);
- ret=H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims);
- assert(ret>=0);
+ ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims);
+ assert(ret >= 0);
ret=make_dset(fid,"chunked",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Oset_comment(fid, "chunked", "This is a dataset with chunked storage", H5P_DEFAULT);
assert(ret >= 0);
@@ -4690,25 +4690,25 @@ static void gent_filters(void)
*/
/* set up chunk */
- ret=H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims);
- assert(ret>=0);
+ ret = H5Pset_chunk(dcpl, SPACE2_RANK, chunk_dims);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* SZIP
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_FILTER_SZIP
- if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
+ if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
/* set szip data */
- ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
- assert(ret>=0);
+ ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
+ assert(ret >= 0);
ret=make_dset(fid,"szip",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
}
#endif /* H5_HAVE_FILTER_SZIP */
@@ -4718,15 +4718,15 @@ static void gent_filters(void)
*/
#if defined (H5_HAVE_FILTER_DEFLATE)
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
/* set deflate data */
- ret=H5Pset_deflate(dcpl, 9);
- assert(ret>=0);
+ ret = H5Pset_deflate(dcpl, 9);
+ assert(ret >= 0);
ret=make_dset(fid,"deflate",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
#endif
@@ -4736,15 +4736,15 @@ static void gent_filters(void)
*/
#if defined (H5_HAVE_FILTER_SHUFFLE)
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
/* set the shuffle filter */
- ret=H5Pset_shuffle(dcpl);
- assert(ret>=0);
+ ret = H5Pset_shuffle(dcpl);
+ assert(ret >= 0);
ret=make_dset(fid,"shuffle",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
#endif
@@ -4754,15 +4754,15 @@ static void gent_filters(void)
*/
#if defined (H5_HAVE_FILTER_FLETCHER32)
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
/* set the checksum filter */
- ret=H5Pset_fletcher32(dcpl);
- assert(ret>=0);
+ ret = H5Pset_fletcher32(dcpl);
+ assert(ret >= 0);
ret=make_dset(fid,"fletcher32",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
#endif
/*-------------------------------------------------------------------------
@@ -4771,17 +4771,17 @@ static void gent_filters(void)
*/
#if defined (H5_HAVE_FILTER_NBIT)
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
/* set the checksum filter */
- ret=H5Pset_nbit(dcpl);
- assert(ret>=0);
+ ret = H5Pset_nbit(dcpl);
+ assert(ret >= 0);
tid=H5Tcopy(H5T_NATIVE_INT);
H5Tset_precision(tid,H5Tget_size(tid)-1);
ret=make_dset(fid,"nbit",sid,tid,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
#endif
/*-------------------------------------------------------------------------
@@ -4790,15 +4790,15 @@ static void gent_filters(void)
*/
#if defined (H5_HAVE_FILTER_SCALEOFFSET)
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
/* set the scaleoffset filter */
- ret=H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT));
- assert(ret>=0);
+ ret = H5Pset_scaleoffset(dcpl,H5Z_SO_INT,(int)H5Tget_size(H5T_NATIVE_INT));
+ assert(ret >= 0);
ret=make_dset(fid,"scaleoffset",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
#endif
/*-------------------------------------------------------------------------
@@ -4806,44 +4806,44 @@ static void gent_filters(void)
*-------------------------------------------------------------------------
*/
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
#if defined (H5_HAVE_FILTER_SHUFFLE)
/* set the shuffle filter */
- ret=H5Pset_shuffle(dcpl);
- assert(ret>=0);
+ ret = H5Pset_shuffle(dcpl);
+ assert(ret >= 0);
#endif
#ifdef H5_HAVE_FILTER_SZIP
- if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
+ if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK;
/* set szip data */
- ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
- assert(ret>=0);
+ ret = H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
+ assert(ret >= 0);
}
#endif /* H5_HAVE_FILTER_SZIP */
#if defined (H5_HAVE_FILTER_DEFLATE)
/* set deflate data */
- ret=H5Pset_deflate(dcpl, 5);
- assert(ret>=0);
+ ret = H5Pset_deflate(dcpl, 5);
+ assert(ret >= 0);
#endif
#if defined (H5_HAVE_FILTER_FLETCHER32)
/* set the checksum filter */
- ret=H5Pset_fletcher32(dcpl);
- assert(ret>=0);
+ ret = H5Pset_fletcher32(dcpl);
+ assert(ret >= 0);
#endif
#if defined (H5_HAVE_FILTER_NBIT)
/* set the nbit filter */
- ret=H5Pset_nbit(dcpl);
- assert(ret>=0);
+ ret = H5Pset_nbit(dcpl);
+ assert(ret >= 0);
#endif
ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
@@ -4851,21 +4851,21 @@ static void gent_filters(void)
*-------------------------------------------------------------------------
*/
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
- ret=H5Zregister (H5Z_MYFILTER);
- assert(ret>=0);
+ ret = H5Zregister (H5Z_MYFILTER);
+ assert(ret >= 0);
- ret=H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL);
- assert(ret>=0);
+ ret = H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL);
+ assert(ret >= 0);
ret=make_dset(fid,"myfilter",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
/* remove the filters from the dcpl */
- ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
- assert(ret>=0);
+ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* make an external dataset
@@ -4877,28 +4877,28 @@ static void gent_filters(void)
* H5D_ALLOC_TIME_EARLY
*-------------------------------------------------------------------------
*/
- ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
- assert(ret>=0);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY);
+ assert(ret >= 0);
ret=make_dset(fid,"alloc_time_early",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* H5D_ALLOC_TIME_INCR
*-------------------------------------------------------------------------
*/
- ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR);
- assert(ret>=0);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR);
+ assert(ret >= 0);
ret=make_dset(fid,"alloc_time_incr",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* H5D_ALLOC_TIME_LATE
*-------------------------------------------------------------------------
*/
- ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
- assert(ret>=0);
+ ret = H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE);
+ assert(ret >= 0);
ret=make_dset(fid,"alloc_time_late",sid,H5T_NATIVE_INT,dcpl,buf1);
- assert(ret>=0);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* commit a H5G_TYPE type with a comment
@@ -4911,21 +4911,21 @@ static void gent_filters(void)
ret = H5Oset_comment(fid, "mytype", "This is a commited datatype", H5P_DEFAULT);
assert(ret >= 0);
- ret=H5Tclose(tid);
- assert(ret>=0);
+ ret = H5Tclose(tid);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
- ret=H5Sclose(sid);
- assert(ret>=0);
+ ret = H5Sclose(sid);
+ assert(ret >= 0);
- ret=H5Pclose(dcpl);
- assert(ret>=0);
+ ret = H5Pclose(dcpl);
+ assert(ret >= 0);
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
}
@@ -4962,16 +4962,16 @@ set_local_myfilter(hid_t dcpl_id, hid_t UNUSED tid, hid_t UNUSED sid)
/* Get the filter's current parameters */
#ifdef H5_WANT_H5_V1_6_COMPAT
- if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL)<0)
+ if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL) < 0)
#else
- if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL,NULL)<0)
+ if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL,NULL) < 0)
#endif /* H5_WANT_H5_V1_6_COMPAT */
return(FAIL);
cd_nelmts=2;
/* Modify the filter's parameters for this dataset */
- if(H5Pmodify_filter(dcpl_id,MYFILTER_ID,flags, cd_nelmts,cd_values)<0)
+ if(H5Pmodify_filter(dcpl_id,MYFILTER_ID,flags, cd_nelmts,cd_values) < 0)
return(FAIL);
return(SUCCEED);
@@ -5027,31 +5027,31 @@ static void gent_fcontents(void)
/* hard link to "dset" */
- ret=H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT);
- assert(ret>=0);
+ ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset3", H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
/* hard link to "dset" */
- ret=H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT);
- assert(ret>=0);
+ ret = H5Lcreate_hard(fid, "/dset", H5L_SAME_LOC, "dset4", H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
/* soft link to itself */
- ret=H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT);
- assert(ret>=0);
+ ret = H5Lcreate_soft("mylink", fid, "mylink", H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
/* soft link to "dset" */
- ret=H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT);
- assert(ret>=0);
+ ret = H5Lcreate_soft("/dset", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
/* dangling external link */
- ret=H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT);
- assert(ret>=0);
+ ret = H5Lcreate_external("fname", "oname", fid, "extlink", H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
/* dangling udlink */
- ret=H5Lcreate_ud(fid, "udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT);
- assert(ret>=0);
+ ret = H5Lcreate_ud(fid, "udlink", MY_LINKCLASS, NULL, 0, H5P_DEFAULT, H5P_DEFAULT);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* datatypes
@@ -5081,8 +5081,8 @@ static void gent_fcontents(void)
*/
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
/* create a file for the bootblock test */
@@ -5090,8 +5090,8 @@ static void gent_fcontents(void)
assert(fid>=0);
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
}
/*-------------------------------------------------------------------------
@@ -5142,43 +5142,43 @@ static void gent_fvalues(void)
* H5D_FILL_TIME_IFSET
*-------------------------------------------------------------------------
*/
- ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET);
- assert(ret>=0);
+ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_IFSET);
+ assert(ret >= 0);
- ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1);
- assert(ret>=0);
+ ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1);
+ assert(ret >= 0);
ret=make_dset(fid,"fill_time_ifset",sid,H5T_NATIVE_INT,dcpl,buf);
- assert(ret>=0);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* H5D_FILL_TIME_NEVER
*-------------------------------------------------------------------------
*/
- ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
- assert(ret>=0);
+ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_NEVER);
+ assert(ret >= 0);
- ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1);
- assert(ret>=0);
+ ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1);
+ assert(ret >= 0);
ret=make_dset(fid,"fill_time_never",sid,H5T_NATIVE_INT,dcpl,buf);
- assert(ret>=0);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* H5D_FILL_TIME_ALLOC
*-------------------------------------------------------------------------
*/
- ret=H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC);
- assert(ret>=0);
+ ret = H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC);
+ assert(ret >= 0);
- ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1);
- assert(ret>=0);
+ ret = H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1);
+ assert(ret >= 0);
ret=make_dset(fid,"fill_time_alloc",sid,H5T_NATIVE_INT,dcpl,buf);
- assert(ret>=0);
+ assert(ret >= 0);
- ret=H5Pclose(dcpl);
- assert(ret>=0);
+ ret = H5Pclose(dcpl);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* dataset with no fill value
@@ -5194,14 +5194,14 @@ static void gent_fvalues(void)
tid = H5Tcreate (H5T_COMPOUND, sizeof(c_t));
H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_CHAR);
H5Tinsert(tid, "b", HOFFSET(c_t, b), H5T_NATIVE_DOUBLE);
- ret=H5Pset_fill_value(dcpl, tid, &fillval2);
- assert(ret>=0);
+ ret = H5Pset_fill_value(dcpl, tid, &fillval2);
+ assert(ret >= 0);
ret=make_dset(fid,"fill_compound",sid,tid,dcpl,buf2);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid);
- assert(ret>=0);
- ret=H5Pclose(dcpl);
- assert(ret>=0);
+ assert(ret >= 0);
+ ret = H5Pclose(dcpl);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* dataset with a H5T_VLEN fill value
@@ -5211,26 +5211,26 @@ static void gent_fvalues(void)
buf3[0].p = malloc( 1 * sizeof(int));
((int *)buf3[0].p)[0]=1;
buf3[1].len = 2;
- buf3[1].p = malloc( 2 * sizeof(int));
- ((int *)buf3[1].p)[0]=2;
- ((int *)buf3[1].p)[1]=3;
+ buf3[1].p = malloc(2 * sizeof(int));
+ ((int *)buf3[1].p)[0] = 2;
+ ((int *)buf3[1].p)[1] = 3;
tid = H5Tvlen_create(H5T_NATIVE_INT);
dcpl = H5Pcreate(H5P_DATASET_CREATE);
fillval3.p=NULL; fillval3.len=0;
ret = H5Pset_fill_value(dcpl, tid, &fillval3);
- assert(ret>=0);
+ assert(ret >= 0);
- did = H5Dcreate(fid,"fill_vlen",tid,sid,H5P_DEFAULT);
- ret = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf3);
- assert(ret>=0);
- ret = H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf3);
- assert(ret>=0);
+ did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3);
+ assert(ret >= 0);
+ ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf3);
+ assert(ret >= 0);
ret = H5Dclose(did);
ret = H5Tclose(tid);
ret = H5Pclose(dcpl);
- assert(ret>=0);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* dataset with a H5T_ARRAY fill value
@@ -5245,10 +5245,10 @@ static void gent_fvalues(void)
* close
*-------------------------------------------------------------------------
*/
- ret=H5Sclose(sid);
- assert(ret>=0);
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Sclose(sid);
+ assert(ret >= 0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
}
@@ -5299,30 +5299,30 @@ static void gent_string(void)
*/
tid=H5Tcopy(H5T_C_S1);
- ret=H5Tset_size(tid, sizeof(buf1));
- assert(ret>=0);
+ ret = H5Tset_size(tid, sizeof(buf1));
+ assert(ret >= 0);
write_dset(fid,1,dims1,"str1",tid,buf1);
- assert(ret>=0);
- ret=H5Tclose(tid);
- assert(ret>=0);
+ assert(ret >= 0);
+ ret = H5Tclose(tid);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* str2
*-------------------------------------------------------------------------
*/
sid = H5Screate_simple(SPACE1_RANK, dims2, NULL);
- tid = H5Tcopy (H5T_C_S1);
- ret = H5Tset_size (tid,H5T_VARIABLE);
- assert(ret>=0);
- did = H5Dcreate(fid,"str2",tid,sid,H5P_DEFAULT);
- ret = H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf2);
- assert(ret>=0);
- ret=H5Tclose(tid);
- assert(ret>=0);
- ret=H5Dclose(did);
- assert(ret>=0);
- ret=H5Sclose(sid);
- assert(ret>=0);
+ tid = H5Tcopy(H5T_C_S1);
+ ret = H5Tset_size(tid, H5T_VARIABLE);
+ assert(ret >= 0);
+ did = H5Dcreate2(fid, "str2", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2);
+ assert(ret >= 0);
+ ret = H5Tclose(tid);
+ assert(ret >= 0);
+ ret = H5Dclose(did);
+ assert(ret >= 0);
+ ret = H5Sclose(sid);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* str3
@@ -5335,13 +5335,13 @@ static void gent_string(void)
H5Tinsert(tid, "a", HOFFSET(c_t, a), H5T_NATIVE_INT);
H5Tinsert(tid, "str", HOFFSET(c_t, str), str_tid );
ret=make_dset(fid,"str3",sid,tid,H5P_DEFAULT,&buf3);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(tid);
- assert(ret>=0);
+ assert(ret >= 0);
ret = H5Tclose(str_tid);
- assert(ret>=0);
- ret=H5Sclose(sid);
- assert(ret>=0);
+ assert(ret >= 0);
+ ret = H5Sclose(sid);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* str4
@@ -5349,15 +5349,15 @@ static void gent_string(void)
*/
sid = H5Screate_simple(SPACE1_RANK, dims4, NULL);
ret=make_dset(fid,"str4",sid,H5T_NATIVE_CHAR,H5P_DEFAULT,buf4);
- ret=H5Sclose(sid);
- assert(ret>=0);
+ ret = H5Sclose(sid);
+ assert(ret >= 0);
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
}
@@ -5432,8 +5432,8 @@ static void gent_aindices(void)
* close
*-------------------------------------------------------------------------
*/
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
}
@@ -5505,31 +5505,31 @@ static int gent_ldouble(void)
hsize_t dims[1] = {3};
long double buf[3] = {1,2,3};
- if ((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
+ if((fid = H5Fcreate(FILE52, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- if ((sid = H5Screate_simple(1, dims, NULL))<0)
+ if((sid = H5Screate_simple(1, dims, NULL)) < 0)
goto error;
- if ((tid = H5Tcopy(H5T_NATIVE_LDOUBLE))<0)
+ if((tid = H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0)
goto error;
- if ((size = H5Tget_size(tid))==0)
+ if((size = H5Tget_size(tid)) == 0)
goto error;
- if ((did = H5Dcreate(fid, "dset", tid, sid, H5P_DEFAULT))<0)
+ if((did = H5Dcreate2(fid, "dset", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
- if (H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto error;
- if (H5Sclose(sid)<0)
+ if(H5Sclose(sid) < 0)
goto error;
- if (H5Tclose(tid)<0)
+ if(H5Tclose(tid) < 0)
goto error;
- if (H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto error;
- if (H5Fclose(fid)<0)
+ if(H5Fclose(fid) < 0)
goto error;
return 0;
@@ -5573,7 +5573,7 @@ gent_binary(void)
*-------------------------------------------------------------------------
*/
sid = H5Screate_simple(1, dims, NULL);
- did = H5Dcreate(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT);
+ did = H5Dcreate2(fid, "integer", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ibuf);
H5Dclose(did);
H5Sclose(sid);
@@ -5583,7 +5583,7 @@ gent_binary(void)
*-------------------------------------------------------------------------
*/
sid = H5Screate_simple(1, dims, NULL);
- did = H5Dcreate(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT);
+ did = H5Dcreate2(fid, "float", H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, fbuf);
H5Dclose(did);
H5Sclose(sid);
@@ -5594,7 +5594,7 @@ gent_binary(void)
*/
tid = H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL);
sid = H5Screate_simple(1, dimarray, NULL);
- did = H5Dcreate(fid, "array", tid, sid, H5P_DEFAULT);
+ did = H5Dcreate2(fid, "array", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, abuf);
H5Dclose(did);
H5Tclose(tid);
@@ -5605,10 +5605,9 @@ gent_binary(void)
*-------------------------------------------------------------------------
*/
sid = H5Screate_simple(1, dimsl, NULL);
- did = H5Dcreate(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT);
- dbuf=calloc(100000,sizeof(double));
- if (dbuf!=NULL)
- {
+ did = H5Dcreate2(fid, "double", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ dbuf = calloc(100000, sizeof(double));
+ if(dbuf != NULL) {
H5Dwrite(did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf);
free(dbuf);
}
@@ -5653,22 +5652,22 @@ gent_bigdims(void)
/* create a file */
fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- assert(fid>=0);
+ assert(fid >= 0);
/* create dataset */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue)<0)
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue) < 0)
goto out;
- if (H5Pset_chunk(dcpl, 1, chunk_dims)<0)
+ if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0)
goto out;
- if ((f_sid = H5Screate_simple(1,dims,NULL))<0)
+ if((f_sid = H5Screate_simple(1, dims, NULL)) < 0)
goto out;
- if ((did = H5Dcreate(fid,"dset4gb",H5T_NATIVE_SCHAR,f_sid,dcpl))<0)
+ if((did = H5Dcreate2(fid, "dset4gb", H5T_NATIVE_SCHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto out;
- if ((tid = H5Dget_type(did))<0)
+ if((tid = H5Dget_type(did)) < 0)
goto out;
- if ((size = H5Tget_size(tid))<=0)
+ if((size = H5Tget_size(tid)) <= 0)
goto out;
/* select an hyperslab */
@@ -5676,19 +5675,19 @@ gent_bigdims(void)
hs_start[0] = GB4LL - 10;
hs_size[0] = nelmts;
- if ((m_sid = H5Screate_simple(1, hs_size, hs_size))<0)
+ if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0)
goto out;
buf=(char *) malloc((unsigned)(nelmts*size));
- for (i=0, c=0; i<nelmts; i++, c++)
+ for(i=0, c=0; i<nelmts; i++, c++)
{
buf[i] = c;
}
- if (H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size,NULL)<0)
+ if(H5Sselect_hyperslab (f_sid,H5S_SELECT_SET,hs_start,NULL,hs_size,NULL) < 0)
goto out;
- if (H5Dwrite (did,H5T_NATIVE_SCHAR,m_sid,f_sid,H5P_DEFAULT,buf)<0)
+ if(H5Dwrite (did,H5T_NATIVE_SCHAR,m_sid,f_sid,H5P_DEFAULT,buf) < 0)
goto out;
@@ -5696,17 +5695,17 @@ gent_bigdims(void)
buf=NULL;
/* close */
- if(H5Sclose(f_sid)<0)
+ if(H5Sclose(f_sid) < 0)
goto out;
- if(H5Sclose(m_sid)<0)
+ if(H5Sclose(m_sid) < 0)
goto out;
- if(H5Pclose(dcpl)<0)
+ if(H5Pclose(dcpl) < 0)
goto out;
- if(H5Dclose(did)<0)
+ if(H5Dclose(did) < 0)
goto out;
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
return;
@@ -5741,7 +5740,7 @@ gent_hyperslab(void)
int i, ret;
buf = malloc(32 * 4097 * sizeof(double) );
- for (i = 0; i < 32 * 4097; i++)
+ for(i = 0; i < 32 * 4097; i++)
buf[i] = 1;
/* create a file */
@@ -5750,8 +5749,8 @@ gent_hyperslab(void)
write_dset(fid,2,dims,"stripmine",H5T_NATIVE_DOUBLE,buf);
- ret=H5Fclose(fid);
- assert(ret>=0);
+ ret = H5Fclose(fid);
+ assert(ret >= 0);
free(buf);
}
@@ -5772,13 +5771,13 @@ gent_group_creation_order(void)
hid_t gcpl_id; /* group creation property list ID */
hid_t fcpl_id; /* file creation property list ID (to set root group order) */
- if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ if((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0)
goto out;
- if (H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED ) < 0)
+ if(H5Pset_link_creation_order(fcpl_id, H5P_CRT_ORDER_TRACKED ) < 0)
goto out;
- if ((fid = H5Fcreate(FILE58, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0)
+ if((fid = H5Fcreate(FILE58, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT)) < 0)
goto out;
@@ -5792,40 +5791,40 @@ gent_group_creation_order(void)
*/
- if ((gid = H5Gcreate2(fid, "2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "2/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "2/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "2/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "2/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "2/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "2/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "2/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
@@ -5837,48 +5836,48 @@ gent_group_creation_order(void)
goto out;
- if ((gid = H5Gcreate2(fid, "1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "1/c", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "1/b", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "1/a", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "1/a/a2", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "1/a/a1", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "1/a/a2/a22", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if ((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "1/a/a2/a21", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
- if (H5Pclose(gcpl_id) < 0)
+ if(H5Pclose(gcpl_id) < 0)
goto out;
- if (H5Pclose(fcpl_id) < 0)
+ if(H5Pclose(fcpl_id) < 0)
goto out;
- if (H5Fclose(fid) < 0)
+ if(H5Fclose(fid) < 0)
goto out;
return;
@@ -5956,12 +5955,11 @@ gent_attr_creation_order(void)
*/
/* create a dataset */
- if((did = H5Dcreate(fid, "dset", H5T_NATIVE_UCHAR, sid, dcpl_id)) < 0)
+ if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
goto out;
/* add attributes */
- for(i = 0; i < 3; i++)
- {
+ for(i = 0; i < 3; i++) {
if((aid = H5Acreate2(did, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
@@ -5970,7 +5968,7 @@ gent_attr_creation_order(void)
goto out;
} /* end for */
- if (H5Dclose(did) < 0)
+ if(H5Dclose(did) < 0)
goto out;
@@ -5980,22 +5978,22 @@ gent_attr_creation_order(void)
*-------------------------------------------------------------------------
*/
- if ((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
+ if((gid = H5Gcreate2(fid, "g", H5P_DEFAULT, gcpl_id, H5P_DEFAULT)) < 0)
goto out;
/* add attributes */
for(i = 0; i < 3; i++)
{
- if ((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* close attribute */
- if (H5Aclose(aid) < 0)
+ if(H5Aclose(aid) < 0)
goto out;
} /* end for */
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
/*-------------------------------------------------------------------------
@@ -6003,25 +6001,25 @@ gent_attr_creation_order(void)
*-------------------------------------------------------------------------
*/
- if ((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
+ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
goto out;
- if ((H5Tcommit2(fid, "t", tid, H5P_DEFAULT, tcpl_id, H5P_DEFAULT)) < 0)
+ if((H5Tcommit2(fid, "t", tid, H5P_DEFAULT, tcpl_id, H5P_DEFAULT)) < 0)
goto out;
/* add attributes */
for(i = 0; i < 3; i++)
{
- if ((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(tid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* close attribute */
- if (H5Aclose(aid) < 0)
+ if(H5Aclose(aid) < 0)
goto out;
} /* end for */
- if (H5Tclose(tid) < 0)
+ if(H5Tclose(tid) < 0)
goto out;
/*-------------------------------------------------------------------------
* add some attributes to the root group
@@ -6033,16 +6031,16 @@ gent_attr_creation_order(void)
/* add attributes */
for(i = 0; i < 3; i++)
{
- if ((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ if((aid = H5Acreate2(gid, ".", attr_name[i], H5T_NATIVE_UCHAR, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
/* close attribute */
- if (H5Aclose(aid) < 0)
+ if(H5Aclose(aid) < 0)
goto out;
} /* end for */
- if (H5Gclose(gid) < 0)
+ if(H5Gclose(gid) < 0)
goto out;
@@ -6057,9 +6055,9 @@ gent_attr_creation_order(void)
goto out;
if(H5Pclose(gcpl_id) < 0)
goto out;
- if (H5Pclose(tcpl_id) < 0)
+ if(H5Pclose(tcpl_id) < 0)
goto out;
- if (H5Fclose(fid) < 0)
+ if(H5Fclose(fid) < 0)
goto out;
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 1babd9e..1424ac2 100755
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -871,26 +871,25 @@ processStrData(FILE **strm, struct Input *in, hid_t file_id)
/*enable error reporting */
} H5E_END_TRY;
- if (( space_id = H5Screate_simple(1,dims,NULL)) < 0 )
+ if((space_id = H5Screate_simple(1, dims, NULL)) < 0)
goto out;
- if (( mspace_id = H5Screate(H5S_SCALAR)) < 0 )
+ if((mspace_id = H5Screate(H5S_SCALAR)) < 0)
goto out;
- if (( dset_id = H5Dcreate(handle, in->path.group[j], type_id, space_id, H5P_DEFAULT)) < 0)
+ if((dset_id = H5Dcreate2(handle, in->path.group[j], type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
line = 0;
- while ( !feof( *strm ) )
- {
- c = fgetc( *strm );
+ while(!feof(*strm)) {
+ c = fgetc(*strm);
- str[ i ] = c;
+ str[i] = c;
i++;
- if ( c == 10 ) /* eol */
+ if(c == 10) /* eol */
{
char *str2 = str;
hid_t fspace_id;
@@ -2497,21 +2496,16 @@ process(struct Options *opt)
}
/* create dataspace */
- if (in->configOptionVector[EXTEND] == 1)
- {
+ if(in->configOptionVector[EXTEND] == 1)
dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, in->maxsizeOfDimension);
- }
else
- {
dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, NULL);
- }
/* disable error reporting */
H5E_BEGIN_TRY {
/* create data set */
- if ((dataset = H5Dcreate(handle, in->path.group[j], outtype, dataspace, proplist)) < 0)
- {
- (void) fprintf(stderr, err5);
+ if((dataset = H5Dcreate2(handle, in->path.group[j], outtype, dataspace, H5P_DEFAULT, proplist, H5P_DEFAULT)) < 0) {
+ (void)fprintf(stderr, err5);
H5Pclose(proplist);
H5Sclose(dataspace);
H5Fclose(file_id);
@@ -2522,8 +2516,7 @@ process(struct Options *opt)
} H5E_END_TRY;
/* write dataset */
- if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0)
- {
+ if(H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) {
(void) fprintf(stderr, err6);
H5Dclose(dataset);
H5Pclose(proplist);
diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c
index 846d300..06aaaf1 100644
--- a/tools/h5jam/h5jamgentest.c
+++ b/tools/h5jam/h5jamgentest.c
@@ -228,7 +228,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
/* dset1.1.1 */
dims[0] = 10; dims[1] = 10;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "dset1.1.1", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 10; i++)
for (j = 0; j < 10; j++)
dset1[i][j] = j*i;
@@ -257,7 +257,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
/* dset1.1.2 */
dims[0] = 20;
space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "dset1.1.2", H5T_STD_I32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 20; i++)
dset2[i] = i;
H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2);
@@ -279,7 +279,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
/* dset2.1 */
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
- dataset = H5Dcreate(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "dset2.1", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 10; i++)
dset2_1[i] = (float)(i*0.1+1);
H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1);
@@ -289,7 +289,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
/* dset2.2 */
dims[0] = 3; dims[1] = 5;
space = H5Screate_simple(2, dims, NULL);
- dataset = H5Dcreate(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT);
+ dataset = H5Dcreate2(group, "dset2.2", H5T_IEEE_F32BE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for (i = 0; i < 3; i++)
for (j = 0; j < 5; j++)
dset2_2[i][j] = (float)((i+1)*j*0.1);
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index fcb0854..b1417e1 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -529,13 +529,12 @@ int do_copy_objects(hid_t fidin,
*-------------------------------------------------------------------------
*/
H5E_BEGIN_TRY {
- dset_out=H5Dcreate(fidout,travt->objs[i].name,wtype_id,f_space_id,dcpl_out);
+ dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_out, H5P_DEFAULT);
} H5E_END_TRY;
- if (dset_out==FAIL)
- {
- if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,wtype_id,f_space_id,dcpl_id)) < 0)
+ if(dset_out == FAIL) {
+ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
goto error;
- apply_f=0;
+ apply_f = 0;
}
/*-------------------------------------------------------------------------
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index a1e9fb5..595c32d 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -204,7 +204,7 @@ int do_copy_refobjs(hid_t fidin,
* create/write dataset/close
*-------------------------------------------------------------------------
*/
- if((dset_out = H5Dcreate(fidout, travt->objs[i].name, mtype_id, space_id, dcpl_id)) < 0)
+ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
goto error;
if(nelmts)
if(H5Dwrite(dset_out, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, refbuf) < 0)
@@ -283,7 +283,7 @@ int do_copy_refobjs(hid_t fidin,
* create/write dataset/close
*-------------------------------------------------------------------------
*/
- if((dset_out = H5Dcreate(fidout, travt->objs[i].name, mtype_id, space_id, dcpl_id)) < 0)
+ if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
goto error;
if(nelmts)
if(H5Dwrite(dset_out, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, refbuf) < 0)
diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c
index 16ed995..59cbbf6 100644
--- a/tools/h5repack/h5repacktst.c
+++ b/tools/h5repack/h5repacktst.c
@@ -1595,8 +1595,8 @@ int make_all_objects(hid_t loc_id)
* H5G_DATASET
*-------------------------------------------------------------------------
*/
- space_id = H5Screate_simple(1,dims,NULL);
- dset_id = H5Dcreate(loc_id,"dset_referenced",H5T_NATIVE_INT,space_id,H5P_DEFAULT);
+ space_id = H5Screate_simple(1, dims, NULL);
+ dset_id = H5Dcreate2(loc_id, "dset_referenced", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Sclose(space_id);
/*-------------------------------------------------------------------------
@@ -1670,8 +1670,8 @@ int make_attributes(hid_t loc_id)
*-------------------------------------------------------------------------
*/
- space_id = H5Screate_simple(1,dims,NULL);
- dset_id = H5Dcreate(loc_id,"dset",H5T_NATIVE_INT,space_id,H5P_DEFAULT);
+ space_id = H5Screate_simple(1, dims, NULL);
+ dset_id = H5Dcreate2(loc_id, "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Sclose(space_id);
/*-------------------------------------------------------------------------
@@ -2065,42 +2065,36 @@ int make_nbit(hid_t loc_id)
goto out;
}
-#if defined (H5_HAVE_FILTER_NBIT)
+#if defined H5_HAVE_FILTER_NBIT
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
+ if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0)
{
H5Tclose(dtid);
goto out;
}
- if (H5Pset_nbit(dcpl) < 0)
- {
+ if(H5Pset_nbit(dcpl) < 0) {
H5Tclose(dtid);
goto out;
}
- if((dsid = H5Dcreate (loc_id,"dset_nbit",dtid,sid,dcpl)) < 0)
- {
+ if((dsid = H5Dcreate2(loc_id, "dset_nbit", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5Tclose(dtid);
goto out;
}
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
- {
+ if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
H5Tclose(dtid);
goto out;
}
H5Dclose(dsid);
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
- {
+ if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) {
H5Tclose(dtid);
goto out;
}
- if((dsid = H5Dcreate (loc_id,"dset_int31",dtid,sid,dcpl)) < 0)
- {
+ if((dsid = H5Dcreate2(loc_id, "dset_int31", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5Tclose(dtid);
goto out;
}
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
- {
+ if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
H5Tclose(dtid);
goto out;
}
@@ -2166,34 +2160,28 @@ int make_scaleoffset(hid_t loc_id)
#if defined (H5_HAVE_FILTER_SCALEOFFSET)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
- {
+ if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) {
H5Tclose(dtid);
goto out;
}
- if (H5Pset_scaleoffset(dcpl,H5Z_SO_INT,31) < 0)
- {
+ if(H5Pset_scaleoffset(dcpl, H5Z_SO_INT, 31) < 0) {
H5Tclose(dtid);
goto out;
}
- if((dsid = H5Dcreate (loc_id,"dset_scaleoffset",dtid,sid,dcpl)) < 0)
- {
+ if((dsid = H5Dcreate2(loc_id, "dset_scaleoffset", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) {
H5Tclose(dtid);
goto out;
}
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
- {
+ if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
H5Tclose(dtid);
goto out;
}
H5Dclose(dsid);
- if((dsid = H5Dcreate (loc_id,"dset_none",dtid,sid,H5P_DEFAULT)) < 0)
- {
+ if((dsid = H5Dcreate2(loc_id, "dset_none", dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5Tclose(dtid);
goto out;
}
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
- {
+ if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
H5Tclose(dtid);
goto out;
}
@@ -2369,16 +2357,16 @@ if (szip_can_encode) {
*/
#if defined (H5_HAVE_FILTER_NBIT)
/* remove the filters from the dcpl */
- if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0)
+ if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0)
goto out;
/* set the shuffle filter */
- if (H5Pset_nbit(dcpl) < 0)
+ if(H5Pset_nbit(dcpl) < 0)
goto out;
dtid = H5Tcopy(H5T_NATIVE_INT);
- H5Tset_precision(dtid,(H5Tget_precision(dtid)-1));
- if((dsid = H5Dcreate (loc_id,"dset_nbit",dtid,sid,dcpl)) < 0)
+ H5Tset_precision(dtid, (H5Tget_precision(dtid) - 1));
+ if((dsid = H5Dcreate2(loc_id, "dset_nbit", dtid, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto out;
- if(H5Dwrite(dsid,dtid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
+ if(H5Dwrite(dsid, dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto out;
/* close */
@@ -2446,7 +2434,7 @@ int make_early(void)
for(i = 0; i < iter; i++) {
if((fid = H5Fopen(FNAME5, H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto out;
- if((dset_id = H5Dcreate(fid, "early", H5T_NATIVE_DOUBLE, sid, dcpl)) < 0)
+ if((dset_id = H5Dcreate2(fid, "early", H5T_NATIVE_DOUBLE, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto out;
if((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
goto out;
@@ -2609,21 +2597,21 @@ int make_fill(hid_t loc_id)
hid_t dcpl;
hsize_t dims[2]={3,2};
int buf[3][2]= {{1,1},{1,2},{2,2}};
- int fillvalue=2;
+ int fillvalue = 2;
/*-------------------------------------------------------------------------
* H5T_INTEGER, write a fill value
*-------------------------------------------------------------------------
*/
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue) < 0)
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillvalue) < 0)
goto out;
- if ((sid = H5Screate_simple(2,dims,NULL)) < 0)
+ if((sid = H5Screate_simple(2,dims,NULL)) < 0)
goto out;
- if ((did = H5Dcreate(loc_id,"dset_fill",H5T_NATIVE_INT,sid,dcpl)) < 0)
+ if((did = H5Dcreate2(loc_id, "dset_fill", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto out;
- if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto out;
/* close */
@@ -2676,21 +2664,21 @@ int make_big(hid_t loc_id)
hs_size[0] = 1024;
/* create */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue) < 0)
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_SCHAR, &fillvalue) < 0)
goto out;
if(H5Pset_chunk(dcpl, 1, chunk_dims) < 0)
goto out;
- if ((f_sid = H5Screate_simple(1,dims,NULL)) < 0)
+ if((f_sid = H5Screate_simple(1,dims,NULL)) < 0)
goto out;
- if ((did = H5Dcreate(loc_id,"dset",H5T_NATIVE_SCHAR,f_sid,dcpl)) < 0)
+ if((did = H5Dcreate2(loc_id, "dset", H5T_NATIVE_SCHAR, f_sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto out;
- if ((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0)
+ if((m_sid = H5Screate_simple(1, hs_size, hs_size)) < 0)
goto out;
- if ((tid = H5Dget_type(did)) < 0)
+ if((tid = H5Dget_type(did)) < 0)
goto out;
- if ((size = H5Tget_size(tid))<=0)
+ if((size = H5Tget_size(tid))<=0)
goto out;
/* initialize buffer to 0 */
@@ -2750,15 +2738,15 @@ int make_external(hid_t loc_id)
size = max_size[0] * sizeof(int);
/* create */
- if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
goto out;
- if (H5Pset_external(dcpl, H5REPACK_EXTFILE, (off_t)0, size) < 0)
+ if(H5Pset_external(dcpl, H5REPACK_EXTFILE, (off_t)0, size) < 0)
goto out;
- if ((sid = H5Screate_simple(1,cur_size, max_size)) < 0)
+ if((sid = H5Screate_simple(1,cur_size, max_size)) < 0)
goto out;
- if ((did = H5Dcreate(loc_id,"external",H5T_NATIVE_INT,sid,dcpl)) < 0)
+ if((did = H5Dcreate2(loc_id, "external", H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
goto out;
- if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
goto out;
/* close */
@@ -3115,23 +3103,22 @@ void write_dset_in(hid_t loc_id,
((int *)buf5[0].p)[0]=1;
buf5[1].len = 2;
buf5[1].p = malloc( 2 * sizeof(int));
- ((int *)buf5[1].p)[0]=2;
- ((int *)buf5[1].p)[1]=3;
+ ((int *)buf5[1].p)[0] = 2;
+ ((int *)buf5[1].p)[1] = 3;
- if (make_diffs)
- {
- ((int *)buf5[0].p)[0]=0;
- ((int *)buf5[1].p)[0]=0;
- ((int *)buf5[1].p)[1]=0;
+ if(make_diffs) {
+ ((int *)buf5[0].p)[0] = 0;
+ ((int *)buf5[1].p)[0] = 0;
+ ((int *)buf5[1].p)[1] = 0;
}
- space_id = H5Screate_simple(1,dims,NULL);
+ space_id = H5Screate_simple(1, dims, NULL);
type_id = H5Tvlen_create(H5T_NATIVE_INT);
- dset_id = H5Dcreate(loc_id,"vlen",type_id,space_id,H5P_DEFAULT);
- status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf5);
- assert(status>=0);
- status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf5);
- assert(status>=0);
+ dset_id = H5Dcreate2(loc_id, "vlen", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf5);
+ assert(status >= 0);
status = H5Dclose(dset_id);
status = H5Tclose(type_id);
status = H5Sclose(space_id);
@@ -3261,25 +3248,27 @@ void write_dset_in(hid_t loc_id,
*/
/* Allocate and initialize VL dataset to write */
- n=0;
- for (i = 0; i < 3; i++) {
- for (j = 0; j < 2; j++) {
+ n = 0;
+ for(i = 0; i < 3; i++)
+ for(j = 0; j < 2; j++) {
int l;
+
buf52[i][j].p = malloc((i + 1) * sizeof(int));
buf52[i][j].len = i + 1;
- for (l = 0; l < i + 1; l++)
- if (make_diffs)((int *)buf52[i][j].p)[l] = 0;
- else ((int *)buf52[i][j].p)[l] = n++;
+ for(l = 0; l < i + 1; l++)
+ if(make_diffs)
+ ((int *)buf52[i][j].p)[l] = 0;
+ else
+ ((int *)buf52[i][j].p)[l] = n++;
}
- }
- space_id = H5Screate_simple(2,dims2,NULL);
+ space_id = H5Screate_simple(2, dims2, NULL);
type_id = H5Tvlen_create(H5T_NATIVE_INT);
- dset_id = H5Dcreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT);
- status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf52);
- assert(status>=0);
- status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf52);
- assert(status>=0);
+ dset_id = H5Dcreate2(loc_id, "vlen2D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf52);
+ assert(status >= 0);
status = H5Dclose(dset_id);
status = H5Tclose(type_id);
status = H5Sclose(space_id);
@@ -3305,17 +3294,16 @@ void write_dset_in(hid_t loc_id,
*/
- if (make_diffs)
- {
- memset(buf72,0,sizeof buf72);
- memset(buf82,0,sizeof buf82);
+ if(make_diffs) {
+ memset(buf72, 0, sizeof buf72);
+ memset(buf82, 0, sizeof buf82);
}
plist_id = H5Pcreate(H5P_DATASET_CREATE);
- space_id = H5Screate_simple(2,dims2,NULL);
- dset_id = H5Dcreate(loc_id,"integer2D",H5T_NATIVE_INT,space_id,plist_id);
- status = H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf72);
+ space_id = H5Screate_simple(2, dims2, NULL);
+ dset_id = H5Dcreate2(loc_id, "integer2D", H5T_NATIVE_INT, space_id, H5P_DEFAULT, plist_id, H5P_DEFAULT);
+ status = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf72);
status = H5Pclose(plist_id);
status = H5Dclose(dset_id);
status = H5Sclose(space_id);
@@ -3434,27 +3422,28 @@ void write_dset_in(hid_t loc_id,
*/
/* Allocate and initialize VL dataset to write */
- n=0;
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 3; j++) {
- for (k = 0; k < 2; k++) {
+ n = 0;
+ for(i = 0; i < 4; i++)
+ for(j = 0; j < 3; j++)
+ for(k = 0; k < 2; k++) {
int l;
+
buf53[i][j][k].p = malloc((i + 1) * sizeof(int));
buf53[i][j][k].len = i + 1;
- for (l = 0; l < i + 1; l++)
- if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0;
- else ((int *)buf53[i][j][k].p)[l] = n++;
+ for(l = 0; l < i + 1; l++)
+ if(make_diffs)
+ ((int *)buf53[i][j][k].p)[l] = 0;
+ else
+ ((int *)buf53[i][j][k].p)[l] = n++;
}
- }
- }
- space_id = H5Screate_simple(3,dims3,NULL);
+ space_id = H5Screate_simple(3, dims3, NULL);
type_id = H5Tvlen_create(H5T_NATIVE_INT);
- dset_id = H5Dcreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT);
- status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf53);
- assert(status>=0);
- status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf53);
- assert(status>=0);
+ dset_id = H5Dcreate2(loc_id, "vlen3D", type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ status = H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53);
+ assert(status >= 0);
+ status = H5Dvlen_reclaim(type_id, space_id, H5P_DEFAULT, buf53);
+ assert(status >= 0);
status = H5Dclose(dset_id);
status = H5Tclose(type_id);
status = H5Sclose(space_id);
@@ -3535,20 +3524,20 @@ void make_dset_reg_ref(hid_t loc_id)
herr_t ret; /* Generic return value */
/* Allocate write & read buffers */
- wbuf=(hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
- dwbuf=(int *)malloc(sizeof(int)*SPACE2_DIM1*SPACE2_DIM2);
+ wbuf = (hdset_reg_ref_t *)calloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1);
+ dwbuf = (int *)malloc(sizeof(int) * SPACE2_DIM1 * SPACE2_DIM2);
/* Create dataspace for datasets */
sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL);
/* Create a dataset */
- dset2=H5Dcreate(loc_id,"dsetreg",H5T_NATIVE_UCHAR,sid2,H5P_DEFAULT);
+ dset2 = H5Dcreate2(loc_id, "dsetreg", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- for(i=0; i<SPACE2_DIM1*SPACE2_DIM2; i++)
- dwbuf[i]=i*3;
+ for(i = 0; i < SPACE2_DIM1 * SPACE2_DIM2; i++)
+ dwbuf[i] = i * 3;
/* Write selection to disk */
- ret=H5Dwrite(dset2,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,dwbuf);
+ ret = H5Dwrite(dset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dwbuf);
/* Close Dataset */
ret = H5Dclose(dset2);
@@ -3557,19 +3546,19 @@ void make_dset_reg_ref(hid_t loc_id)
sid1 = H5Screate_simple(SPACE1_RANK, dims1, NULL);
/* Create a dataset */
- dset1=H5Dcreate(loc_id,"refreg",H5T_STD_REF_DSETREG,sid1,H5P_DEFAULT);
+ dset1 = H5Dcreate2(loc_id, "refreg", H5T_STD_REF_DSETREG, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
/* Create references */
/* Select 6x6 hyperslab for first reference */
- start[0]=2; start[1]=2;
- stride[0]=1; stride[1]=1;
- count[0]=6; count[1]=6;
- block[0]=1; block[1]=1;
- ret = H5Sselect_hyperslab(sid2,H5S_SELECT_SET,start,stride,count,block);
+ start[0] = 2; start[1] = 2;
+ stride[0] = 1; stride[1] = 1;
+ count[0] = 6; count[1] = 6;
+ block[0] = 1; block[1] = 1;
+ ret = H5Sselect_hyperslab(sid2, H5S_SELECT_SET, start, stride, count, block);
/* Store dataset region */
- ret = H5Rcreate(&wbuf[0],loc_id,"dsetreg",H5R_DATASET_REGION,sid2);
+ ret = H5Rcreate(&wbuf[0], loc_id, "dsetreg", H5R_DATASET_REGION, sid2);
/* Write selection to disk */
ret=H5Dwrite(dset1,H5T_STD_REF_DSETREG,H5S_ALL,H5S_ALL,H5P_DEFAULT,wbuf);
@@ -4614,26 +4603,27 @@ int make_dset(hid_t loc_id,
hid_t dcpl,
void *buf)
{
- hid_t dsid;
+ hid_t dsid;
- /* create the dataset */
- if((dsid = H5Dcreate (loc_id,name,H5T_NATIVE_INT,sid,dcpl)) < 0)
- return -1;
+ /* create the dataset */
+ if((dsid = H5Dcreate2(loc_id, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ return -1;
- /* write */
- if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
- goto out;
+ /* write */
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ goto out;
- /* close */
- if(H5Dclose(dsid) < 0)
- return -1;
+ /* close */
+ if(H5Dclose(dsid) < 0)
+ return -1;
- return 0;
- out:
- H5E_BEGIN_TRY {
- H5Dclose(dsid);
- } H5E_END_TRY;
- return -1;
+ return 0;
+
+out:
+ H5E_BEGIN_TRY {
+ H5Dclose(dsid);
+ } H5E_END_TRY;
+ return -1;
}
@@ -4656,30 +4646,29 @@ int write_dset( hid_t loc_id,
hid_t type_id,
void *buf )
{
- hid_t dset_id;
- hid_t space_id;
-
- /* Create a buf space */
- if ((space_id = H5Screate_simple(rank,dims,NULL)) < 0)
- return -1;
+ hid_t dset_id;
+ hid_t space_id;
- /* Create a dataset */
- if ((dset_id = H5Dcreate(loc_id,dset_name,type_id,space_id,H5P_DEFAULT)) < 0)
- return -1;
+ /* Create a buf space */
+ if((space_id = H5Screate_simple(rank, dims, NULL)) < 0)
+ return -1;
- /* Write the buf */
- if ( buf )
- if (H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0)
- return -1;
+ /* Create a dataset */
+ if((dset_id = H5Dcreate2(loc_id, dset_name, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ return -1;
- /* Close */
- if (H5Dclose(dset_id) < 0)
- return -1;
- if (H5Sclose(space_id) < 0)
- return -1;
+ /* Write the buf */
+ if(buf)
+ if(H5Dwrite(dset_id, type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
+ return -1;
- return 0;
+ /* Close */
+ if(H5Dclose(dset_id) < 0)
+ return -1;
+ if(H5Sclose(space_id) < 0)
+ return -1;
+ return 0;
}
diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c
index 9c8b22f..a3fcc60 100644
--- a/tools/h5stat/h5stat_gentest.c
+++ b/tools/h5stat/h5stat_gentest.c
@@ -54,7 +54,7 @@ static void gen_file(void)
sprintf(name, "%s%d", GROUP_NAME,i);
gid = H5Gcreate2(file, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(gid);
- }
+ } /* end for */
/* Create a datatype to commit and use */
type_id = H5Tcopy(H5T_NATIVE_INT);
@@ -63,12 +63,12 @@ static void gen_file(void)
space_id = H5Screate(H5S_SCALAR);
/* Create dataset */
- dset_id = H5Dcreate(file, DATASET_NAME, type_id, space_id, H5P_DEFAULT);
+ dset_id = H5Dcreate2(file, DATASET_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for(i = 1; i <= NUM_ATTRS; i++) {
sprintf(attrname, "%s%d", ATTR_NAME,i);
attr_id = H5Acreate2(dset_id, ".", attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Aclose(attr_id);
- }
+ } /* end for */
ret = H5Dclose(dset_id);
ret = H5Sclose(space_id);
diff --git a/tools/lib/talign.c b/tools/lib/talign.c
index 9c16d9a..28b8075 100644
--- a/tools/lib/talign.c
+++ b/tools/lib/talign.c
@@ -116,7 +116,7 @@ int main(void)
*/
dim[0] = 1;
spc = H5Screate_simple(1, dim, NULL);
- set = H5Dcreate(fil, setname, cmp, spc, H5P_DEFAULT);
+ set = H5Dcreate2(fil, setname, cmp, spc, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Dwrite(set, cmp1, spc, H5S_ALL, plist, fok);
H5Dwrite(set, cmp2, spc, H5S_ALL, plist, string5);
diff --git a/tools/misc/h5repart_gentest.c b/tools/misc/h5repart_gentest.c
index 21e3427..9fcc9c8 100644
--- a/tools/misc/h5repart_gentest.c
+++ b/tools/misc/h5repart_gentest.c
@@ -37,60 +37,60 @@ int main(void)
hsize_t dims[2]={FAMILY_NUMBER, FAMILY_SIZE};
/* Set property list and file name for FAMILY driver */
- if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) {
+ if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) {
perror ("H5Pcreate");
exit (1);
}
- if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT)<0) {
+ if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) {
perror ("H5Pset_fapl_family");
exit (1);
}
- if((file=H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) {
- perror ("H5Fcreate");
- exit (1);
+ if((file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) {
+ perror("H5Fcreate");
+ exit(1);
}
/* Create and write dataset */
- if((space=H5Screate_simple(2, dims, NULL))<0) {
- perror ("H5Screate_simple");
- exit (1);
+ if((space = H5Screate_simple(2, dims, NULL)) < 0) {
+ perror("H5Screate_simple");
+ exit(1);
}
- if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0) {
- perror ("H5Dcreate");
- exit (1);
+ if((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ perror("H5Dcreate2");
+ exit(1);
}
- for(i=0; i<FAMILY_NUMBER; i++)
- for(j=0; j<FAMILY_SIZE; j++)
- buf[i][j] = i*10000+j;
+ for(i = 0; i<FAMILY_NUMBER; i++)
+ for(j = 0; j<FAMILY_SIZE; j++)
+ buf[i][j] = i * 10000 + j;
- if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf)<0) {
- perror ("H5Dwrite");
- exit (1);
+ if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) {
+ perror("H5Dwrite");
+ exit(1);
}
- if(H5Sclose(space)<0) {
+ if(H5Sclose(space) < 0) {
perror ("H5Sclose");
exit (1);
}
- if(H5Dclose(dset)<0) {
+ if(H5Dclose(dset) < 0) {
perror ("H5Dclose");
exit (1);
}
- if(H5Pclose(fapl)<0) {
+ if(H5Pclose(fapl) < 0) {
perror ("H5Pclose");
exit (1);
}
- if(H5Fclose(file)<0) {
+ if(H5Fclose(file) < 0) {
perror ("H5Fclose");
exit (1);
}