Bogus const removal continued...
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 14 Dec 2007 17:52:11 +0000 (19:52 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 14 Dec 2007 17:52:11 +0000 (19:52 +0200)
12 files changed:
build/files.c
build/pack.c
build/parsePreamble.c
build/parsePrep.c
build/parseSpec.c
build/rpmfc.c
build/spec.c
lib/signature.c
lib/transaction.c
python/header-py.c
python/rpmts-py.c
tools/rpmcache.c

index 290503e..6c1cb6b 100644 (file)
@@ -766,7 +766,7 @@ static int parseForRegexLang(const char * fileName, char ** lang)
     const char *s;
 
     if (! initialized) {
-       const char *patt = rpmExpand("%{?_langpatt}", NULL);
+       char *patt = rpmExpand("%{?_langpatt}", NULL);
        int rc = 0;
        if (!(patt && *patt != '\0'))
            rc = 1;
@@ -2250,7 +2250,7 @@ static int checkFiles(StringBuf fileList)
 {
     static const char * av_ckfile[] = { "%{?__check_files}", NULL };
     StringBuf sb_stdout = NULL;
-    const char * s;
+    char * s;
     int rc;
     
     s = rpmExpand(av_ckfile[0], NULL);
index d848057..c405438 100644 (file)
@@ -53,7 +53,7 @@ static rpmRC cpio_doio(FD_t fdo, Header h, CSA_t csa,
     rpmRC rc = RPMRC_OK;
     int xx;
 
-    {  const char *fmode = rpmExpand(fmodeMacro, NULL);
+    {  char *fmode = rpmExpand(fmodeMacro, NULL);
        if (!(fmode && fmode[0] == 'w'))
            fmode = xstrdup("w9.gzdio");
        (void) Fflush(fdo);
@@ -348,7 +348,7 @@ rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName,
     FD_t ifd = NULL;
     int32_t count, sigtag;
     const char * sigtarget = NULL;;
-    const char * rpmio_flags = NULL;
+    char * rpmio_flags = NULL;
     const char * SHA1 = NULL;
     char *s;
     char buf[BUFSIZ];
@@ -635,7 +635,7 @@ rpmRC packageBinaries(rpmSpec spec)
 
        providePackageNVR(pkg->header);
 
-    {  const char * optflags = rpmExpand("%{optflags}", NULL);
+    {  char * optflags = rpmExpand("%{optflags}", NULL);
        (void) headerAddEntry(pkg->header, RPMTAG_OPTFLAGS, RPM_STRING_TYPE,
                        optflags, 1);
        optflags = _free(optflags);
index f04be6e..761e3c9 100644 (file)
@@ -209,8 +209,8 @@ static int isMemberInEntry(Header h, const char *name, rpm_tag_t tag)
  */
 static int checkForValidArchitectures(rpmSpec spec)
 {
-    const char *arch = rpmExpand("%{_target_cpu}", NULL);
-    const char *os = rpmExpand("%{_target_os}", NULL);
+    char *arch = rpmExpand("%{_target_cpu}", NULL);
+    char *os = rpmExpand("%{_target_os}", NULL);
     
     if (isMemberInEntry(spec->buildRestrictions,
                        arch, RPMTAG_EXCLUDEARCH) == 1) {
@@ -311,7 +311,7 @@ static void fillOutMainPackage(Header h)
 
     for (ot = optionalTags; ot->ot_mac != NULL; ot++) {
        if (!headerIsEntry(h, ot->ot_tag)) {
-           const char *val = rpmExpand(ot->ot_mac, NULL);
+           char *val = rpmExpand(ot->ot_mac, NULL);
            if (val && *val != '%')
                (void) headerAddEntry(h, ot->ot_tag, RPM_STRING_TYPE, (void *)val, 1);
            val = _free(val);
index f20f866..13a130b 100644 (file)
@@ -408,8 +408,7 @@ static int doSetupMacro(rpmSpec spec, char *line)
        const char ** fm;
 
        for (fm = fixmacs; *fm; fm++) {
-           const char *fix;
-           fix = rpmExpand(*fm, " .", NULL);
+           char * fix = rpmExpand(*fm, " .", NULL);
            if (fix && *fix != '%')
                appendLineStringBuf(spec->prep, fix);
            fix = _free(fix);
index 86a0c21..e4dc558 100644 (file)
@@ -279,22 +279,22 @@ retry:
     if (!spec->readStack->reading && !strncmp("%if", s, sizeof("%if")-1)) {
        match = 0;
     } else if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
-       const char *arch = rpmExpand("%{_target_cpu}", NULL);
+       char *arch = rpmExpand("%{_target_cpu}", NULL);
        s += 7;
        match = matchTok(arch, s);
        arch = _free(arch);
     } else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) {
-       const char *arch = rpmExpand("%{_target_cpu}", NULL);
+       char *arch = rpmExpand("%{_target_cpu}", NULL);
        s += 8;
        match = !matchTok(arch, s);
        arch = _free(arch);
     } else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) {
-       const char *os = rpmExpand("%{_target_os}", NULL);
+       char *os = rpmExpand("%{_target_os}", NULL);
        s += 5;
        match = matchTok(os, s);
        os = _free(os);
     } else if (! strncmp("%ifnos", s, sizeof("%ifnos")-1)) {
-       const char *os = rpmExpand("%{_target_os}", NULL);
+       char *os = rpmExpand("%{_target_os}", NULL);
        s += 6;
        match = !matchTok(os, s);
        os = _free(os);
@@ -558,9 +558,9 @@ int parseSpec(rpmts ts, const char *specFile, const char *rootURL,
 
     /* Check for description in each package and add arch and os */
   {
-    const char *platform = rpmExpand("%{_target_platform}", NULL);
-    const char *arch = rpmExpand("%{_target_cpu}", NULL);
-    const char *os = rpmExpand("%{_target_os}", NULL);
+    char *platform = rpmExpand("%{_target_platform}", NULL);
+    char *arch = rpmExpand("%{_target_cpu}", NULL);
+    char *os = rpmExpand("%{_target_os}", NULL);
 
     for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
        if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
index b48adfe..bc69ac3 100644 (file)
@@ -229,7 +229,7 @@ top:
 int rpmfcExec(ARGV_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp,
                int failnonzero)
 {
-    const char * s = NULL;
+    char * s = NULL;
     ARGV_t xav = NULL;
     ARGV_t pav = NULL;
     int pac = 0;
@@ -801,7 +801,7 @@ static int rpmfcELF(rpmfc fc)
     char buf[BUFSIZ];
     const char * s;
     struct stat sb, * st = &sb;
-    const char * soname = NULL;
+    char * soname = NULL;
     rpmds * depsp, ds;
     rpm_tag_t tagN;
     int32_t dsContext;
index 98a9cd4..e66c631 100644 (file)
@@ -545,7 +545,7 @@ printNewSpecfile(rpmSpec spec)
     Header h;
     speclines sl = spec->sl;
     spectags st = spec->st;
-    const char * msgstr = NULL;
+    char * msgstr = NULL;
     int i, j;
 
     if (sl == NULL || st == NULL)
index c465cd8..2422cf7 100644 (file)
@@ -38,7 +38,7 @@ int rpmLookupSignatureType(int action)
     case RPMLOOKUPSIG_QUERY:
        if (disabled)
            break;      /* Disabled */
-      { const char *name = rpmExpand("%{?_signature}", NULL);
+      { char *name = rpmExpand("%{?_signature}", NULL);
        if (!(name && *name != '\0'))
            rc = 0;
        else if (!xstrcasecmp(name, "none"))
@@ -869,7 +869,7 @@ char * rpmGetPassPhrase(const char * prompt, const rpm_tag_t sigTag)
     switch (sigTag) {
     case RPMSIGTAG_DSA:
     case RPMSIGTAG_GPG:
-      { const char *name = rpmExpand("%{?_gpg_name}", NULL);
+      { char *name = rpmExpand("%{?_gpg_name}", NULL);
        aok = (name && *name != '\0');
        name = _free(name);
       }
@@ -881,7 +881,7 @@ char * rpmGetPassPhrase(const char * prompt, const rpm_tag_t sigTag)
     case RPMSIGTAG_RSA:
     case RPMSIGTAG_PGP5:       /* XXX legacy */
     case RPMSIGTAG_PGP:
-      { const char *name = rpmExpand("%{?_pgp_name}", NULL);
+      { char *name = rpmExpand("%{?_pgp_name}", NULL);
        aok = (name && *name != '\0');
        name = _free(name);
       }
index 8417975..c97d6bc 100644 (file)
@@ -84,7 +84,7 @@ static int handleInstInstalledFiles(const rpmts ts,
     uint32_t prefcolor = rpmtsPrefColor(ts);
     uint32_t otecolor, tecolor;
     uint32_t oFColor, FColor;
-    const char * altNEVR = NULL;
+    char * altNEVR = NULL;
     rpmfi otherFi = NULL;
     int numReplaced = 0;
     rpmps ps;
@@ -626,7 +626,7 @@ static int ensureOlder(rpmts ts,
 
     if (rc == 0) {
        rpmps ps = rpmtsProblems(ts);
-       const char * altNEVR = headerGetNEVRA(h, NULL);
+       char * altNEVR = headerGetNEVRA(h, NULL);
        rpmpsAppend(ps, RPMPROB_OLDPACKAGE,
                rpmteNEVRA(p), rpmteKey(p),
                NULL, NULL,
@@ -657,7 +657,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
     const char ** languages;
     const char * dn, * bn;
     size_t dnlen, bnlen;
-    const char * s;
+    char * s;
     int * drc;
     char * dff;
     int dc;
@@ -666,7 +666,7 @@ static void skipFiles(const rpmts ts, rpmfi fi)
     if (!noDocs)
        noDocs = rpmExpandNumeric("%{_excludedocs}");
 
-    {  const char *tmpPath = rpmExpand("%{_netsharedpath}", NULL);
+    {  char *tmpPath = rpmExpand("%{_netsharedpath}", NULL);
        if (tmpPath && *tmpPath != '%')
            netsharedPaths = splitString(tmpPath, strlen(tmpPath), ':');
        tmpPath = _free(tmpPath);
@@ -1375,7 +1375,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
     }
 
     ts->ignoreSet = ignoreSet;
-    {  const char * currDir = currentDirectory();
+    {  char * currDir = currentDirectory();
        rpmtsSetCurrDir(ts, currDir);
        currDir = _free(currDir);
     }
index 139979d..3d1eb42 100644 (file)
@@ -725,7 +725,7 @@ PyObject * rpmHeaderFromFD(PyObject * self, PyObject * args, PyObject * kwds)
     FD_t fd;
     int fileno;
     PyObject * list;
-    const char * kwlist[] = {"fd", NULL};
+    char * kwlist[] = {"fd", NULL};
 
     if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &fileno))
        return NULL;
index af6e71c..8cb9640 100644 (file)
@@ -543,7 +543,7 @@ rpmts_IDTXglob(rpmtsObject * s)
 {
     PyObject * result = NULL;
     rpm_tag_t tag = RPMTAG_REMOVETID;
-    const char * globstr;
+    char * globstr;
     IDTX idtx;
 
 if (_rpmts_debug)
index 63f620c..9db3058 100644 (file)
@@ -536,7 +536,7 @@ main(int argc, char *argv[])
 {
     rpmts ts = NULL;
     poptContext optCon;
-    const char * s;
+    char * s;
     FTS * ftsp;
     FTSENT * fts;
     int ec = 1;