diff options
author | jbj <devnull@localhost> | 2002-11-05 22:45:02 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-11-05 22:45:02 +0000 |
commit | 90d7f523997837adac14c77a9a61d405fcdf66e9 (patch) | |
tree | d95497c0b1eb522346ac31fd3ce4283ec311d570 /build | |
parent | e99358b753e1f8b12474e0b15097af79bf49cc8c (diff) | |
download | librpm-tizen-90d7f523997837adac14c77a9a61d405fcdf66e9.tar.gz librpm-tizen-90d7f523997837adac14c77a9a61d405fcdf66e9.tar.bz2 librpm-tizen-90d7f523997837adac14c77a9a61d405fcdf66e9.zip |
Remove multilib patch.
splint fiddles.
CVS patchset: 5825
CVS date: 2002/11/05 22:45:02
Diffstat (limited to 'build')
-rw-r--r-- | build/files.c | 170 | ||||
-rw-r--r-- | build/rpmfc.c | 114 | ||||
-rw-r--r-- | build/rpmfc.h | 8 |
3 files changed, 93 insertions, 199 deletions
diff --git a/build/files.c b/build/files.c index 80a8e1224..bb1e61afb 100644 --- a/build/files.c +++ b/build/files.c @@ -102,8 +102,6 @@ typedef struct AttrRec_s { /* list of files */ /*@unchecked@*/ /*@only@*/ /*@null@*/ static StringBuf check_fileList = NULL; -/*@unchecked@*/ -static int check_fileListLen = 0; /** * Package file tree walk data. @@ -873,42 +871,6 @@ static int parseForRegexLang(const char * fileName, /*@out@*/ char ** lang) } /*@=boundswrite@*/ -#ifdef DYING -/** - */ -/*@-boundswrite@*/ -static int parseForRegexMultiLib(const char *fileName) - /*@globals rpmGlobalMacroContext @*/ - /*@modifies rpmGlobalMacroContext @*/ -{ - static int oneshot = 0; - static int hasRegex = 0; - static regex_t compiledPatt; - - if (! oneshot) { - const char *patt; - int rc = 0; - - oneshot = 1; - patt = rpmExpand("%{?_multilibpatt}", NULL); - if (!(patt && *patt != '\0')) - rc = 1; - else if (regcomp(&compiledPatt, patt, REG_EXTENDED | REG_NOSUB)) - rc = -1; - patt = _free(patt); - if (rc) - return rc; - hasRegex = 1; - } - - if (! hasRegex || regexec(&compiledPatt, fileName, 0, NULL, 0)) - return 1; - - return 0; -} -/*@=boundswrite@*/ -#endif - /** */ /*@-exportlocal -exportheadervar@*/ @@ -920,12 +882,6 @@ VFA_t virtualFileAttributes[] = { { "%exclude", 0, RPMFILE_EXCLUDE }, { "%readme", 0, RPMFILE_README }, { "%license", 0, RPMFILE_LICENSE }, -#ifdef DYING - { "%multilib", 0, 0 }, - { "%multilib(0)", 1, RPMFILE_MULTILIB_MASK}, - { "%multilib(1)", 0, RPMFILE_MULTILIB(1) }, - { "%multilib(2)", 0, RPMFILE_MULTILIB(2) }, -#endif #if WHY_NOT { "%spec", RPMFILE_SPEC }, @@ -993,10 +949,6 @@ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char * buf, if (!vfa->flag) { if (!strcmp(s, "%dir")) fl->isDir = 1; /* XXX why not RPMFILE_DIR? */ -#ifdef DYING - else if (!strcmp(s, "%multilib")) - fl->currentFlags |= RPMFILE_MULTILIB(multiLibNo); -#endif } else { if (vfa->not) fl->currentFlags &= ~vfa->flag; @@ -1160,9 +1112,6 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, rpmGlobalMacroContext, fileSystem, internalState @*/ { int _addDotSlash = !(isSrc || rpmExpandNumeric("%{_noPayloadPrefix}")); -#ifdef DYING - uint_32 multiLibMask = 0; -#endif int apathlen = 0; int dpathlen = 0; int skipLen = 0; @@ -1244,18 +1193,6 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, /* Leave room for both dirname and basename NUL's */ dpathlen += (strlen(flp->diskURL) + 2); -#ifdef DYING - /* - * Create union bit mask of all files in the package. - */ - if (flp->flags & RPMFILE_MULTILIB_MASK) { - unsigned mlno; - mlno = (flp->flags & RPMFILE_MULTILIB_MASK); - mlno >>= RPMFILE_MULTILIB_SHIFT; - multiLibMask |= (1u << mlno); - } -#endif - /* * Make the header, the OLDFILENAMES will get converted to a * compressed file list write before we write the actual package to @@ -1377,14 +1314,6 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, (void) headerAddEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE, &(fl->totalFileSize), 1); -#ifdef DYING - /* XXX MULTILIBTODO: only binary packages for now. */ - if (!isSrc) { - (void) headerAddEntry(h, RPMTAG_MULTILIBMASK, RPM_INT32_TYPE, - &multiLibMask, 1); - } -#endif - if (_addDotSlash) (void) rpmlibNeedsFeature(h, "PayloadFilesHavePrefix", "4.0-1"); @@ -1503,13 +1432,6 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, CPIO_MAP_TYPE | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID; if (isSrc) fi->fmapflags[i] |= CPIO_FOLLOW_SYMLINKS; -#ifdef DYING - /* - * Mark multilib colored files as not-yet-processed. - */ - if (flp->flags & RPMFILE_MULTILIB_MASK) - fi->fmapflags[i] |= CPIO_MULTILIB; -#endif } /*@-branchstate@*/ @@ -1541,12 +1463,12 @@ static /*@null@*/ FileListRec freeFileList(/*@only@*/ FileListRec fileList, /* forward ref */ static int recurseDir(FileList fl, const char * diskURL) - /*@globals check_fileList, check_fileListLen, rpmGlobalMacroContext, + /*@globals check_fileList, rpmGlobalMacroContext, fileSystem, internalState @*/ /*@modifies *fl, fl->processingFailed, fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, fl->totalFileSize, fl->fileCount, fl->inFtw, fl->isDir, - check_fileList, check_fileListLen, rpmGlobalMacroContext, + check_fileList, rpmGlobalMacroContext, fileSystem, internalState @*/; /** @@ -1559,12 +1481,12 @@ static int recurseDir(FileList fl, const char * diskURL) /*@-boundswrite@*/ static int addFile(FileList fl, const char * diskURL, /*@null@*/ struct stat * statp) - /*@globals check_fileList, check_fileListLen, rpmGlobalMacroContext, + /*@globals check_fileList, rpmGlobalMacroContext, fileSystem, internalState @*/ /*@modifies *statp, *fl, fl->processingFailed, fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, fl->totalFileSize, fl->fileCount, - check_fileList, check_fileListLen, rpmGlobalMacroContext, + check_fileList, rpmGlobalMacroContext, fileSystem, internalState @*/ { const char *fileURL = diskURL; @@ -1678,7 +1600,6 @@ static int addFile(FileList fl, const char * diskURL, if (check_fileList && S_ISREG(fileMode)) { appendStringBuf(check_fileList, diskURL); appendStringBuf(check_fileList, "\n"); - check_fileListLen += strlen(diskURL) + 1; } /* Add to the file list */ @@ -1726,15 +1647,6 @@ static int addFile(FileList fl, const char * diskURL, flp->specdFlags = fl->currentSpecdFlags; flp->verifyFlags = fl->currentVerifyFlags; -#ifdef DYING - /* If coloring and still white, apply regex to path. */ - if (multiLibNo - && !(flp->flags & RPMFILE_MULTILIB_MASK) - && !parseForRegexMultiLib(fileURL)) { - flp->flags |= RPMFILE_MULTILIB(multiLibNo); - } -#endif - /* Hard links need be counted only once. */ if (S_ISREG(flp->fl_mode) && flp->fl_nlink > 1) { FileListRec ilp; @@ -2436,11 +2348,9 @@ DepMsg_t depMsgs[] = { /** */ /*@-bounds@*/ -static int generateDepends(Spec spec, Package pkg, rpmfi cpioList, int multiLibPass) - /*@globals rpmGlobalMacroContext, - fileSystem, internalState @*/ - /*@modifies cpioList, rpmGlobalMacroContext, - fileSystem, internalState @*/ +static int generateDepends(Spec spec, Package pkg, rpmfi cpioList) + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmfi fi = cpioList; StringBuf sb_stdin; @@ -2461,19 +2371,6 @@ static int generateDepends(Spec spec, Package pkg, rpmfi cpioList, int multiLibP */ sb_stdin = newStringBuf(); for (i = 0; i < fi->fc; i++) { - -#ifdef DYING - /* - * On 2nd dependency pass for multilib, skip files already processed. - */ - if (fi->fmapflags && multiLibPass == 2) { - if (!(fi->fmapflags[i] & CPIO_MULTILIB)) - continue; - /* Mark multilib colored file as processed. */ - fi->fmapflags[i] &= ~CPIO_MULTILIB; - } -#endif - appendStringBuf(sb_stdin, fi->dnl[fi->dil[i]]); appendLineStringBuf(sb_stdin, fi->bnl[i]); } @@ -2522,10 +2419,6 @@ static int generateDepends(Spec spec, Package pkg, rpmfi cpioList, int multiLibP /* Parse dependencies into header */ tagflags &= ~RPMSENSE_MULTILIB; -#ifdef DYING - if (multiLibPass > 1) - tagflags |= RPMSENSE_MULTILIB; -#endif rc = parseRCPOT(spec, pkg, getStringBuf(sb_stdout), tag, 0, tagflags); sb_stdout = freeStringBuf(sb_stdout); @@ -2561,11 +2454,6 @@ static void printDepMsg(DepMsg_t * dm, int count, const char ** names, } rpmMessage(RPMMESS_NORMAL, " %s", *names); -#ifdef DYING - if (hasFlags && isDependsMULTILIB(*flags)) - rpmMessage(RPMMESS_NORMAL, "*"); -#endif - if (hasVersions && !(*versions != NULL && **versions != '\0')) continue; if (!(hasFlags && (*flags && RPMSENSE_SENSEMASK))) @@ -2645,22 +2533,25 @@ static void printDeps(Header h) /** * Check packaged file list against what's in the build root. * @param fileList packaged file list - * @param fileListLen no. of packaged files * @return -1 if skipped, 0 on OK, 1 on error */ -static int checkFiles(StringBuf fileList, int fileListLen) +static int checkFiles(StringBuf fileList) /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { +/*@-readonlytrans@*/ static const char * av_ckfile[] = { "%{?__check_files}", NULL }; +/*@=readonlytrans@*/ StringBuf sb_stdout = NULL; const char * s; int rc; s = rpmExpand(av_ckfile[0], NULL); - rc = (s && *s) ? 0 : -1; - if (rc != 0) + if (!(s && *s)) { + rc = -1; goto exit; + } + rc = 0; rpmMessage(RPMMESS_NORMAL, _("Checking for unpackaged file(s): %s\n"), s); @@ -2695,26 +2586,13 @@ exit: /*@-incondefs@*/ int processBinaryFiles(Spec spec, int installSpecialDoc, int test) - /*@globals check_fileList, check_fileListLen, - multiLibNo, multiLib_oneshot @*/ - /*@modifies check_fileList, check_fileListLen, - multiLibNo, multiLib_oneshot @*/ + /*@globals check_fileList @*/ + /*@modifies check_fileList @*/ { Package pkg; int res = 0; -#ifdef DYING - HGE_t hge = (HGE_t)headerGetEntryMinMemory; - int_32 * mlmp; - int mlm; - - if (!multiLib_oneshot) { - multiLib_oneshot = 1; - multiLibNo = rpmExpandNumeric("%{?_multilibno}"); - } -#endif check_fileList = newStringBuf(); - check_fileListLen = 0; for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { const char *n, *v, *r; @@ -2729,19 +2607,7 @@ int processBinaryFiles(Spec spec, int installSpecialDoc, int test) if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) res = rc; -#ifdef DYING - mlm = 0; - mlmp = NULL; - if (hge(pkg->header, RPMTAG_MULTILIBMASK, NULL, (void **)&mlmp, NULL) - && mlmp != NULL) - mlm = *mlmp; - - if (mlm) { - (void) generateDepends(spec, pkg, pkg->cpioList, 1); - (void) generateDepends(spec, pkg, pkg->cpioList, 2); - } else -#endif - (void) generateDepends(spec, pkg, pkg->cpioList, 0); + (void) generateDepends(spec, pkg, pkg->cpioList); /*@-noeffect@*/ printDeps(pkg->header); @@ -2754,7 +2620,7 @@ int processBinaryFiles(Spec spec, int installSpecialDoc, int test) */ if (res == 0) { - if (checkFiles(check_fileList, check_fileListLen) > 0) + if (checkFiles(check_fileList) > 0) res = 1; } diff --git a/build/rpmfc.c b/build/rpmfc.c index 5fbc53afe..b0c17d8e1 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -17,6 +17,8 @@ int _rpmfc_debug; static int rpmfcExpandAppend(/*@out@*/ ARGV_t * argvp, const ARGV_t av) + /*@globals rpmGlobalMacroContext @*/ + /*@modifies *argvp, rpmGlobalMacroContext @*/ { ARGV_t argv = *argvp; int argc = argvCount(argv); @@ -181,7 +183,6 @@ top: } return readBuff; } -/*@=boundswrite@*/ int rpmfcExec(ARGV_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp, int failnonzero) @@ -218,7 +219,7 @@ int rpmfcExec(ARGV_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp, if (av[1]) xx = rpmfcExpandAppend(&xav, av + 1); - if (sb_stdin) { + if (sb_stdin != NULL) { buf_stdin = getStringBuf(sb_stdin); buf_stdin_len = strlen(buf_stdin); } @@ -226,10 +227,12 @@ int rpmfcExec(ARGV_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp, /* Read output from exec'd helper. */ sb = getOutputFrom(NULL, xav, buf_stdin, buf_stdin_len, failnonzero); - if (sb_stdoutp) { +/*@-branchstate@*/ + if (sb_stdoutp != NULL) { *sb_stdoutp = sb; sb = NULL; /* XXX don't free */ } +/*@=branchstate@*/ ec = 0; @@ -240,10 +243,12 @@ exit: s = _free(s); return ec; } +/*@=boundswrite@*/ /** */ -static int rpmfcSaveArg(ARGV_t * argvp, const char * key) +static int rpmfcSaveArg(/*@out@*/ ARGV_t * argvp, const char * key) + /*@modifies *argvp @*/ { int rc = 0; @@ -256,7 +261,10 @@ static int rpmfcSaveArg(ARGV_t * argvp, const char * key) /** */ -static int rpmfcHelper(rpmfc fc, char deptype, const char * nsdep) +/*@-bounds@*/ +static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep) + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/ { const char * fn = fc->fn[fc->ix]; char buf[BUFSIZ]; @@ -274,13 +282,13 @@ static int rpmfcHelper(rpmfc fc, char deptype, const char * nsdep) switch (deptype) { default: return -1; - break; + /*@notreached@*/ break; case 'P': - snprintf(buf, sizeof(buf), "%%{?__%s_provides}", nsdep); + xx = snprintf(buf, sizeof(buf), "%%{?__%s_provides}", nsdep); depsp = &fc->provides; break; case 'R': - snprintf(buf, sizeof(buf), "%%{?__%s_requires}", nsdep); + xx = snprintf(buf, sizeof(buf), "%%{?__%s_requires}", nsdep); depsp = &fc->requires; break; } @@ -295,6 +303,7 @@ static int rpmfcHelper(rpmfc fc, char deptype, const char * nsdep) sb_stdin = freeStringBuf(sb_stdin); if (xx == 0 && sb_stdout != NULL) { + pav = NULL; xx = argvSplit(&pav, getStringBuf(sb_stdout), " \t\n\r"); pac = argvCount(pav); if (pav) @@ -332,6 +341,7 @@ static int rpmfcHelper(rpmfc fc, char deptype, const char * nsdep) return 0; } +/*@=bounds@*/ /** */ @@ -472,8 +482,8 @@ assert(fx < fc->fddictn->nvals); while (ndx-- > 0) { const char * depval; - char deptype; - int ix; + unsigned char deptype; + unsigned ix; ix = fc->ddictx->vals[dx++]; deptype = ((ix >> 24) & 0xff); @@ -481,16 +491,16 @@ assert(fx < fc->fddictn->nvals); depval = NULL; switch (deptype) { default: -assert(depval); - break; +assert(depval != NULL); + /*@switchbreak@*/ break; case 'P': assert(ix < nprovides); depval = fc->provides[ix]; - break; + /*@switchbreak@*/ break; case 'R': assert(ix < nrequires); depval = fc->requires[ix]; - break; + /*@switchbreak@*/ break; } if (depval) fprintf(fp, "\t%c %s\n", deptype, depval); @@ -523,17 +533,19 @@ rpmfc rpmfcNew(void) } static int rpmfcSCRIPT(rpmfc fc) + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/ { const char * fn = fc->fn[fc->ix]; const char * bn; - char deptype; + unsigned char deptype; char buf[BUFSIZ]; FILE * fp; char * s, * se; size_t ns; char * t; int i; - struct stat sb, * st = &sb;; + struct stat sb, * st = &sb; int xx; /* Only executable scripts are searched. */ @@ -544,7 +556,7 @@ static int rpmfcSCRIPT(rpmfc fc) fp = fopen(fn, "r"); if (fp == NULL || ferror(fp)) { - if (fp) fclose(fp); + if (fp) (void) fclose(fp); return -1; } @@ -570,7 +582,7 @@ static int rpmfcSCRIPT(rpmfc fc) for (se = s+1; *se; se++) { if (strchr(" \t\n\r", *se) != NULL) - break; + /*@innerbreak@*/ break; } *se = '\0'; @@ -607,9 +619,11 @@ static int rpmfcSCRIPT(rpmfc fc) } static int rpmfcELF(rpmfc fc) + /*@globals fileSystem, internalState @*/ + /*@modifies fc, fileSystem, internalState @*/ { #if HAVE_GELF_H && HAVE_LIBELF - const char * fn = fc->fn[fc->ix];; + const char * fn = fc->fn[fc->ix]; Elf * elf; Elf_Scn * scn; Elf_Data * data; @@ -625,7 +639,7 @@ static int rpmfcELF(rpmfc fc) int cnt; char buf[BUFSIZ]; const char * s; - char deptype; + unsigned char deptype; const char * soname = NULL; ARGV_t * depsp; const char * depval; @@ -639,12 +653,14 @@ static int rpmfcELF(rpmfc fc) (void) elf_version(EV_CURRENT); +/*@-evalorder@*/ elf = NULL; if ((elf = elf_begin (fdno, ELF_C_READ, NULL)) == NULL || elf_kind(elf) != ELF_K_ELF || (ehdr = gelf_getehdr(elf, &ehdr_mem)) == NULL || !(ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC)) goto exit; +/*@=evalorder@*/ isElf64 = ehdr->e_ident[EI_CLASS] == ELFCLASS64; @@ -659,7 +675,7 @@ static int rpmfcELF(rpmfc fc) switch (shdr->sh_type) { default: continue; - /*@switchbreak@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case SHT_GNU_verdef: deptype = 'P'; data = NULL; @@ -669,27 +685,30 @@ static int rpmfcELF(rpmfc fc) def = gelf_getverdef (data, offset, &def_mem); if (def == NULL) - break; + /*@innerbreak@*/ break; auxoffset = offset + def->vd_aux; for (cnt2 = def->vd_cnt; --cnt2 >= 0; ) { GElf_Verdaux aux_mem, * aux; aux = gelf_getverdaux (data, auxoffset, &aux_mem); if (aux == NULL) - break; + /*@innerbreak@*/ break; s = elf_strptr(elf, shdr->sh_link, aux->vda_name); + if (s == NULL) + /*@innerbreak@*/ break; /* XXX Ick, but what's a girl to do. */ if (!strncmp("ld-", s, 3) || !strncmp("lib", s, 3)) { soname = _free(soname); soname = xstrdup(s); auxoffset += aux->vda_next; - continue; + /*@innercontinue@*/ continue; } +assert(soname != NULL); + buf[0] = '\0'; t = buf; - *t = '\0'; sprintf(t, "%08d%c ", fc->ix, deptype); t += strlen(t); depval = t; @@ -720,9 +739,11 @@ static int rpmfcELF(rpmfc fc) for (cnt = shdr->sh_info; --cnt >= 0; ) { need = gelf_getverneed (data, offset, &need_mem); if (need == NULL) - break; + /*@innerbreak@*/ break; s = elf_strptr(elf, shdr->sh_link, need->vn_file); + if (s == NULL) + /*@innerbreak@*/ break; soname = _free(soname); soname = xstrdup(s); auxoffset = offset + need->vn_aux; @@ -731,13 +752,15 @@ static int rpmfcELF(rpmfc fc) aux = gelf_getvernaux (data, auxoffset, &aux_mem); if (aux == NULL) - break; + /*@innerbreak@*/ break; s = elf_strptr(elf, shdr->sh_link, aux->vna_name); -assert(soname); + if (s == NULL) + /*@innerbreak@*/ break; +assert(soname != NULL); + buf[0] = '\0'; t = buf; - *t = '\0'; sprintf(t, "%08d%c ", fc->ix, deptype); t += strlen(t); depval = t; @@ -765,11 +788,13 @@ assert(soname); while ((data = elf_getdata (scn, data)) != NULL) { for (cnt = 0; cnt < (shdr->sh_size / shdr->sh_entsize); ++cnt) { dyn = gelf_getdyn (data, cnt, &dyn_mem); + if (dyn == NULL) + /*@innerbreak@*/ break; s = NULL; switch (dyn->d_tag) { default: /*@innercontinue@*/ continue; - /*@notreached@*/ break; + /*@notreached@*/ /*@switchbreak@*/ break; case DT_NEEDED: /* Add to package requires. */ deptype = 'R'; @@ -784,10 +809,10 @@ assert(soname); /*@switchbreak@*/ break; } if (s == NULL) - continue; + /*@innercontinue@*/ continue; + buf[0] = '\0'; t = buf; - *t = '\0'; sprintf(t, "%08d%c ", fc->ix, deptype); t += strlen(t); depval = t; @@ -846,14 +871,14 @@ int rpmfcClassify(rpmfc fc, ARGV_t argv) while ((s = *av++) != NULL) { for (se = s; *se; se++) { if (se[0] == ':' && se[1] == ' ') - break; + /*@innerbreak@*/ break; } if (*se == '\0') return -1; for (se++; *se; se++) { if (!(*se == ' ' || *se == '\t')) - break; + /*@innerbreak@*/ break; } if (*se == '\0') return -1; @@ -872,7 +897,7 @@ int rpmfcClassify(rpmfc fc, ARGV_t argv) while ((s = *av++) != NULL) { for (se = s; *se; se++) { if (se[0] == ':' && se[1] == ' ') - break; + /*@innerbreak@*/ break; } if (*se == '\0') return -1; @@ -884,7 +909,7 @@ int rpmfcClassify(rpmfc fc, ARGV_t argv) for (se++; *se; se++) { if (!(*se == ' ' || *se == '\t')) - break; + /*@innerbreak@*/ break; } if (*se == '\0') return -1; @@ -912,6 +937,7 @@ typedef struct rpmfcApplyTbl_s { int colormask; } * rpmfcApplyTbl; +/*@unchecked@*/ static struct rpmfcApplyTbl_s rpmfcApplyTable[] = { { rpmfcELF, RPMFC_ELF }, { rpmfcSCRIPT, RPMFC_SCRIPT }, @@ -924,7 +950,7 @@ int rpmfcApply(rpmfc fc) char * se; ARGV_t dav, davbase; rpmfcApplyTbl fcat; - char deptype; + unsigned char deptype; int nddict; int previx; unsigned int val; @@ -936,7 +962,7 @@ int rpmfcApply(rpmfc fc) for (fc->ix = 0; fc->fn[fc->ix] != NULL; fc->ix++) { for (fcat = rpmfcApplyTable; fcat->func != NULL; fcat++) { if (!(fc->fcolor->vals[fc->ix] & fcat->colormask)) - continue; + /*@innercontinue@*/ continue; xx = (*fcat->func) (fc); } } @@ -947,25 +973,25 @@ int rpmfcApply(rpmfc fc) for (i = 0; i < nddict; i++) { s = fc->ddict[i]; ix = strtol(s, &se, 10); -assert(se); +assert(se != NULL); deptype = *se++; se++; davbase = NULL; switch (deptype) { default: -assert(davbase); - break; +assert(davbase != NULL); + /*@switchbreak@*/ break; case 'P': davbase = fc->provides; - break; + /*@switchbreak@*/ break; case 'R': davbase = fc->requires; - break; + /*@switchbreak@*/ break; } dav = argvSearch(davbase, se, NULL); -assert(dav); +assert(dav != NULL); val = (deptype << 24) | ((dav - davbase) & 0x00ffffff); xx = argiAdd(&fc->ddictx, -1, val); diff --git a/build/rpmfc.h b/build/rpmfc.h index c9ec7fbdb..ac0fa8207 100644 --- a/build/rpmfc.h +++ b/build/rpmfc.h @@ -80,9 +80,11 @@ extern "C" { /** */ -int rpmfcExec(ARGV_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp, +int rpmfcExec(ARGV_t av, StringBuf sb_stdin, /*@out@*/ StringBuf * sb_stdoutp, int failnonzero) - /*@*/; + /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@modifies *sb_stdoutp, rpmGlobalMacroContext, + fileSystem, internalState @*/; /** */ @@ -109,7 +111,7 @@ rpmfc rpmfcNew(void) * Build file class dictionary and mappings. */ int rpmfcClassify(rpmfc fc, ARGV_t argv) - /*@modifies *fcp @*/; + /*@modifies fc @*/; /** * BUild file/package dependency dictionary and mappings. |