From adbd484372cb38aca5aca3c6dba3b2ca9cae93d1 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 28 Sep 2010 23:06:29 +0300 Subject: [PATCH] Make RPMFILE_STATE_MISSING part of the rpmfileState enum - Shuts up couple of "not in enum" complaints from gcc, and actually "no state" is a perfectly valid state for one case: non-installed packages (so remove the "not valid" comment from formats.c) - OTOH, this created a new complaint for not handled case in a switch. Oh well, fix it up too... --- lib/formats.c | 1 - lib/rpmfi.h | 2 +- lib/verify.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/formats.c b/lib/formats.c index bf1ee22..386bdd3 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -597,7 +597,6 @@ static char * fstateFormat(rpmtd td, char * formatPrefix) case RPMFILE_STATE_WRONGCOLOR: str = _("wrong color"); break; - /* XXX headers should never have this value as file state */ case RPMFILE_STATE_MISSING: str = _("missing"); break; diff --git a/lib/rpmfi.h b/lib/rpmfi.h index 75dfd1e..e7607c6 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -35,13 +35,13 @@ typedef enum rpmFileTypes_e { * File States (when installed). */ typedef enum rpmfileState_e { + RPMFILE_STATE_MISSING = -1, /* used for unavailable data */ RPMFILE_STATE_NORMAL = 0, RPMFILE_STATE_REPLACED = 1, RPMFILE_STATE_NOTINSTALLED = 2, RPMFILE_STATE_NETSHARED = 3, RPMFILE_STATE_WRONGCOLOR = 4 } rpmfileState; -#define RPMFILE_STATE_MISSING -1 /* XXX used for unavailable data */ /** * File Attributes. diff --git a/lib/verify.c b/lib/verify.c index 96fae01..1c3769d 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -72,6 +72,7 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi, case RPMFILE_STATE_REPLACED: case RPMFILE_STATE_NOTINSTALLED: case RPMFILE_STATE_WRONGCOLOR: + case RPMFILE_STATE_MISSING: return 0; break; case RPMFILE_STATE_NORMAL: -- 2.7.4