1
0
mirror of https://git.disroot.org/80486DX2-66/polonium.git synced 2024-12-28 08:00:33 +05:30

readability: replace macro LOOP_ACTION_CONFIG with inline code

This commit is contained in:
Intel A80486DX2-66 2024-11-22 23:47:56 +03:00
parent 078590846a
commit 1205f4c898
Signed by: 80486DX2-66
GPG Key ID: 83631EF27054609B
2 changed files with 10 additions and 9 deletions

View File

@ -106,8 +106,4 @@ typedef off_t file_offset_t;
#define SET_CONFIG(x) config |= (x)
#define CLEAR_CONFIG(x) config &= ~(x)
#define LOOP_ACTION_CONFIG(f, x) \
f(x); \
continue
#endif /* _COMMON_H */

View File

@ -283,15 +283,20 @@ int main(int argc, char** argv) {
else if (ARG_MATCH(arg, ARG_SEED))
arg_destination = ARG_DEST_SEED;
else if (ARG_MATCH(arg, ARG_NOCONFIRM)) {
LOOP_ACTION_CONFIG(CLEAR_CONFIG, C_CONFIRM);
CLEAR_CONFIG(C_CONFIRM);
continue;
} else if (ARG_MATCH(arg, ARG_CONTENTS)) {
LOOP_ACTION_CONFIG(SET_CONFIG, C_CONTENTS);
SET_CONFIG(C_CONTENTS);
continue;
} else if (ARG_MATCH(arg, ARG_LINE_ENDINGS)) {
LOOP_ACTION_CONFIG(SET_CONFIG, C_LINE_ENDINGS);
SET_CONFIG(C_LINE_ENDINGS);
continue;
} else if (ARG_MATCH(arg, ARG_PRINTABLE)) {
LOOP_ACTION_CONFIG(SET_CONFIG, C_PRINTABLE);
SET_CONFIG(C_PRINTABLE);
continue;
} else if (ARG_MATCH(arg, ARG_VERBOSE)) {
LOOP_ACTION_CONFIG(SET_CONFIG, C_VERBOSE);
SET_CONFIG(C_VERBOSE);
continue;
} else
FATAL_ERROR_RET("Unknown command line parameter '%s'.\n"
"Please invoke the program with argument %s to "