diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-12-13 18:16:39 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-12-13 18:16:39 +0200 |
commit | cbd7a684a4cd88bfa3383658790be3c37230707a (patch) | |
tree | 61c4cbe890438131ad44949fa92f1642508e48a5 /lib | |
parent | c8f2927227471758abbdb36781d885b01798f0f8 (diff) | |
download | librpm-tizen-cbd7a684a4cd88bfa3383658790be3c37230707a.tar.gz librpm-tizen-cbd7a684a4cd88bfa3383658790be3c37230707a.tar.bz2 librpm-tizen-cbd7a684a4cd88bfa3383658790be3c37230707a.zip |
Use rpm_count_t everywhere for header data count
- typedef'ed as uint32_t as that's the key size limit imposed by BDB,
relevant for RPM_BIN_TYPE
- easy to change to whatever later on as it's now consistent everywhere
- explicit casts where needed to avoid new warnings from signedness
Diffstat (limited to 'lib')
-rw-r--r-- | lib/formats.c | 2 | ||||
-rw-r--r-- | lib/legacy.c | 2 | ||||
-rw-r--r-- | lib/package.c | 2 | ||||
-rw-r--r-- | lib/psm.c | 6 | ||||
-rw-r--r-- | lib/rpmfi.c | 6 | ||||
-rw-r--r-- | lib/rpmfi.h | 4 | ||||
-rw-r--r-- | lib/rpmts.c | 6 | ||||
-rw-r--r-- | lib/rpmts.h | 4 | ||||
-rw-r--r-- | lib/signature.c | 6 |
9 files changed, 19 insertions, 19 deletions
diff --git a/lib/formats.c b/lib/formats.c index 38d893d49..7333368fc 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -637,7 +637,7 @@ static int triggercondsTag(Header h, rpmTagType * type, item = xmalloc(strlen(names[j]) + strlen(versions[j]) + 20); if (flags[j] & RPMSENSE_SENSEMASK) { buf[0] = '%', buf[1] = '\0'; - flagsStr = depflagsFormat(RPM_INT32_TYPE, flags, buf, 0, j); + flagsStr = depflagsFormat(RPM_INT32_TYPE, flags, buf, 0, 0); sprintf(item, "%s %s %s", names[j], flagsStr, versions[j]); flagsStr = _free(flagsStr); } else { diff --git a/lib/legacy.c b/lib/legacy.c index fde9b4b2f..4241282ab 100644 --- a/lib/legacy.c +++ b/lib/legacy.c @@ -102,7 +102,7 @@ exit: xx = hae(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, baseNames, count); xx = hae(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, - dirNames, dirIndex + 1); + dirNames, (rpm_count_t) dirIndex + 1); } fileNames = hfd(fileNames, fnt); diff --git a/lib/package.c b/lib/package.c index d2884c862..796b0aecb 100644 --- a/lib/package.c +++ b/lib/package.c @@ -486,7 +486,7 @@ verifyinfo_exit: dig->nbytes = 0; sig = memcpy(xmalloc(siglen), dataStart + info->offset, siglen); - (void) rpmtsSetSig(ts, info->tag, info->type, sig, info->count); + (void) rpmtsSetSig(ts, info->tag, info->type, sig, (size_t) info->count); switch (info->tag) { case RPMTAG_RSAHEADER: @@ -475,7 +475,7 @@ static pid_t psmWait(rpmpsm psm) * Run internal Lua script. */ static rpmRC runLuaScript(rpmpsm psm, Header h, rpmTag stag, - int progArgc, const char **progArgv, + unsigned int progArgc, const char **progArgv, const char *script, int arg1, int arg2) { const rpmts ts = psm->ts; @@ -572,7 +572,7 @@ static const char * ldconfig_path = "/sbin/ldconfig"; * @return 0 on success */ static rpmRC runScript(rpmpsm psm, Header h, rpmTag stag, - int progArgc, const char ** progArgv, + unsigned int progArgc, const char ** progArgv, const char * script, int arg1, int arg2) { const rpmts ts = psm->ts; @@ -1701,7 +1701,7 @@ assert(psm->mi == NULL); if (psm->goal == PSM_PKGINSTALL) { int32_t installTime = (int32_t) time(NULL); - int fc = rpmfiFC(fi); + rpm_count_t fc = rpmfiFC(fi); if (fi->h == NULL) break; /* XXX can't happen */ if (fi->fstates != NULL && fc > 0) diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 9b386c104..234f2fdfd 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -45,12 +45,12 @@ fprintf(stderr, "--> fi %p ++ %d %s\n", fi, fi->nrefs, msg); return fi; } -int rpmfiFC(rpmfi fi) +rpm_count_t rpmfiFC(rpmfi fi) { return (fi != NULL ? fi->fc : 0); } -int rpmfiDC(rpmfi fi) +rpm_count_t rpmfiDC(rpmfi fi) { return (fi != NULL ? fi->dc : 0); } @@ -768,7 +768,7 @@ assert(p != NULL); /* Add relocation values to the header */ if (numValid) { const char ** actualRelocations; - int numActual; + rpm_count_t numActual; actualRelocations = xmalloc(numValid * sizeof(*actualRelocations)); numActual = 0; diff --git a/lib/rpmfi.h b/lib/rpmfi.h index 0107962b9..ebce59fa7 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -108,7 +108,7 @@ rpmfi rpmfiLink (rpmfi fi, const char * msg); * @param fi file info set * @return current file count */ -int rpmfiFC(rpmfi fi); +rpm_count_t rpmfiFC(rpmfi fi); /** \ingroup rpmfi * Return current file index from file info set. @@ -130,7 +130,7 @@ int rpmfiSetFX(rpmfi fi, int fx); * @param fi file info set * @return current directory count */ -int rpmfiDC(rpmfi fi); +rpm_count_t rpmfiDC(rpmfi fi); /** \ingroup rpmfi * Return current directory index from file info set. diff --git a/lib/rpmts.c b/lib/rpmts.c index 3014674ca..88c5f9a11 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -1167,16 +1167,16 @@ const void * rpmtsSig(const rpmts ts) return sig; } -int32_t rpmtsSiglen(const rpmts ts) +size_t rpmtsSiglen(const rpmts ts) { - int32_t siglen = 0; + size_t siglen = 0; if (ts != NULL) siglen = ts->siglen; return siglen; } int rpmtsSetSig(rpmts ts, - int32_t sigtag, int32_t sigtype, const void * sig, int32_t siglen) + int32_t sigtag, int32_t sigtype, const void * sig, size_t siglen) { if (ts != NULL) { if (ts->sig && ts->sigtype) diff --git a/lib/rpmts.h b/lib/rpmts.h index 517d674e0..881c5c825 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -541,7 +541,7 @@ extern const void * rpmtsSig(const rpmts ts); * @param ts transaction set * @return signature tag data length */ -int32_t rpmtsSiglen(const rpmts ts); +size_t rpmtsSiglen(const rpmts ts); /** \ingroup rpmts * Set signature tag info, i.e. from header. @@ -554,7 +554,7 @@ int32_t rpmtsSiglen(const rpmts ts); */ int rpmtsSetSig(rpmts ts, int32_t sigtag, int32_t sigtype, - const void * sig, int32_t siglen); + const void * sig, size_t siglen); /** \ingroup rpmts * Get OpenPGP packet parameters, i.e. signature/pubkey constants. diff --git a/lib/signature.c b/lib/signature.c index fa723110f..977e78c4e 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -473,7 +473,7 @@ static int makePGPSignature(const char * file, int32_t * sigTagp, * @return 0 on success, 1 on failure */ static int makeGPGSignature(const char * file, int32_t * sigTagp, - uint8_t ** pktp, int32_t * pktlenp, + uint8_t ** pktp, size_t * pktlenp, const char * passPhrase) { char * sigfile = alloca(strlen(file)+sizeof(".sig")); @@ -613,7 +613,7 @@ static int makeHDRSignature(Header sigh, const char * file, int32_t sigTag, Header h = NULL; FD_t fd = NULL; uint8_t * pkt; - int32_t pktlen; + rpm_count_t pktlen; const char * fn = NULL; const char * SHA1 = NULL; int ret = -1; /* assume failure. */ @@ -715,7 +715,7 @@ int rpmAddSignature(Header sigh, const char * file, int32_t sigTag, { struct stat st; uint8_t * pkt; - int32_t pktlen; + rpm_count_t pktlen; int ret = -1; /* assume failure. */ switch (sigTag) { |