summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff_attr.c6
-rw-r--r--tools/lib/h5diff_dset.c42
-rw-r--r--tools/lib/h5tools_utils.c4
-rw-r--r--tools/lib/talign.c6
4 files changed, 28 insertions, 30 deletions
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index e94c723..dfea49f 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -22,9 +22,9 @@
*
* Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are
* obtained either from
- * loc_id = H5Gopen2( fid, name, H5P_DEFAULT);
- * loc_id = H5Dopen( fid, name);
- * loc_id = H5Topen2( fid, name, H5P_DEFAULT);
+ * loc_id = H5Gopen2(fid, name, H5P_DEFAULT);
+ * loc_id = H5Dopen2(fid, name);
+ * loc_id = H5Topen2(fid, name, H5P_DEFAULT);
*
* Return: number of differences found
*
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index d3a7078..ea833db 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -65,11 +65,11 @@ hsize_t diff_dataset( hid_t file1_id,
const char *obj2_name,
diff_opt_t *options)
{
- hid_t did1=-1;
- hid_t did2=-1;
- hid_t dcpl1=-1;
- hid_t dcpl2=-1;
- hsize_t nfound=0;
+ hid_t did1 = -1;
+ hid_t did2 = -1;
+ hid_t dcpl1 = -1;
+ hid_t dcpl2 = -1;
+ hsize_t nfound = 0;
/*-------------------------------------------------------------------------
* open the handles
@@ -78,23 +78,21 @@ hsize_t diff_dataset( hid_t file1_id,
/* disable error reporting */
H5E_BEGIN_TRY {
/* Open the datasets */
- if ( (did1 = H5Dopen(file1_id,obj1_name)) < 0 )
- {
- printf("Cannot open dataset <%s>\n", obj1_name );
+ if((did1 = H5Dopen2(file1_id, obj1_name, H5P_DEFAULT)) < 0) {
+ printf("Cannot open dataset <%s>\n", obj1_name);
goto error;
}
- if ( (did2 = H5Dopen(file2_id,obj2_name)) < 0 )
- {
- printf("Cannot open dataset <%s>\n", obj2_name );
+ if((did2 = H5Dopen2(file2_id, obj2_name, H5P_DEFAULT)) < 0) {
+ printf("Cannot open dataset <%s>\n", obj2_name);
goto error;
}
/* enable error reporting */
} H5E_END_TRY;
- if ((dcpl1=H5Dget_create_plist(did1))<0)
+ if((dcpl1 = H5Dget_create_plist(did1)) < 0)
goto error;
- if ((dcpl2=H5Dget_create_plist(did2))<0)
+ if((dcpl2 = H5Dget_create_plist(did2)) < 0)
goto error;
/*-------------------------------------------------------------------------
@@ -315,10 +313,10 @@ hsize_t diff_datasetid( hid_t did1,
* memory type and sizes
*-------------------------------------------------------------------------
*/
- if ((m_tid1=h5tools_get_native_type(f_tid1))<0)
+ if ((m_tid1=h5tools_get_native_type(f_tid1)) < 0)
goto error;
- if ((m_tid2=h5tools_get_native_type(f_tid2))<0)
+ if ((m_tid2=h5tools_get_native_type(f_tid2)) < 0)
goto error;
m_size1 = H5Tget_size( m_tid1 );
@@ -378,7 +376,7 @@ hsize_t diff_datasetid( hid_t did1,
{
H5Tclose(m_tid1);
- if ((m_tid1=h5tools_get_native_type(f_tid2))<0)
+ if ((m_tid1=h5tools_get_native_type(f_tid2)) < 0)
goto error;
m_size1 = H5Tget_size( m_tid1 );
@@ -387,7 +385,7 @@ hsize_t diff_datasetid( hid_t did1,
{
H5Tclose(m_tid2);
- if ((m_tid2=h5tools_get_native_type(f_tid1))<0)
+ if ((m_tid2=h5tools_get_native_type(f_tid1)) < 0)
goto error;
m_size2 = H5Tget_size( m_tid2 );
@@ -495,11 +493,11 @@ hsize_t diff_datasetid( hid_t did1,
hs_size[i] = MIN(dims1[i] - hs_offset[i], sm_size[i]);
hs_nelmts *= hs_size[i];
}
- if (H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL)<0)
+ if (H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
goto error;
- if (H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL)<0)
+ if (H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
goto error;
- if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL)<0)
+ if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
goto error;
}
else
@@ -692,10 +690,10 @@ int diff_can_type( hid_t f_tid1, /* file data type */
*-------------------------------------------------------------------------
*/
- if ((tclass1=H5Tget_class(f_tid1))<0)
+ if ((tclass1=H5Tget_class(f_tid1)) < 0)
return -1;
- if ((tclass2=H5Tget_class(f_tid2))<0)
+ if ((tclass2=H5Tget_class(f_tid2)) < 0)
return -1;
if ( tclass1 != tclass2 )
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 4aabe09..de2043e 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -520,14 +520,14 @@ find_objs_cb(hid_t group, const char *name, const H5L_info_t UNUSED *linfo, void
tmp = build_obj_path_name(info->prefix, name);
add_obj(info->dset_table, oinfo.addr, tmp, TRUE);
- if((dset = H5Dopen (group, name)) >= 0) {
+ if((dset = H5Dopen2(group, name, H5P_DEFAULT)) >= 0) {
hid_t type;
type = H5Dget_type(dset);
if(H5Tcommitted(type) > 0) {
H5Oget_info(type, ".", &oinfo, H5P_DEFAULT);
- if (search_obj(info->type_table, oinfo.addr) == NULL) {
+ if(search_obj(info->type_table, oinfo.addr) == NULL) {
char *type_name = HDstrdup(tmp);
add_obj(info->type_table, oinfo.addr, type_name, FALSE);
diff --git a/tools/lib/talign.c b/tools/lib/talign.c
index b0dbbe9..9c16d9a 100644
--- a/tools/lib/talign.c
+++ b/tools/lib/talign.c
@@ -127,17 +127,17 @@ int main(void)
/* Now open the set, and read it back in */
data = malloc(H5Tget_size(fix));
- if (!data) {
+ if(!data) {
perror("malloc() failed");
abort();
}
- set = H5Dopen(fil, setname);
+ set = H5Dopen2(fil, setname, H5P_DEFAULT);
H5Dread(set, fix, spc, H5S_ALL, H5P_DEFAULT, data);
fptr = (float *)(data + H5Tget_member_offset(fix, 1));
- if (fok[0] != fptr[0] || fok[1] != fptr[1]
+ if(fok[0] != fptr[0] || fok[1] != fptr[1]
|| fnok[0] != fptr[2] || fnok[1] != fptr[3]) {
result = 1;
printf("%14s (%2d) %6s = %s\n",