Another bunch of bogus const removals
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 14 Dec 2007 15:55:31 +0000 (17:55 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 14 Dec 2007 15:55:31 +0000 (17:55 +0200)
14 files changed:
lib/depends.c
lib/formats.c
lib/package.c
lib/poptALL.c
lib/psm.c
lib/query.c
lib/rpmchecksig.c
lib/rpmds.c
lib/rpmgi.c
lib/rpminstall.c
lib/rpmps.c
lib/rpmrc.c
lib/rpmts.c
rpmdb/rpmdb.c

index 9f0d8cf..d4b9f4a 100644 (file)
@@ -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;
 
index 83cc020..204293e 100644 (file)
@@ -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;
index 27e3036..150fb0e 100644 (file)
@@ -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"),
index 15023c8..01267e5 100644 (file)
@@ -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);
        }
index e37459a..0cb956c 100644 (file)
--- 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] != '%')
index eaf5d95..7a4ec85 100644 (file)
@@ -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
index 100f7b8..bd374b0 100644 (file)
@@ -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;
index 322c540..b56d7aa 100644 (file)
@@ -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;
index f9e7fa9..c590188 100644 (file)
@@ -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)) {
index c0841b3..04761f3 100644 (file)
@@ -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;
index de6783d..bb78e51 100644 (file)
@@ -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;
 
index 24f7f50..1a8f043 100644 (file)
@@ -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);
index d8ddf6b..bf7ca28 100644 (file)
@@ -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;
index 2e1085d..03cc1ba 100644 (file)
@@ -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++;