diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-18 22:02:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-10-18 22:02:19 (GMT) |
commit | a5984f59f71739531fb78c3933a726e73dd54328 (patch) | |
tree | 839fdd36b93e7976c97b9a351e3937266d1dd7b3 /tools/h5dump | |
parent | cf56cd041d119914d7a9bee79c22e59a8ce85059 (diff) | |
download | hdf5-a5984f59f71739531fb78c3933a726e73dd54328.zip hdf5-a5984f59f71739531fb78c3933a726e73dd54328.tar.gz hdf5-a5984f59f71739531fb78c3933a726e73dd54328.tar.bz2 |
[svn-r14212] Description:
Make H5Tarray_create() and H5Tget_array_dims() versioned, and drop the
"perm" parameter from the '2' versions.
Shift internal library usage to '2' versions.
Add simple regression tests for '1' versions.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/h5dump.c | 4 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 108 |
2 files changed, 55 insertions, 57 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index a46054d..712d133 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -1075,7 +1075,7 @@ print_datatype(hid_t type,unsigned in_group) /* Get array information */ ndims = H5Tget_array_ndims(type); - H5Tget_array_dims(type, dims, NULL); + H5Tget_array_dims2(type, dims); /* Print array dimensions */ for (i = 0; i < ndims; i++) @@ -4790,7 +4790,7 @@ xml_print_datatype(hid_t type, unsigned in_group) printf("%u\">\n", ndims); /* Get array information */ - H5Tget_array_dims(type, dims, NULL); + H5Tget_array_dims2(type, dims); /* list of dimensions */ indent += COL; diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 029f20c..d0cb5f8 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -624,21 +624,21 @@ static void gent_compound_dt(void) { /* test compound data type */ ndims = 1; dim[0] = 4; - array_dt = H5Tarray_create(H5T_STD_I32BE, ndims, dim, NULL); + array_dt = H5Tarray_create2(H5T_STD_I32BE, ndims, dim); H5Tinsert(type, "int_array", HOFFSET(dset3_t, a), array_dt); H5Tclose(array_dt); - array_dt = H5Tarray_create(H5T_NATIVE_INT, ndims, dim, NULL); + array_dt = H5Tarray_create2(H5T_NATIVE_INT, ndims, dim); H5Tinsert(type2, "int_array", HOFFSET(dset3_t, a), array_dt); H5Tclose(array_dt); ndims = 2; dim[0] = 5; dim[1] = 6; - array_dt = H5Tarray_create(H5T_IEEE_F32BE, ndims, dim, NULL); + array_dt = H5Tarray_create2(H5T_IEEE_F32BE, ndims, dim); H5Tinsert(type, "float_array", HOFFSET(dset3_t, b), array_dt); H5Tclose(array_dt); - array_dt = H5Tarray_create(H5T_NATIVE_FLOAT, ndims, dim, NULL); + array_dt = H5Tarray_create2(H5T_NATIVE_FLOAT, ndims, dim); H5Tinsert(type2, "float_array", HOFFSET(dset3_t, b), array_dt); H5Tclose(array_dt); @@ -829,12 +829,12 @@ static void gent_compound_dt2(void) { /* test compound data type */ type = H5Tcreate (H5T_COMPOUND, sizeof(dset3_t)); ndims = 1; dim[0] = 4; - array_dt = H5Tarray_create(H5T_STD_I32BE, ndims, dim, NULL); + array_dt = H5Tarray_create2(H5T_STD_I32BE, ndims, dim); H5Tinsert(type, "int_array", HOFFSET(dset3_t, a), array_dt); H5Tclose(array_dt); ndims = 2; dim[0] = 5; dim[1] = 6; - array_dt = H5Tarray_create(H5T_IEEE_F32BE, ndims, dim, NULL); + array_dt = H5Tarray_create2(H5T_IEEE_F32BE, ndims, dim); H5Tinsert(type, "float_array", HOFFSET(dset3_t, b), array_dt); H5Tclose(array_dt); @@ -1128,29 +1128,29 @@ static void gent_many(void) type = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0])); dim[0] = dim[1] = dim[2] = dim[3] = 2; - array_dt = H5Tarray_create(H5T_STD_I32BE, 4, dim, NULL); + array_dt = H5Tarray_create2(H5T_STD_I32BE, 4, dim); H5Tinsert(type, "a_array", HOFFSET(dset1_t, a), array_dt); H5Tclose(array_dt); - array_dt = H5Tarray_create(H5T_IEEE_F64BE, 4, dim, NULL); + array_dt = H5Tarray_create2(H5T_IEEE_F64BE, 4, dim); H5Tinsert(type, "b_array", HOFFSET(dset1_t, b), array_dt); H5Tclose(array_dt); - array_dt = H5Tarray_create(H5T_IEEE_F64BE, 4, dim, NULL); + array_dt = H5Tarray_create2(H5T_IEEE_F64BE, 4, dim); H5Tinsert(type, "c_array", HOFFSET(dset1_t, c), array_dt); H5Tclose(array_dt); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0])); - array_dt = H5Tarray_create(H5T_NATIVE_INT, 4, dim, NULL); + array_dt = H5Tarray_create2(H5T_NATIVE_INT, 4, dim); H5Tinsert(type2, "a_array", HOFFSET(dset1_t, a), array_dt); H5Tclose(array_dt); - array_dt = H5Tarray_create(H5T_NATIVE_DOUBLE,4,dim, NULL); + array_dt = H5Tarray_create2(H5T_NATIVE_DOUBLE, 4, dim); H5Tinsert(type2, "b_array", HOFFSET(dset1_t, b), array_dt); H5Tclose(array_dt); - array_dt = H5Tarray_create(H5T_NATIVE_DOUBLE, 4, dim, NULL); + array_dt = H5Tarray_create2(H5T_NATIVE_DOUBLE, 4, dim); H5Tinsert(type2, "c_array", HOFFSET(dset1_t, c), array_dt); H5Tclose(array_dt); @@ -1391,24 +1391,24 @@ static void gent_str(void) { mdims[0] = 8; mdims[1] = 10; - array_dt = H5Tarray_create(H5T_STD_I32BE, 2, mdims, NULL); + array_dt = H5Tarray_create2(H5T_STD_I32BE, 2, mdims); H5Tinsert(f_type, "int_array", HOFFSET(compound_t, a), array_dt); H5Tclose(array_dt); - array_dt = H5Tarray_create(H5T_NATIVE_INT, 2, mdims, NULL); + array_dt = H5Tarray_create2(H5T_NATIVE_INT, 2, mdims); H5Tinsert(f_type2, "int_array", HOFFSET(compound_t, a), array_dt); H5Tclose(array_dt); mdims[0] = 3; mdims[1] = 4; str_type = mkstr(32, H5T_STR_SPACEPAD); - array_dt = H5Tarray_create(str_type, 2, mdims, NULL); + array_dt = H5Tarray_create2(str_type, 2, mdims); H5Tinsert(f_type, "string", HOFFSET(compound_t, s), array_dt); H5Tclose(array_dt); H5Tclose(str_type); str_type = mkstr(33, H5T_STR_NULLTERM); - array_dt = H5Tarray_create(str_type, 2, mdims, NULL); + array_dt = H5Tarray_create2(str_type, 2, mdims); H5Tinsert(f_type2, "string", HOFFSET(compound_t, s), array_dt); H5Tclose(array_dt); H5Tclose(str_type); @@ -1909,7 +1909,7 @@ static void gent_nestcomp(void) H5Tset_strpad(char_id, H5T_STR_NULLTERM); H5Tinsert(cmp_tid, "char_name", HOFFSET(cmp_t, a), char_id); - array_dt = H5Tarray_create(H5T_NATIVE_FLOAT, ndims, array_dims, NULL); + array_dt = H5Tarray_create2(H5T_NATIVE_FLOAT, ndims, array_dims); H5Tinsert(cmp_tid, "array_name", HOFFSET(cmp_t, b), array_dt); H5Tclose(array_dt); @@ -2420,7 +2420,7 @@ static void gent_array1(void) sid1 = H5Screate_simple(SPACE1_RANK, sdims1, NULL); /* Create a datatype to refer to */ - tid1 = H5Tarray_create(H5T_NATIVE_INT, ARRAY1_RANK, tdims1, NULL); + tid1 = H5Tarray_create2(H5T_NATIVE_INT, ARRAY1_RANK, tdims1); /* Create a dataset */ dataset = H5Dcreate2(fid1, "Dataset1", tid1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -2466,7 +2466,7 @@ static void gent_array2(void) sid = H5Screate_simple(SPACE1_RANK, sdims1, NULL); /* Create a datatype to refer to */ - tid = H5Tarray_create(H5T_NATIVE_INT, ARRAY2_RANK, tdims2, NULL); + tid = H5Tarray_create2(H5T_NATIVE_INT, ARRAY2_RANK, tdims2); /* Create a dataset */ dataset = H5Dcreate2(fid, "Dataset1", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -2514,10 +2514,10 @@ static void gent_array3(void) sid = H5Screate_simple(SPACE1_RANK, sdims1, NULL); /* Create a 2-D datatype to refer to */ - tid2 = H5Tarray_create(H5T_NATIVE_INT, ARRAY3_RANK, tdims2, NULL); + tid2 = H5Tarray_create2(H5T_NATIVE_INT, ARRAY3_RANK, tdims2); /* Create a 1-D datatype to refer to */ - tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); + tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Create a dataset */ dataset = H5Dcreate2(fid, "Dataset1", tid1, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -2581,7 +2581,7 @@ static void gent_array4(void) assert(ret >= 0); /* Create an array datatype to refer to */ - tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); + tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close compound datatype */ ret = H5Tclose(tid2); @@ -2645,7 +2645,7 @@ static void gent_array5(void) assert(ret >= 0); /* Create an array of floats datatype */ - tid3 = H5Tarray_create(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1, NULL); + tid3 = H5Tarray_create2(H5T_NATIVE_FLOAT, ARRAY1_RANK, tdims1); /* Insert float array field */ ret = H5Tinsert (tid2, "f", HOFFSET(s2_t,f), tid3); @@ -2656,7 +2656,7 @@ static void gent_array5(void) assert(ret >= 0); /* Create an array datatype to refer to */ - tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); + tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close compound datatype */ ret = H5Tclose(tid2); @@ -2712,7 +2712,7 @@ static void gent_array6(void) tid2 = H5Tvlen_create(H5T_NATIVE_UINT); /* Create an array datatype to refer to */ - tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); + tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close VL datatype */ ret = H5Tclose(tid2); @@ -2771,7 +2771,7 @@ static void gent_array7(void) sid1 = H5Screate_simple(SPACE1_RANK, sdims1, NULL); /* Create the nested array datatype to refer to */ - tid3 = H5Tarray_create(H5T_NATIVE_UINT, ARRAY1_RANK, tdims1, NULL); + tid3 = H5Tarray_create2(H5T_NATIVE_UINT, ARRAY1_RANK, tdims1); /* Create a VL datatype of 1-D arrays to refer to */ tid2 = H5Tvlen_create(tid3); @@ -2781,7 +2781,7 @@ static void gent_array7(void) assert(ret >= 0); /* Create an array datatype to refer to */ - tid1 = H5Tarray_create(tid2, ARRAY1_RANK, tdims1, NULL); + tid1 = H5Tarray_create2(tid2, ARRAY1_RANK, tdims1); /* Close VL datatype */ ret = H5Tclose(tid2); @@ -2846,7 +2846,7 @@ static void gent_empty(void) assert(ret >= 0); /* write out an empty array dataset */ - type = H5Tarray_create(H5T_NATIVE_INT, SPACE1_RANK, dims, NULL); + type = H5Tarray_create2(H5T_NATIVE_INT, SPACE1_RANK, dims); dset = H5Dcreate2(file, "Dataset4.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Don't write any data */ ret = H5Dclose(dset); @@ -3335,16 +3335,16 @@ static void write_attr_in(hid_t loc_id, * H5T_ARRAY *------------------------------------------------------------------------- */ - tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); - write_attr(loc_id,1,dims,"array",tid,buf6); + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 1, dims, "array", tid, buf6); status = H5Tclose(tid); /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - write_attr(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); - write_attr(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); + write_attr(loc_id, 1, dims, "integer", H5T_NATIVE_INT, buf7); + write_attr(loc_id, 1, dims, "float", H5T_NATIVE_FLOAT, buf8); /*------------------------------------------------------------------------- @@ -3446,16 +3446,16 @@ static void write_attr_in(hid_t loc_id, * H5T_ARRAY *------------------------------------------------------------------------- */ - tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); - write_attr(loc_id,2,dims2,"array2D",tid,buf62); + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 2, dims2, "array2D", tid, buf62); status = H5Tclose(tid); /*------------------------------------------------------------------------- * H5T_INTEGER and H5T_FLOAT *------------------------------------------------------------------------- */ - write_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); - write_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); + write_attr(loc_id, 2, dims2, "integer2D", H5T_NATIVE_INT, buf72); + write_attr(loc_id, 2, dims2, "float2D", H5T_NATIVE_FLOAT, buf82); /*------------------------------------------------------------------------- @@ -3579,15 +3579,13 @@ static void write_attr_in(hid_t loc_id, * H5T_ARRAY *------------------------------------------------------------------------- */ - n=1; - for(i = 0; i < 24; i++) { - for(j = 0; j < (int)dimarray[0]; j++) { - buf63[i][j]=n++; - } - } + n = 1; + for(i = 0; i < 24; i++) + for(j = 0; j < (int)dimarray[0]; j++) + buf63[i][j] = n++; - tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); - write_attr(loc_id,3,dims3,"array3D",tid,buf63); + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_attr(loc_id, 3, dims3, "array3D", tid, buf63); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -3779,8 +3777,8 @@ static void write_dset_in(hid_t loc_id, * H5T_ARRAY *------------------------------------------------------------------------- */ - tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); - write_dset(loc_id,1,dims,"array",tid,buf6); + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_dset(loc_id, 1, dims, "array", tid, buf6); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -3889,7 +3887,7 @@ static void write_dset_in(hid_t loc_id, * H5T_ARRAY *------------------------------------------------------------------------- */ - tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); write_dset(loc_id, 2, dims2, "array2D", tid, buf62); status = H5Tclose(tid); @@ -4040,8 +4038,8 @@ static void write_dset_in(hid_t loc_id, } } - tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); - write_dset(loc_id,3,dims3,"array3D",tid,buf63); + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_dset(loc_id, 3, dims3, "array3D", tid, buf63); status = H5Tclose(tid); /*------------------------------------------------------------------------- @@ -4299,7 +4297,7 @@ static void gent_compound_complex(void) 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); + str_array_id = H5Tarray_create2(array_tid, F41_ARRAY_RANK, array_dimb); assert(str_array_id >= 0); /* Copy the array data type for the character array */ @@ -4311,11 +4309,11 @@ static void gent_compound_complex(void) 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); + array2_tid = H5Tarray_create2(H5T_NATIVE_SHORT, F41_ARRAY_RANKd, array_dimd); 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); + array4_tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, F41_ARRAY_RANK, array_dimf); assert(array4_tid >= 0); /* Create the memory data type */ @@ -5232,8 +5230,8 @@ static void gent_fvalues(void) * dataset with a H5T_ARRAY fill value *------------------------------------------------------------------------- */ - tid = H5Tarray_create(H5T_NATIVE_INT, 1, dimarray, NULL); - write_dset(fid,1,dims,"fill_array",tid,buf4); + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dimarray); + write_dset(fid, 1, dims, "fill_array", tid, buf4); ret = H5Tclose(tid); @@ -5588,7 +5586,7 @@ gent_binary(void) * array *------------------------------------------------------------------------- */ - tid = H5Tarray_create(H5T_NATIVE_INT, 1, dims, NULL); + tid = H5Tarray_create2(H5T_NATIVE_INT, 1, dims); sid = H5Screate_simple(1, dimarray, NULL); did = H5Dcreate2(fid, "array", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, abuf); |