From 4b67d7621c20e1f2c5aa1ebdf7bb26eb3a6ae0d5 Mon Sep 17 00:00:00 2001 From: jbj Date: Sat, 13 Oct 2001 22:01:38 +0000 Subject: [PATCH] More lclint annotations. CVS patchset: 5105 CVS date: 2001/10/13 22:01:38 --- .lclintrc | 18 +++--- build.c | 6 +- build/expression.c | 28 ++++----- build/files.c | 52 ++++++++--------- build/pack.c | 4 +- build/parseReqs.c | 10 ++-- build/parseScript.c | 4 +- build/parseSpec.c | 18 +++--- lib/depends.c | 38 +++++++------ lib/formats.c | 6 +- lib/fsm.c | 29 +++++++--- lib/header.c | 32 +++++------ lib/header_internal.c | 55 ++++++++++++------ lib/misc.c | 14 ++--- lib/package.c | 60 ++++++++++++++------ lib/psm.c | 18 +++--- lib/query.c | 22 +++++--- lib/rpmchecksig.c | 52 ++++++++--------- lib/rpminstall.c | 14 ++--- lib/rpmrc.c | 13 +++-- lib/transaction.c | 127 +++++++++++++++++++++-------------------- po/rpm.pot | 150 +++++++++++++++++++++++++------------------------ popt/po/popt.pot | 24 ++++---- popt/popt.c | 27 +++++---- popt/poptconfig.c | 6 +- popt/poptparse.c | 4 +- rpmdb/dbconfig.c | 14 ++--- rpmdb/rpmdb.c | 132 ++++++++++++++++++++++++++----------------- rpmio/macro.c | 34 +++++------ rpmio/rpmio.c | 44 ++++++++------- rpmio/rpmio_internal.h | 8 +-- rpmio/rpmpgp.c | 64 ++++++++++----------- rpmio/rpmrpc.c | 17 +++--- rpmqv.c | 20 +++---- system.h | 2 +- 35 files changed, 640 insertions(+), 526 deletions(-) diff --git a/.lclintrc b/.lclintrc index e9c7319..7c6b208 100644 --- a/.lclintrc +++ b/.lclintrc @@ -1,7 +1,7 @@ -I. -I./build -I./lib -I./rpmdb -I./rpmio -I./beecrypt -I./popt -I/usr/lib/gcc-lib/i386-redhat-linux/2.96/include -DHAVE_CONFIG_H -D_GNU_SOURCE -D_REENTRANT -DHAVE_DEV_DSP -DHAVE_SYS_SOUNDCARD #+partial -#+forcehints ++forcehints -warnunixlib -warnposix @@ -28,27 +28,23 @@ -globstate -ifblock # tedious -incondefs # tedium --internalglobs # 38 occurences --looploopcontinue # 86 occurences --loopswitchbreak # 286 occurences +-internalglobs # lots of global annotations needed -matchfields # heartburn -modfilesys # 153 occurences -modnomods # 927 occurences -modobserveruncon # 192 occurences -mods # 281 occurences, errno will be a pita --mustmod # heartburn --mutrep # heartburn --namechecks # tedious ANSI compliance wrto db3 --noeffectuncon # 228 occurences +-namechecks # tedious ANSI compliance checks +-noeffectuncon # 228 occurences, HGE_t needs special annotations -numenummembers 1024 # RPMTAG has 138 members -numstructfields 256 # Java jni.h has 229 fields -ptrarith # tedious --sizeoftype # tedium +-sizeoftype # ~240 occurences, tedium, more -strictops -strictusereleased -stringliterallen 4096 # redhat*PubKey's are big --usedef # 303 occurences, HGE_t needs special annotatitions --warnmissingglobs +-usedef # 303 occurences, HGE_t needs special annotations +-warnmissingglobs # lots of global annotations needed -whileblock # tedious # --- random anal-retentive parameters diff --git a/build.c b/build.c index 3dd44cf..a78a3aa 100644 --- a/build.c +++ b/build.c @@ -87,13 +87,13 @@ static int isSpecFile(const char * specfile) case '\r': case '\n': checking = 1; - break; + /*@switchbreak@*/ break; case ':': checking = 0; - break; + /*@switchbreak@*/ break; default: if (checking && !(isprint(*s) || isspace(*s))) return 0; - break; + /*@switchbreak@*/ break; } } return 1; diff --git a/build/expression.c b/build/expression.c index 9a2d69e..3b8ee4c 100644 --- a/build/expression.c +++ b/build/expression.c @@ -541,24 +541,24 @@ static Value doRelational(ParseState state) switch (op) { case TOK_EQ: r = (i1 == i2); - break; + /*@switchbreak@*/ break; case TOK_NEQ: r = (i1 != i2); - break; + /*@switchbreak@*/ break; case TOK_LT: r = (i1 < i2); - break; + /*@switchbreak@*/ break; case TOK_LE: r = (i1 <= i2); - break; + /*@switchbreak@*/ break; case TOK_GT: r = (i1 > i2); - break; + /*@switchbreak@*/ break; case TOK_GE: r = (i1 >= i2); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } valueFree(v1); v1 = valueMakeInteger(r); @@ -569,24 +569,24 @@ static Value doRelational(ParseState state) switch (op) { case TOK_EQ: r = (strcmp(s1,s2) == 0); - break; + /*@switchbreak@*/ break; case TOK_NEQ: r = (strcmp(s1,s2) != 0); - break; + /*@switchbreak@*/ break; case TOK_LT: r = (strcmp(s1,s2) < 0); - break; + /*@switchbreak@*/ break; case TOK_LE: r = (strcmp(s1,s2) <= 0); - break; + /*@switchbreak@*/ break; case TOK_GT: r = (strcmp(s1,s2) > 0); - break; + /*@switchbreak@*/ break; case TOK_GE: r = (strcmp(s1,s2) >= 0); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } valueFree(v1); v1 = valueMakeInteger(r); diff --git a/build/files.c b/build/files.c index 6f10598..1b1b363 100644 --- a/build/files.c +++ b/build/files.c @@ -362,7 +362,7 @@ static int parseForVerify(char * buf, FileList fl) { VFA_t *vfa; for (vfa = verifyAttrs; vfa->attribute != NULL; vfa++) { if (strcmp(p, vfa->attribute)) - continue; + /*@innercontinue@*/ continue; verifyFlags |= vfa->flag; /*@innerbreak@*/ break; } @@ -747,7 +747,7 @@ static int parseForLang(char * buf, FileList fl) if (fl->currentLangs != NULL) for (i = 0; i < fl->nLangs; i++) { if (strncmp(fl->currentLangs[i], p, np)) - continue; + /*@innercontinue@*/ continue; rpmError(RPMERR_BADSPEC, _("Duplicate locale %.*s in %%lang(%s)\n"), (int)np, p, q); fl->processingFailed = 1; @@ -911,7 +911,7 @@ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char * buf, { VFA_t *vfa; for (vfa = virtualFileAttributes; vfa->attribute != NULL; vfa++) { if (strcmp(s, vfa->attribute)) - continue; + /*@innercontinue@*/ continue; if (!vfa->flag) { if (!strcmp(s, "%dir")) fl->isDir = 1; /* XXX why not RPMFILE_DIR? */ @@ -1045,16 +1045,16 @@ static void checkHardLinks(FileList fl) for (j = i + 1; j < fl->fileListRecsUsed; j++) { jlp = fl->fileList + j; if (!S_ISREG(jlp->fl_mode)) - continue; + /*@innercontinue@*/ continue; if (ilp->fl_nlink != jlp->fl_nlink) - continue; + /*@innercontinue@*/ continue; if (ilp->fl_ino != jlp->fl_ino) - continue; + /*@innercontinue@*/ continue; if (ilp->fl_dev != jlp->fl_dev) - continue; + /*@innercontinue@*/ continue; if (!strcmp(ilp->langs, jlp->langs)) { jlp->flags |= RPMFILE_SPECFILE; - continue; + /*@innercontinue@*/ continue; } if (te == nlangs) te = stpcpy(te, ilp->langs); @@ -1071,13 +1071,13 @@ static void checkHardLinks(FileList fl) for (j = i + 1; j < fl->fileListRecsUsed; j++) { jlp = fl->fileList + j; if (!S_ISREG(jlp->fl_mode)) - continue; + /*@innercontinue@*/ continue; if (ilp->fl_nlink != jlp->fl_nlink) - continue; + /*@innercontinue@*/ continue; if (ilp->fl_ino != jlp->fl_ino) - continue; + /*@innercontinue@*/ continue; if (ilp->fl_dev != jlp->fl_dev) - continue; + /*@innercontinue@*/ continue; jlp->flags |= RPMFILE_SPECFILE; jlp->langs = _free(jlp->langs); jlp->langs = xstrdup(nlangs); @@ -1985,10 +1985,10 @@ void initSourceHeader(Spec spec) case HEADER_I18NTABLE: if (ptr) (void)headerAddEntry(spec->sourceHeader, tag, type, ptr, count); - break; + /*@switchbreak@*/ break; default: /* do not copy */ - break; + /*@switchbreak@*/ break; } } hi = headerFreeIterator(hi); @@ -2384,16 +2384,16 @@ static int generateDepends(Spec spec, Package pkg, TFI_t cpioList, int multiLib) continue; failnonzero = 1; tagflags = RPMSENSE_FIND_PROVIDES; - break; + /*@switchbreak@*/ break; case RPMTAG_REQUIREFLAGS: if (!pkg->autoReq) continue; failnonzero = 0; tagflags = RPMSENSE_FIND_REQUIRES; - break; + /*@switchbreak@*/ break; default: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } /* Get the script name to run */ @@ -2516,35 +2516,35 @@ static void printDeps(Header h) switch (dm->ntag) { case 0: names = hfd(names, dnt); - break; + /*@switchbreak@*/ break; case -1: - break; + /*@switchbreak@*/ break; default: names = hfd(names, dnt); if (!hge(h, dm->ntag, &dnt, (void **) &names, &count)) continue; - break; + /*@switchbreak@*/ break; } switch (dm->vtag) { case 0: versions = hfd(versions, dvt); - break; + /*@switchbreak@*/ break; case -1: - break; + /*@switchbreak@*/ break; default: versions = hfd(versions, dvt); (void) hge(h, dm->vtag, &dvt, (void **) &versions, NULL); - break; + /*@switchbreak@*/ break; } switch (dm->ftag) { case 0: flags = NULL; - break; + /*@switchbreak@*/ break; case -1: - break; + /*@switchbreak@*/ break; default: (void) hge(h, dm->ftag, NULL, (void **) &flags, NULL); - break; + /*@switchbreak@*/ break; } printDepMsg(dm, count, names, versions, flags); } diff --git a/build/pack.c b/build/pack.c index dfb936e..ad1c936 100644 --- a/build/pack.c +++ b/build/pack.c @@ -729,12 +729,12 @@ int packageBinaries(Spec spec) switch(errno) { case ENOENT: if (Mkdir(dn, 0755) == 0) - break; + /*@switchbreak@*/ break; /*@fallthrough@*/ default: rpmError(RPMERR_BADFILENAME,_("cannot create %s: %s\n"), dn, strerror(errno)); - break; + /*@switchbreak@*/ break; } } dn = _free(dn); diff --git a/build/parseReqs.c b/build/parseReqs.c index c60c5dc..848bc00 100644 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -112,9 +112,9 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, spec->lineNum, spec->line); return RPMERR_BADSPEC; } - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } re = r; @@ -136,7 +136,7 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, struct ReqComp *rc; for (rc = ReqComparisons; rc->token != NULL; rc++) { if ((ve-v) != strlen(rc->token) || strncmp(v, rc->token, (ve-v))) - continue; + /*@innercontinue@*/ continue; if (r[0] == '/') { rpmError(RPMERR_BADSPEC, @@ -153,9 +153,9 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, /* Add prereq on rpmlib that has versioned dependencies. */ if (!rpmExpandNumeric("%{_noVersionedDependencies}")) (void) rpmlibNeedsFeature(h, "VersionedDependencies", "3.0.3-1"); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } flags |= rc->sense; diff --git a/build/parseScript.c b/build/parseScript.c index d94f153..58b0d32 100644 --- a/build/parseScript.c +++ b/build/parseScript.c @@ -180,10 +180,10 @@ int parseScript(Spec spec, int parsePart) rc = RPMERR_BADSPEC; goto exit; } - break; + /*@switchbreak@*/ break; case 'n': flag = PART_NAME; - break; + /*@switchbreak@*/ break; } } diff --git a/build/parseSpec.c b/build/parseSpec.c index 84324ee..7ead34a 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -425,21 +425,21 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU case PART_PREAMBLE: parsePart = parsePreamble(spec, initialPackage); initialPackage = 0; - break; + /*@switchbreak@*/ break; case PART_PREP: parsePart = parsePrep(spec); - break; + /*@switchbreak@*/ break; case PART_BUILD: case PART_INSTALL: case PART_CLEAN: parsePart = parseBuildInstallClean(spec, parsePart); - break; + /*@switchbreak@*/ break; case PART_CHANGELOG: parsePart = parseChangelog(spec); - break; + /*@switchbreak@*/ break; case PART_DESCRIPTION: parsePart = parseDescription(spec); - break; + /*@switchbreak@*/ break; case PART_PRE: case PART_POST: @@ -450,16 +450,16 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU case PART_TRIGGERUN: case PART_TRIGGERPOSTUN: parsePart = parseScript(spec, parsePart); - break; + /*@switchbreak@*/ break; case PART_FILES: parsePart = parseFiles(spec); - break; + /*@switchbreak@*/ break; case PART_NONE: /* XXX avoid gcc whining */ case PART_LAST: case PART_BUILDARCHITECTURES: - break; + /*@switchbreak@*/ break; } if (parsePart >= PART_LAST) { @@ -480,7 +480,7 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU /* Skip if not arch is not compatible. */ if (!rpmMachineScore(RPM_MACHTABLE_BUILDARCH, spec->BANames[x])) - continue; + /*@innercontinue@*/ continue; #ifdef DYING rpmGetMachine(&saveArch, NULL); saveArch = xstrdup(saveArch); diff --git a/lib/depends.c b/lib/depends.c index 86922e4..ad6e384 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -462,7 +462,7 @@ static void alMakeIndex(availableList al) if (al->list[i].multiLib && !isDependsMULTILIB(al->list[i].provideFlags[j])) { ai->size--; - continue; + /*@innercontinue@*/ continue; } ai->index[k].package = al->list + i; @@ -1001,7 +1001,7 @@ alAllFileSatisfiesDepend(const availableList al, for (i = 0; i < dirMatch->numFiles; i++) { if (dirMatch->files[i].baseName == NULL || strcmp(dirMatch->files[i].baseName, baseName)) - continue; + /*@innercontinue@*/ continue; /* * If a file dependency would be satisfied by a file @@ -1009,7 +1009,7 @@ alAllFileSatisfiesDepend(const availableList al, */ if (al->list[dirMatch->files[i].pkgNum].multiLib && !isFileMULTILIB(dirMatch->files[i].fileFlags)) - continue; + /*@innercontinue@*/ continue; if (keyType) rpmMessage(RPMMESS_DEBUG, _("%s: %-45s YES (added files)\n"), @@ -1113,7 +1113,7 @@ alAllSatisfiesDepend(const availableList al, /* Filter out provides that came along for the ride. */ if (strcmp(p->provides[i], keyName)) - continue; + /*@innercontinue@*/ continue; proEVR = (p->providesEVR ? p->providesEVR[i] : NULL); proFlags = (p->provideFlags ? p->provideFlags[i] : 0); @@ -1125,7 +1125,7 @@ alAllSatisfiesDepend(const availableList al, if (keyType && keyDepend && rc) rpmMessage(RPMMESS_DEBUG, _("%s: %-45s YES (added provide)\n"), keyType, keyDepend+2); - break; + /*@switchbreak@*/ break; } if (rc) { @@ -1418,7 +1418,7 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, switch (rc) { case 0: /* requirements are satisfied. */ - break; + /*@switchbreak@*/ break; case 1: /* requirements are not satisfied. */ rpmMessage(RPMMESS_DEBUG, _("package %s-%s-%s require not satisfied: %s\n"), name, version, release, keyDepend+2); @@ -1454,11 +1454,11 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, } psp->num++; - break; + /*@switchbreak@*/ break; case 2: /* something went wrong! */ default: ourrc = 1; - break; + /*@switchbreak@*/ break; } keyDepend = _free(keyDepend); } @@ -1521,13 +1521,13 @@ static int checkPackageDeps(rpmTransactionSet ts, problemsSet psp, } psp->num++; - break; + /*@switchbreak@*/ break; case 1: /* conflicts don't exist. */ - break; + /*@switchbreak@*/ break; case 2: /* something went wrong! */ default: ourrc = 1; - break; + /*@switchbreak@*/ break; } keyDepend = _free(keyDepend); } @@ -1914,14 +1914,15 @@ int rpmdepOrder(rpmTransactionSet ts) /* First, do pre-requisites. */ for (j = 0; j < p->requiresCount; j++) { - if (p->requireFlags == NULL) continue; /* XXX can't happen */ + if (p->requireFlags == NULL) /* XXX can't happen */ + /*@innercontinue@*/ continue; /* Skip if not %pre/%post requires or legacy prereq. */ if (isErasePreReq(p->requireFlags[j]) || !( isInstallPreReq(p->requireFlags[j]) || isLegacyPreReq(p->requireFlags[j]) )) - continue; + /*@innercontinue@*/ continue; /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ (void) addRelation(ts, p, selected, j); @@ -1931,14 +1932,15 @@ int rpmdepOrder(rpmTransactionSet ts) /* Then do co-requisites. */ for (j = 0; j < p->requiresCount; j++) { - if (p->requireFlags == NULL) continue; /* XXX can't happen */ + if (p->requireFlags == NULL) /* XXX can't happen */ + /*@innercontinue@*/ continue; /* Skip if %pre/%post requires or legacy prereq. */ if (isErasePreReq(p->requireFlags[j]) || ( isInstallPreReq(p->requireFlags[j]) || isLegacyPreReq(p->requireFlags[j]) )) - continue; + /*@innercontinue@*/ continue; /* T3. Record next "q <- p" relation (i.e. "p" requires "q"). */ (void) addRelation(ts, p, selected, j); @@ -2226,7 +2228,7 @@ int rpmdepCheck(rpmTransactionSet ts, for (j = 0; j < p->providesCount; j++) { /* Adding: check provides key against conflicts matches. */ if (!checkDependentConflicts(ts, ps, p->provides[j])) - continue; + /*@innercontinue@*/ continue; rc = 1; /*@innerbreak@*/ break; } @@ -2265,7 +2267,7 @@ int rpmdepCheck(rpmTransactionSet ts, for (j = 0; j < providesCount; j++) { /* Erasing: check provides against requiredby matches. */ if (!checkDependentPackages(ts, ps, provides[j])) - continue; + /*@innercontinue@*/ continue; rc = 1; /*@innerbreak@*/ break; } @@ -2300,7 +2302,7 @@ int rpmdepCheck(rpmTransactionSet ts, (void) stpcpy( stpcpy(fileName, dirNames[dirIndexes[j]]) , baseNames[j]); /* Erasing: check filename against requiredby matches. */ if (!checkDependentPackages(ts, ps, fileName)) - continue; + /*@innercontinue@*/ continue; rc = 1; /*@innerbreak@*/ break; } diff --git a/lib/formats.c b/lib/formats.c index 44df032..9bb4772 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -333,7 +333,8 @@ static int triggercondsTag(Header h, /*@out@*/ rpmTagType * type, chptr = xstrdup(""); for (j = 0; j < numNames; j++) { - if (indices[j] != i) continue; + if (indices[j] != i) + /*@innercontinue@*/ continue; item = xmalloc(strlen(names[j]) + strlen(versions[j]) + 20); if (flags[j] & RPMSENSE_SENSEMASK) { @@ -397,7 +398,8 @@ static int triggertypeTag(Header h, /*@out@*/ rpmTagType * type, *type = RPM_STRING_ARRAY_TYPE; for (i = 0; i < numScripts; i++) { for (j = 0; j < numNames; j++) { - if (indices[j] != i) continue; + if (indices[j] != i) + /*@innercontinue@*/ continue; if (flags[j] & RPMSENSE_TRIGGERIN) conds[i] = xstrdup("in"); diff --git a/lib/fsm.c b/lib/fsm.c index b47a647..0a85f47 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -84,11 +84,13 @@ const char * fsmFsPath(/*@special@*/ /*@null@*/ const FSM_t fsm, * @param p file info iterator * @retval NULL always */ +/*@-mustmod@*/ /* LCL: *p is modified */ static /*@null@*/ void * mapFreeIterator(/*@only@*//*@null@*/const void * p) /*@modifies *p @*/ { return _free((void *)p); } +/*@=mustmod@*/ /** \ingroup payload * Create file info iterator. @@ -120,6 +122,7 @@ mapInitIterator(/*@kept@*/ const void * a, /*@kept@*/ const void * b) * @param a file info iterator * @return next index, -1 on termination */ +/*@-mustmod@*/ /* LCL: *a is modified */ static int mapNextIterator(void * a) /*@modifies *a @*/ { @@ -135,6 +138,7 @@ static int mapNextIterator(void * a) iter->isave = i; return i; } +/*@=mustmod@*/ /** \ingroup payload */ @@ -268,14 +272,18 @@ static /*@only@*/ void * dnlInitIterator(/*@special@*/ const FSM_t fsm, const char * dnl; int jlen; - if (!dnli->active[j] || j == dil) continue; + if (!dnli->active[j] || j == dil) + /*@innercontinue@*/ continue; dnl = fi->dnl[j]; jlen = strlen(dnl); - if (jlen != (dnlen+bnlen+1)) continue; - if (strncmp(dnl, fi->dnl[dil], dnlen)) continue; - if (strncmp(dnl+dnlen, fi->bnl[i], bnlen)) continue; + if (jlen != (dnlen+bnlen+1)) + /*@innercontinue@*/ continue; + if (strncmp(dnl, fi->dnl[dil], dnlen)) + /*@innercontinue@*/ continue; + if (strncmp(dnl+dnlen, fi->bnl[i], bnlen)) + /*@innercontinue@*/ continue; if (dnl[dnlen+bnlen] != '/' || dnl[dnlen+bnlen+1] != '\0') - continue; + /*@innercontinue@*/ continue; /* This directory is included in the package. */ dnli->active[j] = 0; /*@innerbreak@*/ break; @@ -1094,7 +1102,8 @@ static int fsmMkdirs(/*@special@*/ FSM_t fsm) /* Assume '/' directory exists, "mkdir -p" for others if non-existent */ for (i = 1, te = dn + 1; *te != '\0'; te++, i++) { - if (*te != '/') continue; + if (*te != '/') + /*@innercontinue@*/ continue; *te = '\0'; @@ -1107,7 +1116,7 @@ static int fsmMkdirs(/*@special@*/ FSM_t fsm) *te = '/'; /* Move pre-existing path marker forward. */ fsm->dnlx[dc] = (te - dn); - continue; + /*@innercontinue@*/ continue; } /*@=usedef =compdef =nullpass =nullderef@*/ @@ -1317,7 +1326,8 @@ int fsmStage(FSM_t fsm, fileStage stage) /* Re-calculate link count for archive header. */ for (j = -1, nlink = 0, i = 0; i < fsm->li->nlink; i++) { - if (fsm->li->filex[i] < 0) continue; + if (fsm->li->filex[i] < 0) + /*@innercontinue@*/ continue; nlink++; if (j == -1) j = i; } @@ -1751,7 +1761,8 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; fsm->commit && fsm->li->linksLeft) { for (i = 0 ; i < fsm->li->linksLeft; i++) { - if (fsm->li->filex[i] < 0) continue; + if (fsm->li->filex[i] < 0) + /*@innercontinue@*/ continue; rc = CPIOERR_MISSING_HARDLINK; if (fsm->failedFile && *fsm->failedFile == NULL) { fsm->ix = fsm->li->filex[i]; diff --git a/lib/header.c b/lib/header.c index 96c6f0e..f912e61 100644 --- a/lib/header.c +++ b/lib/header.c @@ -387,16 +387,16 @@ static int regionSwab(/*@null@*/ indexEntry entry, int il, int dl, for (; ie.info.count > 0; ie.info.count--, it += 1) *it = htonl(*it); t = (char *) it; - } break; + } /*@switchbreak@*/ break; case RPM_INT16_TYPE: { int_16 * it = (int_16 *) t; for (; ie.info.count > 0; ie.info.count--, it += 1) *it = htons(*it); t = (char *) it; - } break; + } /*@switchbreak@*/ break; default: t += ie.length; - break; + /*@switchbreak@*/ break; } dl += ie.length; @@ -487,7 +487,7 @@ static /*@only@*/ /*@null@*/ void * doHeaderUnload(Header h, /* Skip rest of entries in region, but account for dribbles. */ for (; i < h->indexUsed && entry->info.offset <= rid+1; i++, entry++) { if (entry->info.offset <= rid) - continue; + /*@innercontinue@*/ continue; /* Alignment */ type = entry->info.type; @@ -650,7 +650,7 @@ t = te; te += sizeof(int_32); src += sizeof(int_32); } - break; + /*@switchbreak@*/ break; case RPM_INT16_TYPE: count = entry->info.count; @@ -660,12 +660,12 @@ t = te; te += sizeof(int_16); src += sizeof(int_16); } - break; + /*@switchbreak@*/ break; default: memcpy(te, entry->data, entry->length); te += entry->length; - break; + /*@switchbreak@*/ break; } pe++; } @@ -1772,7 +1772,7 @@ freeFormat( /*@only@*/ /*@null@*/ sprintfToken format, int num) format[i].u.array.format = freeFormat(format[i].u.array.format, format[i].u.array.numTokens); - break; + /*@switchbreak@*/ break; case PTOK_COND: format[i].u.cond.ifFormat = freeFormat(format[i].u.cond.ifFormat, @@ -1780,12 +1780,12 @@ freeFormat( /*@only@*/ /*@null@*/ sprintfToken format, int num) format[i].u.cond.elseFormat = freeFormat(format[i].u.cond.elseFormat, format[i].u.cond.numElseTokens); - break; + /*@switchbreak@*/ break; case PTOK_NONE: case PTOK_TAG: case PTOK_STRING: default: - break; + /*@switchbreak@*/ break; } } format = _free(format); @@ -1898,7 +1898,7 @@ static int parseFormat(char * str, const headerTagTableEntry tags, *dst++ = *start++; - break; /* out of switch */ + /*@switchbreak@*/ break; } currToken++; @@ -1916,7 +1916,7 @@ static int parseFormat(char * str, const headerTagTableEntry tags, return 1; } start = newEnd; - break; /* out of switch */ + /*@switchbreak@*/ break; } /*@-assignexpose@*/ @@ -2015,7 +2015,7 @@ static int parseFormat(char * str, const headerTagTableEntry tags, start = next; - break; + /*@switchbreak@*/ break; case '[': *dst++ = '\0'; @@ -2042,7 +2042,7 @@ static int parseFormat(char * str, const headerTagTableEntry tags, format[currToken].type = PTOK_ARRAY; - break; + /*@switchbreak@*/ break; case ']': case '}': @@ -2063,7 +2063,7 @@ static int parseFormat(char * str, const headerTagTableEntry tags, *start++ = '\0'; if (endPtr) *endPtr = start; done = 1; - break; + /*@switchbreak@*/ break; default: if (currToken < 0 || format[currToken].type != PTOK_STRING) { @@ -2080,7 +2080,7 @@ static int parseFormat(char * str, const headerTagTableEntry tags, } else { *dst++ = *start++; } - break; + /*@switchbreak@*/ break; } if (done) break; diff --git a/lib/header_internal.c b/lib/header_internal.c index a96154c..9c30d13 100644 --- a/lib/header_internal.c +++ b/lib/header_internal.c @@ -45,17 +45,37 @@ void headerDump(Header h, FILE *f, int flags, " OFSET COUNT\n"); for (i = 0; i < h->indexUsed; i++) { switch (p->info.type) { - case RPM_NULL_TYPE: type = "NULL"; break; - case RPM_CHAR_TYPE: type = "CHAR"; break; - case RPM_BIN_TYPE: type = "BIN"; break; - case RPM_INT8_TYPE: type = "INT8"; break; - case RPM_INT16_TYPE: type = "INT16"; break; - case RPM_INT32_TYPE: type = "INT32"; break; + case RPM_NULL_TYPE: + type = "NULL"; + /*@switchbreak@*/ break; + case RPM_CHAR_TYPE: + type = "CHAR"; + /*@switchbreak@*/ break; + case RPM_BIN_TYPE: + type = "BIN"; + /*@switchbreak@*/ break; + case RPM_INT8_TYPE: + type = "INT8"; + /*@switchbreak@*/ break; + case RPM_INT16_TYPE: + type = "INT16"; + /*@switchbreak@*/ break; + case RPM_INT32_TYPE: + type = "INT32"; + /*@switchbreak@*/ break; /*case RPM_INT64_TYPE: type = "INT64"; break;*/ - case RPM_STRING_TYPE: type = "STRING"; break; - case RPM_STRING_ARRAY_TYPE: type = "STRING_ARRAY"; break; - case RPM_I18NSTRING_TYPE: type = "I18N_STRING"; break; - default: type = "(unknown)"; break; + case RPM_STRING_TYPE: + type = "STRING"; + /*@switchbreak@*/ break; + case RPM_STRING_ARRAY_TYPE: + type = "STRING_ARRAY"; + /*@switchbreak@*/ break; + case RPM_I18NSTRING_TYPE: + type = "I18N_STRING"; + /*@switchbreak@*/ break; + default: + type = "(unknown)"; + /*@switchbreak@*/ break; } tage = tags; @@ -84,7 +104,7 @@ void headerDump(Header h, FILE *f, int flags, (int) *((int_32 *) dp)); dp += sizeof(int_32); } - break; + /*@switchbreak@*/ break; case RPM_INT16_TYPE: while (c--) { @@ -93,7 +113,7 @@ void headerDump(Header h, FILE *f, int flags, (int) *((int_16 *) dp)); dp += sizeof(int_16); } - break; + /*@switchbreak@*/ break; case RPM_INT8_TYPE: while (c--) { fprintf(f, " Data: %.3d 0x%02x (%d)\n", ct++, @@ -101,7 +121,7 @@ void headerDump(Header h, FILE *f, int flags, (int) *((int_8 *) dp)); dp += sizeof(int_8); } - break; + /*@switchbreak@*/ break; case RPM_BIN_TYPE: while (c > 0) { fprintf(f, " Data: %.3d ", ct); @@ -115,7 +135,7 @@ void headerDump(Header h, FILE *f, int flags, } fprintf(f, "\n"); } - break; + /*@switchbreak@*/ break; case RPM_CHAR_TYPE: while (c--) { char ch = (char) *((char *) dp); @@ -125,7 +145,7 @@ void headerDump(Header h, FILE *f, int flags, (int) *((char *) dp)); dp += sizeof(char); } - break; + /*@switchbreak@*/ break; case RPM_STRING_TYPE: case RPM_STRING_ARRAY_TYPE: case RPM_I18NSTRING_TYPE: @@ -134,14 +154,13 @@ void headerDump(Header h, FILE *f, int flags, dp = strchr(dp, 0); dp++; } - break; + /*@switchbreak@*/ break; default: fprintf(stderr, _("Data type %d not supported\n"), (int) p->info.type); - break; + /*@switchbreak@*/ break; } } p++; } } - diff --git a/lib/misc.c b/lib/misc.c index 6206dbb..7af3878 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -174,9 +174,9 @@ static int rpmMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid) switch(errno) { default: return errno; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case ENOENT: - break; + /*@switchbreak@*/ break; } rc = mkdir(d, mode); if (rc) @@ -243,9 +243,9 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) case URL_IS_HTTP: case URL_IS_DASH: goto errxit; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } fd = Fopen(tempfn, "w+x.ufdio"); @@ -414,7 +414,7 @@ exit: static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, /*@out@*/ int * fileCountPtr, rpmTag baseNameTag, rpmTag dirNameTag, rpmTag dirIndexesTag) - /*@modifies h @*/ + /*@modifies *fileListPtr, *fileCountPtr @*/ { HGE_t hge = (HGE_t)headerGetEntryMinMemory; HFD_t hfd = headerFreeData; @@ -587,9 +587,9 @@ fprintf(stderr, "*** rpmGlob argv[%d] \"%s\"\n", argc, argv[argc]); case URL_IS_PATH: case URL_IS_DASH: strncpy(globRoot, av[j], nb); - break; + /*@switchbreak@*/ break; case URL_IS_UNKNOWN: - break; + /*@switchbreak@*/ break; } globRoot += nb; *globRoot = '\0'; diff --git a/lib/package.c b/lib/package.c index 683e73a..77778cb 100644 --- a/lib/package.c +++ b/lib/package.c @@ -32,17 +32,31 @@ void headerMergeLegacySigs(Header h, const Header sig) ptr = hfd(ptr, type)) { switch (tag) { - case RPMSIGTAG_SIZE: tag = RPMTAG_SIGSIZE; break; - case RPMSIGTAG_LEMD5_1: tag = RPMTAG_SIGLEMD5_1;break; - case RPMSIGTAG_PGP: tag = RPMTAG_SIGPGP; break; - case RPMSIGTAG_LEMD5_2: tag = RPMTAG_SIGLEMD5_2;break; - case RPMSIGTAG_MD5: tag = RPMTAG_SIGMD5; break; - case RPMSIGTAG_GPG: tag = RPMTAG_SIGGPG; break; - case RPMSIGTAG_PGP5: tag = RPMTAG_SIGPGP5; break; + case RPMSIGTAG_SIZE: + tag = RPMTAG_SIGSIZE; + /*@switchbreak@*/ break; + case RPMSIGTAG_LEMD5_1: + tag = RPMTAG_SIGLEMD5_1; + /*@switchbreak@*/ break; + case RPMSIGTAG_PGP: + tag = RPMTAG_SIGPGP; + /*@switchbreak@*/ break; + case RPMSIGTAG_LEMD5_2: + tag = RPMTAG_SIGLEMD5_2; + /*@switchbreak@*/ break; + case RPMSIGTAG_MD5: + tag = RPMTAG_SIGMD5; + /*@switchbreak@*/ break; + case RPMSIGTAG_GPG: + tag = RPMTAG_SIGGPG; + /*@switchbreak@*/ break; + case RPMSIGTAG_PGP5: + tag = RPMTAG_SIGPGP5; + /*@switchbreak@*/ break; default: if (!(tag >= HEADER_SIGBASE && tag < HEADER_TAGBASE)) continue; - break; + /*@switchbreak@*/ break; } if (ptr == NULL) continue; /* XXX can't happen */ if (!headerIsEntry(h, tag)) @@ -66,18 +80,32 @@ Header headerRegenSigHeader(const Header h) ptr = hfd(ptr, type)) { switch (tag) { - case RPMTAG_SIGSIZE: stag = RPMSIGTAG_SIZE; break; - case RPMTAG_SIGLEMD5_1: stag = RPMSIGTAG_LEMD5_1;break; - case RPMTAG_SIGPGP: stag = RPMSIGTAG_PGP; break; - case RPMTAG_SIGLEMD5_2: stag = RPMSIGTAG_LEMD5_2;break; - case RPMTAG_SIGMD5: stag = RPMSIGTAG_MD5; break; - case RPMTAG_SIGGPG: stag = RPMSIGTAG_GPG; break; - case RPMTAG_SIGPGP5: stag = RPMSIGTAG_PGP5; break; + case RPMTAG_SIGSIZE: + stag = RPMSIGTAG_SIZE; + /*@switchbreak@*/ break; + case RPMTAG_SIGLEMD5_1: + stag = RPMSIGTAG_LEMD5_1; + /*@switchbreak@*/ break; + case RPMTAG_SIGPGP: + stag = RPMSIGTAG_PGP; + /*@switchbreak@*/ break; + case RPMTAG_SIGLEMD5_2: + stag = RPMSIGTAG_LEMD5_2; + /*@switchbreak@*/ break; + case RPMTAG_SIGMD5: + stag = RPMSIGTAG_MD5; + /*@switchbreak@*/ break; + case RPMTAG_SIGGPG: + stag = RPMSIGTAG_GPG; + /*@switchbreak@*/ break; + case RPMTAG_SIGPGP5: + stag = RPMSIGTAG_PGP5; + /*@switchbreak@*/ break; default: if (!(tag >= HEADER_SIGBASE && tag < HEADER_TAGBASE)) continue; stag = tag; - break; + /*@switchbreak@*/ break; } if (ptr == NULL) continue; /* XXX can't happen */ if (!headerIsEntry(sig, stag)) diff --git a/lib/psm.c b/lib/psm.c index 1c99a5a..1356302 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -283,10 +283,10 @@ static int rpmInstallLoadMacros(TFI_t fi, Header h) case RPM_INT32_TYPE: sprintf(numbuf, "%d", *body.i32p); addMacro(NULL, tagm->macroname, NULL, numbuf, -1); - break; + /*@switchbreak@*/ break; case RPM_STRING_TYPE: addMacro(NULL, tagm->macroname, NULL, body.str, -1); - break; + /*@switchbreak@*/ break; case RPM_NULL_TYPE: case RPM_CHAR_TYPE: case RPM_INT8_TYPE: @@ -295,7 +295,7 @@ static int rpmInstallLoadMacros(TFI_t fi, Header h) case RPM_STRING_ARRAY_TYPE: case RPM_I18NSTRING_TYPE: default: - break; + /*@switchbreak@*/ break; } } return 0; @@ -370,7 +370,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) ((int_8 *) newdata)[k++] = ((int_8 *) data)[j]; (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); - break; + /*@switchbreak@*/ break; case RPM_INT16_TYPE: newdata = xcalloc(fc, sizeof(int_16)); for (j = 0, k = 0; j < count; j++) @@ -378,7 +378,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) ((int_16 *) newdata)[k++] = ((int_16 *) data)[j]; (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); - break; + /*@switchbreak@*/ break; case RPM_INT32_TYPE: newdata = xcalloc(fc, sizeof(int_32)); for (j = 0, k = 0; j < count; j++) @@ -386,7 +386,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) ((int_32 *) newdata)[k++] = ((int_32 *) data)[j]; (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); - break; + /*@switchbreak@*/ break; case RPM_STRING_ARRAY_TYPE: newdata = xcalloc(fc, sizeof(char *)); for (j = 0, k = 0; j < count; j++) @@ -394,12 +394,12 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) ((char **) newdata)[k++] = ((char **) data)[j]; (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); - break; + /*@switchbreak@*/ break; default: rpmError(RPMERR_DATATYPE, _("Data type %d not supported\n"), (int) type); return 1; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } data = hfd(data, type); } @@ -461,7 +461,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) } for (j = 0, k = 0; j < newCount; j++) { if (!newNames[j] || !isDependsMULTILIB(newFlags[j])) - continue; + /*@innercontinue@*/ continue; if (j != k) { newNames[k] = newNames[j]; newEVR[k] = newEVR[j]; diff --git a/lib/query.c b/lib/query.c index c5c42ae..7de754c 100644 --- a/lib/query.c +++ b/lib/query.c @@ -270,17 +270,21 @@ int showQueryPackage(QVA_t qva, /*@unused@*/rpmdb rpmdb, Header h) rpmfileState fstate = fileStatesList[i]; switch (fstate) { case RPMFILE_STATE_NORMAL: - te = stpcpy(te, _("normal ")); break; + te = stpcpy(te, _("normal ")); + /*@switchbreak@*/ break; case RPMFILE_STATE_REPLACED: - te = stpcpy(te, _("replaced ")); break; + te = stpcpy(te, _("replaced ")); + /*@switchbreak@*/ break; case RPMFILE_STATE_NOTINSTALLED: - te = stpcpy(te, _("not installed ")); break; + te = stpcpy(te, _("not installed ")); + /*@switchbreak@*/ break; case RPMFILE_STATE_NETSHARED: - te = stpcpy(te, _("net shared ")); break; + te = stpcpy(te, _("net shared ")); + /*@switchbreak@*/ break; default: sprintf(te, _("(unknown %3d) "), (int)fileStatesList[i]); te += strlen(te); - break; + /*@switchbreak@*/ break; } } else { te = stpcpy(te, _("(no state) ")); @@ -457,11 +461,11 @@ printNewSpecfile(Spec spec) (void) stpcpy( stpcpy( stpcpy(buf, tn), ": "), msgstr); sl->sl_lines[t->t_startx] = buf; } - break; + /*@switchbreak@*/ break; case RPMTAG_DESCRIPTION: for (j = 1; j < t->t_nlines; j++) { if (*sl->sl_lines[t->t_startx + j] == '%') - continue; + /*@innercontinue@*/ continue; /*@-unqualifiedtrans@*/ sl->sl_lines[t->t_startx + j] = _free(sl->sl_lines[t->t_startx + j]); @@ -474,7 +478,7 @@ printNewSpecfile(Spec spec) sl->sl_lines[t->t_startx + 1] = xstrdup(msgstr); if (t->t_nlines > 2) sl->sl_lines[t->t_startx + 2] = xstrdup("\n\n"); - break; + /*@switchbreak@*/ break; } } msgstr = _free(msgstr); @@ -506,7 +510,7 @@ void rpmDisplayQueryTags(FILE * fp) /* XXX don't print query tags twice. */ for (i = 0, t = rpmTagTable; i < rpmTagTableSize; i++, t++) { if (t->name == NULL) /* XXX programmer error. */ - continue; + /*@innercontinue@*/ continue; if (!strcmp(t->name, ext->name)) /*@innerbreak@*/ break; } diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 4ce4d89..972b871 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -149,13 +149,13 @@ int rpmReSign(rpmResignFlags flags, char * passPhrase, const char ** argv) case 1: rpmError(RPMERR_BADSIGTYPE, _("%s: Can't sign v1.0 RPM\n"), rpm); goto exit; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case 2: rpmError(RPMERR_BADSIGTYPE, _("%s: Can't re-sign v2.0 RPM\n"), rpm); goto exit; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } rc = rpmReadSignature(fd, &sig, l->signature_type); @@ -293,9 +293,9 @@ int rpmCheckSig(rpmCheckSigFlags flags, const char ** argv) rpmError(RPMERR_BADSIGTYPE, _("%s: No signature available (v1.0 RPM)\n"), pkgfn); res++; goto bottom; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } rc = rpmReadSignature(fd, &sig, l->signature_type); @@ -328,12 +328,13 @@ int rpmCheckSig(rpmCheckSigFlags flags, const char ** argv) headerNextIterator(hi, &tag, &type, &ptr, &count); ptr = headerFreeData(ptr, type)) { - if (ptr == NULL) continue; /* XXX can't happen */ + if (ptr == NULL) /* XXX can't happen */ + /*@innercontinue@*/ continue; switch (tag) { case RPMSIGTAG_PGP5: /* XXX legacy */ case RPMSIGTAG_PGP: if (!(flags & CHECKSIG_PGP)) - continue; + /*@innercontinue@*/ continue; if (rpmIsVerbose()) fprintf(stderr, "========================= Package RSA Signature\n"); (void) pgpPrtPkts(ptr, count, dig, rpmIsVerbose()); @@ -373,10 +374,10 @@ fprintf(stderr, "========================= Red Hat RSA Public Key\n"); hexstr = _free(hexstr); } - break; + /*@switchbreak@*/ break; case RPMSIGTAG_GPG: if (!(flags & CHECKSIG_GPG)) - continue; + /*@innercontinue@*/ continue; if (rpmIsVerbose()) fprintf(stderr, "========================= Package DSA Signature\n"); (void) pgpPrtPkts(ptr, count, dig, rpmIsVerbose()); @@ -393,18 +394,19 @@ fprintf(stderr, "========================= Red Hat DSA Public Key\n"); (void) pgpPrtPkts(gpgpk, gpgpklen, NULL, rpmIsVerbose()); } (void) pgpPrtPkts(gpgpk, gpgpklen, dig, 0); - break; + /*@switchbreak@*/ break; case RPMSIGTAG_LEMD5_2: case RPMSIGTAG_LEMD5_1: case RPMSIGTAG_MD5: if (!(flags & CHECKSIG_MD5)) - continue; - break; + /*@innercontinue@*/ continue; + /*@switchbreak@*/ break; default: - continue; - /*@notreached@*/ break; + /*@innercontinue@*/ continue; + /*@notreached@*/ /*@switchbreak@*/ break; } - if (ptr == NULL) continue; /* XXX can't happen */ + if (ptr == NULL) /* XXX can't happen */ + /*@innercontinue@*/ continue; if ((res3 = rpmVerifySignature(sigtarget, tag, ptr, count, dig, result))) { @@ -417,13 +419,13 @@ fprintf(stderr, "========================= Red Hat DSA Public Key\n"); case RPMSIGTAG_SIZE: strcat(buffer, "SIZE "); res2 = 1; - break; + /*@switchbreak@*/ break; case RPMSIGTAG_LEMD5_2: case RPMSIGTAG_LEMD5_1: case RPMSIGTAG_MD5: strcat(buffer, "MD5 "); res2 = 1; - break; + /*@switchbreak@*/ break; case RPMSIGTAG_PGP5: /* XXX legacy */ case RPMSIGTAG_PGP: switch (res3) { @@ -452,7 +454,7 @@ fprintf(stderr, "========================= Red Hat DSA Public Key\n"); res2 = 1; /*@innerbreak@*/ break; } - break; + /*@switchbreak@*/ break; case RPMSIGTAG_GPG: /* Do not consider this a failure */ switch (res3) { @@ -468,11 +470,11 @@ fprintf(stderr, "========================= Red Hat DSA Public Key\n"); res2 = 1; /*@innerbreak@*/ break; } - break; + /*@switchbreak@*/ break; default: strcat(buffer, "?UnknownSignatureType? "); res2 = 1; - break; + /*@switchbreak@*/ break; } } } else { @@ -482,22 +484,22 @@ fprintf(stderr, "========================= Red Hat DSA Public Key\n"); switch (tag) { case RPMSIGTAG_SIZE: strcat(buffer, "size "); - break; + /*@switchbreak@*/ break; case RPMSIGTAG_LEMD5_2: case RPMSIGTAG_LEMD5_1: case RPMSIGTAG_MD5: strcat(buffer, "md5 "); - break; + /*@switchbreak@*/ break; case RPMSIGTAG_PGP5: /* XXX legacy */ case RPMSIGTAG_PGP: strcat(buffer, "pgp "); - break; + /*@switchbreak@*/ break; case RPMSIGTAG_GPG: strcat(buffer, "gpg "); - break; + /*@switchbreak@*/ break; default: strcat(buffer, "??? "); - break; + /*@switchbreak@*/ break; } } } diff --git a/lib/rpminstall.c b/lib/rpminstall.c index aa52ea0..757a11b 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -275,18 +275,18 @@ restart: eiu->numFailed++; eiu->pkgURL[eiu->pkgx] = NULL; tfn = _free(tfn); - break; + /*@switchbreak@*/ break; } eiu->pkgState[eiu->pkgx] = 1; eiu->pkgURL[eiu->pkgx] = tfn; eiu->pkgx++; - } break; + } /*@switchbreak@*/ break; case URL_IS_PATH: default: eiu->pkgURL[eiu->pkgx] = fileURL; fileURL = NULL; eiu->pkgx++; - break; + /*@switchbreak@*/ break; } } fileURL = _free(fileURL); @@ -396,7 +396,7 @@ restart: count = rpmdbGetIteratorCount(mi); while ((oldH = rpmdbNextIterator(mi)) != NULL) { if (rpmVersionCompare(oldH, eiu->h) < 0) - continue; + /*@innercontinue@*/ continue; /* same or newer package already installed */ count = 0; /*@innerbreak@*/ break; @@ -421,20 +421,20 @@ restart: case 0: rpmMessage(RPMMESS_DEBUG, "\tadded binary package [%d]\n", eiu->numRPMS); - break; + /*@switchbreak@*/ break; case 1: rpmMessage(RPMMESS_ERROR, _("error reading from file %s\n"), *eiu->fnp); eiu->numFailed++; goto exit; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case 2: rpmMessage(RPMMESS_ERROR, _("file %s requires a newer version of RPM\n"), *eiu->fnp); eiu->numFailed++; goto exit; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } eiu->numRPMS++; diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 8e6c964..573a672 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -134,7 +134,7 @@ static int optionCompare(const void * a, const void * b) } static void rpmRebuildTargetVars(/*@null@*/ const char **target, /*@null@*/ const char ** canontarget) - /*@modifies *target, *canontarget @*/; + /*@modifies *canontarget @*/; static /*@observer@*/ /*@null@*/ machCacheEntry machCacheFindEntry(const machCache cache, const char * key) @@ -733,7 +733,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) fn = _free(fn); if (rc) return rc; continue; /* XXX don't save include value as var/macro */ - } /*@notreached@*/ break; + } /*@notreached@*/ /*@switchbreak@*/ break; case RPMVAR_MACROFILES: fn = rpmGetPath(se, NULL); if (fn == NULL || *fn == '\0') { @@ -743,7 +743,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) return 1; } se = (char *)fn; - break; + /*@switchbreak@*/ break; case RPMVAR_PROVIDES: { char *t; s = rpmGetVar(RPMVAR_PROVIDES); @@ -754,9 +754,9 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) while (*se != '\0') *t++ = *se++; *t++ = '\0'; se = (char *)fn; - } break; + } /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (option->archSpecific) { @@ -1553,7 +1553,8 @@ void rpmFreeRpmrc(void) for (j = 0; j < t->cache.size; j++) { machCacheEntry e; e = t->cache.cache + j; - if (e == NULL) continue; + if (e == NULL) + /*@innercontinue@*/ continue; e->name = _free(e->name); if (e->equivs) { for (k = 0; k < e->count; k++) diff --git a/lib/transaction.c b/lib/transaction.c index 7072730..2e4fde4 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -115,7 +115,7 @@ int rpmtransGetKeys(const rpmTransactionSet ts, const void *** ep, int * nep) struct availablePackage * alp; alp = ts->addedPackages.list + ts->order[oc].u.addedIndex; *e = alp->key; - break; + /*@switchbreak@*/ break; } /*@fallthrough@*/ default: @@ -123,7 +123,7 @@ int rpmtransGetKeys(const rpmTransactionSet ts, const void *** ep, int * nep) /*@-mods@*/ /* FIX: double indirection. */ *e = NULL; /*@=mods@*/ - break; + /*@switchbreak@*/ break; } } } @@ -451,7 +451,7 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, if (relocations[j - 1].oldPath == NULL || /* XXX can't happen */ relocations[j ].oldPath == NULL || /* XXX can't happen */ strcmp(relocations[j - 1].oldPath, relocations[j].oldPath) <= 0) - continue; + /*@innercontinue@*/ continue; /*@-usereleased@*/ /* LCL: ??? */ tmpReloc = relocations[j - 1]; relocations[j - 1] = relocations[j]; @@ -487,7 +487,7 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, for (j = 0; j < numRelocations; j++) { if (relocations[j].oldPath == NULL || /* XXX can't happen */ strcmp(validRelocations[i], relocations[j].oldPath)) - continue; + /*@innercontinue@*/ continue; /* On install, a relocate to NULL means skip the path. */ if (relocations[j].newPath) { actualRelocations[numActual] = relocations[j].newPath; @@ -564,22 +564,23 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, * relocation list be a good idea? */ for (j = numRelocations - 1; j >= 0; j--) { - if (relocations[j].oldPath == NULL) continue; /* XXX can't happen */ + if (relocations[j].oldPath == NULL) /* XXX can't happen */ + /*@innercontinue@*/ continue; len = strcmp(relocations[j].oldPath, "/") ? strlen(relocations[j].oldPath) : 0; if (fnlen < len) - continue; + /*@innercontinue@*/ continue; /* * Only subdirectories or complete file paths may be relocated. We * don't check for '\0' as our directory names all end in '/'. */ if (!(fn[len] == '/' || fnlen == len)) - continue; + /*@innercontinue@*/ continue; if (strncmp(relocations[j].oldPath, fn, len)) - continue; + /*@innercontinue@*/ continue; /*@innerbreak@*/ break; } if (j < 0) continue; @@ -594,9 +595,9 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, len = strlen(dirNames[j]) - 1; while (len > 0 && dirNames[j][len-1] == '/') len--; if (fnlen != len) - continue; + /*@innercontinue@*/ continue; if (strncmp(fn, dirNames[j], fnlen)) - continue; + /*@innercontinue@*/ continue; /*@innerbreak@*/ break; } if (j < dirCount) @@ -635,9 +636,9 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, /* Does this directory already exist in the directory list? */ for (j = 0; j < dirCount; j++) { if (fnlen != strlen(dirNames[j])) - continue; + /*@innercontinue@*/ continue; if (strncmp(fn, dirNames[j], fnlen)) - continue; + /*@innercontinue@*/ continue; /*@innerbreak@*/ break; } @@ -670,20 +671,21 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, for (i = dirCount - 1; i >= 0; i--) { for (j = numRelocations - 1; j >= 0; j--) { - if (relocations[j].oldPath == NULL) continue; /* XXX can't happen */ + if (relocations[j].oldPath == NULL) /* XXX can't happen */ + /*@innercontinue@*/ continue; len = strcmp(relocations[j].oldPath, "/") ? strlen(relocations[j].oldPath) : 0; if (len && strncmp(relocations[j].oldPath, dirNames[i], len)) - continue; + /*@innercontinue@*/ continue; /* * Only subdirectories or complete file paths may be relocated. We * don't check for '\0' as our directory names all end in '/'. */ if (dirNames[i][len] != '/') - continue; + /*@innercontinue@*/ continue; if (relocations[j].newPath) { /* Relocate the path */ const char * s = relocations[j].newPath; @@ -1135,7 +1137,7 @@ static void handleOverlappedFiles(TFI_t fi, hashTable ht, for (otherPkgNum = j - 1; otherPkgNum >= 0; otherPkgNum--) { /* Added packages need only look at other added packages. */ if (fi->type == TR_ADDED && recs[otherPkgNum]->type != TR_ADDED) - continue; + /*@innercontinue@*/ continue; /* TESTME: there are more efficient searches in the world... */ for (otherFileNum = 0; otherFileNum < recs[otherPkgNum]->fc; @@ -1163,7 +1165,7 @@ static void handleOverlappedFiles(TFI_t fi, hashTable ht, if (otherPkgNum < 0) { /* XXX is this test still necessary? */ if (fi->actions[i] != FA_UNKNOWN) - break; + /*@switchbreak@*/ break; if ((fi->fflags[i] & RPMFILE_CONFIG) && !lstat(filespec, &sb)) { /* Here is a non-overlapped pre-existing config file. */ @@ -1172,7 +1174,7 @@ static void handleOverlappedFiles(TFI_t fi, hashTable ht, } else { fi->actions[i] = FA_CREATE; } - break; + /*@switchbreak@*/ break; } /* Mark added overlapped non-identical files as a conflict. */ @@ -1196,36 +1198,36 @@ static void handleOverlappedFiles(TFI_t fi, hashTable ht, } else { fi->actions[i] = FA_CREATE; } - } break; + } /*@switchbreak@*/ break; case TR_REMOVED: if (otherPkgNum >= 0) { /* Here is an overlapped added file we don't want to nuke. */ if (recs[otherPkgNum]->actions[otherFileNum] != FA_ERASE) { /* On updates, don't remove files. */ fi->actions[i] = FA_SKIP; - break; + /*@switchbreak@*/ break; } /* Here is an overlapped removed file: skip in previous. */ recs[otherPkgNum]->actions[otherFileNum] = FA_SKIP; } if (XFA_SKIPPING(fi->actions[i])) - break; + /*@switchbreak@*/ break; if (fi->fstates && fi->fstates[i] != RPMFILE_STATE_NORMAL) - break; + /*@switchbreak@*/ break; if (!(S_ISREG(fi->fmodes[i]) && (fi->fflags[i] & RPMFILE_CONFIG))) { fi->actions[i] = FA_ERASE; - break; + /*@switchbreak@*/ break; } /* Here is a pre-existing modified config file that needs saving. */ { char mdsum[50]; if (!mdfile(filespec, mdsum) && strcmp(fi->fmd5s[i], mdsum)) { fi->actions[i] = FA_BACKUP; - break; + /*@switchbreak@*/ break; } } fi->actions[i] = FA_ERASE; - break; + /*@switchbreak@*/ break; } if (ds) { @@ -1237,7 +1239,7 @@ static void handleOverlappedFiles(TFI_t fi, hashTable ht, case FA_ALTNAME: ds->ineeded++; ds->bneeded += s; - break; + /*@switchbreak@*/ break; /* * FIXME: If two packages share a file (same md5sum), and @@ -1247,15 +1249,15 @@ static void handleOverlappedFiles(TFI_t fi, hashTable ht, case FA_CREATE: ds->bneeded += s; ds->bneeded -= BLOCK_ROUND(fi->replacedSizes[i], ds->bsize); - break; + /*@switchbreak@*/ break; case FA_ERASE: ds->ineeded--; ds->bneeded -= s; - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } ds->bneeded -= BLOCK_ROUND(fixupSize, ds->bsize); @@ -1351,16 +1353,22 @@ static void skipFiles(const rpmTransactionSet ts, TFI_t fi) len = strlen(*nsp); if (dnlen >= len) { - if (strncmp(dn, *nsp, len)) continue; + if (strncmp(dn, *nsp, len)) + /*@innercontinue@*/ continue; /* Only directories or complete file paths can be net shared */ - if (!(dn[len] == '/' || dn[len] == '\0')) continue; + if (!(dn[len] == '/' || dn[len] == '\0')) + /*@innercontinue@*/ continue; } else { - if (len < (dnlen + bnlen)) continue; - if (strncmp(dn, *nsp, dnlen)) continue; - if (strncmp(bn, (*nsp) + dnlen, bnlen)) continue; + if (len < (dnlen + bnlen)) + /*@innercontinue@*/ continue; + if (strncmp(dn, *nsp, dnlen)) + /*@innercontinue@*/ continue; + if (strncmp(bn, (*nsp) + dnlen, bnlen)) + /*@innercontinue@*/ continue; len = dnlen + bnlen; /* Only directories or complete file paths can be net shared */ - if (!((*nsp)[len] == '/' || (*nsp)[len] == '\0')) continue; + if (!((*nsp)[len] == '/' || (*nsp)[len] == '\0')) + /*@innercontinue@*/ continue; } /*@innerbreak@*/ break; @@ -1427,18 +1435,18 @@ static void skipFiles(const rpmTransactionSet ts, TFI_t fi) const char * dir; if (XFA_SKIPPING(fi->actions[i])) - continue; + /*@innercontinue@*/ continue; if (whatis(fi->fmodes[i]) != XDIR) - continue; + /*@innercontinue@*/ continue; dir = fi->dnl[fi->dil[i]]; if (strlen(dir) != dnlen) - continue; + /*@innercontinue@*/ continue; if (strncmp(dir, dn, dnlen)) - continue; + /*@innercontinue@*/ continue; if (strlen(fi->bnl[i]) != bnlen) - continue; + /*@innercontinue@*/ continue; if (strncmp(fi->bnl[i], bn, bnlen)) - continue; + /*@innercontinue@*/ continue; rpmMessage(RPMMESS_DEBUG, _("excluding directory %s\n"), dn); fi->actions[i] = FA_SKIPNSTATE; /*@innerbreak@*/ break; @@ -1758,7 +1766,7 @@ int rpmRunTransactions( rpmTransactionSet ts, /* Skip netshared paths, not our i18n files, and excluded docs */ skipFiles(ts, fi); - break; + /*@switchbreak@*/ break; case TR_REMOVED: fi->ap = NULL; fi->record = ts->order[oc].u.removed.dboffset; @@ -1776,7 +1784,7 @@ int rpmRunTransactions( rpmTransactionSet ts, } /* XXX header arg unused. */ loadFi(fi->h, fi); - break; + /*@switchbreak@*/ break; } if (fi->fc) @@ -1807,7 +1815,7 @@ int rpmRunTransactions( rpmTransactionSet ts, fpLookupList(fpc, fi->dnl, fi->bnl, fi->dil, fi->fc, fi->fps); for (i = 0; i < fi->fc; i++) { if (XFA_SKIPPING(fi->actions[i])) - continue; + /*@innercontinue@*/ continue; /*@-dependenttrans@*/ htAddEntry(ht, fi->fps + i, fi); /*@=dependenttrans@*/ @@ -1856,9 +1864,9 @@ int rpmRunTransactions( rpmTransactionSet ts, case TR_REMOVED: if (ts->order[k].u.removed.dboffset == ro) knownBad = ro; - break; + /*@switchbreak@*/ break; case TR_ADDED: - break; + /*@switchbreak@*/ break; } } @@ -1893,7 +1901,7 @@ int rpmRunTransactions( rpmTransactionSet ts, beingRemoved = 0; for (j = 0; j < ts->numRemovedPackages; j++) { if (ts->removedPackages[j] != shared->otherPkg) - continue; + /*@innercontinue@*/ continue; beingRemoved = 1; /*@innerbreak@*/ break; } @@ -1904,11 +1912,11 @@ int rpmRunTransactions( rpmTransactionSet ts, (void) handleInstInstalledFiles(fi, ts->rpmdb, shared, nexti - i, !(beingRemoved || (ts->ignoreSet & RPMPROB_FILTER_REPLACEOLDFILES)), ts->probs, ts->transFlags); - break; + /*@switchbreak@*/ break; case TR_REMOVED: if (!beingRemoved) (void) handleRmvdInstalledFiles(fi, ts->rpmdb, shared, nexti - i); - break; + /*@switchbreak@*/ break; } } @@ -1923,14 +1931,14 @@ int rpmRunTransactions( rpmTransactionSet ts, switch (fi->type) { case TR_ADDED: if (!(ts->di && fi->fc)) - break; + /*@switchbreak@*/ break; for (i = 0; i < ts->filesystemCount; i++) { dip = ts->di + i; /* XXX Avoid FAT and other file systems that have not inodes. */ if (dip->iavail <= 0) - continue; + /*@innercontinue@*/ continue; if (adj_fs_blocks(dip->bneeded) > dip->bavail) psAppend(ts->probs, RPMPROB_DISKSPACE, fi->ap, @@ -1942,9 +1950,9 @@ int rpmRunTransactions( rpmTransactionSet ts, ts->filesystems[i], NULL, NULL, (adj_fs_blocks(dip->ineeded) - dip->iavail)); } - break; + /*@switchbreak@*/ break; case TR_REMOVED: - break; + /*@switchbreak@*/ break; } } tsi = tsFreeIterator(tsi); @@ -2002,11 +2010,11 @@ int rpmRunTransactions( rpmTransactionSet ts, psm->fi = fi; switch (fi->type) { case TR_ADDED: - break; + /*@switchbreak@*/ break; case TR_REMOVED: if (ts->transFlags & RPMTRANS_FLAG_REPACKAGE) (void) psmStage(psm, PSM_PKGSAVE); - break; + /*@switchbreak@*/ break; } } tsi = tsFreeIterator(tsi); @@ -2024,8 +2032,7 @@ int rpmRunTransactions( rpmTransactionSet ts, gotfd = 0; psm->fi = fi; - switch (fi->type) - { + switch (fi->type) { case TR_ADDED: alp = tsGetAlp(tsi); assert(alp == fi->ap); @@ -2091,17 +2098,17 @@ assert(alp == fi->ap); alp->key, ts->notifyData); alp->fd = NULL; } - break; + /*@switchbreak@*/ break; case TR_REMOVED: oc = tsGetOc(tsi); /* If install failed, then we shouldn't erase. */ if (ts->order[oc].u.removed.dependsOnIndex == lastFailed) - break; + /*@switchbreak@*/ break; if (psmStage(psm, PSM_PKGERASE)) ourrc++; - break; + /*@switchbreak@*/ break; } (void) rpmdbSync(ts->rpmdb); } diff --git a/po/rpm.pot b/po/rpm.pot index d5f6c08..0a26732 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-10-13 15:29-0400\n" +"POT-Creation-Date: 2001-10-13 17:57-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1349,6 +1349,7 @@ msgstr "" msgid "Unusual locale length: \"%.*s\" in %%lang(%s)\n" msgstr "" +#. @innercontinue@ #: build/files.c:751 #, c-format msgid "Duplicate locale %.*s in %%lang(%s)\n" @@ -2128,6 +2129,8 @@ msgstr "" msgid "%s: (%s, %s) added to Depends cache.\n" msgstr "" +#. requirements are satisfied. +#. @switchbreak@ #. requirements are not satisfied. #: lib/depends.c:1423 #, c-format @@ -2151,20 +2154,20 @@ msgid "========== recording tsort relations\n" msgstr "" #. T4. Scan for zeroes. -#: lib/depends.c:1956 +#: lib/depends.c:1958 msgid "" "========== tsorting packages (order, #predecessors, #succesors, depth)\n" msgstr "" -#: lib/depends.c:2006 +#: lib/depends.c:2008 msgid "========== successors only (presentation order)\n" msgstr "" -#: lib/depends.c:2058 +#: lib/depends.c:2060 msgid "LOOP:\n" msgstr "" -#: lib/depends.c:2087 +#: lib/depends.c:2089 msgid "========== continuing tsort ...\n" msgstr "" @@ -2206,46 +2209,46 @@ msgstr "" msgid "file %s is on an unknown device\n" msgstr "" -#: lib/fsm.c:293 +#: lib/fsm.c:301 msgid "========= Directories not explictly included in package:\n" msgstr "" -#: lib/fsm.c:295 +#: lib/fsm.c:303 #, c-format msgid "%9d %s\n" msgstr "" -#: lib/fsm.c:1129 +#: lib/fsm.c:1138 #, c-format msgid "%s directory created with perms %04o.\n" msgstr "" -#: lib/fsm.c:1406 +#: lib/fsm.c:1416 #, c-format msgid "archive file %s was not found in header file list\n" msgstr "" -#: lib/fsm.c:1525 lib/fsm.c:1650 +#: lib/fsm.c:1535 lib/fsm.c:1660 #, c-format msgid "%s saved as %s\n" msgstr "" -#: lib/fsm.c:1676 +#: lib/fsm.c:1686 #, c-format msgid "%s rmdir of %s failed: Directory not empty\n" msgstr "" -#: lib/fsm.c:1682 +#: lib/fsm.c:1692 #, c-format msgid "%s rmdir of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1692 +#: lib/fsm.c:1702 #, c-format msgid "%s unlink of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1711 +#: lib/fsm.c:1721 #, c-format msgid "%s created as %s\n" msgstr "" @@ -2255,7 +2258,7 @@ msgstr "" msgid "dataLength() RPM_STRING_TYPE count must be 1.\n" msgstr "" -#: lib/header.c:296 lib/header_internal.c:139 lib/psm.c:399 +#: lib/header.c:296 lib/header_internal.c:159 lib/psm.c:399 #, c-format msgid "Data type %d not supported\n" msgstr "" @@ -2340,11 +2343,11 @@ msgstr "" msgid "error creating temporary file %s\n" msgstr "" -#: lib/package.c:131 +#: lib/package.c:159 msgid "packaging version 1 is not supported by this version of RPM\n" msgstr "" -#: lib/package.c:195 +#: lib/package.c:223 msgid "" "only packaging with major numbers <= 4 is supported by this version of RPM\n" msgstr "" @@ -2878,111 +2881,111 @@ msgstr "" msgid "normal " msgstr "" -#: lib/query.c:275 +#: lib/query.c:276 msgid "replaced " msgstr "" -#: lib/query.c:277 +#: lib/query.c:279 msgid "not installed " msgstr "" -#: lib/query.c:279 +#: lib/query.c:282 msgid "net shared " msgstr "" -#: lib/query.c:281 +#: lib/query.c:285 #, c-format msgid "(unknown %3d) " msgstr "" -#: lib/query.c:286 +#: lib/query.c:290 msgid "(no state) " msgstr "" -#: lib/query.c:305 lib/query.c:357 +#: lib/query.c:309 lib/query.c:361 msgid "package has neither file owner or id lists\n" msgstr "" -#: lib/query.c:444 +#: lib/query.c:448 #, c-format msgid "can't query %s: %s\n" msgstr "" -#: lib/query.c:580 lib/query.c:614 lib/rpminstall.c:309 lib/rpminstall.c:453 +#: lib/query.c:584 lib/query.c:618 lib/rpminstall.c:309 lib/rpminstall.c:453 #: lib/rpminstall.c:824 #, c-format msgid "open of %s failed: %s\n" msgstr "" -#: lib/query.c:593 +#: lib/query.c:597 #, c-format msgid "query of %s failed\n" msgstr "" -#: lib/query.c:599 +#: lib/query.c:603 msgid "old format source packages cannot be queried\n" msgstr "" -#: lib/query.c:624 lib/rpminstall.c:466 +#: lib/query.c:628 lib/rpminstall.c:466 #, c-format msgid "%s: read manifest failed: %s\n" msgstr "" -#: lib/query.c:666 +#: lib/query.c:670 #, c-format msgid "query of specfile %s failed, can't parse\n" msgstr "" -#: lib/query.c:688 +#: lib/query.c:692 msgid "no packages\n" msgstr "" -#: lib/query.c:707 +#: lib/query.c:711 #, c-format msgid "group %s does not contain any packages\n" msgstr "" -#: lib/query.c:717 +#: lib/query.c:721 #, c-format msgid "no package triggers %s\n" msgstr "" -#: lib/query.c:727 +#: lib/query.c:731 #, c-format msgid "no package requires %s\n" msgstr "" -#: lib/query.c:738 +#: lib/query.c:742 #, c-format msgid "no package provides %s\n" msgstr "" -#: lib/query.c:775 +#: lib/query.c:779 #, c-format msgid "file %s: %s\n" msgstr "" -#: lib/query.c:779 +#: lib/query.c:783 #, c-format msgid "file %s is not owned by any package\n" msgstr "" -#: lib/query.c:805 +#: lib/query.c:809 #, c-format msgid "invalid package number: %s\n" msgstr "" -#: lib/query.c:808 +#: lib/query.c:812 #, c-format msgid "package record number: %u\n" msgstr "" -#: lib/query.c:813 +#: lib/query.c:817 #, c-format msgid "record %u could not be read\n" msgstr "" -#: lib/query.c:824 lib/rpminstall.c:615 +#: lib/query.c:828 lib/rpminstall.c:615 #, c-format msgid "package %s is not installed\n" msgstr "" @@ -3046,27 +3049,27 @@ msgstr "" msgid "%s: No signature available (v1.0 RPM)\n" msgstr "" -#: lib/rpmchecksig.c:516 +#: lib/rpmchecksig.c:518 msgid "NOT OK" msgstr "" -#: lib/rpmchecksig.c:517 lib/rpmchecksig.c:531 +#: lib/rpmchecksig.c:519 lib/rpmchecksig.c:533 msgid " (MISSING KEYS:" msgstr "" -#: lib/rpmchecksig.c:519 lib/rpmchecksig.c:533 +#: lib/rpmchecksig.c:521 lib/rpmchecksig.c:535 msgid ") " msgstr "" -#: lib/rpmchecksig.c:520 lib/rpmchecksig.c:534 +#: lib/rpmchecksig.c:522 lib/rpmchecksig.c:536 msgid " (UNTRUSTED KEYS:" msgstr "" -#: lib/rpmchecksig.c:522 lib/rpmchecksig.c:536 +#: lib/rpmchecksig.c:524 lib/rpmchecksig.c:538 msgid ")" msgstr "" -#: lib/rpmchecksig.c:530 +#: lib/rpmchecksig.c:532 msgid "OK" msgstr "" @@ -3402,27 +3405,28 @@ msgstr "" msgid "excluding multilib path %s%s\n" msgstr "" -#: lib/transaction.c:607 +#: lib/transaction.c:608 #, c-format msgid "excluding %s %s\n" msgstr "" -#: lib/transaction.c:617 +#: lib/transaction.c:618 #, c-format msgid "relocating %s to %s\n" msgstr "" -#: lib/transaction.c:695 +#: lib/transaction.c:697 #, c-format msgid "relocating directory %s to %s\n" msgstr "" -#: lib/transaction.c:838 +#: lib/transaction.c:840 #, c-format msgid "%s skipped due to missingok flag\n" msgstr "" -#: lib/transaction.c:1442 +#. @innercontinue@ +#: lib/transaction.c:1450 #, c-format msgid "excluding directory %s\n" msgstr "" @@ -3633,109 +3637,109 @@ msgstr "" msgid "error(%d) counting packages\n" msgstr "" -#: rpmdb/rpmdb.c:1963 rpmdb/rpmdb.c:3145 +#: rpmdb/rpmdb.c:1989 rpmdb/rpmdb.c:3171 #, c-format msgid "record number %u in database is bad -- skipping.\n" msgstr "" -#: rpmdb/rpmdb.c:2014 +#: rpmdb/rpmdb.c:2040 #, c-format msgid "rpmdb: damaged header instance #%u retrieved, skipping.\n" msgstr "" -#: rpmdb/rpmdb.c:2279 +#: rpmdb/rpmdb.c:2305 #, c-format msgid "%s: cannot read header at 0x%x\n" msgstr "" -#: rpmdb/rpmdb.c:2348 +#: rpmdb/rpmdb.c:2374 #, c-format msgid "removing \"%s\" from %s index.\n" msgstr "" -#: rpmdb/rpmdb.c:2357 +#: rpmdb/rpmdb.c:2383 #, c-format msgid "removing %d entries from %s index.\n" msgstr "" -#: rpmdb/rpmdb.c:2552 +#: rpmdb/rpmdb.c:2578 #, c-format msgid "error(%d) allocating new package instance\n" msgstr "" -#: rpmdb/rpmdb.c:2630 +#: rpmdb/rpmdb.c:2656 #, c-format msgid "adding \"%s\" to %s index.\n" msgstr "" -#: rpmdb/rpmdb.c:2641 +#: rpmdb/rpmdb.c:2667 #, c-format msgid "adding %d entries to %s index.\n" msgstr "" -#: rpmdb/rpmdb.c:3034 +#: rpmdb/rpmdb.c:3060 #, c-format msgid "removing %s after successful db3 rebuild.\n" msgstr "" -#: rpmdb/rpmdb.c:3064 +#: rpmdb/rpmdb.c:3090 msgid "no dbpath has been set" msgstr "" -#: rpmdb/rpmdb.c:3091 +#: rpmdb/rpmdb.c:3117 #, c-format msgid "rebuilding database %s into %s\n" msgstr "" -#: rpmdb/rpmdb.c:3095 +#: rpmdb/rpmdb.c:3121 #, c-format msgid "temporary database %s already exists\n" msgstr "" -#: rpmdb/rpmdb.c:3101 +#: rpmdb/rpmdb.c:3127 #, c-format msgid "creating directory %s\n" msgstr "" -#: rpmdb/rpmdb.c:3103 +#: rpmdb/rpmdb.c:3129 #, c-format msgid "creating directory %s: %s\n" msgstr "" -#: rpmdb/rpmdb.c:3110 +#: rpmdb/rpmdb.c:3136 #, c-format msgid "opening old database with dbapi %d\n" msgstr "" -#: rpmdb/rpmdb.c:3121 +#: rpmdb/rpmdb.c:3147 #, c-format msgid "opening new database with dbapi %d\n" msgstr "" -#: rpmdb/rpmdb.c:3185 +#: rpmdb/rpmdb.c:3211 #, c-format msgid "cannot add record originally at %u\n" msgstr "" -#: rpmdb/rpmdb.c:3203 +#: rpmdb/rpmdb.c:3229 msgid "failed to rebuild database: original database remains in place\n" msgstr "" -#: rpmdb/rpmdb.c:3211 +#: rpmdb/rpmdb.c:3237 msgid "failed to replace old database with new database!\n" msgstr "" -#: rpmdb/rpmdb.c:3213 +#: rpmdb/rpmdb.c:3239 #, c-format msgid "replace files in %s with files from %s to recover" msgstr "" -#: rpmdb/rpmdb.c:3223 +#: rpmdb/rpmdb.c:3249 #, c-format msgid "removing directory %s\n" msgstr "" -#: rpmdb/rpmdb.c:3225 +#: rpmdb/rpmdb.c:3251 #, c-format msgid "failed to remove directory %s: %s\n" msgstr "" diff --git a/popt/po/popt.pot b/popt/po/popt.pot index 75e5f3c..349c304 100644 --- a/popt/po/popt.pot +++ b/popt/po/popt.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-10-13 13:15-0400\n" +"POT-Creation-Date: 2001-10-13 17:57-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,48 +18,48 @@ msgstr "" msgid "unknown errno" msgstr "" -#: popt.c:892 +#: popt.c:896 #, c-format msgid "option type (%d) not implemented in popt\n" msgstr "" -#: popt.c:1100 +#: popt.c:1105 msgid "missing argument" msgstr "" -#: popt.c:1102 +#: popt.c:1107 msgid "unknown option" msgstr "" -#: popt.c:1104 +#: popt.c:1109 msgid "mutually exclusive logical operations requested" msgstr "" -#: popt.c:1106 +#: popt.c:1111 msgid "opt->arg should not be NULL" msgstr "" -#: popt.c:1108 +#: popt.c:1113 msgid "aliases nested too deeply" msgstr "" -#: popt.c:1110 +#: popt.c:1115 msgid "error in parameter quoting" msgstr "" -#: popt.c:1112 +#: popt.c:1117 msgid "invalid numeric value" msgstr "" -#: popt.c:1114 +#: popt.c:1119 msgid "number too large or too small" msgstr "" -#: popt.c:1116 +#: popt.c:1121 msgid "memory allocation failed" msgstr "" -#: popt.c:1120 +#: popt.c:1125 msgid "unknown error" msgstr "" diff --git a/popt/popt.c b/popt/popt.c index c4fa4ee..e90b08f 100644 --- a/popt/popt.c +++ b/popt/popt.c @@ -505,9 +505,12 @@ static const char * findNextArg(/*@special@*/ poptContext con, if (os->next == os->argc && os == con->optionStack) break; if (os->argv != NULL) for (i = os->next; i < os->argc; i++) { - if (os->argb && PBM_ISSET(i, os->argb)) continue; - if (*os->argv[i] == '-') continue; - if (--argx > 0) continue; + if (os->argb && PBM_ISSET(i, os->argb)) + /*@innercontinue@*/ continue; + if (*os->argv[i] == '-') + /*@innercontinue@*/ continue; + if (--argx > 0) + /*@innercontinue@*/ continue; arg = os->argv[i]; if (delete_arg) { if (os->argb == NULL) os->argb = PBM_ALLOC(os->argc); @@ -540,14 +543,15 @@ expandNextArg(/*@special@*/ poptContext con, const char * s) #if 0 /* XXX can't do this */ case '\\': /* escape */ c = *s++; - break; + /*@switchbreak@*/ break; #endif case '!': if (!(s[0] == '#' && s[1] == ':' && s[2] == '+')) - break; + /*@switchbreak@*/ break; /* XXX Make sure that findNextArg deletes only next arg. */ if (a == NULL) { - if ((a = findNextArg(con, 1, 1)) == NULL) break; + if ((a = findNextArg(con, 1, 1)) == NULL) + /*@switchbreak@*/ break; } s += 3; @@ -558,9 +562,9 @@ expandNextArg(/*@special@*/ poptContext con, const char * s) te = t + strlen(t); strncpy(te, a, alen); te += alen; continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } *te++ = c; } @@ -834,7 +838,7 @@ int poptGetNextOpt(poptContext con) /* XXX memory leak, hard to plug */ *((const char **) opt->arg) = (con->os->nextArg) ? xstrdup(con->os->nextArg) : NULL; - break; + /*@switchbreak@*/ break; case POPT_ARG_INT: case POPT_ARG_LONG: @@ -858,7 +862,7 @@ int poptGetNextOpt(poptContext con) if (poptSaveInt(opt, aLong)) return POPT_ERROR_BADOPERATION; } - } break; + } /*@switchbreak@*/ break; case POPT_ARG_FLOAT: case POPT_ARG_DOUBLE: @@ -886,12 +890,13 @@ int poptGetNextOpt(poptContext con) return POPT_ERROR_OVERFLOW; *((float *) opt->arg) = aDouble; } - } break; + } /*@switchbreak@*/ break; default: fprintf(stdout, POPT_("option type (%d) not implemented in popt\n"), (opt->argInfo & POPT_ARG_MASK)); exit(EXIT_FAILURE); + /*@notreached@*/ /*@switchbreak@*/ break; } } } diff --git a/popt/poptconfig.c b/popt/poptconfig.c index 1801db6..bc902d4 100644 --- a/popt/poptconfig.c +++ b/popt/poptconfig.c @@ -126,7 +126,7 @@ int poptReadConfigFile(poptContext con, const char * fn) if (*dst && *dst != '#') configLine(con, dst); chptr++; - break; + /*@switchbreak@*/ break; case '\\': *dst++ = *chptr++; if (chptr < end) { @@ -136,10 +136,10 @@ int poptReadConfigFile(poptContext con, const char * fn) else *dst++ = *chptr++; } - break; + /*@switchbreak@*/ break; default: *dst++ = *chptr++; - break; + /*@switchbreak@*/ break; } } /*@=infloops@*/ diff --git a/popt/poptparse.c b/popt/poptparse.c index fdce572..f9faae3 100644 --- a/popt/poptparse.c +++ b/popt/poptparse.c @@ -90,7 +90,7 @@ int poptParseArgvString(const char * s, int * argcPtr, const char *** argvPtr) case '"': case '\'': quote = *src; - break; + /*@switchbreak@*/ break; case '\\': src++; if (!*src) { @@ -100,7 +100,7 @@ int poptParseArgvString(const char * s, int * argcPtr, const char *** argvPtr) /*@fallthrough@*/ default: *buf++ = *src; - break; + /*@switchbreak@*/ break; } } diff --git a/rpmdb/dbconfig.c b/rpmdb/dbconfig.c index 2da3c05..324ca04 100644 --- a/rpmdb/dbconfig.c +++ b/rpmdb/dbconfig.c @@ -383,7 +383,7 @@ dbiIndex db3New(rpmdb rpmdb, int rpmtag) /* Find key in option table. */ for (opt = rdbOptions; opt->longName != NULL; opt++) { if (strcmp(tok, opt->longName)) - continue; + /*@innercontinue@*/ continue; /*@innerbreak@*/ break; } if (opt->longName == NULL) { @@ -402,17 +402,17 @@ dbiIndex db3New(rpmdb rpmdb, int rpmtag) case POPT_ARG_NONE: (void) dbSaveInt(opt, argInfo, 1L); - break; + /*@switchbreak@*/ break; case POPT_ARG_VAL: (void) dbSaveInt(opt, argInfo, (long)opt->val); - break; + /*@switchbreak@*/ break; case POPT_ARG_STRING: { const char ** t = opt->arg; if (t) { *t = _free(*t); *t = xstrdup( (p ? p : "") ); } - } break; + } /*@switchbreak@*/ break; case POPT_ARG_INT: case POPT_ARG_LONG: @@ -438,7 +438,7 @@ dbiIndex db3New(rpmdb rpmdb, int rpmtag) continue; } (void) dbSaveLong(opt, argInfo, aLong); - break; + /*@switchbreak@*/ break; } else { if (aLong > INT_MAX || aLong < INT_MIN) { rpmError(RPMERR_DBCONFIG, @@ -448,9 +448,9 @@ dbiIndex db3New(rpmdb rpmdb, int rpmtag) } (void) dbSaveInt(opt, argInfo, aLong); } - } break; + } /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } } diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index 41b10f4..19b9bec 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -947,9 +947,9 @@ static int openDatabase(/*@null@*/ const char * prefix, case RPMDBI_REMOVED: case RPMDBI_DEPENDS: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } dbi = dbiOpen(db, rpmtag, 0); @@ -966,12 +966,12 @@ static int openDatabase(/*@null@*/ const char * prefix, if (db->db_api == 3) #endif goto exit; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case RPMTAG_NAME: if (dbi == NULL) rc |= 1; if (minimal) goto exit; - break; + /*@switchbreak@*/ break; case RPMTAG_BASENAMES: { void * keyp = NULL; DBC * dbcursor; @@ -984,7 +984,7 @@ static int openDatabase(/*@null@*/ const char * prefix, * XXX db1/db2 linkage) conditions. */ if (justCheck) - break; + /*@switchbreak@*/ break; dbcursor = NULL; xx = dbiCopen(dbi, &dbcursor, 0); xx = dbiGet(dbi, dbcursor, &keyp, NULL, NULL, NULL, gflags); @@ -998,9 +998,9 @@ static int openDatabase(/*@null@*/ const char * prefix, } xx = dbiCclose(dbi, dbcursor, 0); dbcursor = NULL; - } break; + } /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } } @@ -1366,8 +1366,12 @@ static int dbiFindByLabel(dbiIndex dbi, DBC * dbcursor, brackets = 0; for (s -= 1; s > localarg; s--) { switch (*s) { - case '[': brackets = 1; break; - case ']': if (c != '[') brackets = 0; break; + case '[': + brackets = 1; + /*@switchbreak@*/ break; + case ']': + if (c != '[') brackets = 0; + /*@switchbreak@*/ break; } c = *s; if (!brackets && *s == '-') @@ -1393,8 +1397,12 @@ static int dbiFindByLabel(dbiIndex dbi, DBC * dbcursor, brackets = 0; for (; s > localarg; s--) { switch (*s) { - case '[': brackets = 1; break; - case ']': if (c != '[') brackets = 0; break; + case '[': + brackets = 1; + /*@switchbreak@*/ break; + case ']': + if (c != '[') brackets = 0; + /*@switchbreak@*/ break; } c = *s; if (!brackets && *s == '-') @@ -1639,10 +1647,18 @@ static /*@only@*/ char * mireDup(rpmTag tag, rpmMireMode *modep, for (s = pattern; *s != '\0'; s++) { switch (*s) { case '.': - case '*': if (!brackets) nb++; break; - case '\\': s++; break; - case '[': brackets = 1; break; - case ']': if (c != '[') brackets = 0; break; + case '*': + if (!brackets) nb++; + /*@switchbreak@*/ break; + case '\\': + s++; + /*@switchbreak@*/ break; + case '[': + brackets = 1; + /*@switchbreak@*/ break; + case ']': + if (c != '[') brackets = 0; + /*@switchbreak@*/ break; } c = *s; } @@ -1656,11 +1672,21 @@ static /*@only@*/ char * mireDup(rpmTag tag, rpmMireMode *modep, brackets = 0; for (s = pattern; *s != '\0'; s++, t++) { switch (*s) { - case '.': if (!brackets) *t++ = '\\'; break; - case '*': if (!brackets) *t++ = '.'; break; - case '\\': *t++ = *s++; break; - case '[': brackets = 1; break; - case ']': if (c != '[') brackets = 0; break; + case '.': + if (!brackets) *t++ = '\\'; + /*@switchbreak@*/ break; + case '*': + if (!brackets) *t++ = '.'; + /*@switchbreak@*/ break; + case '\\': + *t++ = *s++; + /*@switchbreak@*/ break; + case '[': + brackets = 1; + /*@switchbreak@*/ break; + case ']': + if (c != '[') brackets = 0; + /*@switchbreak@*/ break; } c = *t = *s; } @@ -1828,24 +1854,24 @@ static int mireSkip (const rpmdbMatchIterator mi) rc = miregexec(mire, numbuf); if ((!rc && !mire->notmatch) || (rc && mire->notmatch)) anymatch++; - break; + /*@switchbreak@*/ break; case RPM_INT16_TYPE: sprintf(numbuf, "%d", (int) *u.i16p); rc = miregexec(mire, numbuf); if ((!rc && !mire->notmatch) || (rc && mire->notmatch)) anymatch++; - break; + /*@switchbreak@*/ break; case RPM_INT32_TYPE: sprintf(numbuf, "%d", (int) *u.i32p); rc = miregexec(mire, numbuf); if ((!rc && !mire->notmatch) || (rc && mire->notmatch)) anymatch++; - break; + /*@switchbreak@*/ break; case RPM_STRING_TYPE: rc = miregexec(mire, u.str); if ((!rc && !mire->notmatch) || (rc && mire->notmatch)) anymatch++; - break; + /*@switchbreak@*/ break; case RPM_I18NSTRING_TYPE: case RPM_STRING_ARRAY_TYPE: for (j = 0; j < c; j++) { @@ -1855,16 +1881,16 @@ static int mireSkip (const rpmdbMatchIterator mi) /*@innerbreak@*/ break; } } - break; + /*@switchbreak@*/ break; case RPM_NULL_TYPE: case RPM_BIN_TYPE: default: - break; + /*@switchbreak@*/ break; } if ((i+1) < mi->mi_nre && mire[0].tag == mire[1].tag) { i++; mire++; - continue; + /*@innercontinue@*/ continue; } /*@innerbreak@*/ break; } @@ -2321,7 +2347,7 @@ int rpmdbRemove(rpmdb rpmdb, /*@unused@*/ int rid, unsigned int hdrNum) case RPMDBI_REMOVED: case RPMDBI_DEPENDS: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case RPMDBI_PACKAGES: dbi = dbiOpen(rpmdb, rpmtag, 0); if (dbi != NULL) { @@ -2333,7 +2359,7 @@ int rpmdbRemove(rpmdb rpmdb, /*@unused@*/ int rid, unsigned int hdrNum) xx = dbiSync(dbi, 0); } continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } if (!hge(h, rpmtag, &rpmtype, (void **) &rpmvals, &rpmcnt)) @@ -2369,20 +2395,20 @@ int rpmdbRemove(rpmdb rpmdb, /*@unused@*/ int rid, unsigned int hdrNum) case RPM_INT8_TYPE: vallen = sizeof(RPM_CHAR_TYPE); valp = rpmvals + i; - break; + /*@switchbreak@*/ break; case RPM_INT16_TYPE: vallen = sizeof(int_16); valp = rpmvals + i; - break; + /*@switchbreak@*/ break; case RPM_INT32_TYPE: vallen = sizeof(int_32); valp = rpmvals + i; - break; + /*@switchbreak@*/ break; case RPM_BIN_TYPE: vallen = rpmcnt; valp = rpmvals; rpmcnt = 1; /* XXX break out of loop. */ - break; + /*@switchbreak@*/ break; case RPM_STRING_TYPE: case RPM_I18NSTRING_TYPE: rpmcnt = 1; /* XXX break out of loop. */ @@ -2391,7 +2417,7 @@ int rpmdbRemove(rpmdb rpmdb, /*@unused@*/ int rid, unsigned int hdrNum) default: vallen = strlen(rpmvals[i]); valp = rpmvals[i]; - break; + /*@switchbreak@*/ break; } /* @@ -2580,7 +2606,7 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) case RPMDBI_REMOVED: case RPMDBI_DEPENDS: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case RPMDBI_PACKAGES: dbi = dbiOpen(rpmdb, rpmtag, 0); if (dbi != NULL) { @@ -2596,20 +2622,20 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) } } continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; /* XXX preserve legacy behavior */ case RPMTAG_BASENAMES: rpmtype = bnt; rpmvals = baseNames; rpmcnt = count; - break; + /*@switchbreak@*/ break; case RPMTAG_REQUIRENAME: (void) hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); (void) hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **)&requireFlags, NULL); - break; + /*@switchbreak@*/ break; default: (void) hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); - break; + /*@switchbreak@*/ break; } if (rpmcnt <= 0) { @@ -2655,9 +2681,9 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) case RPMTAG_REQUIRENAME: /* Filter out install prerequisites. */ if (requireFlags && isInstallPreReq(requireFlags[i])) - continue; + /*@innercontinue@*/ continue; rec->tagNum = i; - break; + /*@switchbreak@*/ break; case RPMTAG_TRIGGERNAME: if (i) { /* don't add duplicates */ for (j = 0; j < i; j++) { @@ -2665,13 +2691,13 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) /*@innerbreak@*/ break; } if (j < i) - continue; + /*@innercontinue@*/ continue; } rec->tagNum = i; - break; + /*@switchbreak@*/ break; default: rec->tagNum = i; - break; + /*@switchbreak@*/ break; } /* Identify value pointer and length. */ @@ -2680,20 +2706,20 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) case RPM_INT8_TYPE: vallen = sizeof(int_8); valp = rpmvals + i; - break; + /*@switchbreak@*/ break; case RPM_INT16_TYPE: vallen = sizeof(int_16); valp = rpmvals + i; - break; + /*@switchbreak@*/ break; case RPM_INT32_TYPE: vallen = sizeof(int_32); valp = rpmvals + i; - break; + /*@switchbreak@*/ break; case RPM_BIN_TYPE: vallen = rpmcnt; valp = rpmvals; rpmcnt = 1; /* XXX break out of loop. */ - break; + /*@switchbreak@*/ break; case RPM_STRING_TYPE: case RPM_I18NSTRING_TYPE: rpmcnt = 1; /* XXX break out of loop. */ @@ -2702,7 +2728,7 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) default: valp = rpmvals[i]; vallen = strlen(rpmvals[i]); - break; + /*@switchbreak@*/ break; } rc += addIndexEntry(dbi, dbcursor, valp, vallen, rec); @@ -2955,9 +2981,9 @@ static int rpmdbMoveDatabase(const char * rootdir, case RPMDBI_REMOVED: case RPMDBI_DEPENDS: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } base = tagName(rpmtag); @@ -3001,9 +3027,9 @@ static int rpmdbMoveDatabase(const char * rootdir, case RPMDBI_REMOVED: case RPMDBI_DEPENDS: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } base = db1basename(rpmtag); diff --git a/rpmio/macro.c b/rpmio/macro.c index c29985a..1db21cc 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1093,13 +1093,13 @@ expandMacro(MacroBuf mb) switch(c) { case '%': if (*s != '%') - break; + /*@switchbreak@*/ break; s++; /* skip first % in %% */ /*@fallthrough@*/ default: SAVECHAR(mb, c); continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } /* Expand next macro */ @@ -1116,10 +1116,10 @@ expandMacro(MacroBuf mb) switch(*s++) { case '!': negate = ((negate + 1) % 2); - break; + /*@switchbreak@*/ break; case '?': chkexist++; - break; + /*@switchbreak@*/ break; } } f = se = s; @@ -1143,7 +1143,7 @@ expandMacro(MacroBuf mb) /* For "%name " macros ... */ if ((c = *fe) && isblank(c)) grab = '\n'; - break; + /*@switchbreak@*/ break; case '(': /* %(...) shell escape */ if ((se = matchchar(s, c, ')')) == NULL) { rpmError(RPMERR_BADSPEC, @@ -1160,7 +1160,7 @@ expandMacro(MacroBuf mb) s = se; continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case '{': /* %{...}/%{...:...} substitution */ if ((se = matchchar(s, c, '}')) == NULL) { rpmError(RPMERR_BADSPEC, @@ -1174,10 +1174,10 @@ expandMacro(MacroBuf mb) switch(*f++) { case '!': negate = ((negate + 1) % 2); - break; + /*@switchbreak@*/ break; case '?': chkexist++; - break; + /*@switchbreak@*/ break; } } for (fe = f; (c = *fe) && !strchr(" :}", c);) @@ -1193,7 +1193,7 @@ expandMacro(MacroBuf mb) default: /*@innerbreak@*/ break; } - break; + /*@switchbreak@*/ break; } /* XXX Everything below expects fe > f */ @@ -1544,7 +1544,7 @@ rpmInitMacros(MacroContext mc, const char *macrofiles) SKIPBLANK(n, c); if (c != '%') - continue; + /*@innercontinue@*/ continue; n++; /* skip % */ (void)rpmDefineMacro(NULL, n, RMIL_MACROFILES); } @@ -1703,10 +1703,10 @@ char *rpmCleanPath(char * path) if (s[1] == '/' && s[2] == '/') { *t++ = *s++; *t++ = *s++; - break; + /*@switchbreak@*/ break; } begin=1; - break; + /*@switchbreak@*/ break; case '/': /* Move parent dir forward */ for (se = te + 1; se < t && *se != '/'; se++) @@ -1719,17 +1719,17 @@ char *rpmCleanPath(char * path) s++; while (t > path && t[-1] == '/') t--; - break; + /*@switchbreak@*/ break; case '.': /* Leading .. is special */ if (begin && s[1] == '.') { /*fprintf(stderr, " leading \"..\"\n"); */ *t++ = *s++; - break; + /*@switchbreak@*/ break; } /* Single . is special */ if (begin && s[1] == '\0') { - break; + /*@switchbreak@*/ break; } /* Trim embedded ./ , trailing /. */ if ((t[-1] == '/' && s[1] == '\0') || (t != path && s[1] == '/')) { @@ -1748,10 +1748,10 @@ char *rpmCleanPath(char * path) s++; continue; } - break; + /*@switchbreak@*/ break; default: begin = 0; - break; + /*@switchbreak@*/ break; } *t++ = *s++; } diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index b52b1de..23fec6c 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -467,10 +467,10 @@ fprintf(stderr, "*** fdWritable fdno %d rc %d %s\n", fdno, rc, strerror(errno)); switch (errno) { case EINTR: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: return rc; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } } return rc; @@ -505,10 +505,10 @@ int fdReadable(FD_t fd, int secs) switch (errno) { case EINTR: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: return rc; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; } } return rc; @@ -537,13 +537,13 @@ int fdFgets(FD_t fd, char * buf, size_t len) case -1: /* error */ ec = -1; continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case 0: /* timeout */ ec = -1; continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: /* data to read */ - break; + /*@switchbreak@*/ break; } errno = 0; @@ -557,9 +557,9 @@ int fdFgets(FD_t fd, char * buf, size_t len) switch (errno) { case EWOULDBLOCK: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (_rpmio_debug) fprintf(stderr, "*** read: fd %p rc %d errno %d %s \"%s\"\n", fd, rc, errno, strerror(errno), buf); @@ -814,7 +814,7 @@ fprintf(stderr, "<- %s\n", s); strncpy(errorCode, e, 3); errorCode[3] = '\0'; } - continue; + /*@innercontinue@*/ continue; } /* HTTP: look for "token: ..." */ @@ -860,7 +860,7 @@ fprintf(stderr, "<- %s\n", s); if (!strncmp(s, "Allow:", ne)) { } #endif - continue; + /*@innercontinue@*/ continue; } /* HTTP: look for "501 ... " */ @@ -1564,9 +1564,9 @@ static ssize_t ufdRead(void * cookie, /*@out@*/ char * buf, size_t count) case -1: /* error */ case 0: /* timeout */ return total; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: /* data to read */ - break; + /*@switchbreak@*/ break; } rc = fdRead(fd, buf + total, count - total); @@ -1575,9 +1575,9 @@ static ssize_t ufdRead(void * cookie, /*@out@*/ char * buf, size_t count) switch (errno) { case EWOULDBLOCK: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (_rpmio_debug) fprintf(stderr, "*** read: rc %d errno %d %s \"%s\"\n", rc, errno, strerror(errno), buf); @@ -1628,9 +1628,9 @@ fprintf(stderr, "*** ufdWrite fd %p WRITE PAST END OF CONTENT\n", fd); case -1: /* error */ case 0: /* timeout */ return total; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: /* data to write */ - break; + /*@switchbreak@*/ break; } rc = fdWrite(fd, buf + total, count - total); @@ -1639,9 +1639,9 @@ fprintf(stderr, "*** ufdWrite fd %p WRITE PAST END OF CONTENT\n", fd); switch (errno) { case EWOULDBLOCK: continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (_rpmio_debug) fprintf(stderr, "*** write: rc %d errno %d %s \"%s\"\n", rc, errno, strerror(errno), buf); @@ -2577,22 +2577,26 @@ static inline void cvtfmode (const char *m, while ((c = *m++) != '\0') { switch (c) { case '.': - break; + /*@switchbreak@*/ break; case '+': flags &= ~(O_RDONLY|O_WRONLY); flags |= O_RDWR; if (--nstdio > 0) *stdio++ = c; continue; + /*@notreached@*/ /*@switchbreak@*/ break; case 'b': if (--nstdio > 0) *stdio++ = c; continue; + /*@notreached@*/ /*@switchbreak@*/ break; case 'x': flags |= O_EXCL; if (--nstdio > 0) *stdio++ = c; continue; + /*@notreached@*/ /*@switchbreak@*/ break; default: if (--nother > 0) *other++ = c; continue; + /*@notreached@*/ /*@switchbreak@*/ break; } break; } diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h index 2483bcc..ff5be71 100644 --- a/rpmio/rpmio_internal.h +++ b/rpmio/rpmio_internal.h @@ -367,17 +367,17 @@ void fdstat_print(/*@null@*/ FD_t fd, const char * msg, FILE * fp) fprintf(fp, "%8d reads, %8ld total bytes in %d.%03d secs\n", ops->count, (long)ops->bytes, (int)(ops->msecs/1000), (int)(ops->msecs%1000)); - break; + /*@switchbreak@*/ break; case FDSTAT_WRITE: if (msg) fprintf(fp, "%s:", msg); fprintf(fp, "%8d writes, %8ld total bytes in %d.%03d secs\n", ops->count, (long)ops->bytes, (int)(ops->msecs/1000), (int)(ops->msecs%1000)); - break; + /*@switchbreak@*/ break; case FDSTAT_SEEK: - break; + /*@switchbreak@*/ break; case FDSTAT_CLOSE: - break; + /*@switchbreak@*/ break; } } } diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c index be36fe8..06e5bc2 100644 --- a/rpmio/rpmpgp.c +++ b/rpmio/rpmpgp.c @@ -339,9 +339,9 @@ int pgpPrtPktSigV3(pgpPkt pkt, const byte *h, unsigned int hlen) mp32nsethex(&_dig->c, pgpMpiHex(p)); if (_debug && _print) printf("\t m**d = "), mp32println(_dig->c.size, _dig->c.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpSigRSA[i]); @@ -353,12 +353,12 @@ printf("\t m**d = "), mp32println(_dig->c.size, _dig->c.data); switch (i) { case 0: /* r */ pgpHexSet(pgpSigDSA[i], 160, &_dig->r, p); - break; + /*@switchbreak@*/ break; case 1: /* s */ pgpHexSet(pgpSigDSA[i], 160, &_dig->s, p); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpSigDSA[i]); @@ -390,22 +390,22 @@ int pgpPrtSubType(const byte *h, unsigned int hlen) for (i = 1; i < plen; i++) pgpPrtVal(" ", pgpSymkeyTbl, p[i]); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_PREFER_HASH: /* preferred hash algorithms */ for (i = 1; i < plen; i++) pgpPrtVal(" ", pgpHashTbl, p[i]); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_PREFER_COMPRESS:/* preferred compression algorithms */ for (i = 1; i < plen; i++) pgpPrtVal(" ", pgpCompressionTbl, p[i]); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_KEYSERVER_PREFERS:/* key server preferences */ for (i = 1; i < plen; i++) pgpPrtVal(" ", pgpKeyServerPrefsTbl, p[i]); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_SIG_CREATE_TIME: case PGPSUBTYPE_SIG_EXPIRE_TIME: case PGPSUBTYPE_KEY_EXPIRE_TIME: @@ -416,7 +416,7 @@ int pgpPrtSubType(const byte *h, unsigned int hlen) } else pgpPrtHex("", p+1, plen-1); pgpPrtNL(); - break; + /*@switchbreak@*/ break; case PGPSUBTYPE_ISSUER_KEYID: /* issuer key ID */ case PGPSUBTYPE_EXPORTABLE_CERT: @@ -446,7 +446,7 @@ int pgpPrtSubType(const byte *h, unsigned int hlen) default: pgpPrtHex("", p+1, plen-1); pgpPrtNL(); - break; + /*@switchbreak@*/ break; } p += plen; hlen -= plen; @@ -513,9 +513,9 @@ fprintf(stderr, " unhash[%u] -- %s\n", plen, pgpHexStr(p, plen)); mp32nsethex(&_dig->c, pgpMpiHex(p)); if (_debug && _print) printf("\t m**d = "), mp32println(_dig->c.size, _dig->c.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpSigRSA[i]); @@ -527,12 +527,12 @@ printf("\t m**d = "), mp32println(_dig->c.size, _dig->c.data); switch (i) { case 0: /* r */ pgpHexSet(pgpSigDSA[i], 160, &_dig->r, p); - break; + /*@switchbreak@*/ break; case 1: /* s */ pgpHexSet(pgpSigDSA[i], 160, &_dig->s, p); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpSigDSA[i]); @@ -636,14 +636,14 @@ int pgpPrtKeyV3(pgpPkt pkt, const byte *h, unsigned int hlen) mp32bsethex(&_dig->rsa_pk.n, pgpMpiHex(p)); if (_debug && _print) printf("\t n = "), mp32println(_dig->rsa_pk.n.size, _dig->rsa_pk.n.modl); - break; + /*@switchbreak@*/ break; case 1: /* e */ mp32nsethex(&_dig->rsa_pk.e, pgpMpiHex(p)); if (_debug && _print) printf("\t e = "), mp32println(_dig->rsa_pk.e.size, _dig->rsa_pk.e.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpPublicRSA[i]); @@ -655,24 +655,24 @@ printf("\t e = "), mp32println(_dig->rsa_pk.e.size, _dig->rsa_pk.e.data); mp32bsethex(&_dig->p, pgpMpiHex(p)); if (_debug && _print) printf("\t p = "), mp32println(_dig->p.size, _dig->p.modl); - break; + /*@switchbreak@*/ break; case 1: /* q */ mp32bsethex(&_dig->q, pgpMpiHex(p)); if (_debug && _print) printf("\t q = "), mp32println(_dig->q.size, _dig->q.modl); - break; + /*@switchbreak@*/ break; case 2: /* g */ mp32nsethex(&_dig->g, pgpMpiHex(p)); if (_debug && _print) printf("\t g = "), mp32println(_dig->g.size, _dig->g.data); - break; + /*@switchbreak@*/ break; case 3: /* y */ mp32nsethex(&_dig->y, pgpMpiHex(p)); if (_debug && _print) printf("\t y = "), mp32println(_dig->y.size, _dig->y.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpPublicDSA[i]); @@ -718,14 +718,14 @@ int pgpPrtKeyV4(pgpPkt pkt, const byte *h, unsigned int hlen) mp32bsethex(&_dig->rsa_pk.n, pgpMpiHex(p)); if (_debug && _print) printf("\t n = "), mp32println(_dig->rsa_pk.n.size, _dig->rsa_pk.n.modl); - break; + /*@switchbreak@*/ break; case 1: /* e */ mp32nsethex(&_dig->rsa_pk.e, pgpMpiHex(p)); if (_debug && _print) printf("\t e = "), mp32println(_dig->rsa_pk.e.size, _dig->rsa_pk.e.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpPublicRSA[i]); @@ -737,24 +737,24 @@ printf("\t e = "), mp32println(_dig->rsa_pk.e.size, _dig->rsa_pk.e.data); mp32bsethex(&_dig->p, pgpMpiHex(p)); if (_debug && _print) printf("\t p = "), mp32println(_dig->p.size, _dig->p.modl); - break; + /*@switchbreak@*/ break; case 1: /* q */ mp32bsethex(&_dig->q, pgpMpiHex(p)); if (_debug && _print) printf("\t q = "), mp32println(_dig->q.size, _dig->q.modl); - break; + /*@switchbreak@*/ break; case 2: /* g */ mp32nsethex(&_dig->g, pgpMpiHex(p)); if (_debug && _print) printf("\t g = "), mp32println(_dig->g.size, _dig->g.data); - break; + /*@switchbreak@*/ break; case 3: /* y */ mp32nsethex(&_dig->y, pgpMpiHex(p)); if (_debug && _print) printf("\t y = "), mp32println(_dig->y.size, _dig->y.data); - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } pgpPrtStr("", pgpPublicDSA[i]); diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c index c947697..b52d172 100644 --- a/rpmio/rpmrpc.c +++ b/rpmio/rpmrpc.c @@ -890,35 +890,38 @@ static int ftpNLST(const char * url, ftpSysCall_t ftpSysCall, /*@innerbreak@*/ break; *se++ = '\0'; - if (!strncmp(s, "total ", sizeof("total ")-1)) continue; + if (!strncmp(s, "total ", sizeof("total ")-1)) + /*@innercontinue@*/ continue; o = NULL; for (bingo = 0, n = se; n >= s; n--) { switch (*n) { case '\0': oe = ne = n; - break; + /*@switchbreak@*/ break; case ' ': if (o || !(n[-3] == ' ' && n[-2] == '-' && n[-1] == '>')) { while (*(++n) == ' ') {}; bingo++; - break; + /*@switchbreak@*/ break; } for (o = n + 1; *o == ' '; o++) {}; n -= 3; ne = n; - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } if (bingo) /*@innerbreak@*/ break; } - if (nbn != (ne - n)) continue; /* Same name length? */ - if (strncmp(n, bn, nbn)) continue; /* Same name? */ + if (nbn != (ne - n)) /* Same name length? */ + /*@innercontinue@*/ continue; + if (strncmp(n, bn, nbn)) /* Same name? */ + /*@innercontinue@*/ continue; moretodo = 0; /*@innerbreak@*/ break; diff --git a/rpmqv.c b/rpmqv.c index 1e21c96..bb7db9d 100755 --- a/rpmqv.c +++ b/rpmqv.c @@ -383,9 +383,9 @@ int main(int argc, const char ** argv) switch(arg) { case 'v': rpmIncreaseVerbosity(); /* XXX silly use by showrc */ - break; + /*@switchbreak@*/ break; default: - break; + /*@switchbreak@*/ break; } } @@ -444,7 +444,7 @@ int main(int argc, const char ** argv) case 'v': rpmIncreaseVerbosity(); - break; + /*@switchbreak@*/ break; /* XXX options used in multiple rpm modes */ #if defined(IAM_RPMQV) || defined(IAM_RPMK) @@ -460,7 +460,7 @@ int main(int argc, const char ** argv) else #endif /*@-ifempty@*/ ; - break; + /*@switchbreak@*/ break; #endif /* IAM_RPMQV || IAM_RPMK */ #if defined(IAM_RPMQV) || defined(IAM_RPMEIU) || defined(IAM_RPMBT) @@ -483,7 +483,7 @@ int main(int argc, const char ** argv) else #endif /*@-ifempty@*/ ; - break; + /*@switchbreak@*/ break; case POPT_FORCE: #ifdef IAM_RPMEIU @@ -503,7 +503,7 @@ int main(int argc, const char ** argv) else #endif /*@-ifempty@*/ ; - break; + /*@switchbreak@*/ break; case 'i': #ifdef IAM_RPMQV @@ -527,7 +527,7 @@ int main(int argc, const char ** argv) } else #endif /*@-ifempty@*/ ; - break; + /*@switchbreak@*/ break; case POPT_NOSCRIPTS: #ifdef IAM_RPMQV @@ -543,7 +543,7 @@ int main(int argc, const char ** argv) else #endif /*@-ifempty@*/ ; - break; + /*@switchbreak@*/ break; #endif /* IAM_RPMQV || IAM_RPMEIU || IAM_RPMBT */ @@ -553,7 +553,7 @@ int main(int argc, const char ** argv) (void) rpmDefineMacro(&rpmCLIMacroContext, optArg,RMIL_CMDLINE); } noUsageMsg = 1; - break; + /*@switchbreak@*/ break; case GETOPT_EVALMACRO: if (optArg) { @@ -562,7 +562,7 @@ int main(int argc, const char ** argv) val = _free(val); } noUsageMsg = 1; - break; + /*@switchbreak@*/ break; #if defined(GETOPT_RCFILE) case GETOPT_RCFILE: diff --git a/system.h b/system.h index 3ae16b1..9114a74 100644 --- a/system.h +++ b/system.h @@ -495,7 +495,7 @@ extern void unsetenv(const char *name); #include #endif -#if HAVE_SYS_SELECT_H +#if HAVE_SYS_SELECT_H && !defined(__LCLINT__) #include #endif -- 2.7.4