From 61e35657a6e3ce33a44067e82bb382b8b3133c4a Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 14 Dec 2007 17:55:31 +0200 Subject: [PATCH] Another bunch of bogus const removals --- lib/depends.c | 4 ++-- lib/formats.c | 4 ++-- lib/package.c | 2 +- lib/poptALL.c | 2 +- lib/psm.c | 2 +- lib/query.c | 2 +- lib/rpmchecksig.c | 2 +- lib/rpmds.c | 4 ++-- lib/rpmgi.c | 4 ++-- lib/rpminstall.c | 2 +- lib/rpmps.c | 2 +- lib/rpmrc.c | 6 +++--- lib/rpmts.c | 18 +++++++++--------- rpmdb/rpmdb.c | 4 ++-- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/depends.c b/lib/depends.c index 9f0d8cf..d4b9f4a 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -333,7 +333,7 @@ addheader: */ if (rpmdsEVR(obsoletes) == NULL || rpmdsAnyMatchesDep(oh, obsoletes, _rpmds_nopromote)) { - const char * ohNEVRA = headerGetNEVRA(oh, NULL); + char * ohNEVRA = headerGetNEVRA(oh, NULL); #ifdef DYING /* XXX see http://bugzilla.redhat.com #134497 */ if (rpmVersionCompare(h, oh)) #endif @@ -654,7 +654,7 @@ static int checkPackageSet(rpmts ts, const char * dep, (void) rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); while ((h = rpmdbNextIterator(mi)) != NULL) { - const char * pkgNEVRA; + char * pkgNEVRA; rpmds requires, conflicts; int rc; diff --git a/lib/formats.c b/lib/formats.c index 83cc020..204293e 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -185,7 +185,7 @@ static char * base64Format(rpm_tagtype_t type, const void * data, if (type != RPM_BIN_TYPE) { val = xstrdup(_("(not a blob)")); } else { - const char * enc; + char * enc; char * t; /* XXX HACK ALERT: element field abused as no. bytes of binary data. */ size_t ns = element; @@ -260,7 +260,7 @@ static char * xmlFormat(rpm_tagtype_t type, const void * data, const char * xtag = NULL; size_t nb; char * val; - const char * s = NULL; + char * s = NULL; char * t, * te; unsigned long anint = 0; int xx; diff --git a/lib/package.c b/lib/package.c index 27e3036..150fb0e 100644 --- a/lib/package.c +++ b/lib/package.c @@ -967,7 +967,7 @@ rpmRC headerCheckPayloadFormat(Header h) { if (payloadfmt && strncmp(payloadfmt, "cpio", strlen("cpio")) == 0) { rc = RPMRC_OK; } else { - const char *nevra = headerGetNEVRA(h, NULL); + char *nevra = headerGetNEVRA(h, NULL); if (payloadfmt && strncmp(payloadfmt, "drpm", strlen("drpm")) == 0) { rpmlog(RPMLOG_ERR, _("%s is a Delta RPM and cannot be directly installed\n"), diff --git a/lib/poptALL.c b/lib/poptALL.c index 15023c8..01267e5 100644 --- a/lib/poptALL.c +++ b/lib/poptALL.c @@ -128,7 +128,7 @@ static void rpmcliAllArgCallback( poptContext con, break; case 'E': rpmcliConfigured(); - { const char *val = rpmExpand(arg, NULL); + { char *val = rpmExpand(arg, NULL); fprintf(stdout, "%s\n", val); val = _free(val); } diff --git a/lib/psm.c b/lib/psm.c index e37459a..0cb956c 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -797,7 +797,7 @@ static rpmRC runScript(rpmpsm psm, Header h, rpm_tag_t stag, xx = Fclose (scriptFd); } - { const char *ipath = rpmExpand("PATH=%{_install_script_path}", NULL); + { char *ipath = rpmExpand("PATH=%{_install_script_path}", NULL); const char *path = SCRIPT_PATH; if (ipath && ipath[5] != '%') diff --git a/lib/query.c b/lib/query.c index eaf5d95..7a4ec85 100644 --- a/lib/query.c +++ b/lib/query.c @@ -600,7 +600,7 @@ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg) else fn = xstrdup(arg); } else if (*arg != '/') { - const char *curDir = currentDirectory(); + char *curDir = currentDirectory(); fn = (char *) rpmGetPath(curDir, "/", arg, NULL); curDir = _free(curDir); } else diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 100f7b8..bd374b0 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -397,7 +397,7 @@ static int rpmcliImportPubkeys(const rpmts ts, const char ** argv) { const char * fn; - const unsigned char * pkt = NULL; + unsigned char * pkt = NULL; size_t pktlen = 0; char * t = NULL; int res = 0; diff --git a/lib/rpmds.c b/lib/rpmds.c index 322c540..b56d7aa 100644 --- a/lib/rpmds.c +++ b/lib/rpmds.c @@ -779,8 +779,8 @@ void parseEVR(char * evr, int rpmdsCompare(const rpmds A, const rpmds B) { - const char *aDepend = (A->DNEVR != NULL ? xstrdup(A->DNEVR+2) : ""); - const char *bDepend = (B->DNEVR != NULL ? xstrdup(B->DNEVR+2) : ""); + char *aDepend = (A->DNEVR != NULL ? xstrdup(A->DNEVR+2) : ""); + char *bDepend = (B->DNEVR != NULL ? xstrdup(B->DNEVR+2) : ""); char *aEVR, *bEVR; const char *aE, *aV, *aR, *bE, *bV, *bR; int result; diff --git a/lib/rpmgi.c b/lib/rpmgi.c index f9e7fa9..c590188 100644 --- a/lib/rpmgi.c +++ b/lib/rpmgi.c @@ -90,7 +90,7 @@ static const char * ftsInfoStr(int fts_info) */ static FD_t rpmgiOpen(const char * path, const char * fmode) { - const char * fn = rpmExpand(path, NULL); + char * fn = rpmExpand(path, NULL); FD_t fd = Fopen(fn, fmode); if (fd == NULL || Ferror(fd)) { @@ -169,7 +169,7 @@ static rpmRC rpmgiLoadReadHeader(rpmgi gi) if (gi->argv != NULL && gi->argv[gi->i] != NULL) do { - const char * fn; /* XXX gi->hdrPath? */ + char * fn; /* XXX gi->hdrPath? */ fn = gi->argv[gi->i]; if (!(gi->flags & RPMGI_NOHEADER)) { diff --git a/lib/rpminstall.c b/lib/rpminstall.c index c0841b3..04761f3 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -888,7 +888,7 @@ int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia, const char ** argv) niids = 0; } - { const char * globstr = rpmExpand("%{_repackage_dir}/*.rpm", NULL); + { char * globstr = rpmExpand("%{_repackage_dir}/*.rpm", NULL); if (globstr == NULL || *globstr == '%') { globstr = _free(globstr); rc = -1; diff --git a/lib/rpmps.c b/lib/rpmps.c index de6783d..bb78e51 100644 --- a/lib/rpmps.c +++ b/lib/rpmps.c @@ -399,7 +399,7 @@ static int sameProblem(const rpmProblem ap, const rpmProblem bp) void rpmpsPrint(FILE *fp, rpmps ps) { - const char * msg; + char * msg = NULL; rpmpsi psi = NULL; int i; diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 24f7f50..1a8f043 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -998,7 +998,7 @@ static void defaultMachine(const char ** arch, while (!gotDefaults) { if (!rpmPlatform(platform)) { - const char * s; + char * s; s = rpmExpand("%{_host_cpu}", NULL); if (s) { strncpy(un.machine, s, sizeof(un.machine)); @@ -1696,8 +1696,8 @@ int rpmReadConfigFiles(const char * file, const char * target) rpmRebuildTargetVars(&target, NULL); /* Finally set target platform */ - { const char *cpu = rpmExpand("%{_target_cpu}", NULL); - const char *os = rpmExpand("%{_target_os}", NULL); + { char *cpu = rpmExpand("%{_target_cpu}", NULL); + char *os = rpmExpand("%{_target_os}", NULL); rpmSetMachine(cpu, os); cpu = _free(cpu); os = _free(os); diff --git a/lib/rpmts.c b/lib/rpmts.c index d8ddf6b..bf7ca28 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -265,7 +265,7 @@ rpmRC rpmtsFindPubkey(rpmts ts) pgpDigParams sigp = rpmtsSignature(ts); pgpDigParams pubp = rpmtsPubkey(ts); rpmRC res = RPMRC_NOKEY; - const char * pubkeysource = NULL; + char * pubkeysource = NULL; int xx; if (sig == NULL || dig == NULL || sigp == NULL || pubp == NULL) @@ -325,7 +325,7 @@ fprintf(stderr, "*** free pkt %p[%d] id %08x %08x\n", ts->pkpkt, ts->pkpktlen, p /* Try keyserver lookup. */ if (ts->pkpkt == NULL) { - const char * fn = rpmExpand("%{_hkp_keyserver_query}", + char * fn = rpmExpand("%{_hkp_keyserver_query}", pgpHexStr(sigp->signid, sizeof(sigp->signid)), NULL); xx = 0; @@ -411,13 +411,13 @@ rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char * pkt, size_t pktlen int32_t zero = 0; pgpDig dig = NULL; pgpDigParams pubp = NULL; - const char * d = NULL; - const char * enc = NULL; - const char * n = NULL; - const char * u = NULL; - const char * v = NULL; - const char * r = NULL; - const char * evr = NULL; + char * d = NULL; + char * enc = NULL; + char * n = NULL; + char * u = NULL; + char * v = NULL; + char * r = NULL; + char * evr = NULL; Header h = NULL; rpmRC rc = RPMRC_FAIL; /* assume failure */ char * t; diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index 2e1085d..03cc1ba 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -1742,7 +1742,7 @@ int rpmdbSetIteratorRE(rpmdbMatchIterator mi, rpm_tag_t tag, int rc = 0; if (defmode == (rpmMireMode)-1) { - const char *t = rpmExpand("%{?_query_selector_match}", NULL); + char *t = rpmExpand("%{?_query_selector_match}", NULL); if (*t == '\0' || !strcmp(t, "default")) defmode = RPMMIRE_DEFAULT; @@ -1911,7 +1911,7 @@ static int mireSkip (const rpmdbMatchIterator mi) break; case RPM_BIN_TYPE: { - const char * str = bin2hex((const char*) u.ptr, c); + char * str = bin2hex((const char*) u.ptr, c); rc = miregexec(mire, str); if ((!rc && !mire->notmatch) || (rc && mire->notmatch)) anymatch++; -- 2.7.4