diff --git a/examples/ph5example.c b/examples/ph5example.c index 4e6d56fac93..5ec2cdc2841 100644 --- a/examples/ph5example.c +++ b/examples/ph5example.c @@ -46,10 +46,10 @@ /* Define some handy debugging shorthands, routines, ... */ /* debugging tools */ #define MESG(x) \ -do { \ - if (verbose) \ - printf("%s\n", x); \ -} while(0) + do { \ + if (verbose) \ + printf("%s\n", x); \ + } while (0) #define MPI_BANNER(mesg) \ do { \ @@ -57,14 +57,14 @@ do { printf("Proc %d: ", mpi_rank); \ printf("*** %s\n", mesg); \ printf("--------------------------------\n"); \ - } while(0) + } while (0) #define SYNC(comm) \ do { \ MPI_BANNER("doing a SYNC"); \ MPI_Barrier(comm); \ MPI_BANNER("SYNC DONE"); \ - } while(0) + } while (0) /* End of Define some handy debugging shorthands, routines, ... */ /* Constants definitions */ diff --git a/src/H5EA.c b/src/H5EA.c index a940195c84c..097169552de 100644 --- a/src/H5EA.c +++ b/src/H5EA.c @@ -627,7 +627,8 @@ H5EA__lookup_elmt(const H5EA_t *ea, hsize_t idx, hbool_t will_extend, unsigned t if (dblock && *thing != dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array data block"); if (dblk_page && *thing != dblk_page && H5EA__dblk_page_unprotect(dblk_page, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array data block page"); + HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, + "unable to release extensible array data block page"); FUNC_LEAVE_NOAPI(ret_value) } /* end H5EA__lookup_elmt() */ diff --git a/src/H5EAdbg.c b/src/H5EAdbg.c index f38cda565c4..e9a53cad207 100644 --- a/src/H5EAdbg.c +++ b/src/H5EAdbg.c @@ -136,7 +136,8 @@ H5EA__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, co done: if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) - HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to release extensible array debugging context"); + HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, + "unable to release extensible array debugging context"); if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array header"); @@ -251,7 +252,8 @@ H5EA__iblock_debug(H5F_t *f, haddr_t H5_ATTR_UNUSED addr, FILE *stream, int inde done: if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) - HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to release extensible array debugging context"); + HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, + "unable to release extensible array debugging context"); if (iblock && H5EA__iblock_unprotect(iblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array index block"); if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) @@ -337,7 +339,8 @@ H5EA__sblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, done: if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) - HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to release extensible array debugging context"); + HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, + "unable to release extensible array debugging context"); if (sblock && H5EA__sblock_unprotect(sblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array super block"); if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) @@ -413,7 +416,8 @@ H5EA__dblock_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, done: if (dbg_ctx && cls->dst_dbg_ctx(dbg_ctx) < 0) - HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, "unable to release extensible array debugging context"); + HDONE_ERROR(H5E_EARRAY, H5E_CANTRELEASE, FAIL, + "unable to release extensible array debugging context"); if (dblock && H5EA__dblock_unprotect(dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_EARRAY, H5E_CANTUNPROTECT, FAIL, "unable to release extensible array data block"); if (hdr && H5EA__hdr_unprotect(hdr, H5AC__NO_FLAGS_SET) < 0) diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 272a85b8251..0491439a29c 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -30,20 +30,20 @@ typedef struct H5E_t H5E_t; * error number, the minor error number, and a description of the error. */ #define HERROR(maj_id, min_id, ...) \ -do { \ - H5E_printf_stack(NULL, __FILE__, __func__, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__); \ -} while(0) + do { \ + H5E_printf_stack(NULL, __FILE__, __func__, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, __VA_ARGS__); \ + } while (0) /* * HCOMMON_ERROR macro, used by HDONE_ERROR and HGOTO_ERROR * (Shouldn't need to be used outside this header file) */ #define HCOMMON_ERROR(maj, min, ...) \ -do { \ - HERROR(maj, min, __VA_ARGS__); \ - err_occurred = TRUE; \ - err_occurred = err_occurred; /* Shut GCC warnings up! */ \ -} while(0) + do { \ + HERROR(maj, min, __VA_ARGS__); \ + err_occurred = TRUE; \ + err_occurred = err_occurred; /* Shut GCC warnings up! */ \ + } while (0) /* * HDONE_ERROR macro, used to facilitate error reporting between a @@ -58,7 +58,7 @@ do { do { \ HCOMMON_ERROR(maj, min, __VA_ARGS__); \ ret_value = ret_val; \ - } while(0) + } while (0) /* * HGOTO_ERROR macro, used to facilitate error reporting between a @@ -82,7 +82,7 @@ do { H5AC_tag(prv_tag, NULL); \ HCOMMON_ERROR(maj, min, __VA_ARGS__); \ HGOTO_DONE(ret_val); \ - } while(0) + } while (0) /* * HGOTO_DONE macro, used to facilitate normal return between a FUNC_ENTER() @@ -104,7 +104,7 @@ do { do { \ H5AC_tag(prv_tag, NULL); \ HGOTO_DONE(ret_val); \ - } while(0) + } while (0) /* * Macros handling system error messages as described in C standard. diff --git a/src/H5FAdblock.c b/src/H5FAdblock.c index 92eef60de70..a5489f10a61 100644 --- a/src/H5FAdblock.c +++ b/src/H5FAdblock.c @@ -233,11 +233,13 @@ H5FA__dblock_create(H5FA_hdr_t *hdr, hbool_t *hdr_dirty) /* Release data block's disk space */ if (H5_addr_defined(dblock->addr) && H5MF_xfree(hdr->f, H5FD_MEM_FARRAY_DBLOCK, dblock->addr, (hsize_t)dblock->size) < 0) - HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, HADDR_UNDEF, "unable to release fixed array data block"); + HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, HADDR_UNDEF, + "unable to release fixed array data block"); /* Destroy data block */ if (H5FA__dblock_dest(dblock) < 0) - HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, HADDR_UNDEF, "unable to destroy fixed array data block"); + HDONE_ERROR(H5E_FARRAY, H5E_CANTFREE, HADDR_UNDEF, + "unable to destroy fixed array data block"); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 08466588469..718b3a71578 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -575,7 +575,8 @@ H5O__shared_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, H5F_t *file_dst, H5_BEGIN_TAG(H5AC__COPIED_TAG) if (H5SM_try_share(file_dst, NULL, H5SM_DEFER, mesg_type->id, _native_dst, mesg_flags) < 0) - HGOTO_ERROR_TAG(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to determine if message should be shared"); + HGOTO_ERROR_TAG(H5E_OHDR, H5E_WRITEERROR, FAIL, + "unable to determine if message should be shared"); /* Reset metadata tag */ H5_END_TAG diff --git a/src/H5SL.c b/src/H5SL.c index 194ba44066d..d185d6da9ad 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -235,7 +235,7 @@ X->forward[_lvl + 1] = PREV->forward[_lvl + 1]; \ } \ PREV->forward[_lvl + 1] = X; \ - } while(0) + } while (0) /* Macro used to reduce the level of a node by 1. Does not update the head node * "current level". PREV is the previous node of the current height of X. */ diff --git a/src/H5Tinit_float.c b/src/H5Tinit_float.c index e30c868e5b6..9c1ef34724e 100644 --- a/src/H5Tinit_float.c +++ b/src/H5Tinit_float.c @@ -138,7 +138,7 @@ INFO.ebias = H5T__find_bias(INFO.epos, INFO.esize, INFO.perm, &_v1); \ H5T__set_precision(&(INFO)); \ COMP_ALIGNMENT(TYPE, INFO.comp_align); \ - } while(0) + } while (0) /* Detect alignment for C structure */ #define COMP_ALIGNMENT(TYPE, COMP_ALIGN) \ diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index da8bf82bfab..abb81b91b85 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -93,7 +93,7 @@ static hbool_t not_comparable; per = (double)ABS((double)((B) - (A)) / (double)(A)); \ else \ not_comparable = TRUE; \ - } while(0) + } while (0) #define PER_UNSIGN(TYPE, A, B) \ do { \ diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h index 76168397253..8a7414c3596 100644 --- a/tools/lib/h5tools_error.h +++ b/tools/lib/h5tools_error.h @@ -226,7 +226,7 @@ catch_except:; ret_value = v; \ if (!past_catch) \ goto catch_except; \ - } while(0) + } while (0) /* * H5TOOLS_THROW macro, used to facilitate error reporting within a function body. diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index fc18f34dab0..84567c834f5 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -145,7 +145,7 @@ static struct dispatch_t { dispatch_g[TYPE].name = (NAME); \ dispatch_g[TYPE].list1 = (LIST1); \ dispatch_g[TYPE].list2 = (LIST2); \ - } while(0) + } while (0) static void print_type(h5tools_str_t *buffer, hid_t type, int ind); static hbool_t print_int_type(h5tools_str_t *buffer, hid_t type, int ind); diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index c30113c20b1..00a7ae2c830 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -20,7 +20,7 @@ do { \ H5_FAILED(); \ goto error; \ - } while(0) + } while (0) /* fill value test */ #define FNAME0 "h5repack_fill.h5"