summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-05-10 16:09:55 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-05-10 16:09:55 (GMT)
commitdd45c3694ffc423170b513f8be339d5bc4484476 (patch)
tree79968843466c5712779c52fb26997c7c2d147563 /tools/lib
parent772e6e9a7f5a5b01cfb6198830a41a4a0323a0a2 (diff)
downloadhdf5-dd45c3694ffc423170b513f8be339d5bc4484476.zip
hdf5-dd45c3694ffc423170b513f8be339d5bc4484476.tar.gz
hdf5-dd45c3694ffc423170b513f8be339d5bc4484476.tar.bz2
HDFFV-10186 braces formatting
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff_util.c131
1 files changed, 59 insertions, 72 deletions
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 6a512ac..454f993 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -33,19 +33,14 @@ print_dimensions (int rank, hsize_t *dims)
{
int i;
- if ( rank <= 0 )
- {
+ if( rank <= 0 )
parallel_print("H5S_SCALAR" );
- }
- else
- {
+ else {
if (!dims)
parallel_print("dimension is NULL");
- else
- {
+ 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");
}
@@ -74,108 +69,104 @@ print_dimensions (int rank, hsize_t *dims)
*/
void print_type(hid_t type)
{
- switch (H5Tget_class(type))
- {
+ switch (H5Tget_class(type)) {
case H5T_INTEGER:
- if (H5Tequal(type, H5T_STD_I8BE)) {
+ if(H5Tequal(type, H5T_STD_I8BE))
parallel_print("H5T_STD_I8BE");
- } else if (H5Tequal(type, H5T_STD_I8LE)) {
+ else if(H5Tequal(type, H5T_STD_I8LE))
parallel_print("H5T_STD_I8LE");
- } else if (H5Tequal(type, H5T_STD_I16BE)) {
+ else if(H5Tequal(type, H5T_STD_I16BE))
parallel_print("H5T_STD_I16BE");
- } else if (H5Tequal(type, H5T_STD_I16LE)) {
+ else if(H5Tequal(type, H5T_STD_I16LE))
parallel_print("H5T_STD_I16LE");
- } else if (H5Tequal(type, H5T_STD_I32BE)) {
+ else if(H5Tequal(type, H5T_STD_I32BE))
parallel_print("H5T_STD_I32BE");
- } else if (H5Tequal(type, H5T_STD_I32LE)) {
+ else if(H5Tequal(type, H5T_STD_I32LE))
parallel_print("H5T_STD_I32LE");
- } else if (H5Tequal(type, H5T_STD_I64BE)) {
+ else if(H5Tequal(type, H5T_STD_I64BE))
parallel_print("H5T_STD_I64BE");
- } else if (H5Tequal(type, H5T_STD_I64LE)) {
+ else if(H5Tequal(type, H5T_STD_I64LE))
parallel_print("H5T_STD_I64LE");
- } else if (H5Tequal(type, H5T_STD_U8BE)) {
+ else if(H5Tequal(type, H5T_STD_U8BE))
parallel_print("H5T_STD_U8BE");
- } else if (H5Tequal(type, H5T_STD_U8LE)) {
+ else if(H5Tequal(type, H5T_STD_U8LE))
parallel_print("H5T_STD_U8LE");
- } else if (H5Tequal(type, H5T_STD_U16BE)) {
+ else if(H5Tequal(type, H5T_STD_U16BE))
parallel_print("H5T_STD_U16BE");
- } else if (H5Tequal(type, H5T_STD_U16LE)) {
+ else if(H5Tequal(type, H5T_STD_U16LE))
parallel_print("H5T_STD_U16LE");
- } else if (H5Tequal(type, H5T_STD_U32BE)) {
+ else if(H5Tequal(type, H5T_STD_U32BE))
parallel_print("H5T_STD_U32BE");
- } else if (H5Tequal(type, H5T_STD_U32LE)) {
+ else if(H5Tequal(type, H5T_STD_U32LE))
parallel_print("H5T_STD_U32LE");
- } else if (H5Tequal(type, H5T_STD_U64BE)) {
+ else if(H5Tequal(type, H5T_STD_U64BE))
parallel_print("H5T_STD_U64BE");
- } else if (H5Tequal(type, H5T_STD_U64LE)) {
+ else if(H5Tequal(type, H5T_STD_U64LE))
parallel_print("H5T_STD_U64LE");
- } else if (H5Tequal(type, H5T_NATIVE_SCHAR)) {
+ else if(H5Tequal(type, H5T_NATIVE_SCHAR))
parallel_print("H5T_NATIVE_SCHAR");
- } else if (H5Tequal(type, H5T_NATIVE_UCHAR)) {
+ else if(H5Tequal(type, H5T_NATIVE_UCHAR))
parallel_print("H5T_NATIVE_UCHAR");
- } else if (H5Tequal(type, H5T_NATIVE_SHORT)) {
+ else if(H5Tequal(type, H5T_NATIVE_SHORT))
parallel_print("H5T_NATIVE_SHORT");
- } else if (H5Tequal(type, H5T_NATIVE_USHORT)) {
+ else if(H5Tequal(type, H5T_NATIVE_USHORT))
parallel_print("H5T_NATIVE_USHORT");
- } else if (H5Tequal(type, H5T_NATIVE_INT)) {
+ else if(H5Tequal(type, H5T_NATIVE_INT))
parallel_print("H5T_NATIVE_INT");
- } else if (H5Tequal(type, H5T_NATIVE_UINT)) {
+ else if(H5Tequal(type, H5T_NATIVE_UINT))
parallel_print("H5T_NATIVE_UINT");
- } else if (H5Tequal(type, H5T_NATIVE_LONG)) {
+ else if(H5Tequal(type, H5T_NATIVE_LONG))
parallel_print("H5T_NATIVE_LONG");
- } else if (H5Tequal(type, H5T_NATIVE_ULONG)) {
+ else if(H5Tequal(type, H5T_NATIVE_ULONG))
parallel_print("H5T_NATIVE_ULONG");
- } else if (H5Tequal(type, H5T_NATIVE_LLONG)) {
+ else if(H5Tequal(type, H5T_NATIVE_LLONG))
parallel_print("H5T_NATIVE_LLONG");
- } else if (H5Tequal(type, H5T_NATIVE_ULLONG)) {
+ else if(H5Tequal(type, H5T_NATIVE_ULLONG))
parallel_print("H5T_NATIVE_ULLONG");
- } else {
+ else
parallel_print("undefined integer");
- }
break;
case H5T_FLOAT:
- if (H5Tequal(type, H5T_IEEE_F32BE)) {
+ if(H5Tequal(type, H5T_IEEE_F32BE))
parallel_print("H5T_IEEE_F32BE");
- } else if (H5Tequal(type, H5T_IEEE_F32LE)) {
+ else if(H5Tequal(type, H5T_IEEE_F32LE))
parallel_print("H5T_IEEE_F32LE");
- } else if (H5Tequal(type, H5T_IEEE_F64BE)) {
+ else if(H5Tequal(type, H5T_IEEE_F64BE))
parallel_print("H5T_IEEE_F64BE");
- } else if (H5Tequal(type, H5T_IEEE_F64LE)) {
+ else if(H5Tequal(type, H5T_IEEE_F64LE))
parallel_print("H5T_IEEE_F64LE");
- } else if (H5Tequal(type, H5T_NATIVE_FLOAT)) {
+ else if(H5Tequal(type, H5T_NATIVE_FLOAT))
parallel_print("H5T_NATIVE_FLOAT");
- } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) {
+ else if(H5Tequal(type, H5T_NATIVE_DOUBLE))
parallel_print("H5T_NATIVE_DOUBLE");
#if H5_SIZEOF_LONG_DOUBLE !=0
- } else if (H5Tequal(type, H5T_NATIVE_LDOUBLE)) {
+ else if(H5Tequal(type, H5T_NATIVE_LDOUBLE))
parallel_print("H5T_NATIVE_LDOUBLE");
#endif
- } else {
+ else
parallel_print("undefined float");
- }
break;
case H5T_BITFIELD:
- if (H5Tequal(type, H5T_STD_B8BE)) {
+ if(H5Tequal(type, H5T_STD_B8BE))
parallel_print("H5T_STD_B8BE");
- } else if (H5Tequal(type, H5T_STD_B8LE)) {
+ else if(H5Tequal(type, H5T_STD_B8LE))
parallel_print("H5T_STD_B8LE");
- } else if (H5Tequal(type, H5T_STD_B16BE)) {
+ else if(H5Tequal(type, H5T_STD_B16BE))
parallel_print("H5T_STD_B16BE");
- } else if (H5Tequal(type, H5T_STD_B16LE)) {
+ else if(H5Tequal(type, H5T_STD_B16LE))
parallel_print("H5T_STD_B16LE");
- } else if (H5Tequal(type, H5T_STD_B32BE)) {
+ else if(H5Tequal(type, H5T_STD_B32BE))
parallel_print("H5T_STD_B32BE");
- } else if (H5Tequal(type, H5T_STD_B32LE)) {
+ else if(H5Tequal(type, H5T_STD_B32LE))
parallel_print("H5T_STD_B32LE");
- } else if (H5Tequal(type, H5T_STD_B64BE)) {
+ else if(H5Tequal(type, H5T_STD_B64BE))
parallel_print("H5T_STD_B64BE");
- } else if (H5Tequal(type, H5T_STD_B64LE)) {
+ else if(H5Tequal(type, H5T_STD_B64LE))
parallel_print("H5T_STD_B64LE");
- } else {
+ else
parallel_print("undefined bitfield");
- }
break;
case H5T_TIME:
@@ -210,16 +201,16 @@ diff_basename(const char *name)
{
size_t i;
- if (name == NULL)
+ if(name == NULL)
return NULL;
/* Find the end of the base name */
i = HDstrlen(name);
- while (i > 0 && '/' == name[i - 1])
+ while(i > 0 && '/' == name[i - 1])
--i;
/* Skip backward over base name */
- while (i > 0 && '/' != name[i - 1])
+ while(i > 0 && '/' != name[i - 1])
--i;
return(name+i);
@@ -277,7 +268,7 @@ get_type(h5trav_type_t type)
H5_ATTR_PURE const char*
get_sign(H5T_sign_t sign)
{
- switch (sign)
+ switch(sign)
{
case H5T_SGN_NONE:
return "H5T_SGN_NONE";
@@ -312,7 +303,7 @@ get_sign(H5T_sign_t sign)
H5_ATTR_PURE const char*
get_class(H5T_class_t tclass)
{
- switch (tclass) {
+ switch(tclass) {
case H5T_TIME:
return("H5T_TIME");
@@ -382,14 +373,11 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
{
herr_t ret = SUCCEED;
- if( (*m_size1) != (*m_size2) )
- {
- if( (*m_size1) < (*m_size2) )
- {
+ if((*m_size1) != (*m_size2)) {
+ if((*m_size1) < (*m_size2)) {
H5Tclose( *m_tid1 );
- if(( (*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0)
- {
+ if(((*m_tid1) = H5Tget_native_type(f_tid2_id, H5T_DIR_DEFAULT)) < 0) {
ret = FAIL;
goto out;
}
@@ -399,8 +387,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
else {
H5Tclose(*m_tid2);
- if(( (*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0)
- {
+ if(((*m_tid2) = H5Tget_native_type(f_tid1_id, H5T_DIR_DEFAULT)) < 0) {
ret = FAIL;
goto out;
}
@@ -408,7 +395,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
*m_size2 = H5Tget_size(*m_tid2);
} /* end else */
} /* end if */
- HDassert( (*m_size1) == (*m_size2) );
+ HDassert((*m_size1) == (*m_size2));
out:
return ret;