diff options
Diffstat (limited to 'src/H5trace.c')
-rw-r--r-- | src/H5trace.c | 921 |
1 files changed, 464 insertions, 457 deletions
diff --git a/src/H5trace.c b/src/H5trace.c index 30da8de..3d8dc4a 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -25,61 +25,51 @@ /****************/ /* Module Setup */ /****************/ -#define H5I_PACKAGE /*suppress error about including H5Ipkg */ - +#define H5I_PACKAGE /*suppress error about including H5Ipkg */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5FDprivate.h" /* File drivers */ -#include "H5Ipkg.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5FDprivate.h" /* File drivers */ +#include "H5Ipkg.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #ifdef H5_HAVE_PARALLEL /* datatypes of predefined drivers needed by H5_trace() */ #include "H5FDmpio.h" #endif /* H5_HAVE_PARALLEL */ - /****************/ /* Local Macros */ /****************/ - /******************/ /* Local Typedefs */ /******************/ - /********************/ /* Package Typedefs */ /********************/ - /********************/ /* Local Prototypes */ /********************/ - /*********************/ /* Package Variables */ /*********************/ - /*****************************/ /* Library Private Variables */ /*****************************/ - /*******************/ /* Local Variables */ /*******************/ - - /*------------------------------------------------------------------------- * Function: H5_trace * @@ -118,46 +108,46 @@ double H5_trace(const double *returning, const char *func, const char *type, ...) { - va_list ap; - char buf[64], *rest; - const char *argname; - int argno = 0, ptr, asize_idx; - hssize_t asize[16]; - hssize_t i; - void *vp = NULL; - FILE *out = H5_debug_g.trace; - H5_timer_t event_time; - static H5_timer_t first_time = {0.0F, 0.0F, 0.0F}; - static int current_depth = 0; - static int last_call_depth = 0; + va_list ap; + char buf[64], *rest; + const char * argname; + int argno = 0, ptr, asize_idx; + hssize_t asize[16]; + hssize_t i; + void * vp = NULL; + FILE * out = H5_debug_g.trace; + H5_timer_t event_time; + static H5_timer_t first_time = {0.0F, 0.0F, 0.0F}; + static int current_depth = 0; + static int last_call_depth = 0; /* FUNC_ENTER() should not be called */ - if(!out) - return 0.0F; /*tracing is off*/ + if (!out) + return 0.0F; /*tracing is off*/ va_start(ap, type); - if(H5_debug_g.ttop) { - if(returning) { - if(current_depth > 1) { + if (H5_debug_g.ttop) { + if (returning) { + if (current_depth > 1) { --current_depth; return 0.0F; } /* end if */ - } /* end if */ + } /* end if */ else { - if(current_depth > 0) { + if (current_depth > 0) { /*do not update last_call_depth*/ current_depth++; return 0.0F; } /* end if */ - } /* end else */ - } /* end if */ + } /* end else */ + } /* end if */ /* Get time for event */ - if(HDfabs(first_time.etime) < 0.0000000001F) + if (HDfabs(first_time.etime) < 0.0000000001F) /* That is == 0.0, but direct comparison between floats is bad */ H5_timer_begin(&first_time); - if(H5_debug_g.ttimes) + if (H5_debug_g.ttimes) H5_timer_begin(&event_time); else HDmemset(&event_time, 0, sizeof event_time); @@ -168,87 +158,89 @@ H5_trace(const double *returning, const char *func, const char *type, ...) * function return and no other calls have been made to H5_trace() * since the one for the function call, then we're continuing * the same line. */ - if(returning) { + if (returning) { HDassert(current_depth > 0); --current_depth; - if(current_depth < last_call_depth) { + if (current_depth < last_call_depth) { /* We are at the beginning of a line */ - if(H5_debug_g.ttimes) { + if (H5_debug_g.ttimes) { char tmp[128]; - HDsprintf(tmp, "%.6f", event_time.etime-first_time.etime); + HDsprintf(tmp, "%.6f", event_time.etime - first_time.etime); HDfprintf(out, " %*s ", (int)HDstrlen(tmp), ""); } /* end if */ - for(i = 0; i < current_depth; i++) + for (i = 0; i < current_depth; i++) HDfputc('+', out); - HDfprintf(out, "%*s%s = ", 2*current_depth, "", func); + HDfprintf(out, "%*s%s = ", 2 * current_depth, "", func); } /* end if */ else { /* Continue current line with return value */ HDfprintf(out, " = "); } /* end else */ - } /* end if */ + } /* end if */ else { - if(current_depth>last_call_depth) + if (current_depth > last_call_depth) HDfputs(" = <delayed>\n", out); - if(H5_debug_g.ttimes) + if (H5_debug_g.ttimes) HDfprintf(out, "@%.6f ", event_time.etime - first_time.etime); - for(i = 0; i < current_depth; i++) + for (i = 0; i < current_depth; i++) HDfputc('+', out); - HDfprintf(out, "%*s%s(", 2*current_depth, "", func); + HDfprintf(out, "%*s%s(", 2 * current_depth, "", func); } /* end else */ /* Clear array sizes */ - for(i = 0; i < (hssize_t)NELMTS(asize); i++) + for (i = 0; i < (hssize_t)NELMTS(asize); i++) asize[i] = -1; /* Parse the argument types */ - for(argno = 0; *type; argno++, type += (HDisupper(*type) ? 2 : 1)) { - /* Count levels of indirection */ - for(ptr = 0; '*' == *type; type++) + for (argno = 0; *type; argno++, type += (HDisupper(*type) ? 2 : 1)) { + /* Count levels of indirection */ + for (ptr = 0; '*' == *type; type++) ptr++; - if('[' == *type) { - if('a' == type[1]) { - asize_idx = (int)HDstrtol(type + 2, &rest, 10); - HDassert(0 <= asize_idx && asize_idx < (int) NELMTS(asize)); - HDassert(']'==*rest); - type = rest + 1; - } else { - rest = (char *)HDstrchr(type, ']'); - HDassert(rest); - type = rest + 1; - asize_idx = -1; - } - } /* end if */ + if ('[' == *type) { + if ('a' == type[1]) { + asize_idx = (int)HDstrtol(type + 2, &rest, 10); + HDassert(0 <= asize_idx && asize_idx < (int)NELMTS(asize)); + HDassert(']' == *rest); + type = rest + 1; + } + else { + rest = (char *)HDstrchr(type, ']'); + HDassert(rest); + type = rest + 1; + asize_idx = -1; + } + } /* end if */ else - asize_idx = -1; - - /* - * The argument name. Leave off the `_id' part. If the argument - * name is the null pointer then don't print the argument or the - * following `='. This is used for return values. - */ - argname = va_arg(ap, char *); /*lint !e64 Type mismatch not really occuring */ - if(argname) { - unsigned n = (unsigned)MAX (0, (int)HDstrlen(argname) - 3); /*lint !e666 Allow expression with side effects */ - - if(!HDstrcmp(argname + n, "_id")) { - HDstrncpy(buf, argname, (size_t)MIN((int)sizeof(buf) - 1, n)); - buf[MIN((int)sizeof(buf) - 1, n)] = '\0'; - argname = buf; - } /* end if */ - HDfprintf(out, "%s%s=", argno?", ":"", argname); - } /* end if */ + asize_idx = -1; + + /* + * The argument name. Leave off the `_id' part. If the argument + * name is the null pointer then don't print the argument or the + * following `='. This is used for return values. + */ + argname = va_arg(ap, char *); /*lint !e64 Type mismatch not really occuring */ + if (argname) { + unsigned n = (unsigned)MAX(0, (int)HDstrlen(argname) - + 3); /*lint !e666 Allow expression with side effects */ + + if (!HDstrcmp(argname + n, "_id")) { + HDstrncpy(buf, argname, (size_t)MIN((int)sizeof(buf) - 1, n)); + buf[MIN((int)sizeof(buf) - 1, n)] = '\0'; + argname = buf; + } /* end if */ + HDfprintf(out, "%s%s=", argno ? ", " : "", argname); + } /* end if */ else - argname = ""; + argname = ""; - /* The value */ - if(ptr) + /* The value */ + if (ptr) vp = va_arg(ap, void *); /*lint !e64 Type mismatch not really occuring */ - switch(type[0]) { + switch (type[0]) { case 'a': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -261,8 +253,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'b': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -270,9 +262,9 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { hbool_t bool_var = va_arg(ap, hbool_t); /*lint !e732 Loss of sign not really occuring */ - if(TRUE == bool_var) + if (TRUE == bool_var) HDfprintf(out, "TRUE"); - else if(!bool_var) + else if (!bool_var) HDfprintf(out, "FALSE"); else HDfprintf(out, "TRUE(%u)", (unsigned)bool_var); @@ -280,8 +272,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'd': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -294,18 +286,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'D': - switch(type[1]) { + switch (type[1]) { case 'a': - if(ptr) { - if(vp) - HDfprintf (out, "0x%lx", (unsigned long)vp); + if (ptr) { + if (vp) + HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { H5D_alloc_time_t alloc_time = (H5D_alloc_time_t)va_arg(ap, int); - switch(alloc_time) { + switch (alloc_time) { case H5D_ALLOC_TIME_ERROR: HDfprintf(out, "H5D_ALLOC_TIME_ERROR"); break; @@ -330,12 +322,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)alloc_time); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'c': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -343,7 +335,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5FD_mpio_collective_opt_t opt = (H5FD_mpio_collective_opt_t)va_arg(ap, int); - switch(opt) { + switch (opt) { case H5FD_MPIO_COLLECTIVE_IO: HDfprintf(out, "H5FD_MPIO_COLLECTIVE_IO"); break; @@ -356,12 +348,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)opt); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'f': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -369,7 +361,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5D_fill_time_t fill_time = (H5D_fill_time_t)va_arg(ap, int); - switch(fill_time) { + switch (fill_time) { case H5D_FILL_TIME_ERROR: HDfprintf(out, "H5D_FILL_TIME_ERROR"); break; @@ -390,12 +382,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)fill_time); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'F': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -403,7 +395,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5D_fill_value_t fill_value = (H5D_fill_value_t)va_arg(ap, int); - switch(fill_value) { + switch (fill_value) { case H5D_FILL_VALUE_ERROR: HDfprintf(out, "H5D_FILL_VALUE_ERROR"); break; @@ -424,12 +416,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)fill_value); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'h': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -437,7 +429,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5FD_mpio_chunk_opt_t opt = (H5FD_mpio_chunk_opt_t)va_arg(ap, int); - switch(opt) { + switch (opt) { case H5FD_MPIO_CHUNK_DEFAULT: HDfprintf(out, "H5FD_MPIO_CHUNK_DEFAULT"); break; @@ -454,20 +446,21 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)opt); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'i': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - H5D_mpio_actual_io_mode_t actual_io_mode = (H5D_mpio_actual_io_mode_t)va_arg(ap, int); + H5D_mpio_actual_io_mode_t actual_io_mode = + (H5D_mpio_actual_io_mode_t)va_arg(ap, int); - switch(actual_io_mode) { + switch (actual_io_mode) { case H5D_MPIO_NO_COLLECTIVE: HDfprintf(out, "H5D_MPIO_NO_COLLECTIVE"); break; @@ -492,12 +485,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)actual_io_mode); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'l': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -505,7 +498,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5D_layout_t layout = (H5D_layout_t)va_arg(ap, int); - switch(layout) { + switch (layout) { case H5D_LAYOUT_ERROR: HDfprintf(out, "H5D_LAYOUT_ERROR"); break; @@ -530,71 +523,79 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)layout); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'n': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - H5D_mpio_no_collective_cause_t nocol_cause_mode = (H5D_mpio_no_collective_cause_t)va_arg(ap, int); + H5D_mpio_no_collective_cause_t nocol_cause_mode = + (H5D_mpio_no_collective_cause_t)va_arg(ap, int); hbool_t flag_already_displayed = FALSE; /* Check for all bit-flags which might be set */ - if(nocol_cause_mode & H5D_MPIO_COLLECTIVE) { + if (nocol_cause_mode & H5D_MPIO_COLLECTIVE) { HDfprintf(out, "H5D_MPIO_COLLECTIVE"); flag_already_displayed = TRUE; } /* end if */ - if(nocol_cause_mode & H5D_MPIO_SET_INDEPENDENT) { - HDfprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", flag_already_displayed ? " | " : ""); + if (nocol_cause_mode & H5D_MPIO_SET_INDEPENDENT) { + HDfprintf(out, "%sH5D_MPIO_SET_INDEPENDENT", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ - if(nocol_cause_mode & H5D_MPIO_DATATYPE_CONVERSION) { - HDfprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", flag_already_displayed ? " | " : ""); + if (nocol_cause_mode & H5D_MPIO_DATATYPE_CONVERSION) { + HDfprintf(out, "%sH5D_MPIO_DATATYPE_CONVERSION", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ - if(nocol_cause_mode & H5D_MPIO_DATA_TRANSFORMS) { - HDfprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", flag_already_displayed ? " | " : ""); + if (nocol_cause_mode & H5D_MPIO_DATA_TRANSFORMS) { + HDfprintf(out, "%sH5D_MPIO_DATA_TRANSFORMS", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ - if(nocol_cause_mode & H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED) { - HDfprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", flag_already_displayed ? " | " : ""); + if (nocol_cause_mode & H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED) { + HDfprintf(out, "%sH5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ - if(nocol_cause_mode & H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES) { - HDfprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", flag_already_displayed ? " | " : ""); + if (nocol_cause_mode & H5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES) { + HDfprintf(out, "%sH5D_MPIO_NOT_SIMPLE_OR_SCALAR_DATASPACES", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ - if(nocol_cause_mode & H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) { - HDfprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", flag_already_displayed ? " | " : ""); + if (nocol_cause_mode & H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET) { + HDfprintf(out, "%sH5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET", + flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ - if(nocol_cause_mode & H5D_MPIO_FILTERS) { + if (nocol_cause_mode & H5D_MPIO_FILTERS) { HDfprintf(out, "%sH5D_MPIO_FILTERS", flag_already_displayed ? " | " : ""); flag_already_displayed = TRUE; } /* end if */ /* Display '<none>' if there's no flags set */ - if(!flag_already_displayed) + if (!flag_already_displayed) HDfprintf(out, "<none>"); } /* end else */ break; case 'o': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode = (H5D_mpio_actual_chunk_opt_mode_t)va_arg(ap, int); + H5D_mpio_actual_chunk_opt_mode_t chunk_opt_mode = + (H5D_mpio_actual_chunk_opt_mode_t)va_arg(ap, int); - switch(chunk_opt_mode) { + switch (chunk_opt_mode) { case H5D_MPIO_NO_CHUNK_OPTIMIZATION: HDfprintf(out, "H5D_MPIO_NO_CHUNK_OPTIMIZATION"); break; @@ -611,12 +612,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)chunk_opt_mode); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 's': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -624,7 +625,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5D_space_status_t space_status = (H5D_space_status_t)va_arg(ap, int); - switch(space_status) { + switch (space_status) { case H5D_SPACE_STATUS_NOT_ALLOCATED: HDfprintf(out, "H5D_SPACE_STATUS_NOT_ALLOCATED"); break; @@ -645,12 +646,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)space_status); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -658,7 +659,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5FD_mpio_xfer_t transfer = (H5FD_mpio_xfer_t)va_arg(ap, int); - switch(transfer) { + switch (transfer) { case H5FD_MPIO_INDEPENDENT: HDfprintf(out, "H5FD_MPIO_INDEPENDENT"); break; @@ -671,18 +672,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)transfer); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: - HDfprintf (out, "BADTYPE(D%c)", type[1]); + HDfprintf(out, "BADTYPE(D%c)", type[1]); goto error; } /* end switch */ break; case 'e': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -690,18 +691,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { herr_t status = va_arg(ap, herr_t); - if(status >= 0) + if (status >= 0) HDfprintf(out, "SUCCEED"); - else + else HDfprintf(out, "FAIL"); } /* end else */ break; case 'E': - switch(type[1]) { + switch (type[1]) { case 'd': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -709,7 +710,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5E_direction_t direction = (H5E_direction_t)va_arg(ap, int); - switch(direction) { + switch (direction) { case H5E_WALK_UPWARD: HDfprintf(out, "H5E_WALK_UPWARD"); break; @@ -722,26 +723,27 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)direction); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'e': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - H5E_error2_t *error = va_arg(ap, H5E_error2_t *); /*lint !e64 Type mismatch not really occuring */ + H5E_error2_t *error = + va_arg(ap, H5E_error2_t *); /*lint !e64 Type mismatch not really occuring */ HDfprintf(out, "0x%lx", (unsigned long)error); } /* end else */ break; case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -749,7 +751,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5E_type_t etype = (H5E_type_t)va_arg(ap, int); - switch(etype) { + switch (etype) { case H5E_MAJOR: HDfprintf(out, "H5E_MAJOR"); break; @@ -762,7 +764,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)etype); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: @@ -772,10 +774,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'F': - switch(type[1]) { + switch (type[1]) { case 'd': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -783,7 +785,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5F_close_degree_t degree = (H5F_close_degree_t)va_arg(ap, int); - switch(degree) { + switch (degree) { case H5F_CLOSE_DEFAULT: HDfprintf(out, "H5F_CLOSE_DEFAULT"); break; @@ -804,12 +806,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)degree); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'm': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -817,7 +819,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5F_mem_t mem_type = (H5F_mem_t)va_arg(ap, int); - switch(mem_type) { + switch (mem_type) { case H5FD_MEM_NOLIST: HDfprintf(out, "H5FD_MEM_NOLIST"); break; @@ -855,12 +857,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)mem_type); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 's': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -868,7 +870,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5F_scope_t scope = (H5F_scope_t)va_arg(ap, int); - switch(scope) { + switch (scope) { case H5F_SCOPE_LOCAL: HDfprintf(out, "H5F_SCOPE_LOCAL"); break; @@ -881,12 +883,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)scope); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'v': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -894,7 +896,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5F_libver_t libver_vers = (H5F_libver_t)va_arg(ap, int); - switch(libver_vers) { + switch (libver_vers) { case H5F_LIBVER_EARLIEST: HDfprintf(out, "H5F_LIBVER_EARLIEST"); break; @@ -907,7 +909,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)libver_vers); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: @@ -917,11 +919,11 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'G': - switch(type[1]) { + switch (type[1]) { #ifndef H5_NO_DEPRECATED_SYMBOLS case 'o': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -929,7 +931,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5G_obj_t obj_type = (H5G_obj_t)va_arg(ap, int); - switch(obj_type) { + switch (obj_type) { case H5G_UNKNOWN: HDfprintf(out, "H5G_UNKNOWN"); break; @@ -964,18 +966,19 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)obj_type); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 's': - if(ptr) { - if(vp) - HDfprintf (out, "0x%lx", (unsigned long)vp); + if (ptr) { + if (vp) + HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - H5G_stat_t *statbuf = va_arg(ap, H5G_stat_t*); /*lint !e64 Type mismatch not really occuring */ + H5G_stat_t *statbuf = + va_arg(ap, H5G_stat_t *); /*lint !e64 Type mismatch not really occuring */ HDfprintf(out, "0x%lx", (unsigned long)statbuf); } @@ -989,52 +992,52 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'h': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { + if (asize_idx >= 0 && asize[asize_idx] >= 0) { hsize_t *p = (hsize_t *)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) { - if(H5S_UNLIMITED == p[i]) + for (i = 0; i < asize[asize_idx]; i++) { + if (H5S_UNLIMITED == p[i]) HDfprintf(out, "%sH5S_UNLIMITED", (i ? ", " : "")); else HDfprintf(out, "%s%Hu", (i ? ", " : ""), p[i]); } /* end for */ HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ else { hsize_t hsize = va_arg(ap, hsize_t); /*lint !e732 Loss of sign not really occuring */ - if(H5S_UNLIMITED == hsize) + if (H5S_UNLIMITED == hsize) HDfprintf(out, "H5S_UNLIMITED"); else { HDfprintf(out, "%Hu", hsize); asize[argno] = (hssize_t)hsize; } /* end else */ - } /* end else */ + } /* end else */ break; case 'H': - switch(type[1]) { + switch (type[1]) { case 's': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { + if (asize_idx >= 0 && asize[asize_idx] >= 0) { hssize_t *p = (hssize_t *)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) + for (i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Hd", (i ? ", " : ""), p[i]); HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ @@ -1047,14 +1050,14 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(H%c)", type[1]); + HDfprintf(out, "BADTYPE(H%c)", type[1]); goto error; } /* end switch */ break; case 'i': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1062,12 +1065,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { hid_t obj = va_arg(ap, hid_t); - if(H5P_DEFAULT == obj) + if (H5P_DEFAULT == obj) HDfprintf(out, "H5P_DEFAULT"); - else if(obj < 0) + else if (obj < 0) HDfprintf(out, "FAIL"); else { - switch(H5I_TYPE(obj)) { /* Use internal H5I macro instead of function call */ + switch (H5I_TYPE(obj)) { /* Use internal H5I macro instead of function call */ case H5I_UNINIT: HDfprintf(out, "%ld (uninit - error)", (long)obj); break; @@ -1085,93 +1088,93 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5I_DATATYPE: - if(obj == H5T_NATIVE_SCHAR_g) + if (obj == H5T_NATIVE_SCHAR_g) HDfprintf(out, "H5T_NATIVE_SCHAR"); - else if(obj == H5T_NATIVE_UCHAR_g) + else if (obj == H5T_NATIVE_UCHAR_g) HDfprintf(out, "H5T_NATIVE_UCHAR"); - else if(obj == H5T_NATIVE_SHORT_g) + else if (obj == H5T_NATIVE_SHORT_g) HDfprintf(out, "H5T_NATIVE_SHORT"); - else if(obj == H5T_NATIVE_USHORT_g) + else if (obj == H5T_NATIVE_USHORT_g) HDfprintf(out, "H5T_NATIVE_USHORT"); - else if(obj == H5T_NATIVE_INT_g) + else if (obj == H5T_NATIVE_INT_g) HDfprintf(out, "H5T_NATIVE_INT"); - else if(obj == H5T_NATIVE_UINT_g) + else if (obj == H5T_NATIVE_UINT_g) HDfprintf(out, "H5T_NATIVE_UINT"); - else if(obj == H5T_NATIVE_LONG_g) + else if (obj == H5T_NATIVE_LONG_g) HDfprintf(out, "H5T_NATIVE_LONG"); - else if(obj == H5T_NATIVE_ULONG_g) + else if (obj == H5T_NATIVE_ULONG_g) HDfprintf(out, "H5T_NATIVE_ULONG"); - else if(obj == H5T_NATIVE_LLONG_g) + else if (obj == H5T_NATIVE_LLONG_g) HDfprintf(out, "H5T_NATIVE_LLONG"); - else if(obj == H5T_NATIVE_ULLONG_g) + else if (obj == H5T_NATIVE_ULLONG_g) HDfprintf(out, "H5T_NATIVE_ULLONG"); - else if(obj == H5T_NATIVE_FLOAT_g) + else if (obj == H5T_NATIVE_FLOAT_g) HDfprintf(out, "H5T_NATIVE_FLOAT"); - else if(obj == H5T_NATIVE_DOUBLE_g) + else if (obj == H5T_NATIVE_DOUBLE_g) HDfprintf(out, "H5T_NATIVE_DOUBLE"); -#if H5_SIZEOF_LONG_DOUBLE !=0 - else if(obj == H5T_NATIVE_LDOUBLE_g) +#if H5_SIZEOF_LONG_DOUBLE != 0 + else if (obj == H5T_NATIVE_LDOUBLE_g) HDfprintf(out, "H5T_NATIVE_LDOUBLE"); #endif - else if(obj == H5T_IEEE_F32BE_g) + else if (obj == H5T_IEEE_F32BE_g) HDfprintf(out, "H5T_IEEE_F32BE"); - else if(obj == H5T_IEEE_F32LE_g) + else if (obj == H5T_IEEE_F32LE_g) HDfprintf(out, "H5T_IEEE_F32LE"); - else if(obj == H5T_IEEE_F64BE_g) + else if (obj == H5T_IEEE_F64BE_g) HDfprintf(out, "H5T_IEEE_F64BE"); - else if(obj == H5T_IEEE_F64LE_g) + else if (obj == H5T_IEEE_F64LE_g) HDfprintf(out, "H5T_IEEE_F64LE"); - else if(obj == H5T_STD_I8BE_g) + else if (obj == H5T_STD_I8BE_g) HDfprintf(out, "H5T_STD_I8BE"); - else if(obj == H5T_STD_I8LE_g) + else if (obj == H5T_STD_I8LE_g) HDfprintf(out, "H5T_STD_I8LE"); - else if(obj == H5T_STD_I16BE_g) + else if (obj == H5T_STD_I16BE_g) HDfprintf(out, "H5T_STD_I16BE"); - else if(obj == H5T_STD_I16LE_g) + else if (obj == H5T_STD_I16LE_g) HDfprintf(out, "H5T_STD_I16LE"); - else if(obj == H5T_STD_I32BE_g) + else if (obj == H5T_STD_I32BE_g) HDfprintf(out, "H5T_STD_I32BE"); - else if(obj == H5T_STD_I32LE_g) + else if (obj == H5T_STD_I32LE_g) HDfprintf(out, "H5T_STD_I32LE"); - else if(obj == H5T_STD_I64BE_g) + else if (obj == H5T_STD_I64BE_g) HDfprintf(out, "H5T_STD_I64BE"); - else if(obj == H5T_STD_I64LE_g) + else if (obj == H5T_STD_I64LE_g) HDfprintf(out, "H5T_STD_I64LE"); - else if(obj == H5T_STD_U8BE_g) + else if (obj == H5T_STD_U8BE_g) HDfprintf(out, "H5T_STD_U8BE"); - else if(obj == H5T_STD_U8LE_g) + else if (obj == H5T_STD_U8LE_g) HDfprintf(out, "H5T_STD_U8LE"); - else if(obj == H5T_STD_U16BE_g) + else if (obj == H5T_STD_U16BE_g) HDfprintf(out, "H5T_STD_U16BE"); - else if(obj == H5T_STD_U16LE_g) + else if (obj == H5T_STD_U16LE_g) HDfprintf(out, "H5T_STD_U16LE"); - else if(obj == H5T_STD_U32BE_g) + else if (obj == H5T_STD_U32BE_g) HDfprintf(out, "H5T_STD_U32BE"); - else if(obj == H5T_STD_U32LE_g) + else if (obj == H5T_STD_U32LE_g) HDfprintf(out, "H5T_STD_U32LE"); - else if(obj == H5T_STD_U64BE_g) + else if (obj == H5T_STD_U64BE_g) HDfprintf(out, "H5T_STD_U64BE"); - else if(obj == H5T_STD_U64LE_g) + else if (obj == H5T_STD_U64LE_g) HDfprintf(out, "H5T_STD_U64LE"); - else if(obj == H5T_STD_B8BE_g) + else if (obj == H5T_STD_B8BE_g) HDfprintf(out, "H5T_STD_B8BE"); - else if(obj == H5T_STD_B8LE_g) + else if (obj == H5T_STD_B8LE_g) HDfprintf(out, "H5T_STD_B8LE"); - else if(obj == H5T_STD_B16BE_g) + else if (obj == H5T_STD_B16BE_g) HDfprintf(out, "H5T_STD_B16BE"); - else if(obj == H5T_STD_B16LE_g) + else if (obj == H5T_STD_B16LE_g) HDfprintf(out, "H5T_STD_B16LE"); - else if(obj == H5T_STD_B32BE_g) + else if (obj == H5T_STD_B32BE_g) HDfprintf(out, "H5T_STD_B32BE"); - else if(obj == H5T_STD_B32LE_g) + else if (obj == H5T_STD_B32LE_g) HDfprintf(out, "H5T_STD_B32LE"); - else if(obj == H5T_STD_B64BE_g) + else if (obj == H5T_STD_B64BE_g) HDfprintf(out, "H5T_STD_B64BE"); - else if(obj == H5T_STD_B64LE_g) + else if (obj == H5T_STD_B64LE_g) HDfprintf(out, "H5T_STD_B64LE"); - else if(obj == H5T_C_S1_g) + else if (obj == H5T_C_S1_g) HDfprintf(out, "H5T_C_S1"); - else if(obj == H5T_FORTRAN_S1_g) + else if (obj == H5T_FORTRAN_S1_g) HDfprintf(out, "H5T_FORTRAN_S1"); else HDfprintf(out, "%ld (dtype)", (long)obj); @@ -1184,8 +1187,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) { H5S_t *space; - if(NULL != (space = (H5S_t *)H5I_object(obj))) - if(H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)) + if (NULL != (space = (H5S_t *)H5I_object(obj))) + if (H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)) asize[argno] = H5S_GET_EXTENT_NDIMS(space); } break; @@ -1227,22 +1230,22 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case H5I_NTYPES: - HDfprintf (out, "%ld (ntypes - error)", (long)obj); + HDfprintf(out, "%ld (ntypes - error)", (long)obj); break; default: HDfprintf(out, "%ld (unknown class)", (long)obj); break; } /* end switch */ - } /* end else */ - } /* end else */ + } /* end else */ + } /* end else */ break; case 'I': switch (type[1]) { case 'i': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1250,7 +1253,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5_index_t idx_type = (H5_index_t)va_arg(ap, int); - switch(idx_type) { + switch (idx_type) { case H5_INDEX_UNKNOWN: HDfprintf(out, "H5_INDEX_UNKNOWN"); break; @@ -1271,12 +1274,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)idx_type); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'o': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1284,7 +1287,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5_iter_order_t order = (H5_iter_order_t)va_arg(ap, int); - switch(order) { + switch (order) { case H5_ITER_UNKNOWN: HDfprintf(out, "H5_ITER_UNKNOWN"); break; @@ -1309,36 +1312,36 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)order); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 's': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { - int *p = (int*)vp; + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + int *p = (int *)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) + for (i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%d", (i ? ", " : ""), p[i]); HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ else { int is = va_arg(ap, int); - HDfprintf (out, "%d", is); + HDfprintf(out, "%d", is); asize[argno] = is; } /* end else */ break; case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1415,27 +1418,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)id_type); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'u': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { - unsigned *p = (unsigned*)vp; + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + unsigned *p = (unsigned *)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%u", i?", ":"", p[i]); + for (i = 0; i < asize[asize_idx]; i++) + HDfprintf(out, "%s%u", i ? ", " : "", p[i]); HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ else { - unsigned iu = va_arg(ap, unsigned); /*lint !e732 Loss of sign not really occuring */ + unsigned iu = + va_arg(ap, unsigned); /*lint !e732 Loss of sign not really occuring */ HDfprintf(out, "%u", iu); asize[argno] = iu; @@ -1443,24 +1447,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(I%c)", type[1]); + HDfprintf(out, "BADTYPE(I%c)", type[1]); goto error; } /* end switch */ break; case 'L': - switch(type[1]) { + switch (type[1]) { case 'l': - if(ptr) { - if(vp) - HDfprintf (out, "0x%lx", (unsigned long)vp); + if (ptr) { + if (vp) + HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { H5L_type_t link_type = (H5L_type_t)va_arg(ap, int); - switch(link_type) { + switch (link_type) { case H5L_TYPE_ERROR: HDfprintf(out, "H5L_TYPE_ERROR"); break; @@ -1485,7 +1489,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)link_type); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: @@ -1495,10 +1499,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'M': - switch(type[1]) { + switch (type[1]) { case 'c': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1509,12 +1513,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)comm); } /* end else */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ break; case 'i': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1525,12 +1529,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)info); } /* end else */ -#endif /* H5_HAVE_PARALLEL */ +#endif /* H5_HAVE_PARALLEL */ break; case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1538,7 +1542,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5FD_mem_t mt = (H5FD_mem_t)va_arg(ap, int); - switch(mt) { + switch (mt) { case H5FD_MEM_NOLIST: HDfprintf(out, "H5FD_MEM_NOLIST"); break; @@ -1579,7 +1583,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)mt); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: @@ -1588,8 +1592,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'o': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1597,15 +1601,15 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { off_t offset = va_arg(ap, off_t); - HDfprintf (out, "%ld", (long)offset); + HDfprintf(out, "%ld", (long)offset); } /* end else */ break; case 'O': - switch(type[1]) { + switch (type[1]) { case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1613,7 +1617,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5O_type_t objtype = (H5O_type_t)va_arg(ap, int); - switch(objtype) { + switch (objtype) { case H5O_TYPE_UNKNOWN: HDfprintf(out, "H5O_TYPE_UNKNOWN"); break; @@ -1638,7 +1642,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "BADTYPE(%ld)", (long)objtype); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: @@ -1648,21 +1652,21 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'p': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - hid_t pclass_id = va_arg(ap, hid_t); - char *class_name = NULL; + hid_t pclass_id = va_arg(ap, hid_t); + char * class_name = NULL; H5P_genclass_t *pclass; /* Get the class name and print it */ /* (This may generate recursive call to the library... -QAK) */ - if(NULL != (pclass = (H5P_genclass_t *)H5I_object(pclass_id)) && - NULL != (class_name = H5P_get_class_name(pclass))) { + if (NULL != (pclass = (H5P_genclass_t *)H5I_object(pclass_id)) && + NULL != (class_name = H5P_get_class_name(pclass))) { HDfprintf(out, "%s", class_name); H5MM_xfree(class_name); } /* end if */ @@ -1672,8 +1676,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'r': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1686,10 +1690,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'R': - switch(type[1]) { + switch (type[1]) { case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1697,7 +1701,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5R_type_t reftype = (H5R_type_t)va_arg(ap, int); - switch(reftype) { + switch (reftype) { case H5R_BADTYPE: HDfprintf(out, "H5R_BADTYPE"); break; @@ -1718,7 +1722,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "BADTYPE(%ld)", (long)reftype); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: @@ -1728,10 +1732,10 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'S': - switch(type[1]) { + switch (type[1]) { case 'c': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1739,7 +1743,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5S_class_t cls = (H5S_class_t)va_arg(ap, int); - switch(cls) { + switch (cls) { case H5S_NO_CLASS: HDfprintf(out, "H5S_NO_CLASS"); break; @@ -1760,12 +1764,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)cls); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 's': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1773,7 +1777,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5S_seloper_t so = (H5S_seloper_t)va_arg(ap, int); - switch(so) { + switch (so) { case H5S_SELECT_NOOP: HDfprintf(out, "H5S_NOOP"); break; @@ -1818,12 +1822,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)so); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1831,7 +1835,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5S_sel_type st = (H5S_sel_type)va_arg(ap, int); - switch(st) { + switch (st) { case H5S_SEL_ERROR: HDfprintf(out, "H5S_SEL_ERROR"); break; @@ -1860,7 +1864,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)st); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: @@ -1870,24 +1874,25 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 's': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - const char *str = va_arg(ap, const char *); /*lint !e64 Type mismatch not really occuring */ + const char *str = + va_arg(ap, const char *); /*lint !e64 Type mismatch not really occuring */ HDfprintf(out, "\"%s\"", str); } /* end else */ break; case 'T': - switch(type[1]) { + switch (type[1]) { case 'c': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1895,7 +1900,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_cset_t cset = (H5T_cset_t)va_arg(ap, int); - switch(cset) { + switch (cset) { case H5T_CSET_ERROR: HDfprintf(out, "H5T_CSET_ERROR"); break; @@ -1929,12 +1934,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)cset); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'd': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1942,7 +1947,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_direction_t direct = (H5T_direction_t)va_arg(ap, int); - switch(direct) { + switch (direct) { case H5T_DIR_DEFAULT: HDfprintf(out, "H5T_DIR_DEFAULT"); break; @@ -1959,12 +1964,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)direct); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'e': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -1972,7 +1977,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_pers_t pers = (H5T_pers_t)va_arg(ap, int); - switch(pers) { + switch (pers) { case H5T_PERS_DONTCARE: HDfprintf(out, "H5T_PERS_DONTCARE"); break; @@ -1989,12 +1994,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)pers); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'n': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2002,7 +2007,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_norm_t norm = (H5T_norm_t)va_arg(ap, int); - switch(norm) { + switch (norm) { case H5T_NORM_ERROR: HDfprintf(out, "H5T_NORM_ERROR"); break; @@ -2023,12 +2028,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)norm); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'o': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2036,7 +2041,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_order_t order = (H5T_order_t)va_arg(ap, int); - switch(order) { + switch (order) { case H5T_ORDER_ERROR: HDfprintf(out, "H5T_ORDER_ERROR"); break; @@ -2065,12 +2070,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)order); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'p': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2078,7 +2083,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_pad_t pad = (H5T_pad_t)va_arg(ap, int); - switch(pad) { + switch (pad) { case H5T_PAD_ERROR: HDfprintf(out, "H5T_PAD_ERROR"); break; @@ -2103,12 +2108,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)pad); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 's': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2116,7 +2121,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_sign_t sign = (H5T_sign_t)va_arg(ap, int); - switch(sign) { + switch (sign) { case H5T_SGN_ERROR: HDfprintf(out, "H5T_SGN_ERROR"); break; @@ -2137,12 +2142,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)sign); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2150,7 +2155,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_class_t type_class = (H5T_class_t)va_arg(ap, int); - switch(type_class) { + switch (type_class) { case H5T_NO_CLASS: HDfprintf(out, "H5T_NO_CLASS"); break; @@ -2207,12 +2212,12 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)type_class); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'z': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2220,7 +2225,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5T_str_t str = (H5T_str_t)va_arg(ap, int); - switch(str) { + switch (str) { case H5T_STR_ERROR: HDfprintf(out, "H5T_STR_ERROR"); break; @@ -2250,61 +2255,62 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5T_STR_RESERVED_13: case H5T_STR_RESERVED_14: case H5T_STR_RESERVED_15: - HDfprintf(out, "H5T_STR_RESERVED(%ld)",(long)str); + HDfprintf(out, "H5T_STR_RESERVED(%ld)", (long)str); break; default: HDfprintf(out, "%ld", (long)str); break; } /* end switch */ - } /* end else */ + } /* end else */ break; default: - HDfprintf (out, "BADTYPE(T%c)", type[1]); + HDfprintf(out, "BADTYPE(T%c)", type[1]); goto error; } /* end switch */ break; case 't': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - htri_t tri_var = va_arg (ap, htri_t); + htri_t tri_var = va_arg(ap, htri_t); - if(tri_var>0) - HDfprintf (out, "TRUE"); - else if(!tri_var) - HDfprintf (out, "FALSE"); + if (tri_var > 0) + HDfprintf(out, "TRUE"); + else if (!tri_var) + HDfprintf(out, "FALSE"); else HDfprintf(out, "FAIL(%d)", (int)tri_var); } /* end else */ break; case 'U': - switch(type[1]) { + switch (type[1]) { case 'l': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { + if (asize_idx >= 0 && asize[asize_idx] >= 0) { unsigned long *p = (unsigned long *)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%lu", i?", ":"", p[i]); + for (i = 0; i < asize[asize_idx]; i++) + HDfprintf(out, "%s%lu", i ? ", " : "", p[i]); HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ else { - unsigned long iul = va_arg(ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ + unsigned long iul = + va_arg(ap, unsigned long); /*lint !e732 Loss of sign not really occuring */ HDfprintf(out, "%lu", iul); asize[argno] = iul; @@ -2312,23 +2318,24 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'L': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { + if (asize_idx >= 0 && asize[asize_idx] >= 0) { unsigned long long *p = (unsigned long long *)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) - HDfprintf(out, "%s%llu", i?", ":"", p[i]); + for (i = 0; i < asize[asize_idx]; i++) + HDfprintf(out, "%s%llu", i ? ", " : "", p[i]); HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ else { - unsigned long long iull = va_arg(ap, unsigned long long); /*lint !e732 Loss of sign not really occuring */ + unsigned long long iull = va_arg( + ap, unsigned long long); /*lint !e732 Loss of sign not really occuring */ HDfprintf(out, "%llu", iull); asize[argno] = iull; @@ -2336,35 +2343,35 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - HDfprintf (out, "BADTYPE(U%c)", type[1]); + HDfprintf(out, "BADTYPE(U%c)", type[1]); goto error; } /* end switch */ break; case 'x': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { - void **p = (void**)vp; + if (asize_idx >= 0 && asize[asize_idx] >= 0) { + void **p = (void **)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) { - if(p[i]) + for (i = 0; i < asize[asize_idx]; i++) { + if (p[i]) HDfprintf(out, "%s0x%lx", (i ? ", " : ""), (unsigned long)(p[i])); else HDfprintf(out, "%sNULL", (i ? ", " : "")); } /* end for */ HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ else { - vp = va_arg (ap, void *); /*lint !e64 Type mismatch not really occuring */ + vp = va_arg(ap, void *); /*lint !e64 Type mismatch not really occuring */ - if(vp) + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2372,18 +2379,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'z': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { + if (asize_idx >= 0 && asize[asize_idx] >= 0) { size_t *p = (size_t *)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) + for (i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Zu", (i ? ", " : ""), p[i]); HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ @@ -2398,8 +2405,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case 'Z': switch (type[1]) { case 'a': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2407,7 +2414,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5Z_SO_scale_type_t scale_type = (H5Z_SO_scale_type_t)va_arg(ap, int); - switch(scale_type) { + switch (scale_type) { case H5Z_SO_FLOAT_DSCALE: HDfprintf(out, "H5Z_SO_FLOAT_DSCALE"); break; @@ -2424,26 +2431,27 @@ H5_trace(const double *returning, const char *func, const char *type, ...) HDfprintf(out, "%ld", (long)scale_type); break; } /* end switch */ - } /* end else */ + } /* end else */ break; case 'c': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); } /* end if */ else { - H5Z_class2_t *filter = va_arg(ap, H5Z_class2_t*); /*lint !e64 Type mismatch not really occuring */ + H5Z_class2_t *filter = + va_arg(ap, H5Z_class2_t *); /*lint !e64 Type mismatch not really occuring */ HDfprintf(out, "0x%lx", (unsigned long)filter); } /* end else */ break; case 'e': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2451,7 +2459,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5Z_EDC_t edc = (H5Z_EDC_t)va_arg(ap, int); - if(H5Z_DISABLE_EDC == edc) + if (H5Z_DISABLE_EDC == edc) HDfprintf(out, "H5Z_DISABLE_EDC"); else if (H5Z_ENABLE_EDC == edc) HDfprintf(out, "H5Z_ENABLE_EDC"); @@ -2461,8 +2469,8 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 'f': - if(ptr) { - if(vp) + if (ptr) { + if (vp) HDfprintf(out, "0x%lx", (unsigned long)vp); else HDfprintf(out, "NULL"); @@ -2470,7 +2478,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) else { H5Z_filter_t id = va_arg(ap, H5Z_filter_t); - if(H5Z_FILTER_DEFLATE == id) + if (H5Z_FILTER_DEFLATE == id) HDfprintf(out, "H5Z_FILTER_DEFLATE"); else HDfprintf(out, "%ld", (long)id); @@ -2478,18 +2486,18 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; case 's': - if(ptr) { - if(vp) { + if (ptr) { + if (vp) { HDfprintf(out, "0x%lx", (unsigned long)vp); - if(asize_idx >= 0 && asize[asize_idx] >= 0) { + if (asize_idx >= 0 && asize[asize_idx] >= 0) { ssize_t *p = (ssize_t *)vp; HDfprintf(out, " {"); - for(i = 0; i < asize[asize_idx]; i++) + for (i = 0; i < asize[asize_idx]; i++) HDfprintf(out, "%s%Zd", (i ? ", " : ""), p[i]); HDfprintf(out, "}"); } /* end if */ - } /* end if */ + } /* end if */ else HDfprintf(out, "NULL"); } /* end if */ @@ -2508,29 +2516,28 @@ H5_trace(const double *returning, const char *func, const char *type, ...) break; default: - if(HDisupper(type[0])) + if (HDisupper(type[0])) HDfprintf(out, "BADTYPE(%c%c)", type[0], type[1]); else HDfprintf(out, "BADTYPE(%c)", type[0]); goto error; - } /* end switch */ - } /* end for */ + } /* end switch */ + } /* end for */ /* Display event time for return */ - if(returning && H5_debug_g.ttimes) + if (returning && H5_debug_g.ttimes) HDfprintf(out, " @%.6f [dt=%.6f]", (event_time.etime - first_time.etime), - (event_time.etime - *returning)); + (event_time.etime - *returning)); error: va_end(ap); - if(returning) - HDfprintf(out, ";\n"); + if (returning) + HDfprintf(out, ";\n"); else { - last_call_depth = current_depth++; - HDfprintf (out, ")"); + last_call_depth = current_depth++; + HDfprintf(out, ")"); } /* end else */ HDfflush(out); return event_time.etime; } /* end H5_trace() */ - |