rpmioSlurp() related cleanups.
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 12 Jul 2007 08:55:45 +0000 (11:55 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 12 Jul 2007 08:55:45 +0000 (11:55 +0300)
Derived from rpm5.org / Ralf S. Engelschall

build/files.c
lib/rpmrc.c
rpmio/rpmio.c
rpmio/rpmio_internal.h
rpmio/rpmpgp.c

index 9014f6e..aeaec15 100644 (file)
@@ -1779,8 +1779,8 @@ static int processMetadataFile(Package pkg, FileList fl, const char * fileURL,
     const char * buildURL = "%{_builddir}/%{?buildsubdir}/";
     const char * fn = NULL;
     const char * apkt = NULL;
-    const unsigned char * pkt = NULL;
-    size_t pktlen = 0;
+    byte * pkt = NULL;
+    ssize_t pktlen = 0;
     int absolute = 0;
     int rc = 1;
     int xx;
@@ -1800,7 +1800,7 @@ static int processMetadataFile(Package pkg, FileList fl, const char * fileURL,
        goto exit;
        /*@notreached@*/ break;
     case RPMTAG_PUBKEYS:
-       if ((rc = pgpReadPkts(fn, &pkt, &pktlen)) <= 0) {
+       if ((rc = pgpReadPkts(fn, (const byte **)&pkt, (size_t *)&pktlen)) <= 0) {
            rpmError(RPMERR_BADSPEC, _("%s: public key read failed.\n"), fn);
            goto exit;
        }
index 00afa9d..ab8698e 100644 (file)
@@ -14,6 +14,7 @@
 #define __power_pc() 0
 #endif
 
+#include <rpmio_internal.h>
 #include <rpmlib.h>
 #include <rpmmacro.h>
 #include <rpmlua.h>
@@ -783,7 +784,7 @@ static int rpmPlatform(const char * platform)
                rpmGlobalMacroContext, fileSystem, internalState @*/
 {
     char *cpu = NULL, *vendor = NULL, *os = NULL, *gnu = NULL;
-    char * b = NULL;
+    byte * b = NULL;
     ssize_t blen = 0;
     int init_platform = 0;
     char * p, * pe;
@@ -796,7 +797,7 @@ static int rpmPlatform(const char * platform)
        goto exit;
     }
 
-    p = b;
+    p = (char *)b;
     for (pe = p; p && *p; p = pe) {
        pe = strchr(p, '\n');
        if (pe)
index 3fbdd30..e2bfec7 100644 (file)
@@ -3392,7 +3392,7 @@ int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid)
 /*@=bounds@*/
 
 /*@-boundswrite@*/
-int rpmioSlurp(const char * fn, const byte ** bp, size_t * blenp)
+int rpmioSlurp(const char * fn, byte ** bp, ssize_t * blenp)
 {
     static ssize_t blenmax = (32 * BUFSIZ);
     ssize_t blen = 0;
index 40c006e..2e81226 100644 (file)
@@ -627,7 +627,7 @@ int fdFileno(/*@null@*/ void * cookie)
  * @return             0 on success
  */
 int rpmioSlurp(const char * fn,
-                /*@out@*/ const unsigned char ** bp, /*@out@*/ size_t * blenp)
+                /*@out@*/ byte ** bp, /*@out@*/ ssize_t * blenp)
         /*@globals h_errno, fileSystem, internalState @*/
         /*@modifies *bp, *blenp, fileSystem, internalState @*/;
 
index feca030..d5eda4d 100644 (file)
@@ -1143,8 +1143,8 @@ int pgpPrtPkts(const byte * pkts, unsigned int pktlen, pgpDig dig, int printing)
 /*@-boundswrite@*/
 pgpArmor pgpReadPkts(const char * fn, const byte ** pkt, size_t * pktlen)
 {
-    const byte * b = NULL;
-    size_t blen;
+    byte * b = NULL;
+    ssize_t blen;
     const char * enc = NULL;
     const char * crcenc = NULL;
     byte * dec;