diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-09-30 14:27:10 (GMT) |
commit | b2d661b508a7fc7a2592c13bc6bdc175551f075d (patch) | |
tree | 13baeb0d83a7c2a4c6299993c182b1227c2f6114 /src/H5Tdbg.c | |
parent | 29ab58b58dce556639ea3154e262895773a8a8df (diff) | |
download | hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.zip hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.gz hdf5-b2d661b508a7fc7a2592c13bc6bdc175551f075d.tar.bz2 |
Clang-format of source files
Diffstat (limited to 'src/H5Tdbg.c')
-rw-r--r-- | src/H5Tdbg.c | 106 |
1 files changed, 43 insertions, 63 deletions
diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index a230753..5d0c5cd 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -26,53 +26,43 @@ /* Module Setup */ /****************/ -#include "H5Tmodule.h" /* This source code file is part of the H5T module */ - +#include "H5Tmodule.h" /* This source code file is part of the H5T module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Tpkg.h" /* Datatypes */ - +#include "H5private.h" /* Generic Functions */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Tpkg.h" /* Datatypes */ /****************/ /* Local Macros */ /****************/ - /******************/ /* Local Typedefs */ /******************/ - /********************/ /* Package Typedefs */ /********************/ - /********************/ /* Local Prototypes */ /********************/ - /*********************/ /* Package Variables */ /*********************/ - /*****************************/ /* Library Private Variables */ /*****************************/ - /*******************/ /* Local Variables */ /*******************/ - - /*------------------------------------------------------------------------- * Function: H5T__print_stats * @@ -93,35 +83,31 @@ *------------------------------------------------------------------------- */ herr_t -H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/*in,out*/) +H5T__print_stats(H5T_path_t H5_ATTR_UNUSED *path, int H5_ATTR_UNUSED *nprint /*in,out*/) { FUNC_ENTER_PACKAGE_NOERR #ifdef H5T_DEBUG - if(H5DEBUG(T) && path->stats.ncalls > 0) { - hsize_t nbytes; + if (H5DEBUG(T) && path->stats.ncalls > 0) { + hsize_t nbytes; char bandwidth[32]; struct { char *user; char *system; char *elapsed; - } timestrs = { - H5_timer_get_time_string(path->stats.times.user), - H5_timer_get_time_string(path->stats.times.system), - H5_timer_get_time_string(path->stats.times.elapsed) - }; + } timestrs = {H5_timer_get_time_string(path->stats.times.user), + H5_timer_get_time_string(path->stats.times.system), + H5_timer_get_time_string(path->stats.times.elapsed)}; - if(nprint && 0 == (*nprint)++) { + if (nprint && 0 == (*nprint)++) { HDfprintf(H5DEBUG(T), "H5T: type conversion statistics:\n"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "Conversion", "Elmts", "Calls", "User", - "System", "Elapsed", "Bandwidth"); - HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", - "----------", "-----", "-----", "----", - "------", "-------", "---------"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", "Conversion", "Elmts", "Calls", + "User", "System", "Elapsed", "Bandwidth"); + HDfprintf(H5DEBUG(T), " %-16s %10s %10s %8s %8s %8s %10s\n", "----------", "-----", "-----", + "----", "------", "-------", "---------"); } /* end if */ - if(path->src && path->dst) + if (path->src && path->dst) nbytes = MAX(H5T_get_size(path->src), H5T_get_size(path->dst)); else if (path->src) nbytes = H5T_get_size(path->src); @@ -131,9 +117,9 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* nbytes = 0; nbytes *= path->stats.nelmts; H5_bandwidth(bandwidth, (double)nbytes, path->stats.times.elapsed); - HDfprintf(H5DEBUG(T), " %-16s %10" PRIdHSIZE " %10u %8s %8s %8s %10s\n", - path->name, path->stats.nelmts, path->stats.ncalls, - timestrs.user, timestrs.system, timestrs.elapsed, bandwidth); + HDfprintf(H5DEBUG(T), " %-16s %10" PRIdHSIZE " %10u %8s %8s %8s %10s\n", path->name, + path->stats.nelmts, path->stats.ncalls, timestrs.user, timestrs.system, timestrs.elapsed, + bandwidth); free(timestrs.user); free(timestrs.system); free(timestrs.elapsed); @@ -143,7 +129,6 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T__print_stats() */ - /*------------------------------------------------------------------------- * Function: H5T_debug * @@ -156,10 +141,10 @@ H5T__print_stats(H5T_path_t H5_ATTR_UNUSED * path, int H5_ATTR_UNUSED * nprint/* herr_t H5T_debug(const H5T_t *dt, FILE *stream) { - const char *s1 = ""; - const char *s2 = ""; + const char *s1 = ""; + const char *s2 = ""; unsigned i; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -205,7 +190,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; case H5T_VLEN: - if(H5T_IS_VL_STRING(dt->shared)) + if (H5T_IS_VL_STRING(dt->shared)) s1 = "str"; else s1 = "vlen"; @@ -217,7 +202,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) default: s1 = ""; break; - } /* end switch */ + } /* end switch */ switch (dt->shared->state) { case H5T_STATE_TRANSIENT: @@ -241,12 +226,12 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; default: HDassert(0 && "This Should never be executed!"); - } /* end switch */ + } /* end switch */ HDfprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); if (H5T_IS_ATOMIC(dt->shared)) { - uint64_t tmp; + uint64_t tmp; switch (dt->shared->u.atomic.order) { case H5T_ORDER_ERROR: @@ -278,9 +263,9 @@ H5T_debug(const H5T_t *dt, FILE *stream) HDfprintf(stream, ", %s", s1); if (dt->shared->u.atomic.offset) - HDfprintf(stream, ", offset=%lu", (unsigned long) (dt->shared->u.atomic.offset)); + HDfprintf(stream, ", offset=%lu", (unsigned long)(dt->shared->u.atomic.offset)); if (dt->shared->u.atomic.prec != 8 * dt->shared->size) - HDfprintf(stream, ", prec=%lu", (unsigned long) (dt->shared->u.atomic.prec)); + HDfprintf(stream, ", prec=%lu", (unsigned long)(dt->shared->u.atomic.prec)); switch (dt->shared->type) { case H5T_NO_CLASS: @@ -288,7 +273,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; case H5T_INTEGER: - switch(dt->shared->u.atomic.u.i.sign) { + switch (dt->shared->u.atomic.u.i.sign) { case H5T_SGN_ERROR: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "sign error"); break; @@ -307,12 +292,12 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; } /* end switch */ - if(s1) + if (s1) HDfprintf(stream, ", %s", s1); break; case H5T_FLOAT: - switch(dt->shared->u.atomic.u.f.norm) { + switch (dt->shared->u.atomic.u.f.norm) { case H5T_NORM_ERROR: HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "norm error"); break; @@ -334,20 +319,16 @@ H5T_debug(const H5T_t *dt, FILE *stream) break; } /* end switch */ - HDfprintf(stream, ", sign=%lu+1", - (unsigned long)(dt->shared->u.atomic.u.f.sign)); - HDfprintf(stream, ", mant=%lu+%lu (%s)", - (unsigned long)(dt->shared->u.atomic.u.f.mpos), - (unsigned long)(dt->shared->u.atomic.u.f.msize), s1); - HDfprintf(stream, ", exp=%lu+%lu", - (unsigned long)(dt->shared->u.atomic.u.f.epos), - (unsigned long)(dt->shared->u.atomic.u.f.esize)); + HDfprintf(stream, ", sign=%lu+1", (unsigned long)(dt->shared->u.atomic.u.f.sign)); + HDfprintf(stream, ", mant=%lu+%lu (%s)", (unsigned long)(dt->shared->u.atomic.u.f.mpos), + (unsigned long)(dt->shared->u.atomic.u.f.msize), s1); + HDfprintf(stream, ", exp=%lu+%lu", (unsigned long)(dt->shared->u.atomic.u.f.epos), + (unsigned long)(dt->shared->u.atomic.u.f.esize)); tmp = dt->shared->u.atomic.u.f.ebias >> 32; if (tmp) { size_t hi = (size_t)tmp; size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); - HDfprintf(stream, " bias=0x%08lx%08lx", - (unsigned long)hi, (unsigned long)lo); + HDfprintf(stream, " bias=0x%08lx%08lx", (unsigned long)hi, (unsigned long)lo); } else { size_t lo = (size_t)(dt->shared->u.atomic.u.f.ebias & 0xffffffff); @@ -373,9 +354,8 @@ H5T_debug(const H5T_t *dt, FILE *stream) else if (H5T_COMPOUND == dt->shared->type) { /* Compound data type */ for (i = 0; i < dt->shared->u.compnd.nmembs; i++) { - HDfprintf(stream, "\n\"%s\" @%lu", - dt->shared->u.compnd.memb[i].name, - (unsigned long)(dt->shared->u.compnd.memb[i].offset)); + HDfprintf(stream, "\n\"%s\" @%lu", dt->shared->u.compnd.memb[i].name, + (unsigned long)(dt->shared->u.compnd.memb[i].offset)); HDfprintf(stream, " "); H5T_debug(dt->shared->u.compnd.memb[i].type, stream); } /* end for */ @@ -412,18 +392,19 @@ H5T_debug(const H5T_t *dt, FILE *stream) } /* end else */ } else if (H5T_ENUM == dt->shared->type) { - size_t base_size; + size_t base_size; /* Enumeration data type */ HDfprintf(stream, " "); H5T_debug(dt->shared->parent, stream); base_size = dt->shared->parent->shared->size; for (i = 0; i < dt->shared->u.enumer.nmembs; i++) { - size_t k; + size_t k; HDfprintf(stream, "\n\"%s\" = 0x", dt->shared->u.enumer.name[i]); for (k = 0; k < base_size; k++) - HDfprintf(stream, "%02" PRIx8, *((uint8_t *)dt->shared->u.enumer.value + (i * base_size) + k)); + HDfprintf(stream, "%02" PRIx8, + *((uint8_t *)dt->shared->u.enumer.value + (i * base_size) + k)); } /* end for */ HDfprintf(stream, "\n"); } @@ -439,4 +420,3 @@ H5T_debug(const H5T_t *dt, FILE *stream) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_debug() */ - |