diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-05-16 18:53:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-05-16 18:53:46 +0200 |
commit | 4c4e6431613c8005220ede59a0d4642814142cb9 (patch) | |
tree | 3a19a1ff7f6ee11f91b4abc24da1c6a1a8d2d400 /src/delta | |
parent | 807f46452202891731b2317ef9bc9a6bc7115f23 (diff) |
delta: enums are much cooler than defines
Diffstat (limited to 'src/delta')
-rw-r--r-- | src/delta/delta.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/delta/delta.c b/src/delta/delta.c index 585bb0c7a7..7b50bce661 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -34,6 +34,18 @@ static bool arg_no_pager = false; +enum { + SHOW_MASKED = 1 << 0, + SHOW_EQUIV = 1 << 1, + SHOW_REDIR = 1 << 2, + SHOW_OVERRIDEN = 1 << 3, + SHOW_UNCHANGED = 1 << 4, + SHOW_DIFF = 1 << 5, + + SHOW_DEFAULTS = + (SHOW_MASKED | SHOW_EQUIV | SHOW_REDIR | SHOW_OVERRIDEN | SHOW_DIFF) +}; + static int equivalent(const char *a, const char *b) { char *x, *y; int r; @@ -55,15 +67,7 @@ static int equivalent(const char *a, const char *b) { return r; } -#define SHOW_MASKED 1 << 0 -#define SHOW_EQUIV 1 << 1 -#define SHOW_REDIR 1 << 2 -#define SHOW_OVERRIDEN 1 << 3 -#define SHOW_UNCHANGED 1 << 4 -#define SHOW_DIFF 1 << 5 -#define SHOW_DEFAULTS \ - (SHOW_MASKED | SHOW_EQUIV | SHOW_REDIR | SHOW_OVERRIDEN | SHOW_DIFF) static int notify_override_masked(int flags, const char *top, const char *bottom) { if (!(flags & SHOW_MASKED)) |