From 964846339260693996ac189db0c7f141d30c1b03 Mon Sep 17 00:00:00 2001 From: cancel Date: Wed, 28 Nov 2018 18:51:36 +0900 Subject: [PATCH] Clean up redundant argument decls in macros --- sim.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/sim.c b/sim.c index 0f6c2f2..f3685c4 100644 --- a/sim.c +++ b/sim.c @@ -125,6 +125,15 @@ Usz UCLAMP(Usz val, Usz min, Usz max) { #define ORCA_DECLARE_OPERATORS(_solo_defs, _dual_defs) \ ORCA_DEFINE_OPER_CHARS(_solo_defs, _dual_defs) +#define OPER_PHASE_COMMON_ARGS \ + Gbuffer const gbuffer, Mbuffer const mbuffer, Usz const height, \ + Usz const width, Usz const y, Usz const x +#define OPER_PHASE_0_COMMON_ARGS \ + OPER_PHASE_COMMON_ARGS, Oper_bank_write_params *const bank_params, \ + U8 const cell_flags +#define OPER_PHASE_1_COMMON_ARGS \ + OPER_PHASE_COMMON_ARGS, Oper_bank_read_params* const bank_params + #define OPER_IGNORE_COMMON_ARGS() \ (void)gbuffer; \ (void)mbuffer; \ @@ -135,36 +144,25 @@ Usz UCLAMP(Usz val, Usz min, Usz max) { (void)bank_params; #define BEGIN_SOLO_PHASE_0(_oper_name) \ - static inline void oper_phase0_##_oper_name( \ - Gbuffer const gbuffer, Mbuffer const mbuffer, Usz const height, \ - Usz const width, Usz const y, Usz const x, \ - Oper_bank_write_params* bank_params, U8 const cell_flags) { \ + static inline void oper_phase0_##_oper_name(OPER_PHASE_0_COMMON_ARGS) { \ OPER_IGNORE_COMMON_ARGS() \ (void)cell_flags; \ enum { This_oper_char = Orca_oper_char_##_oper_name }; #define BEGIN_SOLO_PHASE_1(_oper_name) \ - static inline void oper_phase1_##_oper_name( \ - Gbuffer const gbuffer, Mbuffer const mbuffer, Usz const height, \ - Usz const width, Usz const y, Usz const x, \ - Oper_bank_read_params* bank_params) { \ + static inline void oper_phase1_##_oper_name(OPER_PHASE_1_COMMON_ARGS) { \ OPER_IGNORE_COMMON_ARGS() \ enum { This_oper_char = Orca_oper_char_##_oper_name }; #define BEGIN_DUAL_PHASE_0(_oper_name) \ - static inline void oper_phase0_##_oper_name( \ - Gbuffer const gbuffer, Mbuffer const mbuffer, Usz const height, \ - Usz const width, Usz const y, Usz const x, \ - Oper_bank_write_params* bank_params, U8 const cell_flags, \ - Glyph const This_oper_char) { \ + static inline void oper_phase0_##_oper_name(OPER_PHASE_0_COMMON_ARGS, \ + Glyph const This_oper_char) { \ OPER_IGNORE_COMMON_ARGS() \ (void)cell_flags; \ bool const Dual_is_uppercase = \ Orca_oper_upper_char_##_oper_name == This_oper_char; \ (void)Dual_is_uppercase; #define BEGIN_DUAL_PHASE_1(_oper_name) \ - static inline void oper_phase1_##_oper_name( \ - Gbuffer const gbuffer, Mbuffer const mbuffer, Usz const height, \ - Usz const width, Usz const y, Usz const x, \ - Oper_bank_read_params* bank_params, Glyph const This_oper_char) { \ + static inline void oper_phase1_##_oper_name(OPER_PHASE_1_COMMON_ARGS, \ + Glyph const This_oper_char) { \ OPER_IGNORE_COMMON_ARGS() \ bool const Dual_is_uppercase = \ Orca_oper_upper_char_##_oper_name == This_oper_char; \