[PATCH 3/9] archiver API: make the "flags" in "struct archiver" an enum

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux