Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 21, 2023
1 parent 50d626e commit 6a510b0
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 31 deletions.
12 changes: 6 additions & 6 deletions examples/ph5example.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@
/* 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 { \
printf("--------------------------------\n"); \
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 */
Expand Down
3 changes: 2 additions & 1 deletion src/H5EA.c
Original file line number Diff line number Diff line change
Expand Up @@ -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() */
Expand Down
12 changes: 8 additions & 4 deletions src/H5EAdbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
22 changes: 11 additions & 11 deletions src/H5Eprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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()
Expand All @@ -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.
Expand Down
6 changes: 4 additions & 2 deletions src/H5FAdblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/H5Oshared.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/H5SL.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion src/H5Tinit_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion tools/lib/h5diff_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 { \
Expand Down
2 changes: 1 addition & 1 deletion tools/lib/h5tools_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tools/src/h5ls/h5ls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tools/test/h5repack/h5repacktst.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
do { \
H5_FAILED(); \
goto error; \
} while(0)
} while (0)

/* fill value test */
#define FNAME0 "h5repack_fill.h5"
Expand Down

0 comments on commit 6a510b0

Please sign in to comment.