This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=4f1dbeae8d16fefb15c713dc6cb0dba0359ab2ef

commit 4f1dbeae8d16fefb15c713dc6cb0dba0359ab2ef
Author: Guillem Jover <[email protected]>
AuthorDate: Fri Feb 24 02:39:52 2023 +0100

    libdpkg: Add enumerations for the default, unset and max cases
    
    With a strict handling of enums, we need enumerations for all used
    values, but we were passing explicit literal integers that were not
    described as any enumeration.
    
    Warned-by: clang-16 -Wassign-enum
---
 lib/dpkg/compress.h  | 2 ++
 lib/dpkg/dpkg-db.h   | 4 ++++
 lib/dpkg/fsys.h      | 4 ++++
 lib/dpkg/parsedump.h | 2 ++
 4 files changed, 12 insertions(+)

diff --git a/lib/dpkg/compress.h b/lib/dpkg/compress.h
index 7458e174b..b05bccf6d 100644
--- a/lib/dpkg/compress.h
+++ b/lib/dpkg/compress.h
@@ -43,6 +43,8 @@ enum compressor_type {
        COMPRESSOR_TYPE_ZSTD,
        COMPRESSOR_TYPE_BZIP2,
        COMPRESSOR_TYPE_LZMA,
+
+       COMPRESSOR_TYPE_MAX,
 };
 
 enum compressor_strategy {
diff --git a/lib/dpkg/dpkg-db.h b/lib/dpkg/dpkg-db.h
index 11048e4c6..2cd2c5690 100644
--- a/lib/dpkg/dpkg-db.h
+++ b/lib/dpkg/dpkg-db.h
@@ -264,6 +264,8 @@ char *dpkg_db_get_path(const char *pathpart);
 /*** from dbmodify.c ***/
 
 enum modstatdb_rw {
+  msdbrw_unset                 = -1,
+
   /* Those marked with «return» are possible returns from modstatdb_open(). */
   msdbrw_readonly,                     /* «return» */
   msdbrw_needsuperuserlockonly,                /* «return» */
@@ -460,6 +462,8 @@ write_stanza(FILE *, const char *,
              const struct pkginfo *, const struct pkgbin *);
 
 enum writedb_flags {
+  /** No flags. */
+  wdb_none                     = 0,
   /** Dump ‘available’ in-core structures, not ‘status’. */
   wdb_dump_available           = DPKG_BIT(0),
   /** Must sync the written file. */
diff --git a/lib/dpkg/fsys.h b/lib/dpkg/fsys.h
index 1516f170b..10aae092e 100644
--- a/lib/dpkg/fsys.h
+++ b/lib/dpkg/fsys.h
@@ -54,6 +54,8 @@ struct pkginfo;
  * Flags to fsys_hash_find_node().
  */
 enum fsys_hash_find_flags {
+       /** No flags. */
+       FHFF_NONE                       = 0,
        /** Do not need to copy filename. */
        FHFF_NOCOPY                     = DPKG_BIT(0),
        /** Do not insert the item if it is not found, and return NULL. */
@@ -61,6 +63,8 @@ enum fsys_hash_find_flags {
 };
 
 enum fsys_namenode_flags {
+       /** No flags. */
+       FNNF_NONE                       = 0,
        /** In the newconffiles list. */
        FNNF_NEW_CONFF                  = DPKG_BIT(0),
        /** In the new filesystem archive. */
diff --git a/lib/dpkg/parsedump.h b/lib/dpkg/parsedump.h
index 31b0bdcf2..35dc5fde2 100644
--- a/lib/dpkg/parsedump.h
+++ b/lib/dpkg/parsedump.h
@@ -119,6 +119,8 @@ freadfunction f_trigpend, f_trigaw;
 freadfunction f_archives;
 
 enum fwriteflags {
+       /** No flags. */
+       fw_none                 = 0,
        /** Print field header and trailing newline. */
        fw_printheader          = DPKG_BIT(0),
 };

-- 
Dpkg.Org's dpkg

Reply via email to