[PATCH 3/9] archiver API: make the "flags" in "struct archiver" an enum
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Feb 2, 2023, 09:32 UTC
- Message-ID
- <patch-3.9-9d1a68b5282-20230202T093212Z-avarab@gmail.com>
- In-Reply-To
- <cover-0.9-00000000000-20230202T093212Z-avarab@gmail.com>
Refactor the "#define" pattern in the archiver.h to use a new "enum archiver_flags". This isn't a functional change, but will make adding new flags in a subsequent commit easier to reason about.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- archive.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/archive.h b/archive.h index 08bed3ed3af..6b51288c2ed 100644 --- a/archive.h +++ b/archive.h @@ -36,13 +36,15 @@ const char *archive_format_from_filename(const char *filename); /* archive backend stuff */ -#define ARCHIVER_WANT_COMPRESSION_LEVELS 1 -#define ARCHIVER_REMOTE 2 -#define ARCHIVER_HIGH_COMPRESSION_LEVELS 4 +enum archiver_flags { + ARCHIVER_WANT_COMPRESSION_LEVELS = 1<<0, + ARCHIVER_REMOTE = 1<<1, + ARCHIVER_HIGH_COMPRESSION_LEVELS = 1<<2, +}; struct archiver { const char *name; int (*write_archive)(const struct archiver *, struct archiver_args *); - unsigned flags; + enum archiver_flags flags; char *filter_command; }; void register_archiver(struct archiver *);
-- 2.39.1.1392.g63e6d408230