RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 05-May-2017 19:32:28 Branch: rpm-5_4 Handle: 2017050517322800 Modified files: (Branch: rpm-5_4) rpm/build files.c Log: - splint: RIP. Summary: Revision Changes Path 1.369.2.14 +46 -213 rpm/build/files.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/build/files.c ============================================================================ $ cvs diff -u -r1.369.2.13 -r1.369.2.14 files.c --- rpm/build/files.c 4 May 2017 21:00:26 -0000 1.369.2.13 +++ rpm/build/files.c 5 May 2017 17:32:28 -0000 1.369.2.14 @@ -40,11 +40,6 @@ #include "legacy.h" /* XXX dodigest */ #include "debug.h" -/*@access Header @*/ -/*@access rpmfi @*/ -/*@access rpmte @*/ -/*@access FD_t @*/ - #define SKIPWHITE(_x) {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;} #define SKIPNONWHITE(_x){while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;} @@ -80,50 +75,35 @@ #define fl_size fl_st.st_size #define fl_mtime fl_st.st_mtime -/*@only@*/ const char *diskURL; /* get file from here */ -/*@only@*/ const char *fileURL; /* filename in cpio archive */ -/*@observer@*/ const char *uname; -/*@observer@*/ const char *gname; unsigned flags; specdFlags specdFlags; /* which attributes have been explicitly specified. */ rpmVerifyFlags verifyFlags; -/*@only@*/ const char *langs; /* XXX locales separated with | */ -/*@only@*/ const char *caps; } * FileListRec; /** */ typedef struct AttrRec_s { -/*@null@*/ const char *ar_fmodestr; -/*@null@*/ const char *ar_dmodestr; -/*@null@*/ const char *ar_user; -/*@null@*/ const char *ar_group; mode_t ar_fmode; mode_t ar_dmode; } * AttrRec; -/*@-readonlytrans@*/ -/*@unchecked@*/ /*@observer@*/ static struct AttrRec_s root_ar = { NULL, NULL, "root", "root", 0, 0 }; -/*@=readonlytrans@*/ /** * Package file tree walk data. */ typedef struct FileList_s { -/*@only@*/ const char * buildRootURL; -/*@only@*/ const char * prefix; int fileCount; @@ -148,10 +128,8 @@ specdFlags defSpecdFlags; unsigned defVerifyFlags; int nLangs; -/*@only@*/ /*@null@*/ const char ** currentLangs; int nCaps; -/*@only@*/ /*@null@*/ const char * currentCaps; /* Hard coded limit of MAXDOCDIR docdirs. */ @@ -159,7 +137,6 @@ const char * docDirs[MAXDOCDIR]; int docDirCount; -/*@only@*/ FileListRec fileList; int fileListRecsAlloced; int fileListRecsUsed; @@ -167,7 +144,7 @@ /** */ -static void nullAttrRec(/*@out@*/ AttrRec ar) /*@modifies ar @*/ +static void nullAttrRec(AttrRec ar) { ar->ar_fmodestr = NULL; ar->ar_dmodestr = NULL; @@ -179,22 +156,19 @@ /** */ -static void freeAttrRec(AttrRec ar) /*@modifies ar @*/ +static void freeAttrRec(AttrRec ar) { ar->ar_fmodestr = _free(ar->ar_fmodestr); ar->ar_dmodestr = _free(ar->ar_dmodestr); ar->ar_user = _free(ar->ar_user); ar->ar_group = _free(ar->ar_group); /* XXX doesn't free ar (yet) */ - /*@-nullstate@*/ return; - /*@=nullstate@*/ } /** */ -static void dupAttrRec(const AttrRec oar, /*@in@*/ /*@out@*/ AttrRec nar) - /*@modifies nar @*/ +static void dupAttrRec(const AttrRec oar, AttrRec nar) { if (oar == nar) return; @@ -211,8 +185,6 @@ /** */ static void dumpAttrRec(const char * msg, AttrRec ar) - /*@globals fileSystem@*/ - /*@modifies fileSystem @*/ { if (msg) fprintf(stderr, "%s:\t", msg); @@ -229,9 +201,7 @@ * @param s string * @param delim token delimiters */ -/*@null@*/ -static char *strtokWithQuotes(/*@null@*/ char *s, const char *delim) - /*@modifies *s @*/ +static char *strtokWithQuotes(char *s, const char *delim) { static char *olds = NULL; char *token; @@ -266,16 +236,12 @@ olds = s+1; } - /*@-retalias -temptrans @*/ return token; - /*@=retalias =temptrans @*/ } /** */ static void timeCheck(int tc, Header h) - /*@globals internalState @*/ - /*@modifies internalState @*/ { HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); rpmuint32_t currentTime = (rpmuint32_t) time(NULL); @@ -302,15 +268,13 @@ /** */ typedef struct VFA { -/*@observer@*/ /*@null@*/ const char * attribute; + const char * attribute; int not; int flag; } VFA_t; /** */ -/*@-exportlocal -exportheadervar@*/ -/*@unchecked@*/ static VFA_t verifyAttrs[] = { { "md5", 0, RPMVERIFY_FDIGEST }, /* XXX legacy syntax */ { "size", 0, RPMVERIFY_FILESIZE }, @@ -326,7 +290,6 @@ { "hmac", 0, RPMVERIFY_HMAC }, { NULL, 0, 0 } }; -/*@=exportlocal =exportheadervar@*/ /** * Parse %verify and %defverify from file manifest. @@ -336,9 +299,6 @@ * @return RPMRC_OK on success */ static rpmRC parseForVerify(char * buf, int def, FileList fl) - /*@modifies buf, fl->processingFailed, - fl->currentVerifyFlags, fl->defVerifyFlags, - fl->currentSpecdFlags, fl->defSpecdFlags @*/ { char *p, *pe, *q; const char *name = def ? "%defverify" : "%verify";; @@ -400,10 +360,10 @@ { VFA_t *vfa; for (vfa = verifyAttrs; vfa->attribute != NULL; vfa++) { if (strcmp(p, vfa->attribute)) - /*@innercontinue@*/ continue; + continue; verifyFlags |= vfa->flag; verifyFlags &= ~RPMVERIFY_FDIGEST; - /*@innerbreak@*/ break; + break; } if (vfa->attribute) continue; @@ -442,8 +402,6 @@ * @return RPMRC_OK on success */ static rpmRC parseForDev(char * buf, FileList fl) - /*@modifies buf, fl->processingFailed, - fl->noGlob, fl->devtype, fl->devmajor, fl->devminor @*/ { const char * name; const char * errstr = NULL; @@ -495,12 +453,10 @@ {} ; if (*pe == '\0') { fl->devmajor = atoi(p); - /*@-unsignedcompare @*/ /* LCL: ge is ok */ if (!((int)fl->devmajor >= 0 && (int)fl->devmajor < 256)) { errstr = "devmajor"; goto exit; } - /*@=unsignedcompare @*/ pe++; } else { errstr = "devmajor"; @@ -543,9 +499,6 @@ * @return RPMRC_OK on success */ static rpmRC parseForAttr(char * buf, int def, FileList fl) - /*@modifies buf, fl->processingFailed, - fl->cur_ar, fl->def_ar, - fl->currentSpecdFlags, fl->defSpecdFlags @*/ { const char *name; char *p, *pe, *q; @@ -674,7 +627,6 @@ * @return RPMRC_OK on success */ static rpmRC parseForConfig(char * buf, FileList fl) - /*@modifies buf, fl->processingFailed, fl->currentFlags @*/ { char *p, *pe, *q; const char *name; @@ -734,7 +686,6 @@ /** */ static int langCmp(const void * ap, const void * bp) - /*@*/ { return strcmp(*(const char **)ap, *(const char **)bp); } @@ -746,8 +697,6 @@ * @return RPMRC_OK on success */ static rpmRC parseForLang(char * buf, FileList fl) - /*@modifies buf, fl->processingFailed, - fl->currentLangs, fl->nLangs @*/ { char *p, *pe, *q; const char *name; @@ -807,7 +756,7 @@ if (fl->currentLangs != NULL) for (i = 0; i < fl->nLangs; i++) { if (strncmp(fl->currentLangs[i], p, np)) - /*@innercontinue@*/ continue; + continue; rpmlog(RPMLOG_ERR, _("Duplicate locale %.*s in %%lang(%s)\n"), (int)np, p, q); fl->processingFailed = 1; @@ -834,9 +783,7 @@ /** */ -static int parseForRegexLang(const char * fileName, /*@out@*/ char ** lang) - /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ - /*@modifies *lang, rpmGlobalMacroContext, internalState @*/ +static int parseForRegexLang(const char * fileName, char ** lang) { static int initialized = 0; static int hasRegex = 0; @@ -938,8 +885,6 @@ /** */ -/*@-exportlocal -exportheadervar@*/ -/*@unchecked@*/ static VFA_t virtualFileAttributes[] = { { "%dir", 0, 0 }, /* XXX why not RPMFILE_DIR? */ { "%doc", 0, RPMFILE_DOC }, @@ -962,7 +907,6 @@ { NULL, 0, 0 } }; -/*@=exportlocal =exportheadervar@*/ /** * Parse simple attributes (e.g. %dir) from file manifest. @@ -973,15 +917,8 @@ * @retval *fileName file name * @return RPMRC_OK on success */ -static rpmRC parseForSimple(/*@unused@*/ Spec spec, Package pkg, - char * buf, FileList fl, /*@out@*/ const char ** fileName) - /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ - /*@modifies buf, fl->processingFailed, *fileName, - fl->currentFlags, - fl->docDirs, fl->docDirCount, fl->isDir, - fl->passedSpecialDoc, fl->isSpecialDoc, - pkg->header, pkg->specialDoc, - rpmGlobalMacroContext, internalState @*/ +static rpmRC parseForSimple(Spec spec, Package pkg, + char * buf, FileList fl, const char ** fileName) { char *s, *t; int specialDoc = 0; @@ -1021,7 +958,7 @@ { VFA_t *vfa; for (vfa = virtualFileAttributes; vfa->attribute != NULL; vfa++) { if (strcmp(s, vfa->attribute)) - /*@innercontinue@*/ continue; + continue; if (!vfa->flag) { if (!strcmp(s, "%dir")) fl->isDir = 1; /* XXX why not RPMFILE_DIR? */ @@ -1032,7 +969,7 @@ fl->currentFlags |= vfa->flag; } - /*@innerbreak@*/ break; + break; } /* if we got an attribute, continue with next token */ if (vfa->attribute != NULL) @@ -1067,10 +1004,10 @@ fl->processingFailed = 1; res = RPMRC_FAIL; goto exit; - /*@switchbreak@*/ break; + break; case URL_IS_PATH: *fileName = s; - /*@switchbreak@*/ break; + break; } } } else { @@ -1089,7 +1026,6 @@ } else { /* XXX WATCHOUT: buf is an arg */ { - /*@only@*/ static char *_docdir_fmt = NULL; /* XXX memleak */ static int oneshot = 0; const char *ddir, *fmt, *errstr; @@ -1137,9 +1073,7 @@ pkg->specialDoc = rpmiobAppend(pkg->specialDoc, compress_doc, 1); compress_doc = _free(compress_doc); - /*@-temptrans@*/ *fileName = buf; - /*@=temptrans@*/ fl->passedSpecialDoc = 1; fl->isSpecialDoc = 1; } @@ -1156,7 +1090,7 @@ /** */ -static int compareFileListRecs(const void * ap, const void * bp) /*@*/ +static int compareFileListRecs(const void * ap, const void * bp) { const char *aurl = ((FileListRec)ap)->fileURL; const char *a = NULL; @@ -1173,7 +1107,7 @@ * @param fileName file path * @return 1 if doc file, 0 if not */ -static int isDoc(FileList fl, const char * fileName) /*@*/ +static int isDoc(FileList fl, const char * fileName) { int x = fl->docDirCount; size_t k, l; @@ -1194,7 +1128,6 @@ * @return 1 if partial hardlink sets can exist, 0 otherwise. */ static int checkHardLinks(FileList fl) - /*@*/ { FileListRec ilp, jlp; int i, j; @@ -1209,15 +1142,15 @@ for (j = i + 1; j < fl->fileListRecsUsed; j++) { jlp = fl->fileList + j; if (!S_ISREG(jlp->fl_mode)) - /*@innercontinue@*/ continue; + continue; if (ilp->fl_nlink != jlp->fl_nlink) - /*@innercontinue@*/ continue; + continue; if (ilp->fl_ino != jlp->fl_ino) - /*@innercontinue@*/ continue; + continue; if (ilp->fl_dev != jlp->fl_dev) - /*@innercontinue@*/ continue; + continue; if (jlp->flags & (RPMFILE_EXCLUDE | RPMFILE_GHOST)) - /*@innercontinue@*/ continue; + continue; return 1; } } @@ -1225,7 +1158,6 @@ } static int dncmp(const void * a, const void * b) - /*@*/ { const char ** aurlp = (const char **)a; const char ** burlp = (const char **)b; @@ -1241,8 +1173,6 @@ * @param h header */ static void compressFilelist(Header h) - /*@globals internalState @*/ - /*@modifies h, internalState @*/ { HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); const char ** fileNames; @@ -1303,7 +1233,6 @@ needle = dirNames; savechar = *baseName; *baseName = '\0'; -/*@-compdef@*/ if (dirIndex < 0 || (needle = bsearch(&fileNames[i], dirNames, dirIndex + 1, sizeof(dirNames[0]), dncmp)) == NULL) { char *s = alloca(len + 1); @@ -1313,7 +1242,6 @@ dirNames[dirIndex] = s; } else dirIndexes[i] = needle - dirNames; -/*@=compdef@*/ *baseName = savechar; baseNames[i] = baseName; @@ -1347,7 +1275,6 @@ } static rpmuint32_t getDigestAlgo(Header h, int isSrc) - /*@modifies h @*/ { HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); static rpmuint32_t source_file_dalgo = 0; @@ -1386,12 +1313,12 @@ case PGPHASHALGO_ADLER32: case PGPHASHALGO_CRC64: (void) rpmlibNeedsFeature(h, "FileDigestParameterized", "4.4.6-1"); - /*@switchbreak@*/ break; + break; case PGPHASHALGO_MD5: case PGPHASHALGO_HAVAL_5_160: /* XXX unimplemented */ default: dalgo = PGPHASHALGO_MD5; - /*@switchbreak@*/ break; + break; } return dalgo; @@ -1426,12 +1353,8 @@ * @param h h * @param isSrc isSrc */ -static void genCpioListAndHeader(/*@partial@*/ FileList fl, +static void genCpioListAndHeader(FileList fl, rpmfi * fip, Header h, int isSrc) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies h, *fip, fl->processingFailed, fl->fileList, - fl->totalFileSize, - rpmGlobalMacroContext, fileSystem, internalState @*/ { HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); const char * apath; @@ -1546,7 +1469,6 @@ xx = headerPut(h, he, 0); he->append = 0; -/*@-sizeoftype@*/ ui32 = (rpmuint32_t) flp->fl_size; he->tag = RPMTAG_FILESIZES; he->t = RPM_UINT32_TYPE; @@ -1632,8 +1554,6 @@ xx = headerPut(h, he, 0); he->append = 0; -/*@=sizeoftype@*/ - he->tag = RPMTAG_FILELANGS; he->t = RPM_STRING_ARRAY_TYPE; he->p.argv = &flp->langs; @@ -1773,9 +1693,7 @@ if (fi == NULL) return; /* XXX can't happen */ -/*@-onlytrans@*/ fi->te = xcalloc(1, sizeof(*((rpmte)fi->te))); -/*@=onlytrans@*/ ((rpmte)fi->te)->type = TR_ADDED; fi->dnl = _free(fi->dnl); @@ -1788,11 +1706,9 @@ *d = '\0'; fi->bnl = xmalloc(fi->fc * (sizeof(*fi->bnl) + sizeof(*fi->dil))); -/*@-dependenttrans@*/ /* FIX: artifact of spoofing header tag store */ fi->dil = (!scareMem) ? xcalloc(sizeof(*fi->dil), fi->fc) : (rpmuint32_t *)(fi->bnl + fi->fc); -/*@=dependenttrans@*/ /* XXX Insure at least 1 byte is always allocated. */ fi->apath = xmalloc(fi->fc * sizeof(*fi->apath) + apathlen + 1); @@ -1836,9 +1752,7 @@ /* Create disk directory and base name. */ fi->dil[i] = i; -/*@-dependenttrans@*/ /* FIX: artifact of spoofing header tag store */ fi->dnl[fi->dil[i]] = d; -/*@=dependenttrans@*/ d = stpcpy(d, flp->diskURL); /* Make room for the dirName NUL, find start of baseName. */ @@ -1850,9 +1764,7 @@ d += 2; /* skip both dirname and basename NUL's */ /* Create archive path, normally adding "./" */ - /*@-dependenttrans@*/ /* FIX: xstrdup? nah ... */ fi->apath[i] = a; - /*@=dependenttrans@*/ if (_addDotSlash) a = stpcpy(a, "./"); (void) urlPath(flp->fileURL, &apath); @@ -1877,20 +1789,17 @@ he->c = 1; xx = headerPut(h, he, 0); - /*@-compdef@*/ if (fip) *fip = fi; else fi = rpmfiFree(fi); - /*@=compdef@*/ } } /** */ -static /*@null@*/ FileListRec freeFileList(/*@only@*/ FileListRec fileList, +static FileListRec freeFileList(FileListRec fileList, int count) - /*@*/ { while (count--) { fileList[count].diskURL = _free(fileList[count].diskURL); @@ -1904,14 +1813,7 @@ } /* forward ref */ -static rpmRC recurseDir(FileList fl, const char * diskURL) - /*@globals rpmGlobalMacroContext, h_errno, - fileSystem, internalState @*/ - /*@modifies *fl, fl->processingFailed, - fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, - fl->totalFileSize, fl->fileCount, fl->inFtw, fl->isDir, - rpmGlobalMacroContext, - fileSystem, internalState @*/; +static rpmRC recurseDir(FileList fl, const char * diskURL); /** * Add a file to the package manifest. @@ -1920,15 +1822,7 @@ * @param statp file stat (possibly NULL) * @return RPMRC_OK on success */ -static int addFile(FileList fl, const char * diskURL, - /*@null@*/ struct stat * statp) - /*@globals rpmGlobalMacroContext, h_errno, - fileSystem, internalState @*/ - /*@modifies *statp, *fl, fl->processingFailed, - fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, - fl->totalFileSize, fl->fileCount, - rpmGlobalMacroContext, - fileSystem, internalState @*/ +static int addFile(FileList fl, const char * diskURL, struct stat * statp) { const char *fn = xstrdup(diskURL); const char *fileURL = fn; @@ -2025,10 +1919,8 @@ } if ((! fl->isDir) && S_ISDIR(statp->st_mode)) { -/*@-nullstate@*/ /* FIX: fl->buildRootURL may be NULL */ rc = recurseDir(fl, diskURL); goto exit; -/*@=nullstate@*/ } fileMode = statp->st_mode; @@ -2114,7 +2006,7 @@ fl->fileCount++; exit: -/*@i@*/ fn = _free(fn); + fn = _free(fn); return rc; } @@ -2146,11 +2038,11 @@ case FTS_SLNONE: /* symbolic link without target */ case FTS_DEFAULT: /* none of the above */ rc = addFile(fl, fts->fts_accpath, fts->fts_statp); - /*@switchbreak@*/ break; + break; case FTS_DOT: /* dot or dot-dot */ case FTS_DP: /* postorder directory */ rc = RPMRC_OK; - /*@switchbreak@*/ break; + break; case FTS_NS: /* stat(2) failed */ case FTS_DNR: /* unreadable directory */ case FTS_ERR: /* error; errno is set */ @@ -2160,7 +2052,7 @@ case FTS_W: /* whiteout object */ default: rc = RPMRC_FAIL; - /*@switchbreak@*/ break; + break; } if (rc != RPMRC_OK) break; @@ -2181,15 +2073,8 @@ * @param tag tag to add * @return RPMRC_OK on success */ -static rpmRC processMetadataFile(Package pkg, FileList fl, const char * fileURL, - rpmTag tag) - /*@globals rpmGlobalMacroContext, h_errno, - fileSystem, internalState @*/ - /*@modifies pkg->header, *fl, fl->processingFailed, - fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, - fl->totalFileSize, fl->fileCount, - rpmGlobalMacroContext, - fileSystem, internalState @*/ +static rpmRC processMetadataFile(Package pkg, FileList fl, + const char * fileURL, rpmTag tag) { HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); const char * buildURL = "%{_builddir}/%{?buildsubdir}/"; @@ -2214,7 +2099,7 @@ rpmlog(RPMLOG_ERR, _("%s: can't load unknown tag (%d).\n"), fn, tag); goto exit; - /*@notreached@*/ break; + break; case RPMTAG_PUBKEYS: if ((xx = pgpReadPkts(fn, &pkt, (size_t *)&pktlen)) <= 0) { rpmlog(RPMLOG_ERR, _("%s: public key read failed.\n"), fn); @@ -2268,13 +2153,7 @@ * @param fileURL fileURL * @return RPMRC_OK on success */ -static rpmRC processBinaryFile(/*@unused@*/ Package pkg, FileList fl, - const char * fileURL) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies *fl, fl->processingFailed, - fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, - fl->totalFileSize, fl->fileCount, - rpmGlobalMacroContext, fileSystem, internalState @*/ +static rpmRC processBinaryFile(Package pkg, FileList fl, const char * fileURL) { int quote = 1; /* XXX permit quoted glob characters. */ int doGlob; @@ -2351,11 +2230,6 @@ */ static rpmRC processPackageFiles(Spec spec, Package pkg, int installSpecialDoc, int test) - /*@globals rpmGlobalMacroContext, h_errno, - fileSystem, internalState@*/ - /*@modifies spec->macros, - pkg->fi, pkg->fileList, pkg->specialDoc, pkg->header, - rpmGlobalMacroContext, fileSystem, internalState @*/ { HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); struct FileList_s fl; @@ -2374,9 +2248,7 @@ if (pkg->fileFile) { char *saveptr = NULL; char *filesFiles = xstrdup(pkg->fileFile); -/*@-unrecog@*/ char *token = strtok_r(filesFiles, ",", &saveptr); -/*@=unrecog@*/ do { const char *ffn; FILE * f; @@ -2404,7 +2276,7 @@ } ffn = _free(ffn); - /*@+voidabstract@*/ f = fdGetFp(fd); /*@=voidabstract@*/ + f = fdGetFp(fd); if (f != NULL) { while (fgets(buf, (int)sizeof(buf), f)) { handleComments(buf); @@ -2493,10 +2365,8 @@ if (*s == '\0') continue; fileName = NULL; - /*@-nullpass@*/ /* LCL: buf is NULL ?!? */ strncpy(buf, s, sizeof(buf)-1); buf[sizeof(buf)-1] = '\0'; - /*@=nullpass@*/ /* Reset for a new line in %files */ fl.isDir = 0; @@ -2548,17 +2418,11 @@ specialDoc = xstrdup(fileName); dupAttrRec(&fl.cur_ar, specialDocAttrRec); } else if (fl.currentFlags & RPMFILE_PUBKEY) { -/*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ (void) processMetadataFile(pkg, &fl, fileName, RPMTAG_PUBKEYS); -/*@=nullstate@*/ } else if (fl.currentFlags & RPMFILE_POLICY) { -/*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ (void) processMetadataFile(pkg, &fl, fileName, RPMTAG_POLICIES); -/*@=nullstate@*/ } else { -/*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ (void) processBinaryFile(pkg, &fl, fileName); -/*@=nullstate@*/ } } @@ -2589,9 +2453,7 @@ if (fl.currentLangs) { int i; for (i = 0; i < fl.nLangs; i++) - /*@-unqualifiedtrans@*/ fl.currentLangs[i] = _free(fl.currentLangs[i]); - /*@=unqualifiedtrans@*/ fl.currentLangs = _free(fl.currentLangs); } fl.nLangs = 0; @@ -2599,9 +2461,7 @@ dupAttrRec(specialDocAttrRec, &fl.cur_ar); freeAttrRec(specialDocAttrRec); - /*@-nullstate@*/ /* FIX: pkg->fileFile might be NULL */ (void) processBinaryFile(pkg, &fl, specialDoc); - /*@=nullstate@*/ specialDoc = _free(specialDoc); } @@ -2632,9 +2492,7 @@ if (fl.currentLangs) { int i; for (i = 0; i < fl.nLangs; i++) - /*@-unqualifiedtrans@*/ fl.currentLangs[i] = _free(fl.currentLangs[i]); - /*@=unqualifiedtrans@*/ fl.currentLangs = _free(fl.currentLangs); } @@ -2696,11 +2554,11 @@ #endif if (he->p.ptr) xx = headerPut(spec->sourceHeader, he, 0); - /*@switchbreak@*/ break; + break; default: if (classTag == he->tag && he->p.ptr != NULL) xx = headerPut(spec->sourceHeader, he, 0); - /*@switchbreak@*/ break; + break; } } hi = headerFini(hi); @@ -2766,14 +2624,12 @@ if (spec->sourceHeader != NULL) for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) { { const char * sfn; -/*@-nullpass@*/ /* XXX getSourceDir returns NULL with bad flags. */ sfn = rpmGetPath( ((srcPtr->flags & RPMFILE_GHOST) ? "!" : ""), #if defined(RPM_VENDOR_OPENPKG) /* splitted-source-directory */ getSourceDir(srcPtr->flags, srcPtr->source), srcPtr->source, NULL); #else getSourceDir(srcPtr->flags), srcPtr->source, NULL); #endif -/*@=nullpass@*/ sourceFiles = rpmiobAppend(sourceFiles, sfn, 1); sfn = _free(sfn); } @@ -2824,9 +2680,7 @@ spec->sourceHdrInit = 1; -/*@-usereleased@*/ return 0; -/*@=usereleased@*/ } int processSourceFiles(Spec spec) @@ -2946,13 +2800,8 @@ * @return -1 if skipped, 0 on OK, 1 on error */ static int checkUnpackagedFiles(Spec spec) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies *spec->packages, - rpmGlobalMacroContext, fileSystem, internalState @*/ { -/*@-readonlytrans@*/ static const char * av_ckfile[] = { "%{?__check_files}", NULL }; -/*@=readonlytrans@*/ rpmiob iob_stdout = NULL; const char * s; int rc; @@ -3020,9 +2869,7 @@ /* auxiliary function for checkDuplicateFiles() */ /* XXX need to pass Header because fi->h is NULL */ -static int fiIntersect(/*@null@*/ rpmfi fi1, /*@null@*/ rpmfi fi2) - /*@globals internalState @*/ - /*@modifies fi1, fi2, internalState @*/ +static int fiIntersect(rpmfi fi1, rpmfi fi2) { int n = 0; int i1, i2; @@ -3037,10 +2884,10 @@ if ((fi2 = rpmfiInit(fi2, 0)) != NULL) while ((i2 = rpmfiNext(fi2)) >= 0) { if (S_ISDIR(rpmfiFMode(fi2))) - /*@innercontinue@*/ continue; + continue; fn2 = rpmfiFN(fi2); if (strcmp(fn1, fn2)) - /*@innercontinue@*/ continue; + continue; if (!dups) dups = rpmiobNew(0); dups = rpmiobAppend(dups, "\t", 0); @@ -3076,9 +2923,6 @@ * @return number of duplicate files */ static int checkDuplicateFiles(Spec spec) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies *spec->packages, - rpmGlobalMacroContext, fileSystem, internalState @*/ { int n = 0; Package pkg1, pkg2; @@ -3112,9 +2956,6 @@ /* auxiliary function: check if directory d is packaged */ static inline int packagedDir(Package pkg, const char *d) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies pkg->header, - rpmGlobalMacroContext, fileSystem, internalState @*/ { return rpmbfChk(rpmfiFNBF(pkg->fi), d, strlen(d)); } @@ -3127,9 +2968,6 @@ * Now directories "/A/B" and "/A/B/C" should also be packaged. */ static int pkgUnpackagedSubdirs(Package pkg) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies pkg->header, - rpmGlobalMacroContext, fileSystem, internalState @*/ { int n = 0; int i, j; @@ -3159,7 +2997,7 @@ found = packagedDir(pkg, fn); *p = '/'; if (found) - /*@innerbreak@*/ break; + break; } if (!found) continue; @@ -3169,18 +3007,18 @@ *p = '\0'; if (packagedDir(pkg, fn)) { *p = '/'; - /*@innercontinue@*/ continue; + continue; } /* might be already added */ found = 0; for (j = 0; j < n; j++) if (strcmp(fn, unpackaged[j]) == 0) { found = 1; - /*@innerbreak@*/ break; + break; } if (found) { *p = '/'; - /*@innercontinue@*/ continue; + continue; } unpackaged = xrealloc(unpackaged, sizeof(*unpackaged) * (n + 1)); unpackaged[n++] = xstrdup(fn); @@ -3221,9 +3059,6 @@ * @return number of unpackaged subdirectories */ static int checkUnpackagedSubdirs(Spec spec) - /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ - /*@modifies *spec->packages, - rpmGlobalMacroContext, fileSystem, internalState @*/ { int n = 0; Package pkg; @@ -3233,7 +3068,6 @@ return n; } -/*@-incondefs@*/ rpmRC processBinaryFiles(Spec spec, int installSpecialDoc, int test) { HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he)); @@ -3287,4 +3121,3 @@ return res; } -/*@=incondefs@*/ @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org