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:
parent
078590846a
commit
1205f4c898
@ -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 */
|
||||
|
15
src/main.c
15
src/main.c
@ -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 "
|
||||
|
Loading…
Reference in New Issue
Block a user