From 095e1ba71d28300a31bf411f1e9045bbb539a130 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 4 Mar 2009 15:12:02 +0200 Subject: [PATCH] Condense "shut up gcc" switch-cases to just default no action case --- lib/package.c | 10 +--------- lib/rpmchecksig.c | 12 +----------- lib/signature.c | 38 ++++---------------------------------- 3 files changed, 6 insertions(+), 54 deletions(-) diff --git a/lib/package.c b/lib/package.c index 4d5e087..9a56e49 100644 --- a/lib/package.c +++ b/lib/package.c @@ -779,15 +779,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) fdStealDigest(fd, dig); break; - /* shut up gcc */ - case RPMSIGTAG_LEMD5_1: - case RPMSIGTAG_LEMD5_2: - case RPMSIGTAG_BADSHA1_1: - case RPMSIGTAG_BADSHA1_2: - case RPMSIGTAG_SIZE: - case RPMSIGTAG_LONGSIZE: - case RPMSIGTAG_PAYLOADSIZE: - case RPMSIGTAG_LONGARCHIVESIZE: + default: break; } diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index f80222d..485be84 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -282,17 +282,7 @@ static int rpmReSign(rpmts ts, QVA_t qva, ARGV_const_t argv) case RPMSIGTAG_PGP: xx = headerDel(sigh, RPMSIGTAG_RSA); break; - /* shut up gcc */ - case RPMSIGTAG_SHA1: - case RPMSIGTAG_MD5: - case RPMSIGTAG_LEMD5_1: - case RPMSIGTAG_LEMD5_2: - case RPMSIGTAG_BADSHA1_1: - case RPMSIGTAG_BADSHA1_2: - case RPMSIGTAG_PAYLOADSIZE: - case RPMSIGTAG_LONGARCHIVESIZE: - case RPMSIGTAG_SIZE: - case RPMSIGTAG_LONGSIZE: + default: break; } diff --git a/lib/signature.c b/lib/signature.c index fba0027..545ab4d 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -598,11 +598,6 @@ static int makeGPGSignature(const char * file, rpmSigTag * sigTagp, sigp = &dig->signature; switch (*sigTagp) { - case RPMSIGTAG_SIZE: - case RPMSIGTAG_LONGSIZE: - case RPMSIGTAG_MD5: - case RPMSIGTAG_SHA1: - break; case RPMSIGTAG_GPG: /* XXX check MD5 hash too? */ if (sigp->pubkey_algo == PGPPUBKEYALGO_RSA) @@ -622,13 +617,7 @@ static int makeGPGSignature(const char * file, rpmSigTag * sigTagp, if (sigp->pubkey_algo == PGPPUBKEYALGO_DSA) *sigTagp = RPMSIGTAG_DSA; break; - /* shut up gcc */ - case RPMSIGTAG_LEMD5_1: - case RPMSIGTAG_LEMD5_2: - case RPMSIGTAG_BADSHA1_1: - case RPMSIGTAG_BADSHA1_2: - case RPMSIGTAG_PAYLOADSIZE: - case RPMSIGTAG_LONGARCHIVESIZE: + default: break; } @@ -662,14 +651,6 @@ static int makeHDRSignature(Header sigh, const char * file, rpmSigTag sigTag, int ret = -1; /* assume failure. */ switch (sigTag) { - case RPMSIGTAG_SIZE: - case RPMSIGTAG_LONGSIZE: - case RPMSIGTAG_MD5: - case RPMSIGTAG_PGP5: /* XXX legacy */ - case RPMSIGTAG_PGP: - case RPMSIGTAG_GPG: - goto exit; - break; case RPMSIGTAG_SHA1: fd = Fopen(file, "r.fdio"); if (fd == NULL || Ferror(fd)) @@ -744,13 +725,8 @@ static int makeHDRSignature(Header sigh, const char * file, rpmSigTag sigTag, goto exit; ret = 0; break; - /* shut up gcc */ - case RPMSIGTAG_LEMD5_1: - case RPMSIGTAG_LEMD5_2: - case RPMSIGTAG_BADSHA1_1: - case RPMSIGTAG_BADSHA1_2: - case RPMSIGTAG_PAYLOADSIZE: - case RPMSIGTAG_LONGARCHIVESIZE: + default: + goto exit; break; } @@ -824,13 +800,7 @@ int rpmAddSignature(Header sigh, const char * file, rpmSigTag sigTag, case RPMSIGTAG_SHA1: ret = makeHDRSignature(sigh, file, sigTag, passPhrase); break; - /* shut up gcc */ - case RPMSIGTAG_LEMD5_1: - case RPMSIGTAG_LEMD5_2: - case RPMSIGTAG_BADSHA1_1: - case RPMSIGTAG_BADSHA1_2: - case RPMSIGTAG_PAYLOADSIZE: - case RPMSIGTAG_LONGARCHIVESIZE: + default: break; } free(pkt); -- 2.7.4