diff options
Diffstat (limited to 'tools/lib/h5diff_util.c')
-rw-r--r-- | tools/lib/h5diff_util.c | 100 |
1 files changed, 60 insertions, 40 deletions
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 14fbcaa..985a47d 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -186,21 +186,21 @@ void print_type(hid_t type) * *------------------------------------------------------------------------- */ -const char* +H5_ATTR_PURE const char* 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); @@ -217,20 +217,25 @@ diff_basename(const char *name) * *------------------------------------------------------------------------- */ -const char* +H5_ATTR_PURE H5_ATTR_CONST const char* get_type(h5trav_type_t type) { switch(type) { case H5TRAV_TYPE_DATASET: return("H5G_DATASET"); + case H5TRAV_TYPE_GROUP: return("H5G_GROUP"); + case H5TRAV_TYPE_NAMED_DATATYPE: return("H5G_TYPE"); + case H5TRAV_TYPE_LINK: return("H5G_LINK"); + case H5TRAV_TYPE_UDLINK: return("H5G_UDLINK"); + case H5TRAV_TYPE_UNKNOWN: default: return("unknown type"); @@ -250,19 +255,23 @@ get_type(h5trav_type_t type) * *------------------------------------------------------------------------- */ -const char* +H5_ATTR_PURE const char* get_sign(H5T_sign_t sign) { switch (sign) { case H5T_SGN_NONE: return "H5T_SGN_NONE"; + case H5T_SGN_2: return "H5T_SGN_2"; + case H5T_SGN_ERROR: return "H5T_SGN_ERROR"; + case H5T_NSGN: return "H5T_NSGN"; + default: HDassert(0); return "unknown sign value"; @@ -281,38 +290,48 @@ get_sign(H5T_sign_t sign) * *------------------------------------------------------------------------- */ -const char* +H5_ATTR_PURE const char* get_class(H5T_class_t tclass) { - switch (tclass) - { - case H5T_TIME: - return("H5T_TIME"); - case H5T_INTEGER: - return("H5T_INTEGER"); - case H5T_FLOAT: - return("H5T_FLOAT"); - case H5T_STRING: - return("H5T_STRING"); - case H5T_BITFIELD: - return("H5T_BITFIELD"); - case H5T_OPAQUE: - return("H5T_OPAQUE"); - case H5T_COMPOUND: - return("H5T_COMPOUND"); - case H5T_REFERENCE: - return("H5T_REFERENCE"); - case H5T_ENUM: - return("H5T_ENUM"); - case H5T_VLEN: - return("H5T_VLEN"); - case H5T_ARRAY: - return("H5T_ARRAY"); - case H5T_NO_CLASS: - case H5T_NCLASSES: - default: - HDassert(0); - return("Invalid class"); + switch (tclass) { + case H5T_TIME: + return("H5T_TIME"); + + case H5T_INTEGER: + return("H5T_INTEGER"); + + case H5T_FLOAT: + return("H5T_FLOAT"); + + case H5T_STRING: + return("H5T_STRING"); + + case H5T_BITFIELD: + return("H5T_BITFIELD"); + + case H5T_OPAQUE: + return("H5T_OPAQUE"); + + case H5T_COMPOUND: + return("H5T_COMPOUND"); + + case H5T_REFERENCE: + return("H5T_REFERENCE"); + + case H5T_ENUM: + return("H5T_ENUM"); + + case H5T_VLEN: + return("H5T_VLEN"); + + case H5T_ARRAY: + return("H5T_ARRAY"); + + case H5T_NO_CLASS: + case H5T_NCLASSES: + default: + HDassert(0); + return("Invalid class"); } /* end switch */ } /* end get_class() */ @@ -325,10 +344,10 @@ get_class(H5T_class_t tclass) */ void print_found(hsize_t nfound) { - if(g_Parallel) - parallel_print("%"H5_PRINTF_LL_WIDTH"u differences found\n", (unsigned long long)nfound); - else - HDfprintf(stdout,"%Hu differences found\n",nfound); + if(g_Parallel) + parallel_print("%"H5_PRINTF_LL_WIDTH"u differences found\n", (unsigned long long)nfound); + else + HDfprintf(stdout,"%Hu differences found\n",nfound); } @@ -375,3 +394,4 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id, out: return ret; } + |