From addac6a86be1a6c7a668f97c9d7a0d85277f6779 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 19 Dec 2007 12:05:56 +0200 Subject: Add rpm_data_t (and _constdata_t) for header data, use everywhere - consistent, easy to grep for and change... - bogus consts removed where spotted --- lib/depends.c | 4 +-- lib/formats.c | 66 ++++++++++++++++++++++---------------------- lib/idtx.c | 4 +-- lib/legacy.c | 12 ++++---- lib/package.c | 10 +++---- lib/psm.c | 54 ++++++++++++++++++------------------ lib/rpmchecksig.c | 8 +++--- lib/rpmds.c | 12 ++++---- lib/rpmfi.c | 78 ++++++++++++++++++++++++++-------------------------- lib/rpminstall.c | 2 +- lib/rpmlib.h | 8 +++--- lib/rpmte.c | 8 +++--- lib/rpmts.c | 12 ++++---- lib/rpmts.h | 4 +-- lib/rpmts_internal.h | 2 +- lib/signature.c | 14 +++++----- lib/transaction.c | 4 +-- 17 files changed, 151 insertions(+), 151 deletions(-) (limited to 'lib') diff --git a/lib/depends.c b/lib/depends.c index 254138a05..87f381efd 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -128,9 +128,9 @@ int rpmtsAddInstallElement(rpmts ts, Header h, * FIXME: only catches previously added, older packages. */ arch = NULL; - xx = hge(h, RPMTAG_ARCH, NULL, (void **)&arch, NULL); + xx = hge(h, RPMTAG_ARCH, NULL, (rpm_data_t *)&arch, NULL); os = NULL; - xx = hge(h, RPMTAG_OS, NULL, (void **)&os, NULL); + xx = hge(h, RPMTAG_OS, NULL, (rpm_data_t *)&os, NULL); hcolor = headerGetColor(h); pkgKey = RPMAL_NOMATCH; diff --git a/lib/formats.c b/lib/formats.c index e548d24da..f41eb7e10 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -24,7 +24,7 @@ * @param element (unused) * @return formatted string */ -static char * triggertypeFormat(rpm_tagtype_t type, const void * data, +static char * triggertypeFormat(rpm_tagtype_t type, rpm_constdata_t data, char * formatPrefix, int padding, int element) { @@ -55,7 +55,7 @@ static char * triggertypeFormat(rpm_tagtype_t type, const void * data, * @param element (unused) * @return formatted string */ -static char * permsFormat(rpm_tagtype_t type, const void * data, +static char * permsFormat(rpm_tagtype_t type, rpm_constdata_t data, char * formatPrefix, int padding, int element) { char * val; @@ -83,7 +83,7 @@ static char * permsFormat(rpm_tagtype_t type, const void * data, * @param element (unused) * @return formatted string */ -static char * fflagsFormat(rpm_tagtype_t type, const void * data, +static char * fflagsFormat(rpm_tagtype_t type, rpm_constdata_t data, char * formatPrefix, int padding, int element) { char * val; @@ -129,7 +129,7 @@ static char * fflagsFormat(rpm_tagtype_t type, const void * data, * @param element no. bytes of binary data * @return formatted string */ -static char * armorFormat(rpm_tagtype_t type, const void * data, +static char * armorFormat(rpm_tagtype_t type, rpm_constdata_t data, char * formatPrefix, int padding, int element) { @@ -179,7 +179,7 @@ static char * armorFormat(rpm_tagtype_t type, const void * data, * @param element * @return formatted string */ -static char * base64Format(rpm_tagtype_t type, const void * data, +static char * base64Format(rpm_tagtype_t type, rpm_constdata_t data, char * formatPrefix, int padding, int element) { char * val; @@ -255,7 +255,7 @@ static char * xmlstrcpy(char * t, const char * s) * @param element (unused) * @return formatted string */ -static char * xmlFormat(rpm_tagtype_t type, const void * data, +static char * xmlFormat(rpm_tagtype_t type, rpm_constdata_t data, char * formatPrefix, int padding, int element) { @@ -346,7 +346,7 @@ static char * xmlFormat(rpm_tagtype_t type, const void * data, * @param element (unused) * @return formatted string */ -static char * pgpsigFormat(rpm_tagtype_t type, const void * data, +static char * pgpsigFormat(rpm_tagtype_t type, rpm_constdata_t data, char * formatPrefix, int padding, int element) { @@ -453,7 +453,7 @@ static char * pgpsigFormat(rpm_tagtype_t type, const void * data, * @param element (unused) * @return formatted string */ -static char * depflagsFormat(rpm_tagtype_t type, const void * data, +static char * depflagsFormat(rpm_tagtype_t type, rpm_constdata_t data, char * formatPrefix, int padding, int element) { char * val; @@ -491,7 +491,7 @@ static char * depflagsFormat(rpm_tagtype_t type, const void * data, * @return 0 on success */ static int fsnamesTag( Header h, int32_t * type, - void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { const char ** list; @@ -516,7 +516,7 @@ static int fsnamesTag( Header h, int32_t * type, * @return 0 on success */ static int instprefixTag(Header h, rpm_tagtype_t* type, - const void ** data, + rpm_data_t * data, rpm_count_t * count, int * freeData) { @@ -525,10 +525,10 @@ static int instprefixTag(Header h, rpm_tagtype_t* type, rpm_tagtype_t ipt; char ** array; - if (hge(h, RPMTAG_INSTALLPREFIX, type, (void **)data, count)) { + if (hge(h, RPMTAG_INSTALLPREFIX, type, (rpm_data_t *)data, count)) { if (freeData) *freeData = 0; return 0; - } else if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (void **) &array, count)) { + } else if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (rpm_data_t *) &array, count)) { if (type) *type = RPM_STRING_TYPE; if (data) *data = xstrdup(array[0]); if (freeData) *freeData = 1; @@ -549,7 +549,7 @@ static int instprefixTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int fssizesTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { HGE_t hge = (HGE_t)headerGetEntryMinMemory; @@ -558,7 +558,7 @@ static int fssizesTag(Header h, rpm_tagtype_t* type, uint32_t * usages; rpm_count_t numFiles; - if (!hge(h, RPMTAG_FILESIZES, NULL, (void **) &filesizes, &numFiles)) { + if (!hge(h, RPMTAG_FILESIZES, NULL, (rpm_data_t *) &filesizes, &numFiles)) { filesizes = NULL; numFiles = 0; filenames = NULL; @@ -599,7 +599,7 @@ static int fssizesTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int triggercondsTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { HGE_t hge = (HGE_t)headerGetEntryMinMemory; @@ -615,15 +615,15 @@ static int triggercondsTag(Header h, rpm_tagtype_t* type, int xx; char buf[5]; - if (!hge(h, RPMTAG_TRIGGERNAME, &tnt, (void **) &names, &numNames)) { + if (!hge(h, RPMTAG_TRIGGERNAME, &tnt, (rpm_data_t *) &names, &numNames)) { *freeData = 0; return 0; } - xx = hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, NULL); - xx = hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); - xx = hge(h, RPMTAG_TRIGGERVERSION, &tvt, (void **) &versions, NULL); - xx = hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); + xx = hge(h, RPMTAG_TRIGGERINDEX, NULL, (rpm_data_t *) &indices, NULL); + xx = hge(h, RPMTAG_TRIGGERFLAGS, NULL, (rpm_data_t *) &flags, NULL); + xx = hge(h, RPMTAG_TRIGGERVERSION, &tvt, (rpm_data_t *) &versions, NULL); + xx = hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (rpm_data_t *) &s, &numScripts); s = hfd(s, tst); *freeData = 1; @@ -672,7 +672,7 @@ static int triggercondsTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int triggertypeTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { HGE_t hge = (HGE_t)headerGetEntryMinMemory; @@ -685,13 +685,13 @@ static int triggertypeTag(Header h, rpm_tagtype_t* type, rpm_count_t numScripts, numNames; rpm_count_t i, j; - if (!hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, &numNames)) { + if (!hge(h, RPMTAG_TRIGGERINDEX, NULL, (rpm_data_t *) &indices, &numNames)) { *freeData = 0; return 1; } - xx = hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); - xx = hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); + xx = hge(h, RPMTAG_TRIGGERFLAGS, NULL, (rpm_data_t *) &flags, NULL); + xx = hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (rpm_data_t *) &s, &numScripts); s = hfd(s, tst); *freeData = 1; @@ -730,7 +730,7 @@ static int triggertypeTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int filenamesTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { *type = RPM_STRING_ARRAY_TYPE; @@ -749,7 +749,7 @@ static int filenamesTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int fileclassTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { *type = RPM_STRING_ARRAY_TYPE; @@ -768,7 +768,7 @@ static int fileclassTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int fileprovideTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { *type = RPM_STRING_ARRAY_TYPE; @@ -787,7 +787,7 @@ static int fileprovideTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int filerequireTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { *type = RPM_STRING_ARRAY_TYPE; @@ -816,7 +816,7 @@ static const char * _macro_i18ndomains = "%{?_i18ndomains}"; * @return 0 on success */ static int i18nTag(Header h, rpm_tag_t tag, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { HGE_t hge = (HGE_t)headerGetEntryMinMemory; @@ -884,7 +884,7 @@ static int i18nTag(Header h, rpm_tag_t tag, rpm_tagtype_t* type, dstring = _free(dstring); - rc = hge(h, tag, type, (void **)data, count); + rc = hge(h, tag, type, data, count); if (rc && (*data) != NULL) { *data = xstrdup(*data); @@ -908,7 +908,7 @@ static int i18nTag(Header h, rpm_tag_t tag, rpm_tagtype_t* type, * @return 0 on success */ static int summaryTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { return i18nTag(h, RPMTAG_SUMMARY, type, data, count, freeData); @@ -924,7 +924,7 @@ static int summaryTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int descriptionTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { return i18nTag(h, RPMTAG_DESCRIPTION, type, data, count, freeData); @@ -940,7 +940,7 @@ static int descriptionTag(Header h, rpm_tagtype_t* type, * @return 0 on success */ static int groupTag(Header h, rpm_tagtype_t* type, - const void ** data, rpm_count_t * count, + rpm_data_t * data, rpm_count_t * count, int * freeData) { return i18nTag(h, RPMTAG_GROUP, type, data, count, freeData); diff --git a/lib/idtx.c b/lib/idtx.c index 4d7e1f9ed..dfa898edc 100644 --- a/lib/idtx.c +++ b/lib/idtx.c @@ -81,7 +81,7 @@ IDTX IDTXload(rpmts ts, rpm_tag_t tag) int32_t * tidp; tidp = NULL; - if (!hge(h, tag, &type, (void **)&tidp, &count) || tidp == NULL) + if (!hge(h, tag, &type, (rpm_data_t *)&tidp, &count) || tidp == NULL) continue; if (type == RPM_INT32_TYPE && (*tidp == 0 || *tidp == -1)) @@ -153,7 +153,7 @@ IDTX IDTXglob(rpmts ts, const char * globstr, rpm_tag_t tag) } tidp = NULL; - if (hge(h, tag, &type, (void **) &tidp, &count) && tidp != NULL) { + if (hge(h, tag, &type, (rpm_data_t *) &tidp, &count) && tidp != NULL) { idtx = IDTXgrow(idtx, 1); if (idtx == NULL || idtx->idt == NULL) diff --git a/lib/legacy.c b/lib/legacy.c index 735889dc2..0d29c6cb3 100644 --- a/lib/legacy.c +++ b/lib/legacy.c @@ -49,7 +49,7 @@ void compressFilelist(Header h) return; /* Already converted. */ } - if (!hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &fileNames, &count)) + if (!hge(h, RPMTAG_OLDFILENAMES, &fnt, (rpm_data_t *) &fileNames, &count)) return; /* no file list */ if (fileNames == NULL || count <= 0) return; @@ -159,7 +159,7 @@ void providePackageNVR(Header h) return; pEVR = p = alloca(21 + strlen(version) + 1 + strlen(release) + 1); *p = '\0'; - if (hge(h, RPMTAG_EPOCH, NULL, (void **) &epoch, NULL)) { + if (hge(h, RPMTAG_EPOCH, NULL, (rpm_data_t *) &epoch, NULL)) { sprintf(p, "%d:", *epoch); while (*p != '\0') p++; @@ -170,13 +170,13 @@ void providePackageNVR(Header h) * Rpm prior to 3.0.3 does not have versioned provides. * If no provides at all are available, we can just add. */ - if (!hge(h, RPMTAG_PROVIDENAME, &pnt, (void **) &provides, &providesCount)) + if (!hge(h, RPMTAG_PROVIDENAME, &pnt, (rpm_data_t *) &provides, &providesCount)) goto exit; /* * Otherwise, fill in entries on legacy packages. */ - if (!hge(h, RPMTAG_PROVIDEVERSION, &pvt, (void **) &providesEVR, NULL)) { + if (!hge(h, RPMTAG_PROVIDEVERSION, &pvt, (rpm_data_t *) &providesEVR, NULL)) { for (i = 0; i < providesCount; i++) { const char * vdummy = ""; int32_t fdummy = RPMSENSE_ANY; @@ -188,7 +188,7 @@ void providePackageNVR(Header h) goto exit; } - xx = hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); + xx = hge(h, RPMTAG_PROVIDEFLAGS, NULL, (rpm_data_t *) &provideFlags, NULL); /* LCL: providesEVR is not NULL */ if (provides && providesEVR && provideFlags) @@ -236,7 +236,7 @@ void legacyRetrofit(Header h) * careful. This fixup makes queries give the new values though, * which is quite handy. */ - if (headerGetEntry(h, RPMTAG_DEFAULTPREFIX, NULL, (void **) &prefix, NULL)) + if (headerGetEntry(h, RPMTAG_DEFAULTPREFIX, NULL, (rpm_data_t *) &prefix, NULL)) { const char * nprefix = stripTrailingChar(alloca_strdup(prefix), '/'); (void) headerAddEntry(h, RPMTAG_PREFIXES, RPM_STRING_ARRAY_TYPE, diff --git a/lib/package.c b/lib/package.c index 9e1086774..0db650c54 100644 --- a/lib/package.c +++ b/lib/package.c @@ -90,7 +90,7 @@ void headerMergeLegacySigs(Header h, const Header sigh) rpm_tagtype_t type; rpm_tag_t tag; rpm_count_t count; - const void * ptr; + rpm_data_t ptr; int xx; for (hi = headerInitIterator(sigh); @@ -172,7 +172,7 @@ Header headerRegenSigHeader(const Header h, int noArchiveSize) rpm_count_t count; rpm_tag_t tag, stag; rpm_tagtype_t type; - const void * ptr; + rpm_data_t ptr; int xx; for (hi = headerInitIterator(h); @@ -685,7 +685,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) Header sigh = NULL; rpm_tag_t sigtag; rpm_tagtype_t sigtype; - const void * sig; + rpm_data_t sig; rpm_count_t siglen; rpmtsOpX opx; size_t nb; @@ -806,7 +806,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, Header * hdrp) /* Retrieve the tag parameters from the signature header. */ sig = NULL; - xx = headerGetEntry(sigh, sigtag, &sigtype, (void **) &sig, &siglen); + xx = headerGetEntry(sigh, sigtag, &sigtype, &sig, &siglen); if (sig == NULL) { rc = RPMRC_FAIL; goto exit; @@ -956,7 +956,7 @@ rpmRC headerCheckPayloadFormat(Header h) { const char *payloadfmt = NULL; xx = headerGetEntry(h, RPMTAG_PAYLOADFORMAT, NULL, - (void **)&payloadfmt, NULL); + (rpm_data_t *)&payloadfmt, NULL); /* * XXX Ugh, rpm 3.x packages don't have payload format tag. Instead * of blinly allowing, should check somehow (HDRID existence or... ?) diff --git a/lib/psm.c b/lib/psm.c index f4ce17b51..e8bf7ec47 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -83,9 +83,9 @@ int rpmVersionCompare(Header first, Header second) static int32_t zero = 0; int rc; - if (!headerGetEntry(first, RPMTAG_EPOCH, NULL, (void **) &epochOne, NULL)) + if (!headerGetEntry(first, RPMTAG_EPOCH, NULL, (rpm_data_t *) &epochOne, NULL)) epochOne = &zero; - if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, (void **) &epochTwo, NULL)) + if (!headerGetEntry(second, RPMTAG_EPOCH, NULL, (rpm_data_t *) &epochTwo, NULL)) epochTwo = &zero; if (*epochOne < *epochTwo) @@ -93,15 +93,15 @@ int rpmVersionCompare(Header first, Header second) else if (*epochOne > *epochTwo) return 1; - rc = headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL); - rc = headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL); + rc = headerGetEntry(first, RPMTAG_VERSION, NULL, (rpm_data_t *) &one, NULL); + rc = headerGetEntry(second, RPMTAG_VERSION, NULL, (rpm_data_t *) &two, NULL); rc = rpmvercmp(one, two); if (rc) return rc; - rc = headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL); - rc = headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL); + rc = headerGetEntry(first, RPMTAG_RELEASE, NULL, (rpm_data_t *) &one, NULL); + rc = headerGetEntry(second, RPMTAG_RELEASE, NULL, (rpm_data_t *) &two, NULL); return rpmvercmp(one, two); } @@ -141,7 +141,7 @@ const char ** argv; rpm_tagtype_t type; for (tagm = tagMacros; tagm->macroname != NULL; tagm++) { - if (!hge(h, tagm->tag, &type, (void **) &body, NULL)) + if (!hge(h, tagm->tag, &type, (rpm_data_t *) &body, NULL)) continue; switch (type) { case RPM_INT32_TYPE: @@ -218,7 +218,7 @@ static rpmRC markReplacedFiles(const rpmpsm psm) modified = 0; - if (!hge(h, RPMTAG_FILESTATES, NULL, (void **)&secStates, &count)) + if (!hge(h, RPMTAG_FILESTATES, NULL, (rpm_data_t *)&secStates, &count)) continue; prev = rpmdbGetIteratorOffset(mi); @@ -316,7 +316,7 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, if (cookie) { *cookie = NULL; - if (hge(fi->h, RPMTAG_COOKIE, NULL, (void **) cookie, NULL)) + if (hge(fi->h, RPMTAG_COOKIE, NULL, (rpm_data_t *) cookie, NULL)) *cookie = xstrdup(*cookie); } @@ -639,7 +639,7 @@ static rpmRC runScript(rpmpsm psm, Header h, rpm_tag_t stag, /* XXX FIXME: except for %verifyscript, rpmteNEVR can be used. */ xx = headerNVR(h, &n, &v, &r); - xx = hge(h, RPMTAG_ARCH, NULL, (void **) &a, NULL); + xx = hge(h, RPMTAG_ARCH, NULL, (rpm_data_t *) &a, NULL); if (progArgv && strcmp(progArgv[0], "") == 0) { #ifdef WITH_LUA @@ -719,9 +719,9 @@ static rpmRC runScript(rpmpsm psm, Header h, rpm_tag_t stag, } #endif - if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (void **) &prefixes, &numPrefixes)) { + if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (rpm_data_t *) &prefixes, &numPrefixes)) { freePrefixes = 1; - } else if (hge(h, RPMTAG_INSTALLPREFIX, NULL, (void **) &oldPrefix, NULL)) { + } else if (hge(h, RPMTAG_INSTALLPREFIX, NULL, (rpm_data_t *) &oldPrefix, NULL)) { prefixes = &oldPrefix; numPrefixes = 1; } else { @@ -943,11 +943,11 @@ static rpmRC runInstScript(rpmpsm psm) rpmfi fi = psm->fi; HGE_t hge = fi->hge; HFD_t hfd = (fi->hfd ? fi->hfd : headerFreeData); - void ** progArgv; + rpm_data_t * progArgv; rpm_count_t progArgc; const char ** argv; rpm_tagtype_t ptt, stt; - const char * script; + char * script; rpmRC rc = RPMRC_OK; int xx; @@ -955,8 +955,8 @@ static rpmRC runInstScript(rpmpsm psm) * headerGetEntry() sets the data pointer to NULL if the entry does * not exist. */ - xx = hge(fi->h, psm->scriptTag, &stt, (void **) &script, NULL); - xx = hge(fi->h, psm->progTag, &ptt, (void **) &progArgv, &progArgc); + xx = hge(fi->h, psm->scriptTag, &stt, (rpm_data_t *) &script, NULL); + xx = hge(fi->h, psm->progTag, &ptt, (rpm_data_t *) &progArgv, &progArgc); if (progArgv == NULL && script == NULL) goto exit; @@ -1035,11 +1035,11 @@ static rpmRC handleOneTrigger(const rpmpsm psm, continue; if (!( hge(triggeredH, RPMTAG_TRIGGERINDEX, &tit, - (void **) &triggerIndices, NULL) && + (rpm_data_t *) &triggerIndices, NULL) && hge(triggeredH, RPMTAG_TRIGGERSCRIPTS, &tst, - (void **) &triggerScripts, NULL) && + (rpm_data_t *) &triggerScripts, NULL) && hge(triggeredH, RPMTAG_TRIGGERSCRIPTPROG, &tpt, - (void **) &triggerProgs, NULL)) + (rpm_data_t *) &triggerProgs, NULL)) ) continue; @@ -1140,9 +1140,9 @@ static rpmRC runImmedTriggers(rpmpsm psm) if (fi->h == NULL) return rc; /* XXX can't happen */ if (!( hge(fi->h, RPMTAG_TRIGGERNAME, &tnt, - (void **) &triggerNames, &numTriggers) && + (rpm_data_t *) &triggerNames, &numTriggers) && hge(fi->h, RPMTAG_TRIGGERINDEX, &tit, - (void **) &triggerIndices, &numTriggerIndices)) + (rpm_data_t *) &triggerIndices, &numTriggerIndices)) ) return rc; @@ -1438,7 +1438,7 @@ assert(psm->mi == NULL); * need the leading / stripped. */ { const char * p; - xx = hge(fi->h, RPMTAG_DEFAULTPREFIX, NULL, (void **) &p, NULL); + xx = hge(fi->h, RPMTAG_DEFAULTPREFIX, NULL, (rpm_data_t *) &p, NULL); fi->striplen = (xx ? strlen(p) + 1 : 1); } fi->mapflags = @@ -1451,10 +1451,10 @@ assert(psm->mi == NULL); if (fi->fuser == NULL) xx = hge(fi->h, RPMTAG_FILEUSERNAME, NULL, - (void **) &fi->fuser, NULL); + (rpm_data_t *) &fi->fuser, NULL); if (fi->fgroup == NULL) xx = hge(fi->h, RPMTAG_FILEGROUPNAME, NULL, - (void **) &fi->fgroup, NULL); + (rpm_data_t *) &fi->fgroup, NULL); rc = RPMRC_OK; } if (psm->goal == PSM_PKGERASE || psm->goal == PSM_PKGSAVE) { @@ -1559,7 +1559,7 @@ assert(psm->mi == NULL); rpm_tagtype_t type; rpm_tag_t tag; rpm_count_t count; - hPTR_t ptr; + rpm_data_t ptr; Header oh; /* Load the original header from the blob. */ @@ -1570,7 +1570,7 @@ assert(psm->mi == NULL); for (hi = headerInitIterator(oh); headerNextIterator(hi, &tag, &type, &ptr, &count); - ptr = headerFreeData((void *)ptr, type)) + ptr = headerFreeData(ptr, type)) { if (tag == RPMTAG_ARCHIVESIZE) noArchiveSize = 1; @@ -1985,7 +1985,7 @@ assert(psm->mi == NULL); char * t; if (!hge(fi->h, RPMTAG_PAYLOADCOMPRESSOR, NULL, - (void **) &payload_compressor, NULL)) + (rpm_data_t *) &payload_compressor, NULL)) payload_compressor = "gzip"; psm->rpmio_flags = t = xmalloc(sizeof("w9.gzdio")); *t = '\0'; diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 9d62bfc38..d909faad7 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -110,7 +110,7 @@ exit: */ static int getSignid(Header sig, rpm_tag_t sigtag, pgpKeyID_t signid) { - void * pkt = NULL; + rpm_data_t pkt = NULL; rpm_tagtype_t pkttyp = 0; rpm_count_t pktlen = 0; int rc = 1; @@ -213,7 +213,7 @@ static int rpmReSign(rpmts ts, rpm_tagtype_t type; rpm_tag_t tag; rpm_count_t count; - hPTR_t ptr; + rpm_data_t ptr; Header oh; Header nh; @@ -516,7 +516,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, char untrustedKeys[7164], * u; rpm_tag_t sigtag; rpm_tagtype_t sigtype; - const void * sig; + rpm_data_t sig; pgpDig dig; pgpDigParams sigp; rpm_count_t siglen; @@ -586,7 +586,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, /* XXX RSA needs the hash_algo, so decode early. */ if (sigtag == RPMSIGTAG_RSA || sigtag == RPMSIGTAG_PGP) { - xx = headerGetEntry(sigh, sigtag, &sigtype, (void **)&sig, &siglen); + xx = headerGetEntry(sigh, sigtag, &sigtype, (rpm_data_t *)&sig, &siglen); xx = pgpPrtPkts(sig, siglen, dig, 0); sig = headerFreeData(sig, sigtype); /* XXX assume same hash_algo in header-only and header+payload */ diff --git a/lib/rpmds.c b/lib/rpmds.c index 6337b2154..79720e618 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -159,7 +159,7 @@ rpmds rpmdsNew(Header h, rpm_tag_t tagN, int flags) } else goto exit; - if (hge(h, tagN, &Nt, (void **) &N, &Count) + if (hge(h, tagN, &Nt, (rpm_data_t *) &N, &Count) && N != NULL && Count > 0) { int xx; @@ -175,12 +175,12 @@ rpmds rpmdsNew(Header h, rpm_tag_t tagN, int flags) ds->Count = Count; ds->nopromote = _rpmds_nopromote; - xx = hge(h, tagEVR, &ds->EVRt, (void **) &ds->EVR, NULL); - xx = hge(h, tagF, &ds->Ft, (void **) &ds->Flags, NULL); + xx = hge(h, tagEVR, &ds->EVRt, (rpm_data_t *) &ds->EVR, NULL); + xx = hge(h, tagF, &ds->Ft, (rpm_data_t *) &ds->Flags, NULL); if (!scareMem && ds->Flags != NULL) ds->Flags = memcpy(xmalloc(ds->Count * sizeof(*ds->Flags)), ds->Flags, ds->Count * sizeof(*ds->Flags)); - xx = hge(h, tagBT, &BTt, (void **) &BTp, NULL); + xx = hge(h, tagBT, &BTt, (rpm_data_t *) &BTp, NULL); ds->BT = (xx && BTp != NULL && BTt == RPM_INT32_TYPE ? *BTp : 0); ds->Color = xcalloc(Count, sizeof(*ds->Color)); ds->Refs = xcalloc(Count, sizeof(*ds->Refs)); @@ -271,7 +271,7 @@ rpmds rpmdsThis(Header h, rpm_tag_t tagN, int32_t Flags) xx = headerNVR(h, &n, &v, &r); ep = NULL; - xx = hge(h, RPMTAG_EPOCH, NULL, (void **)&ep, NULL); + xx = hge(h, RPMTAG_EPOCH, NULL, (rpm_data_t *)&ep, NULL); t = xmalloc(sizeof(*N) + strlen(n) + 1); N = (const char **) t; @@ -964,7 +964,7 @@ int rpmdsNVRMatchesDep(const Header h, const rpmds req, int nopromote) t = alloca(21 + strlen(v) + 1 + strlen(r) + 1); pkgEVR = t; *t = '\0'; - if (hge(h, RPMTAG_EPOCH, NULL, (void **) &epoch, NULL)) { + if (hge(h, RPMTAG_EPOCH, NULL, (rpm_data_t *) &epoch, NULL)) { sprintf(t, "%d:", *epoch); while (*t != '\0') t++; diff --git a/lib/rpmfi.c b/lib/rpmfi.c index ab544afa2..8c05d2942 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -650,7 +650,7 @@ Header relocateFileList(const rpmts ts, rpmfi fi, int i, j, xx; if (!hge(origH, RPMTAG_PREFIXES, &validType, - (void **) &validRelocations, &numValid)) + (rpm_data_t *) &validRelocations, &numValid)) numValid = 0; assert(p != NULL); @@ -792,18 +792,18 @@ assert(p != NULL); if (numActual) xx = hae(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE, - (void **) actualRelocations, numActual); + (rpm_data_t *) actualRelocations, numActual); actualRelocations = _free(actualRelocations); validRelocations = hfd(validRelocations, validType); } - xx = hge(h, RPMTAG_BASENAMES, NULL, (void **) &baseNames, &fileCount); - xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, &dirCount); - xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fFlags, NULL); - xx = hge(h, RPMTAG_FILECOLORS, NULL, (void **) &fColors, NULL); - xx = hge(h, RPMTAG_FILEMODES, NULL, (void **) &fModes, NULL); + xx = hge(h, RPMTAG_BASENAMES, NULL, (rpm_data_t *) &baseNames, &fileCount); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (rpm_data_t *) &dirIndexes, NULL); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (rpm_data_t *) &dirNames, &dirCount); + xx = hge(h, RPMTAG_FILEFLAGS, NULL, (rpm_data_t *) &fFlags, NULL); + xx = hge(h, RPMTAG_FILECOLORS, NULL, (rpm_data_t *) &fColors, NULL); + xx = hge(h, RPMTAG_FILEMODES, NULL, (rpm_data_t *) &fModes, NULL); dColors = alloca(dirCount * sizeof(*dColors)); memset(dColors, 0, dirCount * sizeof(*dColors)); @@ -1023,16 +1023,16 @@ dColors[j] |= fColors[i]; xx = hme(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, baseNames, fileCount); fi->bnl = hfd(fi->bnl, RPM_STRING_ARRAY_TYPE); - xx = hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc); + xx = hge(h, RPMTAG_BASENAMES, NULL, (rpm_data_t *) &fi->bnl, &fi->fc); xx = hme(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames, dirCount); fi->dnl = hfd(fi->dnl, RPM_STRING_ARRAY_TYPE); - xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (rpm_data_t *) &fi->dnl, &fi->dc); xx = hme(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, fileCount); - xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (rpm_data_t *) &fi->dil, NULL); } baseNames = hfd(baseNames, RPM_STRING_ARRAY_TYPE); @@ -1142,7 +1142,7 @@ static inline unsigned char nibble(char c) /* XXX Ick, not SEF. */ #define _fdupestring(_h, _tag, _data) \ - if (hge((_h), (_tag), NULL, (void **) &(_data), NULL)) \ + if (hge((_h), (_tag), NULL, (rpm_data_t *) &(_data), NULL)) \ _data = xstrdup(_data) rpmfi rpmfiNew(const rpmts ts, Header h, rpm_tag_t tagN, int scareMem) @@ -1188,7 +1188,7 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpm_tag_t tagN, int scareMem) fi->fsm = newFSM(); /* 0 means unknown */ - xx = hge(h, RPMTAG_ARCHIVESIZE, NULL, (void **) &uip, NULL); + xx = hge(h, RPMTAG_ARCHIVESIZE, NULL, (rpm_data_t *) &uip, NULL); fi->archivePos = 0; fi->archiveSize = (xx ? *uip : 0); @@ -1198,31 +1198,31 @@ rpmfi rpmfiNew(const rpmts ts, Header h, rpm_tag_t tagN, int scareMem) _fdupestring(h, RPMTAG_POSTTRANS, fi->posttrans); _fdupestring(h, RPMTAG_POSTTRANSPROG, fi->posttransprog); - if (!hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc)) { + if (!hge(h, RPMTAG_BASENAMES, NULL, (rpm_data_t *) &fi->bnl, &fi->fc)) { fi->fc = 0; fi->dc = 0; goto exit; } - xx = hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); - xx = hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); - xx = hge(h, RPMTAG_FILEMODES, NULL, (void **) &fi->fmodes, NULL); - xx = hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fi->fflags, NULL); - xx = hge(h, RPMTAG_FILEVERIFYFLAGS, NULL, (void **) &fi->vflags, NULL); - xx = hge(h, RPMTAG_FILESIZES, NULL, (void **) &fi->fsizes, NULL); - - xx = hge(h, RPMTAG_FILECOLORS, NULL, (void **) &fi->fcolors, NULL); + xx = hge(h, RPMTAG_DIRNAMES, NULL, (rpm_data_t *) &fi->dnl, &fi->dc); + xx = hge(h, RPMTAG_DIRINDEXES, NULL, (rpm_data_t *) &fi->dil, NULL); + xx = hge(h, RPMTAG_FILEMODES, NULL, (rpm_data_t *) &fi->fmodes, NULL); + xx = hge(h, RPMTAG_FILEFLAGS, NULL, (rpm_data_t *) &fi->fflags, NULL); + xx = hge(h, RPMTAG_FILEVERIFYFLAGS, NULL, (rpm_data_t *) &fi->vflags, NULL); + xx = hge(h, RPMTAG_FILESIZES, NULL, (rpm_data_t *) &fi->fsizes, NULL); + + xx = hge(h, RPMTAG_FILECOLORS, NULL, (rpm_data_t *) &fi->fcolors, NULL); fi->color = 0; if (fi->fcolors != NULL) for (i = 0; i < fi->fc; i++) fi->color |= fi->fcolors[i]; - xx = hge(h, RPMTAG_CLASSDICT, NULL, (void **) &fi->cdict, &fi->ncdict); - xx = hge(h, RPMTAG_FILECLASS, NULL, (void **) &fi->fcdictx, NULL); + xx = hge(h, RPMTAG_CLASSDICT, NULL, (rpm_data_t *) &fi->cdict, &fi->ncdict); + xx = hge(h, RPMTAG_FILECLASS, NULL, (rpm_data_t *) &fi->fcdictx, NULL); - xx = hge(h, RPMTAG_DEPENDSDICT, NULL, (void **) &fi->ddict, &fi->nddict); - xx = hge(h, RPMTAG_FILEDEPENDSX, NULL, (void **) &fi->fddictx, NULL); - xx = hge(h, RPMTAG_FILEDEPENDSN, NULL, (void **) &fi->fddictn, NULL); + xx = hge(h, RPMTAG_DEPENDSDICT, NULL, (rpm_data_t *) &fi->ddict, &fi->nddict); + xx = hge(h, RPMTAG_FILEDEPENDSX, NULL, (rpm_data_t *) &fi->fddictx, NULL); + xx = hge(h, RPMTAG_FILEDEPENDSN, NULL, (rpm_data_t *) &fi->fddictn, NULL); - xx = hge(h, RPMTAG_FILESTATES, NULL, (void **) &fi->fstates, NULL); + xx = hge(h, RPMTAG_FILESTATES, NULL, (rpm_data_t *) &fi->fstates, NULL); if (xx == 0 || fi->fstates == NULL) fi->fstates = xcalloc(fi->fc, sizeof(*fi->fstates)); else @@ -1240,11 +1240,11 @@ if (fi->actions == NULL) fi->mapflags = CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID; - xx = hge(h, RPMTAG_FILELINKTOS, NULL, (void **) &fi->flinks, NULL); - xx = hge(h, RPMTAG_FILELANGS, NULL, (void **) &fi->flangs, NULL); + xx = hge(h, RPMTAG_FILELINKTOS, NULL, (rpm_data_t *) &fi->flinks, NULL); + xx = hge(h, RPMTAG_FILELANGS, NULL, (rpm_data_t *) &fi->flangs, NULL); fi->fmd5s = NULL; - xx = hge(h, RPMTAG_FILEMD5S, NULL, (void **) &fi->fmd5s, NULL); + xx = hge(h, RPMTAG_FILEMD5S, NULL, (rpm_data_t *) &fi->fmd5s, NULL); fi->md5s = NULL; if (fi->fmd5s) { @@ -1267,14 +1267,14 @@ if (fi->actions == NULL) } /* XXX TR_REMOVED doesn;t need fmtimes, frdevs, finodes, or fcontexts */ - xx = hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &fi->fmtimes, NULL); - xx = hge(h, RPMTAG_FILERDEVS, NULL, (void **) &fi->frdevs, NULL); - xx = hge(h, RPMTAG_FILEINODES, NULL, (void **) &fi->finodes, NULL); + xx = hge(h, RPMTAG_FILEMTIMES, NULL, (rpm_data_t *) &fi->fmtimes, NULL); + xx = hge(h, RPMTAG_FILERDEVS, NULL, (rpm_data_t *) &fi->frdevs, NULL); + xx = hge(h, RPMTAG_FILEINODES, NULL, (rpm_data_t *) &fi->finodes, NULL); fi->replacedSizes = xcalloc(fi->fc, sizeof(*fi->replacedSizes)); - xx = hge(h, RPMTAG_FILEUSERNAME, NULL, (void **) &fi->fuser, NULL); - xx = hge(h, RPMTAG_FILEGROUPNAME, NULL, (void **) &fi->fgroup, NULL); + xx = hge(h, RPMTAG_FILEUSERNAME, NULL, (rpm_data_t *) &fi->fuser, NULL); + xx = hge(h, RPMTAG_FILEGROUPNAME, NULL, (rpm_data_t *) &fi->fgroup, NULL); if (ts != NULL) if (fi != NULL) @@ -1561,14 +1561,14 @@ void rpmfiBuildFNames(Header h, rpm_tag_t tagN, dirIndexesTag = RPMTAG_ORIGDIRINDEXES; } - if (!hge(h, tagN, &bnt, (void **) &baseNames, &count)) { + if (!hge(h, tagN, &bnt, (rpm_data_t *) &baseNames, &count)) { if (fnp) *fnp = NULL; if (fcp) *fcp = 0; return; /* no file list */ } - xx = hge(h, dirNameTag, &dnt, (void **) &dirNames, NULL); - xx = hge(h, dirIndexesTag, NULL, (void **) &dirIndexes, &count); + xx = hge(h, dirNameTag, &dnt, (rpm_data_t *) &dirNames, NULL); + xx = hge(h, dirIndexesTag, NULL, (rpm_data_t *) &dirIndexes, &count); size = sizeof(*fileNames) * count; for (i = 0; i < count; i++) diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 9eea1f8e1..1e11b416a 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -477,7 +477,7 @@ if (fileURL[0] == '=') { rpm_count_t c; if (headerGetEntry(eiu->h, RPMTAG_PREFIXES, &pft, - (void **) &paths, &c) && (c == 1)) + (rpm_data_t *) &paths, &c) && (c == 1)) { eiu->relocations->oldPath = xstrdup(paths[0]); paths = headerFreeData(paths, pft); diff --git a/lib/rpmlib.h b/lib/rpmlib.h index a8a330dde..77840602b 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -188,7 +188,7 @@ void rpmFreeRpmrc(void); * @return NULL always */ typedef - void * (*HFD_t) (const void * data, rpm_tagtype_t type); + void * (*HFD_t) (rpm_data_t data, rpm_tagtype_t type); /** * Prototype for headerGetEntry() vector. @@ -206,7 +206,7 @@ typedef */ typedef int (*HGE_t) (Header h, rpm_tag_t tag, rpm_tagtype_t * type, - void ** p, + rpm_data_t * p, rpm_count_t * c); /** @@ -225,7 +225,7 @@ typedef int (*HGE_t) (Header h, rpm_tag_t tag, * @return 1 on success, 0 on failure */ typedef int (*HAE_t) (Header h, rpm_tag_t tag, rpm_tagtype_t type, - const void * p, rpm_count_t c); + rpm_constdata_t p, rpm_count_t c); /** * Prototype for headerModifyEntry() vector. @@ -239,7 +239,7 @@ typedef int (*HAE_t) (Header h, rpm_tag_t tag, rpm_tagtype_t type, * @return 1 on success, 0 on failure */ typedef int (*HME_t) (Header h, rpm_tag_t tag, rpm_tagtype_t type, - const void * p, rpm_count_t c); + rpm_constdata_t p, rpm_count_t c); /** * Prototype for headerRemoveEntry() vector. diff --git a/lib/rpmte.c b/lib/rpmte.c index 940fe004a..e0d94bd11 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -96,7 +96,7 @@ static void addTE(rpmts ts, rpmte p, Header h, p->db_instance = 0; arch = NULL; - xx = hge(h, RPMTAG_ARCH, NULL, (void **)&arch, NULL); + xx = hge(h, RPMTAG_ARCH, NULL, (rpm_data_t *)&arch, NULL); if (arch != NULL) { p->arch = xstrdup(arch); p->archScore = rpmMachineScore(RPM_MACHTABLE_INSTARCH, arch); @@ -105,7 +105,7 @@ static void addTE(rpmts ts, rpmte p, Header h, p->archScore = 0; } os = NULL; - xx = hge(h, RPMTAG_OS, NULL, (void **)&os, NULL); + xx = hge(h, RPMTAG_OS, NULL, (rpm_data_t *)&os, NULL); if (os != NULL) { p->os = xstrdup(os); p->osScore = rpmMachineScore(RPM_MACHTABLE_INSTOS, os); @@ -130,7 +130,7 @@ static void addTE(rpmts ts, rpmte p, Header h, t = stpcpy( stpcpy( t, "."), p->arch); ep = NULL; - xx = hge(h, RPMTAG_EPOCH, NULL, (void **)&ep, NULL); + xx = hge(h, RPMTAG_EPOCH, NULL, (rpm_data_t *)&ep, NULL); if (ep) { p->epoch = xmalloc(20); sprintf(p->epoch, "%d", *ep); @@ -203,7 +203,7 @@ rpmte rpmteNew(const rpmts ts, Header h, case TR_ADDED: p->u.addedKey = pkgKey; ep = NULL; - xx = headerGetEntry(h, RPMTAG_SIGSIZE, NULL, (void **)&ep, NULL); + xx = headerGetEntry(h, RPMTAG_SIGSIZE, NULL, (rpm_data_t *)&ep, NULL); /* XXX 256 is only an estimate of signature header. */ if (ep != NULL) p->pkgFileSize += 96 + 256 + *ep; diff --git a/lib/rpmts.c b/lib/rpmts.c index 452ec4801..9a0d0efc2 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -300,7 +300,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p rpm_tagtype_t pt; rpm_count_t pc; - if (!headerGetEntry(h, RPMTAG_PUBKEYS, &pt, (void **)&pubkeys, &pc)) + if (!headerGetEntry(h, RPMTAG_PUBKEYS, &pt, (rpm_data_t *)&pubkeys, &pc)) continue; hx = rpmdbGetIteratorOffset(mi); ix = rpmdbGetIteratorFileNum(mi); @@ -636,7 +636,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data) /* XXX Prefer the shortest name if given alternatives. */ hname = NULL; hnamelen = 0; - if (headerGetEntry(h, RPMTAG_NAME, NULL, (void **)&hname, NULL)) { + if (headerGetEntry(h, RPMTAG_NAME, NULL, (rpm_data_t *)&hname, NULL)) { if (hname) hnamelen = strlen(hname); } @@ -645,7 +645,7 @@ int rpmtsSolve(rpmts ts, rpmds ds, const void * data) /* XXX Prefer the newest build if given alternatives. */ htime = 0; - if (headerGetEntry(h, RPMTAG_BUILDTIME, NULL, (void **)&ip, NULL)) + if (headerGetEntry(h, RPMTAG_BUILDTIME, NULL, (rpm_data_t *)&ip, NULL)) htime = (time_t)*ip; if (htime <= bhtime) @@ -1157,9 +1157,9 @@ rpm_tagtype_t rpmtsSigtype(const rpmts ts) return sigtype; } -const void * rpmtsSig(const rpmts ts) +rpm_constdata_t rpmtsSig(const rpmts ts) { - const void * sig = NULL; + rpm_constdata_t sig = NULL; if (ts != NULL) sig = ts->sig; return sig; @@ -1174,7 +1174,7 @@ size_t rpmtsSiglen(const rpmts ts) } int rpmtsSetSig(rpmts ts, rpm_tag_t sigtag, rpm_tagtype_t sigtype, - const void * sig, size_t siglen) + rpm_data_t sig, size_t siglen) { if (ts != NULL) { if (ts->sig && ts->sigtype) diff --git a/lib/rpmts.h b/lib/rpmts.h index cccd1ff3a..122cd66ef 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -534,7 +534,7 @@ rpm_tagtype_t rpmtsSigtype(const rpmts ts); * @param ts transaction set * @return signature tag data */ -extern const void * rpmtsSig(const rpmts ts); +rpm_constdata_t rpmtsSig(const rpmts ts); /** \ingroup rpmts * Get signature tag data length, i.e. no. of bytes of data. @@ -554,7 +554,7 @@ size_t rpmtsSiglen(const rpmts ts); */ int rpmtsSetSig(rpmts ts, rpm_tag_t sigtag, rpm_tagtype_t sigtype, - const void * sig, size_t siglen); + rpm_data_t sig, size_t siglen); /** \ingroup rpmts * Get OpenPGP packet parameters, i.e. signature/pubkey constants. diff --git a/lib/rpmts_internal.h b/lib/rpmts_internal.h index a5fc5305c..0e0ad6d79 100644 --- a/lib/rpmts_internal.h +++ b/lib/rpmts_internal.h @@ -99,7 +99,7 @@ struct rpmts_s { const char * fn; /*!< Current package fn. */ rpm_tag_t sigtag; /*!< Current package signature tag. */ rpm_tagtype_t sigtype; /*!< Current package signature data type. */ - const void * sig; /*!< Current package signature. */ + rpm_data_t sig; /*!< Current package signature. */ size_t siglen; /*!< Current package signature length. */ uint8_t * pkpkt;/*!< Current pubkey packet. */ diff --git a/lib/signature.c b/lib/signature.c index df038aafd..853d997c3 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -280,7 +280,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * sighp, sigType sig_type, char ** msg) } /* Print package component sizes. */ - if (headerGetEntry(sigh, RPMSIGTAG_SIZE, NULL,(void **)&archSize, NULL)) { + if (headerGetEntry(sigh, RPMSIGTAG_SIZE, NULL,(rpm_data_t *)&archSize, NULL)) { rc = printSize(fd, sigSize, pad, *archSize); if (rc != RPMRC_OK) (void) snprintf(buf, sizeof(buf), @@ -924,7 +924,7 @@ static const char * rpmSigString(rpmRC res) static rpmRC verifySizeSignature(const rpmts ts, char * t) { - const void * sig = rpmtsSig(ts); + rpm_constdata_t sig = rpmtsSig(ts); pgpDig dig = rpmtsDig(ts); rpmRC res; size_t size = 0x7fffffff; @@ -959,7 +959,7 @@ static rpmRC verifyMD5Signature(const rpmts ts, char * t, DIGEST_CTX md5ctx) { - const void * sig = rpmtsSig(ts); + rpm_constdata_t sig = rpmtsSig(ts); size_t siglen = rpmtsSiglen(ts); pgpDig dig = rpmtsDig(ts); rpmRC res; @@ -1014,7 +1014,7 @@ static rpmRC verifySHA1Signature(const rpmts ts, char * t, DIGEST_CTX sha1ctx) { - const void * sig = rpmtsSig(ts); + rpm_constdata_t sig = rpmtsSig(ts); #ifdef NOTYET size_t siglen = rpmtsSiglen(ts); #endif @@ -1084,7 +1084,7 @@ static rpmRC verifyRSASignature(rpmts ts, char * t, DIGEST_CTX md5ctx) { - const void * sig = rpmtsSig(ts); + rpm_constdata_t sig = rpmtsSig(ts); #ifdef NOTYET size_t siglen = rpmtsSiglen(ts); #endif @@ -1232,7 +1232,7 @@ static rpmRC verifyDSASignature(rpmts ts, char * t, DIGEST_CTX sha1ctx) { - const void * sig = rpmtsSig(ts); + rpm_constdata_t sig = rpmtsSig(ts); #ifdef NOTYET size_t siglen = rpmtsSiglen(ts); #endif @@ -1323,7 +1323,7 @@ exit: rpmRC rpmVerifySignature(const rpmts ts, char * result) { - const void * sig = rpmtsSig(ts); + rpm_constdata_t sig = rpmtsSig(ts); size_t siglen = rpmtsSiglen(ts); rpm_tag_t sigtag = rpmtsSigtag(ts); pgpDig dig = rpmtsDig(ts); diff --git a/lib/transaction.c b/lib/transaction.c index 1182a8522..3cefe50af 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -227,7 +227,7 @@ static int handleRmvdInstalledFiles(const rpmts ts, rpmfi fi, return 1; } - xx = hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); + xx = hge(h, RPMTAG_FILESTATES, NULL, (rpm_data_t *) &otherStates, NULL); for (i = 0; i < sharedCount; i++, shared++) { int otherFileNum, fileNum; @@ -1098,7 +1098,7 @@ static rpmRC getRepackageHeaderFromTE(rpmts ts, rpmte te, * XXX: Should Match NAC! */ rpmlog(RPMLOG_DEBUG, _("\tREMOVETID matched INSTALLTID.\n")); - if (headerGetEntry(rpIDT->h, RPMTAG_NAME, NULL, (void **) &rpname, NULL)) { + if (headerGetEntry(rpIDT->h, RPMTAG_NAME, NULL, (rpm_data_t *) &rpname, NULL)) { rpmlog(RPMLOG_DEBUG, _("\t\tName: %s.\n"), rpname); if (!strcmp(name,rpname)) { /* It matched we have a canidate */ -- cgit v1.2.3