diff options
-rw-r--r-- | c++/src/H5DataType.cpp | 6 | ||||
-rw-r--r-- | fortran/src/H5Tf.c | 41 | ||||
-rw-r--r-- | src/H5Tdeprec.c | 12 | ||||
-rw-r--r-- | src/H5Tpublic.h | 18 | ||||
-rw-r--r-- | src/H5vers.txt | 1 | ||||
-rw-r--r-- | src/H5version.h | 15 | ||||
-rw-r--r-- | test/dangle.c | 78 | ||||
-rw-r--r-- | test/dt_arith.c | 40 | ||||
-rw-r--r-- | test/dtypes.c | 182 | ||||
-rw-r--r-- | test/enum.c | 6 | ||||
-rw-r--r-- | test/getname.c | 39 | ||||
-rw-r--r-- | test/links.c | 8 | ||||
-rw-r--r-- | test/mount.c | 2 | ||||
-rw-r--r-- | test/ntypes.c | 12 | ||||
-rwxr-xr-x | test/objcopy.c | 24 | ||||
-rw-r--r-- | test/tattr.c | 22 | ||||
-rw-r--r-- | test/tfile.c | 20 | ||||
-rw-r--r-- | test/th5o.c | 16 | ||||
-rw-r--r-- | test/titerate.c | 12 | ||||
-rw-r--r-- | test/tmisc.c | 92 | ||||
-rw-r--r-- | test/trefer.c | 8 | ||||
-rw-r--r-- | test/tsohm.c | 4 | ||||
-rw-r--r-- | test/ttime.c | 16 | ||||
-rw-r--r-- | test/tunicode.c | 4 | ||||
-rw-r--r-- | test/tvlstr.c | 4 | ||||
-rw-r--r-- | test/unlink.c | 8 | ||||
-rw-r--r-- | tools/h5copy/h5copygentest.c | 2 | ||||
-rw-r--r-- | tools/h5diff/h5diffgentest.c | 8 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 56 | ||||
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 16 | ||||
-rw-r--r-- | tools/h5repack/h5repacktst.c | 50 |
31 files changed, 422 insertions, 400 deletions
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 1ac922e..c31395e 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -223,11 +223,9 @@ bool DataType::operator==(const DataType& compared_type ) const void DataType::p_commit(hid_t loc_id, const char* name) { // Call C routine to commit the transient datatype - herr_t ret_value = H5Tcommit(loc_id, name, id); + herr_t ret_value = H5Tcommit2(loc_id, name, id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if( ret_value < 0 ) - { - throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit failed"); - } + throw DataTypeIException(inMemFunc("p_commit"), "H5Tcommit2 failed"); } //-------------------------------------------------------------------------- diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index b1983f3..044da79 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -62,7 +62,7 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) /*---------------------------------------------------------------------------- * Name: h5tcommit_c - * Purpose: Call H5Tcommit to commit a datatype + * Purpose: Call H5Tcommit2 to commit a datatype * Inputs: loc_id - file or group identifier * name - name of the datatype within file or group * namelen - name length @@ -73,32 +73,25 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) +nh5tcommit_c(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) { - int ret_value = -1; - char *c_name; - size_t c_namelen; - hid_t c_type_id; - hid_t c_loc_id; - herr_t status; + char *c_name = NULL; + 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; + /* Convert FORTRAN name to C name */ + if(NULL == (c_name = (char *)HD5f2cstring(name, (size_t)*namelen))) + goto done; - /* - * Call H5Tcommit function. - */ - c_loc_id = *loc_id; - c_type_id = *type_id; - status = H5Tcommit(c_loc_id, c_name, c_type_id); - HDfree(c_name); - if (status < 0) return ret_value; - ret_value = 0; - return ret_value; + /* Call H5Tcommit2 function */ + if(H5Tcommit2((hid_t)*loc_id, c_name, (hid_t)*type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) + goto done; + + ret_value = 0; + +done: + if(c_name) + HDfree(c_name); + return ret_value; } /*---------------------------------------------------------------------------- diff --git a/src/H5Tdeprec.c b/src/H5Tdeprec.c index 63a576f..8dbcc4a 100644 --- a/src/H5Tdeprec.c +++ b/src/H5Tdeprec.c @@ -105,11 +105,13 @@ H5T_init_deprec_interface(void) /*------------------------------------------------------------------------- - * Function: H5Tcommit + * Function: H5Tcommit1 * * Purpose: Save a transient datatype to a file and turn the type handle * into a named, immutable type. * + * Note: Deprecated in favor of H5Tcommit2 + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -118,13 +120,13 @@ H5T_init_deprec_interface(void) *------------------------------------------------------------------------- */ herr_t -H5Tcommit(hid_t loc_id, const char *name, hid_t type_id) +H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id) { H5G_loc_t loc; /* Location to create datatype */ H5T_t *type; /* Datatype for ID */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Tcommit, FAIL) + FUNC_ENTER_API(H5Tcommit1, FAIL) H5TRACE3("e", "i*si", loc_id, name, type_id); /* Check arguments */ @@ -142,7 +144,7 @@ H5Tcommit(hid_t loc_id, const char *name, hid_t type_id) done: FUNC_LEAVE_API(ret_value) -} /* end H5Tcommit() */ +} /* end H5Tcommit1() */ /*------------------------------------------------------------------------- @@ -150,6 +152,8 @@ done: * * Purpose: Opens a named datatype. * + * Note: Deprecated in favor of H5Topen2 + * * Return: Success: Object ID of the named datatype. * * Failure: Negative diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 1a1275d..fbdcba8 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -598,7 +598,23 @@ H5_DLL herr_t H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, * Use of these functions and variables is deprecated. */ H5_DLL hid_t H5Topen(hid_t loc_id, const char *name); -H5_DLL herr_t H5Tcommit(hid_t loc_id, const char *name, hid_t type_id); + +/* Symbols defined for compatibility with previous versions of the HDF5 API. + * + * Use of these symbols is deprecated. + */ +#ifndef H5_NO_DEPRECATED_SYMBOLS + +/* Macros */ + + +/* Typedefs */ + + +/* Function prototypes */ +H5_DLL herr_t H5Tcommit1(hid_t loc_id, const char *name, hid_t type_id); + +#endif /* H5_NO_DEPRECATED_SYMBOLS */ #ifdef __cplusplus } diff --git a/src/H5vers.txt b/src/H5vers.txt index ba2eac0..6d8e732 100644 --- a/src/H5vers.txt +++ b/src/H5vers.txt @@ -54,6 +54,7 @@ FUNCTION: H5Ewalk; H5E_walk, H5E_error; v10, v18 FUNCTION: H5Gcreate; ; v10, v18 FUNCTION: H5Gopen; ; v10, v18 FUNCTION: H5Rget_obj_type; ; v16, v18 +FUNCTION: H5Tcommit; ; v10, v18 # API typedefs # (although not required, it's easier to compare this file with the headers diff --git a/src/H5version.h b/src/H5version.h index 8ea79be..818b699 100644 --- a/src/H5version.h +++ b/src/H5version.h @@ -74,6 +74,10 @@ #define H5Rget_obj_type_vers 1 #endif /* !defined(H5Rget_obj_type_vers) */ +#if !defined(H5Tcommit_vers) +#define H5Tcommit_vers 1 +#endif /* !defined(H5Tcommit_vers) */ + /************/ /* Typedefs */ /************/ @@ -198,6 +202,17 @@ #error "H5Rget_obj_type_vers set to invalid value" #endif /* H5Rget_obj_type_vers */ +#if !defined(H5Tcommit_vers) || H5Tcommit_vers == 2 +#ifndef H5Tcommit_vers +#define H5Tcommit_vers 2 +#endif /* H5Tcommit_vers */ +#define H5Tcommit H5Tcommit2 +#elif H5Tcommit_vers == 1 +#define H5Tcommit H5Tcommit1 +#else /* H5Tcommit_vers */ +#error "H5Tcommit_vers set to invalid value" +#endif /* H5Tcommit_vers */ + /************/ /* Typedefs */ /************/ diff --git a/test/dangle.c b/test/dangle.c index 2f6ad7b..7b657ac 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -243,70 +243,70 @@ static int test_dangle_datatype1(H5F_close_degree_t degree) { char filename[1024]; - hid_t fid; /* File ID */ - hid_t fapl; /* File access property list */ - hid_t tid; /* Datatype ID */ - unsigned u; /* Local index variable */ + hid_t fid; /* File ID */ + hid_t fapl; /* File access property list */ + hid_t tid; /* Datatype ID */ + unsigned u; /* Local index variable */ TESTING(" dangling named datatype IDs"); - if(H5open()<0) + if(H5open() < 0) 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((tid = H5Tcopy (H5T_NATIVE_INT))<0) + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR; - if(H5Tcommit(fid,TYPENAME,tid)<0) + if(H5Tcommit2(fid, TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR; - if(H5Tclose(tid)<0) + if(H5Tclose(tid) < 0) TEST_ERROR; /* Try creating duplicate named datatype */ if((tid = H5Tcopy (H5T_NATIVE_INT))<0) TEST_ERROR; H5E_BEGIN_TRY { - if(H5Tcommit(fid,TYPENAME,tid)>=0) + if(H5Tcommit2(fid, TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) >= 0) TEST_ERROR; } H5E_END_TRY; - if(H5Tclose(tid)<0) + if(H5Tclose(tid) < 0) TEST_ERROR; /* Leave open a _lot_ of objects */ - for(u=0; u<MAX_DANGLE; u++) { - if((tid = H5Topen (fid, TYPENAME))<0) + for(u = 0; u < MAX_DANGLE; u++) { + if((tid = H5Topen(fid, TYPENAME)) < 0) TEST_ERROR; } /* end for */ - if(degree==H5F_CLOSE_SEMI) { + if(degree == H5F_CLOSE_SEMI) { H5E_BEGIN_TRY { - if(H5Fclose(fid)>=0) + if(H5Fclose(fid) >= 0) TEST_ERROR; } H5E_END_TRY; } /* end if */ else - if(H5Fclose(fid)<0) + if(H5Fclose(fid) < 0) TEST_ERROR; - if(H5Pclose(fapl)<0) + if(H5Pclose(fapl) < 0) TEST_ERROR; - if(H5close()<0) + if(H5close() < 0) TEST_ERROR; - if(h5_get_file_size(filename)<0) + if(h5_get_file_size(filename) < 0) TEST_ERROR; /* Clean up temporary file */ @@ -340,33 +340,33 @@ static int test_dangle_datatype2(H5F_close_degree_t degree) { char filename[1024]; - hid_t fid; /* File ID */ - hid_t fapl; /* File access property list */ - hid_t did; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ + hid_t fid; /* File ID */ + hid_t fapl; /* File access property list */ + hid_t did; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ TESTING(" dangling named datatype ID used by dataset"); - if(H5open()<0) + if(H5open() < 0) 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((tid = H5Tcopy (H5T_NATIVE_INT))<0) + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR; - if(H5Tcommit(fid,TYPENAME,tid)<0) + if(H5Tcommit2(fid, TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR; /* Create a dataset that uses the named datatype & leave it open */ @@ -374,26 +374,26 @@ test_dangle_datatype2(H5F_close_degree_t degree) TEST_ERROR; if((did = H5Dcreate(fid, DSETNAME, tid, sid, H5P_DEFAULT)) < 0) TEST_ERROR; - if(H5Sclose(sid)<0) + if(H5Sclose(sid) < 0) TEST_ERROR; - if(degree==H5F_CLOSE_SEMI) { + if(degree == H5F_CLOSE_SEMI) { H5E_BEGIN_TRY { - if(H5Fclose(fid)>=0) + if(H5Fclose(fid) >= 0) TEST_ERROR; } H5E_END_TRY; } /* end if */ else - if(H5Fclose(fid)<0) + if(H5Fclose(fid) < 0) TEST_ERROR; - if(H5Pclose(fapl)<0) + if(H5Pclose(fapl) < 0) TEST_ERROR; - if(H5close()<0) + if(H5close() < 0) TEST_ERROR; - if(h5_get_file_size(filename)<0) + if(h5_get_file_size(filename) < 0) TEST_ERROR; /* Clean up temporary file */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 52fd5bf..e27176d 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -979,29 +979,29 @@ test_derived_flt(void) goto error; } - if(H5Tset_ebias(tid1, 511)<0) { + if(H5Tset_ebias(tid1, 511) < 0) { H5_FAILED(); printf("Can't set exponent bias\n"); goto error; } - if(H5Tset_pad(tid1, H5T_PAD_ZERO, H5T_PAD_ZERO)<0) { + if(H5Tset_pad(tid1, H5T_PAD_ZERO, H5T_PAD_ZERO) < 0) { H5_FAILED(); printf("Can't set padding\n"); goto error; } - if(H5Tcommit(file, "new float type 1", tid1)<0) { + if(H5Tcommit2(file, "new float type 1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); printf("Can't set inpad\n"); goto error; } - if(H5Tclose(tid1)<0) { + if(H5Tclose(tid1) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; } - if((tid1 = H5Topen(file, "new float type 1"))<0) { + if((tid1 = H5Topen(file, "new float type 1")) < 0) { H5_FAILED(); printf("Can't open datatype\n"); goto error; @@ -1141,29 +1141,29 @@ test_derived_flt(void) printf("Can't set size\n"); goto error; } - if(H5Tset_ebias(tid2, 63)<0) { + if(H5Tset_ebias(tid2, 63) < 0) { H5_FAILED(); printf("Can't set size\n"); goto error; } - if(H5Tset_pad(tid2, H5T_PAD_ZERO, H5T_PAD_ZERO)<0) { + if(H5Tset_pad(tid2, H5T_PAD_ZERO, H5T_PAD_ZERO) < 0) { H5_FAILED(); printf("Can't set padding\n"); goto error; } - if(H5Tcommit(file, "new float type 2", tid2)<0) { + if(H5Tcommit2(file, "new float type 2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); printf("Can't set inpad\n"); goto error; } - if(H5Tclose(tid2)<0) { + if(H5Tclose(tid2) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; } - if((tid2 = H5Topen(file, "new float type 2"))<0) { + if((tid2 = H5Topen(file, "new float type 2")) < 0) { H5_FAILED(); printf("Can't open datatype\n"); goto error; @@ -1403,31 +1403,31 @@ test_derived_integer(void) goto error; } - if(H5Tset_precision(tid1,24)<0) { + if(H5Tset_precision(tid1, 24) < 0) { H5_FAILED(); printf("Can't set precision\n"); goto error; } - if(H5Tset_order(tid1, H5T_ORDER_BE)<0) { + if(H5Tset_order(tid1, H5T_ORDER_BE) < 0) { H5_FAILED(); printf("Can't set order\n"); goto error; } - if(H5Tcommit(file, "new integer type 1", tid1)<0) { + if(H5Tcommit2(file, "new integer type 1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); printf("Can't commit data type\n"); goto error; } - if(H5Tclose(tid1)<0) { + if(H5Tclose(tid1) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; } - if((tid1 = H5Topen(file, "new integer type 1"))<0) { + if((tid1 = H5Topen(file, "new integer type 1")) < 0) { H5_FAILED(); printf("Can't open datatype\n"); goto error; @@ -1468,31 +1468,31 @@ test_derived_integer(void) goto error; } - if(H5Tset_offset(tid2,10)<0) { + if(H5Tset_offset(tid2, 10) < 0) { H5_FAILED(); printf("Can't set offset\n"); goto error; } - if(H5Tset_sign(tid2,H5T_SGN_2)<0) { + if(H5Tset_sign(tid2, H5T_SGN_2) < 0) { H5_FAILED(); printf("Can't set offset\n"); goto error; } - if(H5Tcommit(file, "new integer type 2", tid2)<0) { + if(H5Tcommit2(file, "new integer type 2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); printf("Can't commit data type\n"); goto error; } - if(H5Tclose(tid2)<0) { + if(H5Tclose(tid2) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; } - if((tid2 = H5Topen(file, "new integer type 2"))<0) { + if((tid2 = H5Topen(file, "new integer type 2")) < 0) { H5_FAILED(); printf("Can't open datatype\n"); goto error; diff --git a/test/dtypes.c b/test/dtypes.c index 2783f2d..f12be8c 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1560,31 +1560,31 @@ test_compound_9(void) goto error; } /* end if */ - if(H5Tinsert(cmpd_tid,"vl_string",HOFFSET(cmpd_struct,str),str_id)<0) { + if(H5Tinsert(cmpd_tid, "vl_string", HOFFSET(cmpd_struct, str), str_id) < 0) { H5_FAILED(); AT(); printf("Can't insert field 'i1'\n"); goto error; } /* end if */ - if(H5Tinsert(cmpd_tid,"i2",HOFFSET(struct cmpd_struct,i2),H5T_NATIVE_INT)<0) { + if(H5Tinsert(cmpd_tid, "i2", HOFFSET(struct cmpd_struct, i2), H5T_NATIVE_INT) < 0) { H5_FAILED(); AT(); printf("Can't insert field 'i2'\n"); goto error; } /* end if */ - if(H5Tcommit(file,"compound",cmpd_tid)<0) { + if(H5Tcommit2(file, "compound", cmpd_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); AT(); printf("Can't commit datatype\n"); goto error; } /* end if */ - if(H5Tclose(cmpd_tid)<0) { + if(H5Tclose(cmpd_tid) < 0) { H5_FAILED(); AT(); printf("Can't close datatype\n"); goto error; } /* end if */ - if((cmpd_tid = H5Topen(file, "compound"))<0) { + if((cmpd_tid = H5Topen(file, "compound")) < 0) { H5_FAILED(); AT(); printf("Can't open datatype\n"); goto error; @@ -2301,60 +2301,60 @@ test_query(void) } /* end if */ /* Query member number and member index by member name, for enumeration type. */ - if(H5Tget_nmembers(tid2)!=5) { + if(H5Tget_nmembers(tid2) != 5) { H5_FAILED(); printf("Can't get member number\n"); goto error; } /* end if */ - if(H5Tget_member_index(tid2, "ORANGE")!=3) { + if(H5Tget_member_index(tid2, "ORANGE") != 3) { H5_FAILED(); printf("Can't get correct index number\n"); goto error; } /* end if */ /* Commit compound datatype and close it */ - if(H5Tcommit(file, compnd_type, tid1)<0) { + if(H5Tcommit2(file, compnd_type, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); printf("Can't commit compound datatype\n"); goto error; } /* end if */ - if(H5Tclose(tid1)<0) { + if(H5Tclose(tid1) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; } /* end if */ /* Commit enumeration datatype and close it */ - if(H5Tcommit(file, enum_type, tid2)<0) { + if(H5Tcommit2(file, enum_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); printf("Can't commit compound datatype\n"); goto error; } /* end if */ - if(H5Tclose(tid2)<0) { + if(H5Tclose(tid2) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; } /* end if */ /* Open the dataytpe for query */ - if((tid1=H5Topen(file, compnd_type))<0) { + if((tid1 = H5Topen(file, compnd_type)) < 0) { H5_FAILED(); printf("Can't open datatype\n"); goto error; } /* end if */ - if((tid2=H5Topen(file, enum_type))<0) { + if((tid2 = H5Topen(file, enum_type)) < 0) { H5_FAILED(); printf("Can't open datatype\n"); goto error; } /* end if */ /* Query member number and member index by name, for compound type */ - if(H5Tget_nmembers(tid1)!=4) { + if(H5Tget_nmembers(tid1) != 4) { H5_FAILED(); printf("Can't get member number\n"); goto error; } /* end if */ - if(H5Tget_member_index(tid1, "c")!=2) { + if(H5Tget_member_index(tid1, "c") != 2) { H5_FAILED(); printf("Can't get correct index number\n"); goto error; @@ -2603,20 +2603,19 @@ test_named (hid_t fapl) /* Predefined types cannot be committed */ H5E_BEGIN_TRY { - status = H5Tcommit (file, "test_named_1 (should not exist)", - H5T_NATIVE_INT); + status = H5Tcommit2(file, "test_named_1 (should not exist)", H5T_NATIVE_INT, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); HDputs (" Predefined types should not be committable!"); goto error; } /* Copy a predefined data type and commit the copy */ - if ((type = H5Tcopy (H5T_NATIVE_INT))<0) goto error; - if (H5Tcommit (file, "native-int", type)<0) goto error; - if ((status=H5Tcommitted (type))<0) goto error; - if (0==status) { + if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) goto error; + if(H5Tcommit2(file, "native-int", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) goto error; + if((status = H5Tcommitted(type)) < 0) goto error; + if(0 == status) { H5_FAILED(); HDputs (" H5Tcommitted() returned false!"); goto error; @@ -2634,72 +2633,71 @@ test_named (hid_t fapl) /* We should not be able to re-commit a committed type */ H5E_BEGIN_TRY { - status = H5Tcommit(file, "test_named_2 (should not exist)", type); + status = H5Tcommit2(file, "test_named_2 (should not exist)", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - if (status>=0) { + if(status >= 0) { H5_FAILED(); HDputs (" Committed types should not be recommitted!"); goto error; } /* It should be possible to define an attribute for the named type */ - if ((attr1=H5Acreate (type, "attr1", H5T_NATIVE_UCHAR, space, - H5P_DEFAULT))<0) goto error; - for (i=0; i<(size_t)ds_size[0]; i++) - for (j=0; j<(size_t)ds_size[1]; j++) - attr_data[i][j] = (int)(i*ds_size[1]+j); - if (H5Awrite(attr1, H5T_NATIVE_UINT, attr_data)<0) goto error; - if (H5Aclose (attr1)<0) goto error; + if((attr1 = H5Acreate (type, "attr1", H5T_NATIVE_UCHAR, space, + H5P_DEFAULT)) < 0) goto error; + for(i = 0; i < (size_t)ds_size[0]; i++) + for(j = 0; j < (size_t)ds_size[1]; j++) + attr_data[i][j] = (int)(i * ds_size[1] + j); + if(H5Awrite(attr1, H5T_NATIVE_UINT, attr_data) < 0) goto error; + if(H5Aclose(attr1) < 0) goto error; /* * Copying a committed type should result in a transient type which is * not locked. */ - if ((t2 = H5Tcopy (type))<0) goto error; - if ((status=H5Tcommitted (t2))<0) goto error; - if (status) { + if((t2 = H5Tcopy(type)) < 0) goto error; + if((status = H5Tcommitted(t2)) < 0) goto error; + if(status) { H5_FAILED(); HDputs (" Copying a named type should result in a transient type!"); goto error; } - if (H5Tset_precision (t2, 256)<0) goto error; - if (H5Tclose (t2)<0) goto error; + if(H5Tset_precision(t2, 256) < 0) goto error; + if(H5Tclose(t2) < 0) goto error; /* * Close the committed type and reopen it. It should return a named type. */ - if (H5Tclose (type)<0) goto error; - if ((type=H5Topen (file, "native-int"))<0) goto error; - if ((status=H5Tcommitted (type))<0) goto error; - if (!status) { + if(H5Tclose(type) < 0) goto error; + if((type = H5Topen(file, "native-int")) < 0) goto error; + if((status = H5Tcommitted(type)) < 0) goto error; + if(!status) { H5_FAILED(); HDputs (" Opened named types should be named types!"); goto error; } /* Create a dataset that uses the named type */ - if ((dset = H5Dcreate (file, "dset1", type, space, H5P_DEFAULT))<0) { + if((dset = H5Dcreate(file, "dset1", type, space, H5P_DEFAULT)) < 0) goto error; - } /* Get the dataset's data type and make sure it's a named type */ - if ((t2 = H5Dget_type (dset))<0) goto error; - if ((status=H5Tcommitted (t2))<0) goto error; - if (!status) { + if((t2 = H5Dget_type(dset)) < 0) goto error; + if((status = H5Tcommitted(t2)) < 0) goto error; + if(!status) { H5_FAILED(); HDputs (" Dataset type should be a named type!"); goto error; } /* Close the dataset, then close its type, then reopen the dataset */ - if (H5Dclose (dset)<0) goto error; - if (H5Tclose (t2)<0) goto error; - if ((dset = H5Dopen (file, "dset1"))<0) goto error; + if(H5Dclose(dset) < 0) goto error; + if(H5Tclose(t2) < 0) goto error; + if((dset = H5Dopen(file, "dset1")) < 0) goto error; /* Get the dataset's type and make sure it's named */ - if ((t2 = H5Dget_type (dset))<0) goto error; - if ((status=H5Tcommitted (t2))<0) goto error; - if (!status) { + if((t2 = H5Dget_type(dset)) < 0) goto error; + if((status = H5Tcommitted(t2)) < 0) goto error; + if(!status) { H5_FAILED(); HDputs (" Dataset type should be a named type!"); goto error; @@ -2709,67 +2707,67 @@ test_named (hid_t fapl) * Close the dataset and create another with the type returned from the * first dataset. */ - if (H5Dclose (dset)<0) goto error; - if ((dset=H5Dcreate (file, "dset2", t2, space, H5P_DEFAULT))<0) goto error; + if(H5Dclose(dset) < 0) goto error; + if((dset = H5Dcreate(file, "dset2", t2, space, H5P_DEFAULT)) < 0) goto error; /* Reopen the second dataset and make sure the type is shared */ - if (H5Tclose (t2)<0) goto error; - if (H5Dclose (dset)<0) goto error; - if ((dset = H5Dopen (file, "dset2"))<0) goto error; - if ((t2 = H5Dget_type (dset))<0) goto error; - if ((status=H5Tcommitted (t2))<0) goto error; - if (!status) { + if(H5Tclose(t2) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; + if((dset = H5Dopen(file, "dset2")) < 0) goto error; + if((t2 = H5Dget_type(dset)) < 0) goto error; + if((status = H5Tcommitted(t2)) < 0) goto error; + if(!status) { H5_FAILED(); HDputs (" Dataset type should be a named type!"); goto error; } - if (H5Tclose (t2)<0) goto error; + if(H5Tclose(t2) < 0) goto error; /* * Get the dataset data type by applying H5Tcopy() to the dataset. The * result should be modifiable. */ - if ((t2=H5Tcopy (dset))<0) goto error; - if (H5Tset_precision (t2, 256)<0) goto error; - if (H5Tclose (t2)<0) goto error; - if (H5Dclose (dset)<0) goto error; + if((t2 = H5Tcopy(dset)) < 0) goto error; + if(H5Tset_precision(t2, 256) < 0) goto error; + if(H5Tclose(t2) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; /* * Copy of committed type used as dataset type should not be name type */ - if ((t2 = H5Tcopy (type))<0) goto error; - if ((status=H5Tcommitted (t2))<0) goto error; - if (status) { + if((t2 = H5Tcopy(type)) < 0) goto error; + if((status = H5Tcommitted(t2)) < 0) goto error; + if(status) { H5_FAILED(); HDputs (" Copied type should not be a named type!"); goto error; } - if ((dset=H5Dcreate (file, "dset3", t2, space, H5P_DEFAULT))<0) goto error; - if ((t3 = H5Dget_type (dset))<0) goto error; - if ((status=H5Tcommitted (t3))<0) goto error; - if (status) { + if((dset = H5Dcreate(file, "dset3", t2, space, H5P_DEFAULT)) < 0) goto error; + if((t3 = H5Dget_type(dset)) < 0) goto error; + if((status = H5Tcommitted(t3)) < 0) goto error; + if(status) { H5_FAILED(); HDputs (" Datatype from dataset using copied type should not be a named type!"); goto error; } - if (H5Tclose (t3)<0) goto error; - if (H5Dclose (dset)<0) goto error; + if(H5Tclose(t3) < 0) goto error; + if(H5Dclose(dset) < 0) goto error; /* Clean up */ - if (H5Tclose (type)<0) goto error; - if (H5Sclose (space)<0) goto error; - if (H5Fclose (file)<0) goto error; + if(H5Tclose(type) < 0) goto error; + if(H5Sclose(space) < 0) goto error; + if(H5Fclose(file) < 0) goto error; PASSED(); return 0; - error: +error: H5E_BEGIN_TRY { - H5Tclose (t3); - H5Tclose (t2); - H5Tclose (type); - H5Sclose (space); - H5Dclose (dset); - H5Fclose (file); + H5Tclose(t3); + H5Tclose(t2); + H5Tclose(type); + H5Sclose(space); + H5Dclose(dset); + H5Fclose(file); } H5E_END_TRY; return 1; } @@ -4139,7 +4137,7 @@ test_encode(void) printf("Can't get member number\n"); goto error; } /* end if */ - if(H5Tget_member_index(decoded_tid2, "ORANGE")!=3) { + if(H5Tget_member_index(decoded_tid2, "ORANGE") != 3) { H5_FAILED(); printf("Can't get correct index number\n"); goto error; @@ -4150,17 +4148,17 @@ test_encode(void) *----------------------------------------------------------------------- */ /* Commit compound datatype and close it */ - if(H5Tcommit(file, compnd_type, tid1)<0) { + if(H5Tcommit2(file, compnd_type, tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); printf("Can't commit compound datatype\n"); goto error; } /* end if */ - if(H5Tclose(tid1)<0) { + if(H5Tclose(tid1) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; } /* end if */ - if(H5Tclose(decoded_tid1)<0) { + if(H5Tclose(decoded_tid1) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; @@ -4169,17 +4167,17 @@ test_encode(void) cmpd_buf_size = 0; /* Commit enumeration datatype and close it */ - if(H5Tcommit(file, enum_type, tid2)<0) { + if(H5Tcommit2(file, enum_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) { H5_FAILED(); printf("Can't commit compound datatype\n"); goto error; } /* end if */ - if(H5Tclose(tid2)<0) { + if(H5Tclose(tid2) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; } /* end if */ - if(H5Tclose(decoded_tid2)<0) { + if(H5Tclose(decoded_tid2) < 0) { H5_FAILED(); printf("Can't close datatype\n"); goto error; @@ -4392,7 +4390,7 @@ test_latest(void) FAIL_STACK_ERROR /* Commit compound datatype */ - if(H5Tcommit(file, compnd_type, tid2) < 0) + if(H5Tcommit2(file, compnd_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Get information about datatype on disk */ @@ -4453,7 +4451,7 @@ test_latest(void) FAIL_STACK_ERROR /* Commit compound datatype */ - if(H5Tcommit(file, compnd_type, tid2) < 0) + if(H5Tcommit2(file, compnd_type, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Get information about datatype on disk */ diff --git a/test/enum.c b/test/enum.c index 5f73969..bb50d11 100644 --- a/test/enum.c +++ b/test/enum.c @@ -67,7 +67,7 @@ test_named(hid_t file) if(H5Tenum_insert(type, "BLUE", CPTR(val, E1_BLUE )) < 0) FAIL_STACK_ERROR 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(H5Tcommit(cwg, "e1_a", type) < 0) FAIL_STACK_ERROR + if(H5Tcommit2(cwg, "e1_a", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Tclose(type) < 0) FAIL_STACK_ERROR /* A smaller type */ @@ -77,7 +77,7 @@ test_named(hid_t file) if(H5Tenum_insert(type, "BLUE", CPTR(val8, E1_BLUE )) < 0) FAIL_STACK_ERROR if(H5Tenum_insert(type, "WHITE", CPTR(val8, E1_WHITE)) < 0) FAIL_STACK_ERROR if(H5Tenum_insert(type, "BLACK", CPTR(val8, E1_BLACK)) < 0) FAIL_STACK_ERROR - if(H5Tcommit(cwg, "e1_b", type) < 0) FAIL_STACK_ERROR + if(H5Tcommit2(cwg, "e1_b", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Tclose(type) < 0) FAIL_STACK_ERROR /* A non-native type */ @@ -91,7 +91,7 @@ test_named(hid_t file) if(H5Tenum_insert(type, "BLUE", CPTR(val8, E1_BLUE )) < 0) FAIL_STACK_ERROR if(H5Tenum_insert(type, "WHITE", CPTR(val8, E1_WHITE)) < 0) FAIL_STACK_ERROR if(H5Tenum_insert(type, "BLACK", CPTR(val8, E1_BLACK)) < 0) FAIL_STACK_ERROR - if(H5Tcommit(cwg, "e1_c", type) < 0) FAIL_STACK_ERROR + if(H5Tcommit2(cwg, "e1_c", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Tclose(type) < 0) FAIL_STACK_ERROR if(H5Gclose(cwg) < 0) FAIL_STACK_ERROR diff --git a/test/getname.c b/test/getname.c index e3be2de..b6d13d3 100644 --- a/test/getname.c +++ b/test/getname.c @@ -286,23 +286,23 @@ test_main(hid_t file_id, hid_t fapl) PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Tcommit - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Tcommit2 + *------------------------------------------------------------------------- + */ - TESTING("H5Iget_name with H5Tcommit"); + TESTING("H5Iget_name with H5Tcommit2"); /* Create a datatype */ if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) TEST_ERROR /* Insert fields */ - if(H5Tinsert(type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0) TEST_ERROR - if(H5Tinsert(type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0) TEST_ERROR - if(H5Tinsert(type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR /* Save datatype for later */ - if(H5Tcommit(file_id, "t1", type_id) < 0) TEST_ERROR + if(H5Tcommit2(file_id, "t1", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Verify */ if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR @@ -976,15 +976,15 @@ test_main(hid_t file_id, hid_t fapl) if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) TEST_ERROR /* Insert fields */ - if(H5Tinsert(type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0) TEST_ERROR - if(H5Tinsert(type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0) TEST_ERROR - if(H5Tinsert(type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR /* Create group "g17" */ if((group_id = H5Gcreate2(file_id, "g17", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Save datatype for later */ - if(H5Tcommit(group_id, "t", type_id) < 0) TEST_ERROR + if(H5Tcommit2(group_id, "t", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Create a dataspace */ if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR @@ -1257,10 +1257,9 @@ 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) TEST_ERROR if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR - if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, - H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR - if(H5Tcommit(file_id, "g18/t2", type_id) <0) TEST_ERROR + if(H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* Create second file and group "/g3/g4/g5" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); @@ -2430,15 +2429,15 @@ test_obj_ref(hid_t fapl) FAIL_STACK_ERROR /* Insert fields */ - if(H5Tinsert(tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT) < 0) + if(H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR - if(H5Tinsert(tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT) < 0) + if(H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR - if(H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT) < 0) + if(H5Tinsert(tid1, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) FAIL_STACK_ERROR /* Save datatype for later */ - if(H5Tcommit(group, "Datatype1", tid1) < 0) + if(H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Close datatype */ diff --git a/test/links.c b/test/links.c index 176792e..30509b4 100644 --- a/test/links.c +++ b/test/links.c @@ -3410,7 +3410,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(H5Tcommit(fid1, "elink/elink/elink/type1", tid) < 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 /* Close objects */ if(H5Gclose(gid) < 0) TEST_ERROR @@ -5081,7 +5081,7 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* Create a datatype and dataset as targets inside the group */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR - if(H5Tcommit(gid, "datatype", tid) < 0) TEST_ERROR + if(H5Tcommit2(gid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if(H5Tclose(tid) < 0) TEST_ERROR dims[0] = 2; @@ -5196,14 +5196,14 @@ linkinfo(hid_t fapl, hbool_t new_format) /* Set up filename and create file*/ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); - if((fid=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR /* Register a couple of user-defined link classes with the library */ if(H5Lregister(UD_plist_class) < 0) TEST_ERROR /* Create an object of each type */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR - if(H5Tcommit(fid, "datatype", tid) < 0) TEST_ERROR + if(H5Tcommit2(fid, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR if((gid = H5Gcreate2(fid, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if(H5Lcreate_soft("group", fid, "softlink", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR diff --git a/test/mount.c b/test/mount.c index f68589d..0009503 100644 --- a/test/mount.c +++ b/test/mount.c @@ -871,7 +871,7 @@ test_interlink(hid_t fapl) /* Try an interfile hard link by sharing a data type */ if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR - if(H5Tcommit(file1, "/type1", type) < 0) FAIL_STACK_ERROR + 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); diff --git a/test/ntypes.c b/test/ntypes.c index a7713cb..dc1538b 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -1918,26 +1918,26 @@ test_refer_dtype(hid_t file) if(H5Tinsert (tid1, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0) TEST_ERROR; - if(H5Tinsert (tid1, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) + if(H5Tinsert (tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) TEST_ERROR; - if(H5Tinsert (tid1, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) + if(H5Tinsert(tid1, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR; /* Save datatype for later */ - if(H5Tcommit (group, "Datatype1", tid1)<0) + if(H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR; /* Close datatype */ - if(H5Tclose(tid1)<0) + if(H5Tclose(tid1) < 0) TEST_ERROR; /* Close group */ - if(H5Gclose(group)<0) + if(H5Gclose(group) < 0) TEST_ERROR; /* Create a dataset */ - if((dataset=H5Dcreate(file,"Dataset3",H5T_STD_REF_OBJ,sid1,H5P_DEFAULT))<0) + if((dataset = H5Dcreate(file, "Dataset3", H5T_STD_REF_OBJ, sid1, H5P_DEFAULT)) < 0) TEST_ERROR; /* Create reference to named datatype */ diff --git a/test/objcopy.c b/test/objcopy.c index d6740a4..ef35c54 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1412,7 +1412,7 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR /* create named datatype */ - if((H5Tcommit(fid_src, NAME_DATATYPE_SIMPLE, tid)) < 0) TEST_ERROR + if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ if(H5Tclose(tid) < 0) TEST_ERROR @@ -1505,7 +1505,7 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((tid = H5Tvlen_create(H5T_NATIVE_INT)) < 0) TEST_ERROR /* create named datatype */ - if((H5Tcommit(fid_src, NAME_DATATYPE_VL, tid)) < 0) TEST_ERROR + if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the datatype */ if(H5Tclose(tid) < 0) TEST_ERROR @@ -1601,7 +1601,7 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((tid2 = H5Tvlen_create(tid)) < 0) TEST_ERROR /* create named datatype */ - if((H5Tcommit(fid_src, NAME_DATATYPE_VL_VL, tid2)) < 0) TEST_ERROR + if((H5Tcommit2(fid_src, NAME_DATATYPE_VL_VL, tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* close the first datatype */ if(H5Tclose(tid) < 0) TEST_ERROR @@ -2838,7 +2838,7 @@ test_copy_dataset_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* create named datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR - if((H5Tcommit(fid_src, NAME_DATATYPE_SIMPLE, tid)) < 0) TEST_ERROR + 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 @@ -2963,7 +2963,7 @@ test_copy_dataset_named_dtype_hier(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* create named datatype _inside_ hierarchy to copy */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR - if((H5Tcommit(gid, NAME_DATATYPE_SIMPLE, tid)) < 0) TEST_ERROR + 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 @@ -3102,7 +3102,7 @@ test_copy_dataset_named_dtype_hier_outside(hid_t fcpl_src, hid_t fcpl_dst, hid_t /* create named datatype _outside_ hierarchy to copy */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR - if((H5Tcommit(fid_src, NAME_DATATYPE_SIMPLE, tid)) < 0) TEST_ERROR + 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 @@ -3374,7 +3374,7 @@ test_copy_dataset_attr_named_dtype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) /* create named datatype _outside_ hierarchy to copy */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR - if((H5Tcommit(fid_src, NAME_DATATYPE_SIMPLE, tid)) < 0) TEST_ERROR + 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 @@ -5549,7 +5549,7 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl) if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR /* create named datatype */ - if((H5Tcommit(fid, NAME_DATATYPE_SIMPLE, tid)) < 0) TEST_ERROR + if((H5Tcommit2(fid, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* copy the datatype from SRC to DST */ @@ -5732,7 +5732,7 @@ test_copy_dataset_compact_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR /* named data type */ - if((H5Tcommit(fid_src, NAME_DATATYPE_VL, tid)) < 0) TEST_ERROR + if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create and set compact plist */ if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR @@ -5879,7 +5879,7 @@ test_copy_dataset_contig_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR /* named data type */ - if((H5Tcommit(fid_src, NAME_DATATYPE_VL, tid)) < 0) TEST_ERROR + 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 @@ -6020,7 +6020,7 @@ test_copy_dataset_chunked_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR /* named data type */ - if((H5Tcommit(fid_src, NAME_DATATYPE_VL, tid)) < 0) TEST_ERROR + if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create and set chunk plist */ if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR @@ -6169,7 +6169,7 @@ test_copy_dataset_compressed_named_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl if((tid_copy = H5Tcopy(tid)) < 0)TEST_ERROR /* named data type */ - if((H5Tcommit(fid_src, NAME_DATATYPE_VL, tid)) < 0) TEST_ERROR + if((H5Tcommit2(fid_src, NAME_DATATYPE_VL, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR /* create and set chunk plist */ if((pid = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR diff --git a/test/tattr.c b/test/tattr.c index c708fff..c85931c 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -1628,13 +1628,13 @@ test_attr_dtype_shared(hid_t fapl) CHECK(type_id, FAIL, "H5Tcopy"); /* Commit datatype to file */ - ret = H5Tcommit(file_id, TYPE1_NAME, type_id); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(file_id, TYPE1_NAME, type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Check reference count on named datatype */ ret = H5Oget_info(file_id, TYPE1_NAME, &oinfo, H5P_DEFAULT); CHECK(ret, FAIL, "H5Oget_info"); - VERIFY(oinfo.rc, 1, "H5Tcommit"); + VERIFY(oinfo.rc, 1, "H5Oget_info"); /* Create dataspace for dataset */ space_id = H5Screate(H5S_SCALAR); @@ -6693,8 +6693,8 @@ test_attr_shared_write(hid_t fcpl, hid_t fapl) /* Commit datatype to file */ if(test_shared == 2) { - ret = H5Tcommit(fid, TYPE1_NAME, attr_tid); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, TYPE1_NAME, attr_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); } /* end if */ /* Set up to query the object creation properties */ @@ -7019,8 +7019,8 @@ test_attr_shared_rename(hid_t fcpl, hid_t fapl) /* Commit datatype to file */ if(test_shared == 2) { - ret = H5Tcommit(fid, TYPE1_NAME, attr_tid); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, TYPE1_NAME, attr_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); } /* end if */ /* Set up to query the object creation properties */ @@ -7460,8 +7460,8 @@ test_attr_shared_delete(hid_t fcpl, hid_t fapl) /* Commit datatype to file */ if(test_shared == 2) { - ret = H5Tcommit(fid, TYPE1_NAME, attr_tid); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, TYPE1_NAME, attr_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); } /* end if */ /* Set up to query the object creation properties */ @@ -7824,8 +7824,8 @@ test_attr_shared_unlink(hid_t fcpl, hid_t fapl) /* Commit datatype to file */ if(test_shared == 2) { - ret = H5Tcommit(fid, TYPE1_NAME, attr_tid); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, TYPE1_NAME, attr_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); } /* end if */ /* Set up to query the object creation properties */ diff --git a/test/tfile.c b/test/tfile.c index 12f09b8..26a92fa 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -963,8 +963,8 @@ test_get_file_id(void) datatype_id=H5Tcopy(H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Acreate"); - ret = H5Tcommit(fid, TYPE_NAME, datatype_id); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, TYPE_NAME, datatype_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Test H5Iget_file_id() */ check_file_id(fid, datatype_id); @@ -1408,15 +1408,15 @@ test_file_open_dot(void) /* Create a named datatype with no name using the file ID */ H5E_BEGIN_TRY { - ret = H5Tcommit(fid, ".", tid); + ret = H5Tcommit2(fid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Tcommit"); + VERIFY(ret, FAIL, "H5Tcommit2"); /* Create a named datatype with no name using the group ID */ H5E_BEGIN_TRY { - ret = H5Tcommit(gid, ".", tid); + ret = H5Tcommit2(gid, ".", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(ret, FAIL, "H5Tcommit"); + VERIFY(ret, FAIL, "H5Tcommit2"); /* Open a named datatype with no name using the file ID */ H5E_BEGIN_TRY { @@ -1641,8 +1641,8 @@ test_file_getname(void) CHECK(ret, FAIL, "H5Tinsert"); /* Save it on file */ - ret = H5Tcommit(file_id, TESTA_DTYPENAME, type_id); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(file_id, TESTA_DTYPENAME, type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Get and verify file name */ name_len = H5Fget_name(type_id, name, (size_t)TESTA_NAME_BUF_SIZE); @@ -1820,8 +1820,8 @@ test_file_double_datatype_open(void) type1_id = H5Tcopy(H5T_NATIVE_INT); CHECK(type1_id, FAIL, "H5Tcopy"); - ret = H5Tcommit(file1_id, TYPE_NAME, type1_id); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(file1_id, TYPE_NAME, type1_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); type2_id = H5Topen(file2_id, TYPE_NAME); CHECK(type2_id, FAIL, "H5Topen"); diff --git a/test/th5o.c b/test/th5o.c index 291c73c..49f982a 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -65,8 +65,8 @@ test_h5o_open(void) /* Commit the type inside the group */ dtype = H5Tcopy(H5T_NATIVE_INT); CHECK(dtype, FAIL, "H5Tcopy"); - ret = H5Tcommit(fid, "group/datatype", dtype); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, "group/datatype", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); ret = H5Tclose(dtype); CHECK(ret, FAIL, "H5Tclose"); @@ -171,8 +171,8 @@ test_h5o_close(void) /* Commit the type inside the group */ dtype = H5Tcopy(H5T_NATIVE_INT); CHECK(dtype, FAIL, "H5Tcopy"); - ret = H5Tcommit(fid, "group/datatype", dtype); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, "group/datatype", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); ret = H5Oclose(dtype); CHECK(ret, FAIL, "H5Oclose"); @@ -267,8 +267,8 @@ test_h5o_open_by_addr(void) /* Commit the type inside the group */ dtype = H5Tcopy(H5T_NATIVE_INT); CHECK(dtype, FAIL, "H5Tcopy"); - ret = H5Tcommit(fid, "group/datatype", dtype); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, "group/datatype", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); ret = H5Tclose(dtype); CHECK(ret, FAIL, "H5Tclose"); @@ -394,8 +394,8 @@ test_h5o_refcount(void) /* Commit the type inside the group */ dtype = H5Tcopy(H5T_NATIVE_INT); CHECK(dtype, FAIL, "H5Tcopy"); - ret = H5Tcommit(fid, "datatype", dtype); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, "datatype", dtype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Create the data space for the dataset. */ dims[0] = DIM0; diff --git a/test/titerate.c b/test/titerate.c index a8e0f39..175a5a9 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -174,8 +174,8 @@ test_iter_group(hid_t fapl, hbool_t new_format) lnames[NDATASETS] = HDstrdup("grp"); CHECK(lnames[NDATASETS], NULL, "strdup"); - ret = H5Tcommit(file, "dtype", datatype); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); lnames[NDATASETS + 1] = HDstrdup("dtype"); CHECK(lnames[NDATASETS], NULL, "strdup"); @@ -652,8 +652,8 @@ test_iter_group_large(hid_t fapl) CHECK(ret, FAIL, "H5Tinsert"); /* Save datatype for later */ - ret = H5Tcommit(file, "Datatype1", tid); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(file, "Datatype1", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Add the name to the list of objects in the root group */ HDstrcpy(names[ITER_NGROUPS + 1].name, "Datatype1"); @@ -738,8 +738,8 @@ static void test_grp_memb_funcs(hid_t fapl) dnames[NDATASETS] = HDstrdup("grp"); CHECK(dnames[NDATASETS], NULL, "strdup"); - ret = H5Tcommit(file, "dtype", datatype); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(file, "dtype", datatype, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); dnames[NDATASETS + 1] = HDstrdup("dtype"); CHECK(dnames[NDATASETS], NULL, "strdup"); diff --git a/test/tmisc.c b/test/tmisc.c index f9abada..7882120 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -1100,83 +1100,83 @@ test_misc7(void) /* Attempt to commit a non-sensible datatype */ /* Create the file */ - fid=H5Fcreate(MISC7_FILE,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); - CHECK(fid,FAIL,"H5Fcreate"); + fid = H5Fcreate(MISC7_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(fid, FAIL, "H5Fcreate"); /* Create the dataspace */ - sid=H5Screate(H5S_SCALAR); - CHECK(sid,FAIL,"H5Screate"); + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); /* Create the compound datatype to commit*/ tid = H5Tcreate(H5T_COMPOUND, (size_t)32); CHECK(tid, FAIL, "H5Tcreate"); /* Attempt to commit an empty compound datatype */ - ret=H5Tcommit(fid,MISC7_TYPENAME1,tid); - VERIFY(ret,FAIL,"H5Tcommit"); + ret = H5Tcommit2(fid, MISC7_TYPENAME1, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + 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 = H5Dcreate(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT); + VERIFY(ret, FAIL, "H5Dcreate"); /* Add a field to the compound datatype */ ret = H5Tinsert(tid, "a", (size_t)0, H5T_NATIVE_INT); CHECK(ret, FAIL, "H5Tinsert"); /* Attempt to commit the compound datatype now - should work */ - ret=H5Tcommit(fid,MISC7_TYPENAME1,tid); - CHECK(ret,FAIL,"H5Tcommit"); + ret = H5Tcommit2(fid, MISC7_TYPENAME1, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + 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 = H5Dcreate(fid, MISC7_DSETNAME1, tid, sid, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate"); /* Close dataset */ - ret=H5Dclose(did); + ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); /* Close compound datatype */ - ret=H5Tclose(tid); + ret = H5Tclose(tid); CHECK(ret, FAIL, "H5Tclose"); /* Create the enum datatype to commit*/ - tid=H5Tenum_create(H5T_NATIVE_INT); - CHECK(tid,FAIL,"H5Tenum_create"); + tid = H5Tenum_create(H5T_NATIVE_INT); + CHECK(tid, FAIL, "H5Tenum_create"); /* Attempt to commit an empty enum datatype */ - ret=H5Tcommit(fid,MISC7_TYPENAME2,tid); - VERIFY(ret,FAIL,"H5Tcommit"); + ret = H5Tcommit2(fid, MISC7_TYPENAME2, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(ret, FAIL, "H5Tcommit2"); /* Attempt to use empty enum datatype to create dataset */ - did=H5Dcreate(fid,MISC7_DSETNAME2,tid,sid,H5P_DEFAULT); + did = H5Dcreate(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT); VERIFY(did,FAIL,"H5Dcreate"); /* Add a member to the enum datatype */ - ret=H5Tenum_insert(tid,"a",&enum_value); + ret = H5Tenum_insert(tid, "a", &enum_value); CHECK(ret,FAIL,"H5Tenum_insert"); /* Attempt to commit the enum datatype now - should work */ - ret=H5Tcommit(fid,MISC7_TYPENAME2,tid); - CHECK(ret,FAIL,"H5Tcommit"); + 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 = H5Dcreate(fid, MISC7_DSETNAME2, tid, sid, H5P_DEFAULT); + CHECK(did, FAIL, "H5Dcreate"); /* Close dataset */ - ret=H5Dclose(did); + ret = H5Dclose(did); CHECK(ret, FAIL, "H5Dclose"); /* Close enum datatype */ - ret=H5Tclose(tid); + ret = H5Tclose(tid); CHECK(ret, FAIL, "H5Tclose"); /* Close dataspace */ - ret=H5Sclose(sid); + ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); /* Close file */ - ret=H5Fclose(fid); + ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); } /* end test_misc7() */ @@ -2152,27 +2152,27 @@ create_hdf_file(const char *name) CHECK(ret, FAIL, "H5Pset_layout"); /* Use chunked storage for this DCPL */ - chunk_dims[0]=MISC13_CHUNK_DIM1; - chunk_dims[1]=MISC13_CHUNK_DIM2; - ret = H5Pset_chunk(dcpl,MISC13_RANK,chunk_dims); + chunk_dims[0] = MISC13_CHUNK_DIM1; + chunk_dims[1] = MISC13_CHUNK_DIM2; + ret = H5Pset_chunk(dcpl, MISC13_RANK, chunk_dims); CHECK(ret, FAIL, "H5Pset_chunk"); /* Create contiguous dataset in root group */ - create_dataset(fid,MISC13_DSET1_NAME,H5P_DEFAULT); + create_dataset(fid, MISC13_DSET1_NAME, H5P_DEFAULT); /* Create chunked dataset in root group */ - create_dataset(fid,MISC13_DSET2_NAME,dcpl); + create_dataset(fid, MISC13_DSET2_NAME, dcpl); /* Create a datatype to commit to the file */ - tid=H5Tcopy(H5T_NATIVE_INT); + tid = H5Tcopy(H5T_NATIVE_INT); CHECK(tid, FAIL, "H5Tcopy"); /* Create a named datatype in the root group */ - ret=H5Tcommit(fid,MISC13_DTYPE_NAME,tid); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, MISC13_DTYPE_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Close named datatype */ - ret=H5Tclose(tid); + ret = H5Tclose(tid); CHECK(ret, FAIL, "H5Tclose"); /* Create a group in the root group */ @@ -2188,21 +2188,21 @@ create_hdf_file(const char *name) CHECK(ret, FAIL, "H5Gclose"); /* Create contiguous dataset in new group */ - create_dataset(gid,MISC13_DSET1_NAME,H5P_DEFAULT); + create_dataset(gid, MISC13_DSET1_NAME, H5P_DEFAULT); /* Create chunked dataset in new group */ - create_dataset(gid,MISC13_DSET2_NAME,dcpl); + create_dataset(gid, MISC13_DSET2_NAME, dcpl); /* Create a datatype to commit to the new group */ - tid=H5Tcopy(H5T_NATIVE_INT); + tid = H5Tcopy(H5T_NATIVE_INT); CHECK(tid, FAIL, "H5Tcopy"); /* Create a named datatype in the new group */ - ret=H5Tcommit(gid,MISC13_DTYPE_NAME,tid); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(gid, MISC13_DTYPE_NAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Close named datatype */ - ret=H5Tclose(tid); + ret = H5Tclose(tid); CHECK(ret, FAIL, "H5Tclose"); /* Close the first group */ @@ -2215,7 +2215,7 @@ create_hdf_file(const char *name) /* Close the file */ ret = H5Fclose(fid); - assert(ret>=0); + assert(ret >= 0); CHECK(ret, FAIL, "H5Fclose"); } @@ -4051,8 +4051,8 @@ test_misc24(void) type_id = H5Tcopy(H5T_NATIVE_INT); CHECK(type_id, FAIL, "H5Tcopy"); - ret = H5Tcommit(file_id, MISC24_DATATYPE_NAME, type_id); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(file_id, MISC24_DATATYPE_NAME, type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Create soft links to the objects created */ ret = H5Lcreate_soft(MISC24_GROUP_NAME, file_id, MISC24_GROUP_LINK, H5P_DEFAULT, H5P_DEFAULT); diff --git a/test/trefer.c b/test/trefer.c index 233d65e..2b2c96e 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -152,8 +152,8 @@ test_reference_obj(void) CHECK(ret, FAIL, "H5Tinsert"); /* Save datatype for later */ - ret = H5Tcommit(group, "Datatype1", tid1); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Close datatype */ ret = H5Tclose(tid1); @@ -1196,8 +1196,8 @@ test_reference_compat(void) CHECK(ret, FAIL, "H5Tinsert"); /* Save datatype for later */ - ret = H5Tcommit(group, "Datatype1", tid1); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Close datatype */ ret = H5Tclose(tid1); diff --git a/test/tsohm.c b/test/tsohm.c index f5b5235..e0ddc8c 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -1028,8 +1028,8 @@ static void sohm_attr_helper(hid_t fcpl_id) /* Repeat with a committed datatype */ type_id = H5Tcopy(H5T_NATIVE_INT); CHECK_I(type_id, "H5Tcopy"); - ret = H5Tcommit(file_id, "datatype", type_id); - CHECK_I(ret, "H5Tcommit"); + ret = H5Tcommit2(file_id, "datatype", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK_I(ret, "H5Tcommit2"); /* Create and verify an attribute */ group_id = H5Gcreate2(file_id, "another_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); diff --git a/test/ttime.c b/test/ttime.c index 326b401..927d68a 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -48,29 +48,29 @@ test_time_commit(void) tid = H5Tcopy (H5T_UNIX_D32LE); CHECK(tid, FAIL, "H5Tcopy"); - status = H5Tcommit(file_id, "Committed D32LE type", tid); - CHECK(status, FAIL, "H5Tcommit"); + status = H5Tcommit2(file_id, "Committed D32LE type", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(status, FAIL, "H5Tcommit2"); status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); tid = H5Tcopy (H5T_UNIX_D32BE); CHECK(tid, FAIL, "H5Tcopy"); - status = H5Tcommit(file_id, "Committed D32BE type", tid); - CHECK(status, FAIL, "H5Tcommit"); + status = H5Tcommit2(file_id, "Committed D32BE type", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(status, FAIL, "H5Tcommit2"); status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); tid = H5Tcopy (H5T_UNIX_D64LE); CHECK(tid, FAIL, "H5Tcopy"); - status = H5Tcommit(file_id, "Committed D64LE type", tid); - CHECK(status, FAIL, "H5Tcommit"); + status = H5Tcommit2(file_id, "Committed D64LE type", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(status, FAIL, "H5Tcommit2"); status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); tid = H5Tcopy (H5T_UNIX_D64BE); CHECK(tid, FAIL, "H5Tcopy"); - status = H5Tcommit(file_id, "Committed D64BE type", tid); - CHECK(status, FAIL, "H5Tcommit"); + status = H5Tcommit2(file_id, "Committed D64BE type", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(status, FAIL, "H5Tcommit2"); status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); diff --git a/test/tunicode.c b/test/tunicode.c index 66432a3..de22dfc 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -435,8 +435,8 @@ void test_objnames(hid_t fid, const char* string) type_id = H5Tcreate(H5T_OPAQUE, (size_t)1); CHECK(type_id, FAIL, "H5Tcreate"); - ret = H5Tcommit(grp2_id, string, type_id); - CHECK(type_id, FAIL, "H5Tcommit"); + ret = H5Tcommit2(grp2_id, string, type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(type_id, FAIL, "H5Tcommit2"); ret = H5Tclose(type_id); CHECK(type_id, FAIL, "H5Tclose"); diff --git a/test/tvlstr.c b/test/tvlstr.c index f4f77b9..8d8c4a4 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -435,8 +435,8 @@ static void test_vlstring_type(void) VERIFY(pad, H5T_STR_NULLPAD, "H5Tget_strpad"); /* Commit variable-length string datatype to storage */ - ret = H5Tcommit(fid, VLSTR_TYPE, tid_vlstr); - CHECK(ret, FAIL, "H5Tcommit"); + ret = H5Tcommit2(fid, VLSTR_TYPE, tid_vlstr, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Tcommit2"); /* Close datatype */ ret = H5Tclose(tid_vlstr); diff --git a/test/unlink.c b/test/unlink.c index 9ac7532..f99a1cc 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -876,7 +876,7 @@ test_filespace(hid_t fapl) if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR /* Create a single named datatype to remove */ - if(H5Tcommit(file, TYPENAME, type) < 0) FAIL_STACK_ERROR + if(H5Tcommit2(file, TYPENAME, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Tclose(type) < 0) FAIL_STACK_ERROR /* Remove the named datatype */ @@ -1150,7 +1150,7 @@ test_filespace(hid_t fapl) if((type = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR /* Create a single named datatype to remove */ - if(H5Tcommit(file, TYPENAME, type) < 0) FAIL_STACK_ERROR + if(H5Tcommit2(file, TYPENAME, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR if(H5Tclose(type) < 0) FAIL_STACK_ERROR /* Create datatype to commit */ @@ -1158,7 +1158,7 @@ test_filespace(hid_t fapl) /* Create another named datatype with same name */ H5E_BEGIN_TRY { - status = H5Tcommit(file, TYPENAME, type); + status = H5Tcommit2(file, TYPENAME, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); } H5E_END_TRY; if(status >= 0) TEST_ERROR if(H5Tclose(type) < 0) FAIL_STACK_ERROR @@ -1924,7 +1924,7 @@ test_resurrect_datatype(hid_t fapl) /* Create a named datatype in the file */ if((type = H5Tcopy (H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR - if(H5Tcommit(file, TYPENAME, type) < 0) FAIL_STACK_ERROR + if(H5Tcommit2(file, TYPENAME, type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Unlink the datatype while it's open (will mark it for deletion when closed) */ if(H5Ldelete(file, TYPENAME, H5P_DEFAULT) < 0) FAIL_STACK_ERROR diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index 70c4694..6d07ae7 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -236,7 +236,7 @@ static void gent_named_vl(hid_t loc_id) tid = H5Tvlen_create(H5T_NATIVE_INT); /* create named datatype */ - H5Tcommit(loc_id, "vl", tid); + H5Tcommit2(loc_id, "vl", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* create dataset */ did = H5Dcreate(loc_id, DATASET_NAMED_VL, tid, sid, H5P_DEFAULT); diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index b50b985..dba7fca 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -349,15 +349,15 @@ int test_types(const char *fname) */ /* create and commit datatype 1 */ - tid1 = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)); + tid1 = H5Tcreate(H5T_COMPOUND, sizeof(s1_t)); H5Tinsert(tid1, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT); H5Tinsert(tid1, "b", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT); - H5Tcommit(fid1, "t1", tid1); + H5Tcommit2(fid1, "t1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Tclose(tid1); /* create and commit datatype 2 */ - tid2 = H5Tcreate (H5T_COMPOUND, sizeof(s2_t)); + tid2 = H5Tcreate(H5T_COMPOUND, sizeof(s2_t)); H5Tinsert(tid2, "a", HOFFSET(s2_t, a), H5T_NATIVE_INT); - H5Tcommit(fid1, "t2", tid2); + H5Tcommit2(fid1, "t2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Tclose(tid2); /*------------------------------------------------------------------------- diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index ec1b65c..ef80c4a 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -602,7 +602,7 @@ static void gent_compound_dt(void) { /* test compound data type */ type = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t)); H5Tinsert(type, "int_name", HOFFSET(dset2_t, a), H5T_STD_I32BE); H5Tinsert(type, "float_name", HOFFSET(dset2_t, b), H5T_IEEE_F32BE); - H5Tcommit(fid, "type1", type); + H5Tcommit2(fid, "type1", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t)); H5Tinsert(type2, "int_name", HOFFSET(dset2_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "float_name", HOFFSET(dset2_t, b), H5T_NATIVE_FLOAT); @@ -639,7 +639,7 @@ static void gent_compound_dt(void) { /* test compound data type */ H5Tinsert(type2, "float_array", HOFFSET(dset3_t, b), array_dt); H5Tclose(array_dt); - H5Tcommit(fid, "type2", type); + H5Tcommit2(fid, "type2", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); dset3_dim[0] = 3; dset3_dim[1] = 6; @@ -665,7 +665,7 @@ static void gent_compound_dt(void) { /* test compound data type */ type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset4_t)); H5Tinsert(type, "int", HOFFSET(dset4_t, a), H5T_STD_I32BE); H5Tinsert(type, "float", HOFFSET(dset4_t, b), H5T_IEEE_F32BE); - H5Tcommit(group, "type3", 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); @@ -680,11 +680,11 @@ static void gent_compound_dt(void) { /* test compound data type */ /* unamed data type */ group = H5Gcreate2(fid, "/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - type = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t)); + type = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t)); H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE); H5Tinsert(type, "float", HOFFSET(dset5_t, b), H5T_IEEE_F32BE); - H5Tcommit(group, "type4", type); - type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t)); + H5Tcommit2(group, "type4", type, H5P_DEFAULT, H5P_DEFAULT, 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); dataset = H5Dcreate(group, "dset5", type, space, H5P_DEFAULT); @@ -804,10 +804,10 @@ static void gent_compound_dt2(void) { /* test compound data type */ space = H5Screate_simple(1, &sdim, &maxdim); /* shared data type 1 */ - type = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t)); + type = H5Tcreate(H5T_COMPOUND, sizeof(dset2_t)); H5Tinsert(type, "int_name", HOFFSET(dset2_t, a), H5T_STD_I32BE); H5Tinsert(type, "float_name", HOFFSET(dset2_t, b), H5T_IEEE_F32BE); - H5Tcommit(fid, "type1", type); + H5Tcommit2(fid, "type1", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); group = H5Gcreate2(fid, "/group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -836,14 +836,14 @@ static void gent_compound_dt2(void) { /* test compound data type */ H5Tinsert(type, "float_array", HOFFSET(dset3_t, b), array_dt); H5Tclose(array_dt); - H5Tcommit(fid, "type2", type); + H5Tcommit2(fid, "type2", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Tclose(type); /* shared data type 3 */ - type = H5Tcreate (H5T_COMPOUND, sizeof(dset4_t)); + type = H5Tcreate(H5T_COMPOUND, sizeof(dset4_t)); H5Tinsert(type, "int", HOFFSET(dset4_t, a), H5T_STD_I32BE); H5Tinsert(type, "float", HOFFSET(dset4_t, b), H5T_IEEE_F32BE); - H5Tcommit(group, "type3", type); + H5Tcommit2(group, "type3", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); dataset = H5Dcreate(group, "dset4", type, space, create_plist); @@ -861,12 +861,12 @@ static void gent_compound_dt2(void) { /* test compound data type */ /* unamed data type */ group = H5Gcreate2(fid, "/group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - type = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t)); + type = H5Tcreate(H5T_COMPOUND, sizeof(dset5_t)); H5Tinsert(type, "int", HOFFSET(dset5_t, a), H5T_STD_I32BE); H5Tinsert(type, "float", HOFFSET(dset5_t, b), H5T_IEEE_F32BE); - H5Tcommit(group, "type4", type); + H5Tcommit2(group, "type4", type, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); dataset = H5Dcreate(group, "dset5", type, space, create_plist); - type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset5_t)); + 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); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset5); @@ -1617,7 +1617,7 @@ static void gent_enum(void) H5Tenum_insert(type, "BLUE blue", (val = 2, &val)); H5Tenum_insert(type, "WHITE \"white\"", (val = 3, &val)); H5Tenum_insert(type, "BLACK \'black\'", (val = 4, &val)); - H5Tcommit(file, "enum normal", type); + 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); @@ -1691,7 +1691,7 @@ static void gent_objref(void) H5Tinsert(tid1, "c", HOFFSET(s1_t,c), H5T_IEEE_F32BE); /* Save datatype for later */ - H5Tcommit(group, "Datatype1", tid1); + H5Tcommit2(group, "Datatype1", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Close datatype */ H5Tclose(tid1); @@ -3111,7 +3111,7 @@ static void gent_vlstr(void) /* Create a named VL string type. Change padding of datatype */ H5Tset_strpad(tid1, H5T_STR_NULLPAD); - H5Tcommit(fid1, "vl_string_type", tid1); + H5Tcommit2(fid1, "vl_string_type", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); /* Create an group attribute of VL string type */ root = H5Gopen2(fid1, "/", H5P_DEFAULT); @@ -4410,8 +4410,8 @@ static void gent_named_dtype_attr(void) assert(tid>0); /* Commit datatype to file */ - ret=H5Tcommit(fid,F42_TYPENAME,tid); - assert(ret>=0); + ret = H5Tcommit2(fid, F42_TYPENAME, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); /* Create a scalar dataspace used for all objects */ sid=H5Screate(H5S_SCALAR); @@ -4898,9 +4898,9 @@ static void gent_filters(void) * commit a H5G_TYPE type with a comment *------------------------------------------------------------------------- */ - tid=H5Tcopy(H5T_STD_B8LE); - ret=H5Tcommit(fid, "mytype", tid); - assert(ret>=0); + tid = H5Tcopy(H5T_STD_B8LE); + ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); ret = H5Oset_comment(fid, "mytype", "This is a commited datatype", H5P_DEFAULT); assert(ret >= 0); @@ -5051,16 +5051,16 @@ static void gent_fcontents(void) * datatypes *------------------------------------------------------------------------- */ - tid=H5Tcopy(H5T_NATIVE_INT); - ret=H5Tcommit(fid, "mytype", tid); - assert(ret>=0); - ret=H5Tclose(tid); - assert(ret>=0); + tid = H5Tcopy(H5T_NATIVE_INT); + ret = H5Tcommit2(fid, "mytype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + assert(ret >= 0); + ret = H5Tclose(tid); + assert(ret >= 0); /* no name datatype */ tid = H5Tcopy(H5T_NATIVE_INT); - ret = H5Tcommit(fid, "mytype2", tid); + ret = H5Tcommit2(fid, "mytype2", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); assert(ret >= 0); write_dset(fid, 1, dims, "dsetmytype2", tid, buf); ret = H5Ldelete(fid, "mytype2", H5P_DEFAULT); diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 05205b7..5180461 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -752,29 +752,29 @@ int do_copy_objects(hid_t fidin, */ case H5TRAV_TYPE_NAMED_DATATYPE: - if ((type_in = H5Topen (fidin,travt->objs[i].name))<0) + if((type_in = H5Topen(fidin, travt->objs[i].name)) < 0) goto error; - if ((type_out = H5Tcopy(type_in))<0) + if((type_out = H5Tcopy(type_in)) < 0) goto error; - if ((H5Tcommit(fidout,travt->objs[i].name,type_out))<0) + if((H5Tcommit2(fidout, travt->objs[i].name, type_out, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /*------------------------------------------------------------------------- * copy attrs *------------------------------------------------------------------------- */ - if (copy_attr(type_in,type_out,options)<0) + if(copy_attr(type_in, type_out, options) < 0) goto error; - if (H5Tclose(type_in)<0) + if(H5Tclose(type_in) < 0) goto error; - if (H5Tclose(type_out)<0) + if(H5Tclose(type_out) < 0) goto error; - if (options->verbose) - printf(FORMAT_OBJ,"type",travt->objs[i].name ); + if(options->verbose) + printf(FORMAT_OBJ, "type", travt->objs[i].name); break; diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index cc5591d..0cdc4c0 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1558,52 +1558,52 @@ int make_all_objects(hid_t loc_id) } s_t; /*------------------------------------------------------------------------- - * H5G_DATASET - *------------------------------------------------------------------------- - */ + * H5G_DATASET + *------------------------------------------------------------------------- + */ space_id = H5Screate_simple(1,dims,NULL); dset_id = H5Dcreate(loc_id,"dset_referenced",H5T_NATIVE_INT,space_id,H5P_DEFAULT); H5Sclose(space_id); /*------------------------------------------------------------------------- - * H5G_GROUP - *------------------------------------------------------------------------- - */ + * H5G_GROUP + *------------------------------------------------------------------------- + */ group_id = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); root_id = H5Gopen2(loc_id, "/", H5P_DEFAULT); /*------------------------------------------------------------------------- - * H5G_TYPE - *------------------------------------------------------------------------- - */ + * H5G_TYPE + *------------------------------------------------------------------------- + */ /* Create a memory compound datatype */ - type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + type_id = H5Tcreate(H5T_COMPOUND, sizeof(s_t)); H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_INT); H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_FLOAT); /* Commit compound datatype and close it */ - H5Tcommit(loc_id, "type", type_id); + H5Tcommit2(loc_id, "type", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Tclose(type_id); /*------------------------------------------------------------------------- - * H5G_LINK - *------------------------------------------------------------------------- - */ + * H5G_LINK + *------------------------------------------------------------------------- + */ H5Lcreate_soft("dset", loc_id, "link", H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- - * H5G_UDLINK - *------------------------------------------------------------------------- - */ + * H5G_UDLINK + *------------------------------------------------------------------------- + */ /* Create an external link. Other UD links are not supported by h5repack */ H5Lcreate_external("file", "path", loc_id, "ext_link", H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- - * write a series of datasetes - *------------------------------------------------------------------------- - */ + * write a series of datasetes + *------------------------------------------------------------------------- + */ write_dset_in(root_id,"dset_referenced",loc_id,0); @@ -2409,8 +2409,7 @@ int make_early(void) if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto out; - for(i = 0; i < iter; i++) - { + 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) @@ -2418,7 +2417,7 @@ int make_early(void) if((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) goto out; sprintf(name, "%d", i); - if((H5Tcommit(fid, name, tid)) < 0) + if((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Tclose(tid) < 0) goto out; @@ -2438,12 +2437,11 @@ int make_early(void) if((fid = H5Fcreate(FNAME6, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; - for(i = 0; i < iter; i++) - { + for(i = 0; i < iter; i++) { if((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) goto out; sprintf(name, "%d", i); - if((H5Tcommit(fid, name, tid)) < 0) + if((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if(H5Tclose(tid) < 0) goto out; |