summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_util.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2017-12-01 18:41:26 (GMT)
commitb8c6b68c35fa2be23ef488a1d81097ff3ed55000 (patch)
treec3429ee577e454526c8704d66a84f0c45b7959a1 /tools/lib/h5diff_util.c
parent23a702e7bad93fc4f14eab07678c75d276e2d0ad (diff)
parent60f76980aab92f0e0730170b99a2363acd3c97fa (diff)
downloadhdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.zip
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.gz
hdf5-b8c6b68c35fa2be23ef488a1d81097ff3ed55000.tar.bz2
Merge pull request #811 in HDFFV/hdf5 from hdf5_1_8_20 to 1.8/masterhdf5-1_8_20
* commit '60f76980aab92f0e0730170b99a2363acd3c97fa': (108 commits) Update version numbers and remove empty sections in RELEASE.txt. Restore line 1154: C2Cppfunction_map.mht to HTML_EXTRA_FILES. Update version for 1.8.20 release. Fixed documentation warnings HDFFV-10329 Correct LINK INTERFACE and VS20013 compile Switch default build mode from development to production. Increment version string to pre2. Add RELEASE.txt note for HDFFV-10274. (cherry picked from commit f7a7d0a00613cba997212fa8032091629a678797) Initialize hid_t variables in test_Attr_bug9. (cherry picked from commit 97bc393449f3fe02c5992872ab2842e12f611ef0) Fix HDFFV-10274. When deleting all (or almost all) of the messages in an object header chunk, where the total amount deleted was greater than 64K, an error would occur due to an off by one error in the code that handled that case. Fixed this and added a test case. (cherry picked from commit 1b2c2ca9a6a7d7e1fcd5c3302e203f2e2dabf0af) Fix linking of libs Changed file path to relative. iAdd NAG to supported compilers in RELEASE.txt. Add description to RELEASE.txt for HDFFV-10323 Correct issue number Set version to 1.8.20-pre1 Update supported and tested platforms in RELEASE.txt. HDFFV-10321 Merge from 1.8 Incremented lib file .so numbers: revision for all except c++ for code change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. updated issues related to Fortran Incremented lib file .so numbers: revision for all except c++ for dcode change; current incremented, revision and age set to 0 for c++ due to symbols added and removed. ...
Diffstat (limited to 'tools/lib/h5diff_util.c')
-rw-r--r--tools/lib/h5diff_util.c89
1 files changed, 27 insertions, 62 deletions
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 0c02779..0f0fd14 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -24,8 +24,7 @@ int g_nTasks = 1;
/*-------------------------------------------------------------------------
* Function: print_dimensions
*
- * Purpose: print dimensions
- *
+ * Purpose: print dimensions
*-------------------------------------------------------------------------
*/
void
@@ -33,14 +32,14 @@ print_dimensions (int rank, hsize_t *dims)
{
int i;
- if( rank <= 0 )
+ if(rank <= 0)
parallel_print("H5S_SCALAR" );
else {
if (!dims)
parallel_print("dimension is NULL");
else {
parallel_print("[");
- for ( i = 0; i < rank-1; i++) {
+ for (i = 0; i < rank-1; i++) {
parallel_print(HSIZE_T_FORMAT, dims[i]);
parallel_print("x");
}
@@ -55,16 +54,11 @@ print_dimensions (int rank, hsize_t *dims)
/*-------------------------------------------------------------------------
* Function: print_type
*
- * Purpose: Print name of datatype
- *
- * Return: void
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
+ * Purpose: Print name of datatype
*
- * Date: May 9, 2003
- *
- * Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only
+ * Return: void
*
+ * Comments: Adapted from h5dump for H5T_INTEGER and H5T_FLOAT classes only
*-------------------------------------------------------------------------
*/
void print_type(hid_t type)
@@ -188,15 +182,10 @@ void print_type(hid_t type)
/*-------------------------------------------------------------------------
* Function: diff_basename
*
- * Purpose: Returns a pointer to the last component absolute name
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
- *
+ * Purpose: Returns a pointer to the last component absolute name
*-------------------------------------------------------------------------
*/
-const char*
+ const char*
diff_basename(const char *name)
{
size_t i;
@@ -219,12 +208,7 @@ diff_basename(const char *name)
/*-------------------------------------------------------------------------
* Function: get_type
*
- * Purpose: Returns the type as a string
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
- *
+ * Purpose: Returns the type as a string
*-------------------------------------------------------------------------
*/
const char*
@@ -255,21 +239,13 @@ get_type(h5trav_type_t type)
/*-------------------------------------------------------------------------
* Function: get_sign
*
- * Purpose: Returns the sign as a string
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
- *
- * Comments:
- *
+ * Purpose: Returns the sign as a string
*-------------------------------------------------------------------------
*/
-const char*
+ const char*
get_sign(H5T_sign_t sign)
{
- switch(sign)
- {
+ switch(sign) {
case H5T_SGN_NONE:
return "H5T_SGN_NONE";
@@ -283,7 +259,6 @@ get_sign(H5T_sign_t sign)
return "H5T_NSGN";
default:
- HDassert(0);
return "unknown sign value";
} /* end switch */
}
@@ -292,15 +267,10 @@ get_sign(H5T_sign_t sign)
/*-------------------------------------------------------------------------
* Function: get_class
*
- * Purpose: Returns the class as a string
- *
- * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
- *
- * Date: May 9, 2003
- *
+ * Purpose: Returns the class as a string
*-------------------------------------------------------------------------
*/
-const char*
+ const char*
get_class(H5T_class_t tclass)
{
switch(tclass) {
@@ -340,7 +310,6 @@ get_class(H5T_class_t tclass)
case H5T_NO_CLASS:
case H5T_NCLASSES:
default:
- HDassert(0);
return("Invalid class");
} /* end switch */
} /* end get_class() */
@@ -348,8 +317,7 @@ get_class(H5T_class_t tclass)
/*-------------------------------------------------------------------------
* Function: print_found
*
- * Purpose: print number of differences found
- *
+ * Purpose: print number of differences found
*-------------------------------------------------------------------------
*/
void print_found(hsize_t nfound)
@@ -364,40 +332,37 @@ void print_found(hsize_t nfound)
/*-----------------------------------------------------------------
* Function: match_up_memsize
*
- * Purpose: match smaller memory size up to bigger memory size
+ * Purpose: match smaller memory size up to bigger memory size
*------------------------------------------------------------------
*/
herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
hid_t *m_tid1, hid_t *m_tid2,
size_t *m_size1, size_t *m_size2)
{
- herr_t ret = SUCCEED;
+ herr_t ret_value = SUCCEED;
if((*m_size1) != (*m_size2)) {
if((*m_size1) < (*m_size2)) {
- H5Tclose( *m_tid1 );
+ H5Tclose(*m_tid1);
- if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) {
- ret = FAIL;
- goto out;
- }
+ if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
- *m_size1 = H5Tget_size( *m_tid1 );
+ *m_size1 = H5Tget_size(*m_tid1);
} /* end if */
else {
H5Tclose(*m_tid2);
- if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) {
- ret = FAIL;
- goto out;
- }
+ if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
*m_size2 = H5Tget_size(*m_tid2);
} /* end else */
} /* end if */
- HDassert((*m_size1) == (*m_size2));
+ if((*m_size1) != (*m_size2))
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "native type sizes do not compare");
-out:
- return ret;
+done:
+ return ret_value;
}