diff options
author | jbj <devnull@localhost> | 2001-10-16 14:58:57 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-10-16 14:58:57 +0000 |
commit | 9f45bcd3ecf3f3548ed7a8490b882a6ca9ffeb94 (patch) | |
tree | 65c941cf8e72c29c2d63822cd98aec4db0967afc /build | |
parent | cafccc00586497bdc9c5a4c12b19709fbd417976 (diff) | |
download | librpm-tizen-9f45bcd3ecf3f3548ed7a8490b882a6ca9ffeb94.tar.gz librpm-tizen-9f45bcd3ecf3f3548ed7a8490b882a6ca9ffeb94.tar.bz2 librpm-tizen-9f45bcd3ecf3f3548ed7a8490b882a6ca9ffeb94.zip |
More lclint annotations.
CVS patchset: 5116
CVS date: 2001/10/16 14:58:57
Diffstat (limited to 'build')
-rw-r--r-- | build/expression.c | 4 | ||||
-rw-r--r-- | build/files.c | 12 | ||||
-rw-r--r-- | build/myftw.c | 2 | ||||
-rw-r--r-- | build/pack.c | 2 | ||||
-rw-r--r-- | build/parsePreamble.c | 18 | ||||
-rw-r--r-- | build/parseSpec.c | 5 | ||||
-rw-r--r-- | build/reqprov.c | 15 | ||||
-rw-r--r-- | build/spec.c | 4 |
8 files changed, 35 insertions, 27 deletions
diff --git a/build/expression.c b/build/expression.c index 9c79a1fde..817e4dc20 100644 --- a/build/expression.c +++ b/build/expression.c @@ -45,7 +45,7 @@ static Value valueMakeInteger(int i) { Value v; - v = (Value) xmalloc(sizeof(struct _value)); + v = (Value) xmalloc(sizeof(*v)); v->type = VALUE_TYPE_INTEGER; v->data.i = i; return v; @@ -58,7 +58,7 @@ static Value valueMakeString(/*@only@*/ const char *s) { Value v; - v = (Value) xmalloc(sizeof(struct _value)); + v = (Value) xmalloc(sizeof(*v)); v->type = VALUE_TYPE_STRING; v->data.s = s; return v; diff --git a/build/files.c b/build/files.c index 5431e28bc..fa44e1b66 100644 --- a/build/files.c +++ b/build/files.c @@ -266,8 +266,8 @@ static void timeCheck(int tc, Header h) int count, x; time_t currentTime = time(NULL); - (void) hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &files, &count); - (void) hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtime, NULL); + x = hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &files, &count); + x = hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtime, NULL); for (x = 0; x < count; x++) { if ((currentTime - mtime[x]) > tc) @@ -1209,6 +1209,7 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, (void) headerAddOrAppendEntry(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, &(flp->fileURL), 1); +/*@-sizeoftype@*/ if (sizeof(flp->fl_size) != sizeof(uint_32)) { uint_32 psize = (uint_32)flp->fl_size; (void) headerAddOrAppendEntry(h, RPMTAG_FILESIZES, RPM_INT32_TYPE, @@ -1247,6 +1248,7 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, (void) headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE, &(flp->fl_dev), 1); } +/*@=sizeoftype@*/ (void) headerAddOrAppendEntry(h, RPMTAG_FILEINODES, RPM_INT32_TYPE, &(flp->fl_ino), 1); @@ -2551,7 +2553,7 @@ static void printDeps(Header h) rpmTagType dvt = -1; int * flags = NULL; DepMsg_t * dm; - int count; + int count, xx; for (dm = depMsgs; dm->msg != NULL; dm++) { switch (dm->ntag) { @@ -2574,7 +2576,7 @@ static void printDeps(Header h) /*@switchbreak@*/ break; default: versions = hfd(versions, dvt); - (void) hge(h, dm->vtag, &dvt, (void **) &versions, NULL); + xx = hge(h, dm->vtag, &dvt, (void **) &versions, NULL); /*@switchbreak@*/ break; } switch (dm->ftag) { @@ -2584,7 +2586,7 @@ static void printDeps(Header h) case -1: /*@switchbreak@*/ break; default: - (void) hge(h, dm->ftag, NULL, (void **) &flags, NULL); + xx = hge(h, dm->ftag, NULL, (void **) &flags, NULL); /*@switchbreak@*/ break; } /*@-noeffect@*/ diff --git a/build/myftw.c b/build/myftw.c index 20708ec97..73004217a 100644 --- a/build/myftw.c +++ b/build/myftw.c @@ -192,7 +192,7 @@ int myftw (const char *dir, descriptors = 1; /*@access DIR@*/ - dirs = (DIR **) alloca (descriptors * sizeof (DIR *)); + dirs = (DIR **) alloca (descriptors * sizeof (*dirs)); i = descriptors; while (i-- > 0) dirs[i] = NULL; diff --git a/build/pack.c b/build/pack.c index 856051c01..9a7e9b714 100644 --- a/build/pack.c +++ b/build/pack.c @@ -293,12 +293,14 @@ int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead, } /* Get copy of lead */ + /*@-sizeoftype@*/ if ((rc = Fread(lead, sizeof(char), sizeof(*lead), fdi)) != sizeof(*lead)) { rpmError(RPMERR_BADMAGIC, _("readRPM: read %s: %s\n"), (fileName ? fileName : "<stdin>"), Fstrerror(fdi)); return RPMERR_BADMAGIC; } + /*@=sizeoftype@*/ /* XXX FIXME: EPIPE on <stdin> */ if (Fseek(fdi, 0, SEEK_SET) == -1) { diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 5c6400c85..933401b69 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -50,12 +50,13 @@ static rpmTag requiredTags[] = { static void addOrAppendListEntry(Header h, int_32 tag, char * line) /*@modifies h @*/ { + int xx; int argc; const char **argv; - (void) poptParseArgvString(line, &argc, &argv); + xx = poptParseArgvString(line, &argc, &argv); if (argc) - (void) headerAddOrAppendEntry(h, tag, RPM_STRING_ARRAY_TYPE, argv, argc); + xx = headerAddOrAppendEntry(h, tag, RPM_STRING_ARRAY_TYPE, argv, argc); argv = _free(argv); } @@ -370,7 +371,7 @@ static int readIcon(Header h, const char * file) icon = xmalloc(iconsize + 1); *icon = '\0'; - nb = Fread(icon, sizeof(char), iconsize, fd); + nb = Fread(icon, sizeof(icon[0]), iconsize, fd); if (Ferror(fd) || (size >= 0 && nb != size)) { rpmError(RPMERR_BADSPEC, _("Unable to read icon %s: %s\n"), fn, Fstrerror(fd)); @@ -462,6 +463,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, int len; int num; int rc; + int xx; if (field == NULL) return RPMERR_BADSPEC; /* XXX can't happen */ /* Find the start of the "field" and strip trailing space */ @@ -574,7 +576,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, } break; case RPMTAG_PREFIXES: addOrAppendListEntry(pkg->header, tag, field); - (void) hge(pkg->header, tag, &type, (void **)&array, &num); + xx = hge(pkg->header, tag, &type, (void **)&array, &num); while (num--) { len = strlen(array[num]); if (array[num][len - 1] == '/' && len > 1) { @@ -607,7 +609,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, spec->lineNum, spec->line); return RPMERR_BADSPEC; } - (void) headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1); + xx = headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1); break; case RPMTAG_AUTOREQPROV: pkg->autoReq = parseYesNo(field); @@ -830,7 +832,7 @@ static int findPreambleTag(Spec spec, /*@out@*/int * tag, int parsePreamble(Spec spec, int initialPackage) { int nextPart; - int tag, rc; + int tag, rc, xx; char *name, *linep; int flag; Package pkg; @@ -858,11 +860,11 @@ int parsePreamble(Spec spec, int initialPackage) /* Construct the package */ if (flag == PART_SUBNAME) { const char * mainName; - (void) headerNVR(spec->packages->header, &mainName, NULL, NULL); + xx = headerNVR(spec->packages->header, &mainName, NULL, NULL); sprintf(NVR, "%s-%s", mainName, name); } else strcpy(NVR, name); - (void) headerAddEntry(pkg->header, RPMTAG_NAME, RPM_STRING_TYPE, NVR, 1); + xx = headerAddEntry(pkg->header, RPMTAG_NAME, RPM_STRING_TYPE, NVR, 1); } if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { diff --git a/build/parseSpec.c b/build/parseSpec.c index c65c285ed..67a7a87c1 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -335,7 +335,7 @@ retry: } if (match != -1) { - rl = xmalloc(sizeof(struct ReadLevelEntry)); + rl = xmalloc(sizeof(*rl)); rl->reading = spec->readStack->reading && match; rl->next = spec->readStack; spec->readStack = rl; @@ -482,7 +482,8 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU closeSpec(spec); - spec->BASpecs = xcalloc(spec->BACount, sizeof(Spec)); + /* LCL: sizeof(spec->BASpecs[0]) -nullderef whine here */ + spec->BASpecs = xcalloc(spec->BACount, sizeof(*spec->BASpecs)); index = 0; if (spec->BANames != NULL) for (x = 0; x < spec->BACount; x++) { diff --git a/build/reqprov.c b/build/reqprov.c index 11ca71b38..18775014b 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -22,6 +22,7 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, rpmTag indextag = 0; int len; rpmsenseFlags extra = RPMSENSE_ANY; + int xx; if (depFlags & RPMSENSE_PROVIDES) { nametag = RPMTAG_PROVIDENAME; @@ -70,11 +71,11 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, int duplicate = 0; if (flagtag) { - (void) hge(h, versiontag, &dvt, (void **) &versions, NULL); - (void) hge(h, flagtag, NULL, (void **) &flags, NULL); + xx = hge(h, versiontag, &dvt, (void **) &versions, NULL); + xx = hge(h, flagtag, NULL, (void **) &flags, NULL); } if (indextag) - (void) hge(h, indextag, NULL, (void **) &indexes, NULL); + xx = hge(h, indextag, NULL, (void **) &indexes, NULL); while (len > 0) { len--; @@ -103,15 +104,15 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, } /* Add this dependency. */ - (void) headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &depName, 1); + xx = headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &depName, 1); if (flagtag) { - (void) headerAddOrAppendEntry(h, versiontag, + xx = headerAddOrAppendEntry(h, versiontag, RPM_STRING_ARRAY_TYPE, &depEVR, 1); - (void) headerAddOrAppendEntry(h, flagtag, + xx = headerAddOrAppendEntry(h, flagtag, RPM_INT32_TYPE, &depFlags, 1); } if (indextag) - (void) headerAddOrAppendEntry(h, indextag, RPM_INT32_TYPE, &index, 1); + xx = headerAddOrAppendEntry(h, indextag, RPM_INT32_TYPE, &index, 1); return 0; } diff --git a/build/spec.c b/build/spec.c index 319a4840b..c515b6e3c 100644 --- a/build/spec.c +++ b/build/spec.c @@ -299,7 +299,7 @@ int addSource(Spec spec, Package pkg, const char *field, int tag) } /* Create the entry and link it in */ - p = xmalloc(sizeof(struct Source)); + p = xmalloc(sizeof(*p)); p->num = num; p->fullSource = xstrdup(field); p->flags = flag; @@ -542,7 +542,7 @@ Spec freeSpec(Spec spec) { struct OpenFileInfo *ofi; - ofi = xmalloc(sizeof(struct OpenFileInfo)); + ofi = xmalloc(sizeof(*ofi)); ofi->fd = NULL; ofi->fileName = NULL; ofi->lineNum = 0; |