Skip to content

Commit

Permalink
util.h, biquad.c: Wrap if… macros in do…while blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
bmc0 committed Sep 6, 2024
1 parent d66d5f1 commit a5238ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions biquad.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ void biquad_effect_destroy(struct effect *e)

#define BIQUAD_WIDTH_TEST_NO_SLOPE (width_type != BIQUAD_WIDTH_SLOPE && width_type != BIQUAD_WIDTH_SLOPE_DB)
#define CHECK_WIDTH_TYPE(cond) \
if (!(cond)) { \
do { if (!(cond)) { \
LOG_FMT(LL_ERROR, "%s: error: invalid width type", argv[0]); \
return NULL; \
}
} } while (0)

#define INIT_COMMON(n_args, b_type) \
do { \
Expand Down
6 changes: 3 additions & 3 deletions util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
#define CHECK_RANGE(cond, name, action) \
if (!(cond)) { \
do { if (!(cond)) { \
LOG_FMT(LL_ERROR, "%s: error: %s out of range", argv[0], name); \
action; \
}
} } while (0)
#define CHECK_FREQ(var, fs, name, action) \
CHECK_RANGE((var) >= 0.0 && (var) < (double) (fs) / 2.0, name, action)
#define CHECK_ENDPTR(str, endptr, param_name, action) \
if (check_endptr(argv[0], str, endptr, param_name)) { action; }
do { if (check_endptr(argv[0], str, endptr, param_name)) { action; } } while (0)
#if 0
#define GET_BIT(x, o) (((char *) x)[(int) (o) / 8] & (1 << ((int) (o) % 8)))
#define SET_BIT(x, o) ((char *) x)[(int) (o) / 8] |= (1 << ((int) (o) % 8))
Expand Down

0 comments on commit a5238ba

Please sign in to comment.