Remove bogus const from rpmGlob argv return type
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 18 Dec 2007 08:17:18 +0000 (10:17 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 18 Dec 2007 08:17:18 +0000 (10:17 +0200)
- it's malloced and must be freed by caller

build/files.c
lib/idtx.c
lib/manifest.c
lib/rpmgi.c
lib/rpminstall.c
rpmio/macro.c
rpmio/rpmfileutil.c
rpmio/rpmfileutil.h
tools/rpmcache.c
tools/rpmgraph.c

index c3b8864..a0d26c3 100644 (file)
@@ -1728,7 +1728,7 @@ static rpmRC processBinaryFile(Package pkg, FileList fl,
     diskURL = rpmGenPath(fl->buildRootURL, NULL, fileURL);
 
     if (doGlob) {
-       const char ** argv = NULL;
+       char ** argv = NULL;
        int argc = 0;
        int i;
 
index f4c2031..4d7e1f9 100644 (file)
@@ -114,7 +114,7 @@ IDTX IDTXglob(rpmts ts, const char * globstr, rpm_tag_t tag)
     Header h;
     int32_t * tidp;
     FD_t fd;
-    const char ** av = NULL;
+    char ** av = NULL;
     int ac = 0;
     rpmRC rpmrc;
     int xx;
index 6fcfaeb..2b01052 100644 (file)
@@ -65,7 +65,7 @@ rpmRC rpmReadPackageManifest(FD_t fd, int * argcPtr, const char *** argvPtr)
     char * s = NULL;
     char * se;
     int ac = 0;
-    const char ** av = NULL;
+    char ** av = NULL;
     int argc = (argcPtr ? *argcPtr : 0);
     const char ** argv = (argvPtr ? *argvPtr : NULL);
     FILE * f = fdGetFILE(fd);
index f0e0f17..1f6bb7d 100644 (file)
@@ -310,7 +310,7 @@ static rpmRC rpmgiGlobArgv(rpmgi gi, ARGV_t argv)
 
     if (argv != NULL)
     while ((arg = *argv++) != NULL) {
-       ARGV_t av = NULL;
+       char ** av = NULL;
 
        xx = rpmGlob(arg, &ac, &av);
        xx = argvAppend(&gi->argv, av);
index fed2905..0fd0eae 100644 (file)
@@ -254,7 +254,7 @@ int rpmInstall(rpmts ts,
     rpmRelocation * relocations;
     const char * fileURL = NULL;
     int stopInstall = 0;
-    const char ** av = NULL;
+    char ** av = NULL;
     rpmVSFlags vsflags, ovsflags, tvsflags;
     int ac = 0;
     int rc;
index c0a6c47..f06c8ee 100644 (file)
@@ -1546,7 +1546,7 @@ rpmInitMacros(rpmMacroContext mc, const char * macrofiles)
 
     mfiles = xstrdup(macrofiles);
     for (m = mfiles; m && *m != '\0'; m = me) {
-       const char ** av;
+       char ** av;
        int ac;
        int i;
 
index 1b56f24..5f3d350 100644 (file)
@@ -702,12 +702,12 @@ exit:
 /* =============================================================== */
 static int _debug = 0;
 
-int rpmGlob(const char * patterns, int * argcPtr, const char *** argvPtr)
+int rpmGlob(const char * patterns, int * argcPtr, char *** argvPtr)
 {
     int ac = 0;
     const char ** av = NULL;
     int argc = 0;
-    const char ** argv = NULL;
+    char ** argv = NULL;
     char * globRoot = NULL;
     const char *home = getenv("HOME");
     int gflags = 0;
index 7ef6504..336ccd2 100644 (file)
@@ -101,7 +101,6 @@ char * rpmGetPath (const char * path, ...);
  * @retval *argvPtr    array of paths (malloc'd contiguous blob)
  * @return             0 on success
  */
-int rpmGlob(const char * patterns, int * argcPtr,
-               const char *** argvPtr);
+int rpmGlob(const char * patterns, int * argcPtr, char *** argvPtr);
 
 #endif /* _RPMFILEUTIL_H */
index 9db3058..006b5e6 100644 (file)
@@ -42,7 +42,7 @@ static int nbhglobs = 5;
 static int indent = 2;
 
 typedef struct Item_s {
-    const char * path;
+    char * path;
     int32_t size;
     int32_t mtime;
     rpmds this;
@@ -470,7 +470,7 @@ static void initGlobs(rpmts ts, const char ** argv)
     nbhglobs = 5;
     bhglobs = xcalloc(nbhglobs, sizeof(*bhglobs));
     for (i = 0; i < nbhglobs; i++) {
-       const char * pattern;
+       char * pattern;
        const char * macro;
 
        switch (i) {
index 81b89fc..fc0f417 100644 (file)
@@ -43,17 +43,17 @@ static int
 rpmGraph(rpmts ts, struct rpmInstallArguments_s * ia, const char ** fileArgv)
 {
     rpmps ps;
-    const char ** pkgURL = NULL;
+    char ** pkgURL = NULL;
     char * pkgState = NULL;
     const char ** fnp;
-    const char * fileURL = NULL;
+    char * fileURL = NULL;
     int numPkgs = 0;
     int numFailed = 0;
     int prevx = 0;
     int pkgx = 0;
-    const char ** argv = NULL;
+    char ** argv = NULL;
     int argc = 0;
-    const char ** av = NULL;
+    char ** av = NULL;
     int ac = 0;
     Header h;
     rpmRC rpmrc;
@@ -107,7 +107,7 @@ restart:
     fileURL = _free(fileURL);
 
     /* Continue processing file arguments, building transaction set. */
-    for (fnp = pkgURL+prevx; *fnp != NULL; fnp++, prevx++) {
+    for (fnp = (pkgURL+prevx); *fnp != NULL; fnp++, prevx++) {
        const char * fileName;
        FD_t fd;