RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  [EMAIL PROTECTED]
  Module: rpm                              Date:   15-Nov-2007 18:28:01
  Branch: HEAD                             Handle: 2007111517275801

  Modified files:
    rpm                     CHANGES
    rpm/rpmio               .splintrc argv.c digest.c fts.c macro.c rpmdav.c
                            rpmhash.c rpmhook.c rpmio.c rpmlog.c rpmlua.c
                            rpmpgp.c rpmrpc.c rpmsq.c rpmsw.c url.c

  Log:
    - jbj: rpmio: casts for integral conversions.

  Summary:
    Revision    Changes     Path
    1.1828      +1  -0      rpm/CHANGES
    1.17        +1  -1      rpm/rpmio/.splintrc
    1.7         +1  -1      rpm/rpmio/argv.c
    2.36        +1  -1      rpm/rpmio/digest.c
    1.24        +4  -4      rpm/rpmio/fts.c
    2.152       +2  -2      rpm/rpmio/macro.c
    2.52        +7  -7      rpm/rpmio/rpmdav.c
    1.7         +1  -1      rpm/rpmio/rpmhash.c
    1.8         +1  -1      rpm/rpmio/rpmhook.c
    1.102       +45 -45     rpm/rpmio/rpmio.c
    2.35        +3  -2      rpm/rpmio/rpmlog.c
    2.27        +2  -2      rpm/rpmio/rpmlua.c
    2.70        +7  -7      rpm/rpmio/rpmpgp.c
    2.61        +19 -17     rpm/rpmio/rpmrpc.c
    1.30        +7  -7      rpm/rpmio/rpmsq.c
    2.14        +2  -2      rpm/rpmio/rpmsw.c
    1.43        +1  -1      rpm/rpmio/url.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1827 -r1.1828 CHANGES
  --- rpm/CHANGES       15 Nov 2007 16:29:01 -0000      1.1827
  +++ rpm/CHANGES       15 Nov 2007 17:27:58 -0000      1.1828
  @@ -1,4 +1,5 @@
   5.0a1 -> 5.0a2:
  +    - jbj: rpmio: casts for integral conversions.
       - jbj: rpmio: casts for character <-> integral conversions.
       - jbj: first pass through header.c converting to uint32_t everywhere.
       - jbj: get rid of splint spew before chasing header.c integers.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/.splintrc
  ============================================================================
  $ cvs diff -u -r1.16 -r1.17 .splintrc
  --- rpm/rpmio/.splintrc       15 Nov 2007 16:29:01 -0000      1.16
  +++ rpm/rpmio/.splintrc       15 Nov 2007 17:27:59 -0000      1.17
  @@ -72,4 +72,4 @@
   -boolops             # 117
   +boolint             # 11
   +ignorequals         # 112
  -+matchanyintegral    # 39
  +#+matchanyintegral   # 39
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/argv.c
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 argv.c
  --- rpm/rpmio/argv.c  15 Nov 2007 16:29:01 -0000      1.6
  +++ rpm/rpmio/argv.c  15 Nov 2007 17:27:59 -0000      1.7
  @@ -228,7 +228,7 @@
   
       if (fp == NULL)
        return -2;
  -    while (!rc && (b = fgets(buf, sizeof(buf), fp)) != NULL) {
  +    while (!rc && (b = fgets(buf, (int)sizeof(buf), fp)) != NULL) {
        buf[sizeof(buf)-1] = '\0';
        be = b + strlen(buf) - 1;
        while (strchr("\r\n", *be) != NULL)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/digest.c
  ============================================================================
  $ cvs diff -u -r2.35 -r2.36 digest.c
  --- rpm/rpmio/digest.c        6 Oct 2007 19:40:23 -0000       2.35
  +++ rpm/rpmio/digest.c        15 Nov 2007 17:27:59 -0000      2.36
  @@ -655,7 +655,6 @@
   {
       byte * digest;
       char * t;
  -    int i;
   
       if (ctx == NULL)
        return -1;
  @@ -678,6 +677,7 @@
        if (datap) {
            const byte * s = (const byte *) digest;
            static const char hex[] = "0123456789abcdef";
  +         size_t i;
   
            *(char **)datap = t = xmalloc((2*ctx->digestsize) + 1);
            for (i = 0 ; i < ctx->digestsize; i++) {
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/fts.c
  ============================================================================
  $ cvs diff -u -r1.23 -r1.24 fts.c
  --- rpm/rpmio/fts.c   6 Oct 2007 19:40:23 -0000       1.23
  +++ rpm/rpmio/fts.c   15 Nov 2007 17:27:59 -0000      1.24
  @@ -244,7 +244,7 @@
                        /[EMAIL PROTECTED]@*/ break;
                }
   
  -             p = fts_alloc(sp, *argv, len);
  +             p = fts_alloc(sp, *argv, (int)len);
                if (p == NULL)
                        goto mem3;
                p->fts_level = FTS_ROOTLEVEL;
  @@ -310,7 +310,7 @@
   static void
   fts_load(FTS * sp, FTSENT * p)
   {
  -     register int len;
  +     register size_t len;
        register char *cp;
   
        /*
  @@ -325,7 +325,7 @@
        if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
                len = strlen(++cp);
                memmove(p->fts_name, cp, len + 1);
  -             p->fts_namelen = len;
  +             p->fts_namelen = (u_short)len;
        }
        p->fts_accpath = p->fts_path = sp->fts_path;
        sp->fts_dev = p->fts_dev;
  @@ -842,7 +842,7 @@
                }
                p->fts_level = level;
                p->fts_parent = sp->fts_cur;
  -             p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
  +             p->fts_pathlen = (u_short)(len + _D_EXACT_NAMLEN (dp));
   
   #if defined FTS_WHITEOUT && 0
                if (dp->d_type == DT_WHT)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/macro.c
  ============================================================================
  $ cvs diff -u -r2.151 -r2.152 macro.c
  --- rpm/rpmio/macro.c 15 Nov 2007 16:29:01 -0000      2.151
  +++ rpm/rpmio/macro.c 15 Nov 2007 17:27:59 -0000      2.152
  @@ -370,7 +370,7 @@
       if (f != NULL)
       do {
        *(++q) = '\0';                  /* terminate and move forward. */
  -     if (fgets(q, size, f) == NULL)  /* read next line. */
  +     if (fgets(q, (int)size, f) == NULL)     /* read next line. */
            break;
        nb = strlen(q);
        nread += nb;                    /* trim trailing \r and \n */
  @@ -1524,7 +1524,7 @@
                    rc = 1;
                printbuf = rpmluaGetPrintBuffer(lua);
                if (printbuf) {
  -                 int len = strlen(printbuf);
  +                 size_t len = strlen(printbuf);
                    if (len > mb->nb)
                        len = mb->nb;
                    memcpy(mb->t, printbuf, len);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmdav.c
  ============================================================================
  $ cvs diff -u -r2.51 -r2.52 rpmdav.c
  --- rpm/rpmio/rpmdav.c        15 Nov 2007 16:29:01 -0000      2.51
  +++ rpm/rpmio/rpmdav.c        15 Nov 2007 17:27:59 -0000      2.52
  @@ -1207,7 +1207,7 @@
   #endif
   
   if (_dav_debug < 0)
  -fprintf(stderr, "*** davOpen(%s,0x%x,0%o,%p)\n", url, flags, mode, uret);
  +fprintf(stderr, "*** davOpen(%s,0x%x,0%o,%p)\n", url, flags, (unsigned)mode, 
uret);
       rc = davInit(url, &u);
       if (rc || u == NULL || u->sess == NULL)
        goto exit;
  @@ -1356,7 +1356,7 @@
   
   exit:
   if (_dav_debug)
  -fprintf(stderr, "*** davMkdir(%s,0%o) rc %d\n", path, mode, rc);
  +fprintf(stderr, "*** davMkdir(%s,0%o) rc %d\n", path, (unsigned)mode, rc);
       return rc;
   }
   
  @@ -1454,10 +1454,10 @@
        "*** dev %x ino %x mode %0o nlink %d uid %d gid %d rdev %x size %x\n",
        (unsigned)st->st_dev,
        (unsigned)st->st_ino,
  -     st->st_mode,
  +     (unsigned)st->st_mode,
        (unsigned)st->st_nlink,
  -     st->st_uid,
  -     st->st_gid,
  +     (unsigned)st->st_uid,
  +     (unsigned)st->st_gid,
        (unsigned)st->st_rdev,
        (unsigned)st->st_size);
       return buf;
  @@ -1656,7 +1656,7 @@
   
       dp = (struct dirent *) avdir->data;
       av = (const char **) (dp + 1);
  -    ac = avdir->size;
  +    ac = (int)avdir->size;
       dt = (unsigned char *) (av + (ac + 1));
       i = avdir->offset + 1;
   
  @@ -1778,7 +1778,7 @@
   
       dp = (struct dirent *) avdir->data;
       av = (const char **) (dp + 1);
  -    ac = avdir->size;
  +    ac = (int)avdir->size;
       dt = (unsigned char *) (av + (ac + 1));
       i = avdir->offset + 1;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmhash.c
  ============================================================================
  $ cvs diff -u -r1.6 -r1.7 rpmhash.c
  --- rpm/rpmio/rpmhash.c       15 Nov 2007 16:29:01 -0000      1.6
  +++ rpm/rpmio/rpmhash.c       15 Nov 2007 17:27:59 -0000      1.7
  @@ -80,7 +80,7 @@
       const char * chp = data;
       unsigned char sum = (unsigned char)0;
       unsigned char xor = (unsigned char)0;
  -    int i;
  +    size_t i;
   
       if (size == 0)
        size = strlen(chp);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmhook.c
  ============================================================================
  $ cvs diff -u -r1.7 -r1.8 rpmhook.c
  --- rpm/rpmio/rpmhook.c       6 Oct 2007 19:40:23 -0000       1.7
  +++ rpm/rpmio/rpmhook.c       15 Nov 2007 17:27:59 -0000      1.8
  @@ -190,7 +190,7 @@
   static rpmhookArgs rpmhookArgsParse(const char *argt, va_list ap)
        /[EMAIL PROTECTED]/
   {
  -    rpmhookArgs args = rpmhookArgsNew(strlen(argt));
  +    rpmhookArgs args = rpmhookArgsNew((int)strlen(argt));
       int i;
   
   /[EMAIL PROTECTED]@*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmio.c
  ============================================================================
  $ cvs diff -u -r1.101 -r1.102 rpmio.c
  --- rpm/rpmio/rpmio.c 15 Nov 2007 16:29:01 -0000      1.101
  +++ rpm/rpmio/rpmio.c 15 Nov 2007 17:27:59 -0000      1.102
  @@ -473,7 +473,7 @@
   
   DBGIO(fd, (stderr, "==>\tfdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, 
whence, (unsigned long)rc, fdbg(fd)));
   
  -    return rc;
  +    return (int) rc;
   }
   
   static int fdClose( /[EMAIL PROTECTED]@*/ void * cookie)
  @@ -678,7 +678,7 @@
   #ifdef       NOISY
        rc = fdRead(fd, buf + nb, 1);
   #else
  -     rc = read(fdFileno(fd), buf + nb, 1);
  +     rc = (int)read(fdFileno(fd), buf + nb, 1);
   #endif
        if (rc < 0) {
            fd->syserrno = errno;
  @@ -704,7 +704,7 @@
        }
       } while (ec == 0 && nb < len && lastchar != '\n');
   
  -    return (ec >= 0 ? nb : ec);
  +    return (ec >= 0 ? (int)nb : ec);
   }
   
   /* =============================================================== */
  @@ -858,7 +858,7 @@
        for (res = res0; res != NULL; res = res->ai_next) {
            if ((fdno = socket(res->ai_family, res->ai_socktype, 
res->ai_protocol)) < 0)
                continue;
  -         if (connect(fdno, res->ai_addr, res->ai_addrlen) < 0) {
  +         if (connect(fdno, res->ai_addr, (int)res->ai_addrlen) < 0) {
                xx = close(fdno);
                continue;
            }
  @@ -1237,7 +1237,7 @@
   #endif       /* HAVE_GETADDRINFO */
       char remoteIP[NI_MAXHOST];
       char * cmd;
  -    int cmdlen;
  +    size_t cmdlen;
       char * passReply;
       char * chptr;
       int rc;
  @@ -1397,7 +1397,7 @@
   
            {
                int criterr = 0;
  -             while (connect(fdFileno(data), res->ai_addr, res->ai_addrlen) < 
0) {
  +             while (connect(fdFileno(data), res->ai_addr, 
(int)res->ai_addrlen) < 0) {
                    if (errno == EINTR)
                        /[EMAIL PROTECTED]@*/ continue;
                    criterr++;
  @@ -1514,16 +1514,16 @@
       }
   
       while (1) {
  -     rc = Fread(buf, sizeof(buf[0]), sizeof(buf), sfd);
  -     if (rc < 0)
  +     rc = (int) Fread(buf, sizeof(buf[0]), sizeof(buf), sfd);
  +     if (rc < 0)     /* XXX never happens Fread returns size_t */
            break;
        else if (rc == 0) {
            rc = itemsCopied;
            break;
        }
        itemsRead = rc;
  -     rc = Fwrite(buf, sizeof(buf[0]), itemsRead, tfd);
  -     if (rc < 0)
  +     rc = (int) Fwrite(buf, sizeof(buf[0]), itemsRead, tfd);
  +     if (rc < 0)     /* XXX never happens Fwrite returns size_t */
            break;
        if (rc != itemsRead) {
            rc = FTPERR_FILE_IO_ERROR;
  @@ -1883,8 +1883,8 @@
        /[EMAIL PROTECTED] maxRead(buf) == result @*/
   {
       FD_t fd = c2f(cookie);
  -    int bytesRead;
  -    int total;
  +    size_t bytesRead;
  +    size_t total;
   
       /* XXX preserve timedRead() behavior */
       if (fdGetIo(fd) == fdio) {
  @@ -1905,19 +1905,19 @@
        bytesRead = 0;
   
        /* Is there data to read? */
  -     if (fd->bytesRemain == 0) return total; /* XXX simulate EOF */
  +     if (fd->bytesRemain == 0) return (ssize_t) total; /* XXX simulate EOF */
        rc = fdReadable(fd, fd->rd_timeoutsecs);
   
        switch (rc) {
        case -1:        /* error */
        case  0:        /* timeout */
  -         return total;
  +         return (ssize_t) total;
            /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ break;
        default:        /* data to read */
            /[EMAIL PROTECTED]@*/ break;
        }
   
  -     rc = fdRead(fd, buf + total, count - total);
  +     rc = (int) fdRead(fd, buf + total, count - total);
   
        if (rc < 0) {
            switch (errno) {
  @@ -1932,13 +1932,13 @@
            return rc;
            /[EMAIL PROTECTED]@*/ break;
        } else if (rc == 0) {
  -         return total;
  +         return (ssize_t) total;
            /[EMAIL PROTECTED]@*/ break;
        }
  -     bytesRead = rc;
  +     bytesRead = (size_t) rc;
       }
   
  -    return count;
  +    return (ssize_t) count;
   }
   
   static ssize_t ufdWrite(void * cookie, const char * buf, size_t count)
  @@ -1946,8 +1946,8 @@
        /[EMAIL PROTECTED] fileSystem, internalState @*/
   {
       FD_t fd = c2f(cookie);
  -    int bytesWritten;
  -    int total = 0;
  +    size_t bytesWritten;
  +    size_t total = 0;
   
   #ifdef       NOTYET
       if (fdGetIo(fd) == fdio) {
  @@ -1969,20 +1969,20 @@
        /* Is there room to write data? */
        if (fd->bytesRemain == 0) {
   fprintf(stderr, "*** ufdWrite fd %p WRITE PAST END OF CONTENT\n", fd);
  -         return total;       /* XXX simulate EOF */
  +         return (ssize_t) total;     /* XXX simulate EOF */
        }
        rc = fdWritable(fd, 2);         /* XXX configurable? */
   
        switch (rc) {
        case -1:        /* error */
        case  0:        /* timeout */
  -         return total;
  +         return (ssize_t) total;
            /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ break;
        default:        /* data to write */
            /[EMAIL PROTECTED]@*/ break;
        }
   
  -     rc = fdWrite(fd, buf + total, count - total);
  +     rc = (int) fdWrite(fd, buf + total, count - total);
   
        if (rc < 0) {
            switch (errno) {
  @@ -1997,13 +1997,13 @@
            return rc;
            /[EMAIL PROTECTED]@*/ break;
        } else if (rc == 0) {
  -         return total;
  +         return (ssize_t) total;
            /[EMAIL PROTECTED]@*/ break;
        }
  -     bytesWritten = rc;
  +     bytesWritten = (size_t) rc;
       }
   
  -    return count;
  +    return (ssize_t) count;
   }
   
   static inline int ufdSeek(void * cookie, _libio_pos_t pos, int whence)
  @@ -2375,7 +2375,7 @@
       if (gzfile == NULL) return -2;   /* XXX can't happen */
   
       fdstat_enter(fd, FDSTAT_READ);
  -    rc = gzread(gzfile, buf, count);
  +    rc = gzread(gzfile, buf, (unsigned)count);
   DBGIO(fd, (stderr, "==>\tgzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, 
(unsigned)count, (unsigned long)rc, fdbg(fd)));
       if (rc < 0) {
        int zerror = 0;
  @@ -2407,7 +2407,7 @@
       if (gzfile == NULL) return -2;   /* XXX can't happen */
   
       fdstat_enter(fd, FDSTAT_WRITE);
  -    rc = gzwrite(gzfile, (void *)buf, count);
  +    rc = gzwrite(gzfile, (void *)buf, (unsigned)count);
   DBGIO(fd, (stderr, "==>\tgzdWrite(%p,%p,%u) rc %lx %s\n", cookie, buf, 
(unsigned)count, (unsigned long)rc, fdbg(fd)));
       if (rc < 0) {
        int zerror = 0;
  @@ -2445,7 +2445,7 @@
       if (gzfile == NULL) return -2;   /* XXX can't happen */
   
       fdstat_enter(fd, FDSTAT_SEEK);
  -    rc = gzseek(gzfile, p, whence);
  +    rc = gzseek(gzfile, (long)p, whence);
   DBGIO(fd, (stderr, "==>\tgzdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, 
whence, (unsigned long)rc, fdbg(fd)));
       if (rc < 0) {
        int zerror = 0;
  @@ -2601,7 +2601,7 @@
       fdstat_enter(fd, FDSTAT_READ);
       if (bzfile)
        /[EMAIL PROTECTED]@*/
  -     rc = BZ2_bzread(bzfile, buf, count);
  +     rc = BZ2_bzread(bzfile, buf, (int)count);
        /[EMAIL PROTECTED]@*/
       if (rc == -1) {
        int zerror = 0;
  @@ -2633,7 +2633,7 @@
   
       bzfile = bzdFileno(fd);
       fdstat_enter(fd, FDSTAT_WRITE);
  -    rc = BZ2_bzwrite(bzfile, (void *)buf, count);
  +    rc = BZ2_bzwrite(bzfile, (void *)buf, (int)count);
       if (rc == -1) {
        int zerror = 0;
        fd->errcookie = BZ2_bzerror(bzfile, &zerror);
  @@ -2722,7 +2722,7 @@
   #if 0
       FILE *file;
   #endif
  -    int pid;
  +    pid_t pid;
   } LZFILE;
   
   static size_t MyReadFile(FILE *file, void *data, size_t size)
  @@ -2773,7 +2773,7 @@
        /[EMAIL PROTECTED] fileSystem, internalState @*/
        /[EMAIL PROTECTED] fileSystem, internalState @*/
   {
  -    int pid;
  +    pid_t pid;
       int p[2];
       int xx;
       const char *lzma;
  @@ -3009,7 +3009,7 @@
   /[EMAIL PROTECTED]@*/ /* FIX: check rc */
       rc = fclose(lzfile->g_InBuffer.File);
       if (lzfile->pid)
  -     rc = wait4(lzfile->pid, NULL, 0, NULL);
  +     rc = (int) wait4(lzfile->pid, NULL, 0, NULL);
       else { /* reading */
           lzfile->state.Probs = _free(lzfile->state.Probs);
           lzfile->state.Dictionary = _free(lzfile->state.Dictionary);
  @@ -3097,17 +3097,17 @@
   
       if (fdGetIo(fd) == fpio) {
        /[EMAIL PROTECTED] [EMAIL PROTECTED]/
  -     rc = fread(buf, size, nmemb, fdGetFILE(fd));
  +     rc = (int) fread(buf, size, nmemb, fdGetFILE(fd));
        /[EMAIL PROTECTED] [EMAIL PROTECTED]/
  -     return rc;
  +     return (size_t) rc;
       }
   
       /[EMAIL PROTECTED]@*/
       _read = FDIOVEC(fd, read);
       /[EMAIL PROTECTED]@*/
   
  -    rc = (_read ? (*_read) (fd, buf, size * nmemb) : -2);
  -    return rc;
  +    rc = (int) (_read ? (*_read) (fd, buf, size * nmemb) : -2);
  +    return (size_t) rc;
   }
   
   size_t Fwrite(const void *buf, size_t size, size_t nmemb, FD_t fd)
  @@ -3120,17 +3120,17 @@
   
       if (fdGetIo(fd) == fpio) {
        /[EMAIL PROTECTED] [EMAIL PROTECTED]/
  -     rc = fwrite(buf, size, nmemb, fdGetFILE(fd));
  +     rc = (int) fwrite(buf, size, nmemb, fdGetFILE(fd));
        /[EMAIL PROTECTED] [EMAIL PROTECTED]/
  -     return rc;
  +     return (size_t) rc;
       }
   
       /[EMAIL PROTECTED]@*/
       _write = FDIOVEC(fd, write);
       /[EMAIL PROTECTED]@*/
   
  -    rc = (_write ? _write(fd, buf, size * nmemb) : -2);
  -    return rc;
  +    rc = (int) (_write ? _write(fd, buf, size * nmemb) : -2);
  +    return (size_t) rc;
   }
   
   int Fseek(FD_t fd, _libio_off_t offset, int whence) {
  @@ -3152,7 +3152,7 @@
   
        /[EMAIL PROTECTED] [EMAIL PROTECTED]/
        fp = fdGetFILE(fd);
  -     rc = fseek(fp, offset, whence);
  +     rc = fseek(fp, (long)offset, whence);
        /[EMAIL PROTECTED] [EMAIL PROTECTED]/
        return rc;
       }
  @@ -3654,7 +3654,7 @@
       rc = 0;
       if (created)
        rpmlog(RPMLOG_DEBUG, D_("created directory(s) %s mode 0%o\n"),
  -                     path, mode);
  +                     path, (unsigned)mode);
       return rc;
   }
   
  @@ -3814,7 +3814,7 @@
       size = fdSize(fd);
       blen = (size >= 0 ? size : blenmax);
       if (blen) {
  -     int nb;
  +     size_t nb;
        b = xmalloc(blen+1);
        b[0] = (byte) '\0';
        nb = Fread(b, sizeof(*b), blen, fd);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmlog.c
  ============================================================================
  $ cvs diff -u -r2.34 -r2.35 rpmlog.c
  --- rpm/rpmio/rpmlog.c        11 Oct 2007 19:44:24 -0000      2.34
  +++ rpm/rpmio/rpmlog.c        15 Nov 2007 17:27:59 -0000      2.35
  @@ -160,7 +160,8 @@
       /[EMAIL PROTECTED]@*/ unsigned fac = RPMLOG_FAC(code);
   #endif
       char *msgbuf, *msg;
  -    int msgnb = BUFSIZ, nb;
  +    size_t msgnb = BUFSIZ;
  +    int nb;
       FILE * msgout = (_stdlog ? _stdlog : stderr);
   
       if ((mask & rpmlogMask) == 0)
  @@ -174,7 +175,7 @@
        va_list apc;
        /[EMAIL PROTECTED] [EMAIL PROTECTED]/ va_copy(apc, ap); /[EMAIL 
PROTECTED] [EMAIL PROTECTED]/
        nb = vsnprintf(msgbuf, msgnb, fmt, apc);
  -     if (nb > -1 && nb < msgnb)
  +     if (nb > -1 && (size_t)nb < msgnb)
            break;
        if (nb > -1)            /* glibc 2.1 (and later) */
            msgnb = nb+1;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmlua.c
  ============================================================================
  $ cvs diff -u -r2.26 -r2.27 rpmlua.c
  --- rpm/rpmio/rpmlua.c        15 Nov 2007 14:56:21 -0000      2.26
  +++ rpm/rpmio/rpmlua.c        15 Nov 2007 17:27:59 -0000      2.27
  @@ -562,7 +562,7 @@
         (void) fputs(prompt, stdout);
         (void) fflush(stdout);
      }
  -   if (fgets(buffer, sizeof(buffer), stdin) == NULL) {
  +   if (fgets(buffer, (int)sizeof(buffer), stdin) == NULL) {
         return 0;  /* read fails */
      } else {
         lua_pushstring(L, buffer);
  @@ -867,7 +867,7 @@
        if (s == NULL)
            return luaL_error(L, "`tostring' must return a string to `print'");
        if (lua->storeprint) {
  -         int sl = lua_strlen(L, -1);
  +         size_t sl = lua_strlen(L, -1);
            if (lua->printbufused+sl+1 > lua->printbufsize) {
                lua->printbufsize += sl+512;
                lua->printbuf = xrealloc(lua->printbuf, lua->printbufsize);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmpgp.c
  ============================================================================
  $ cvs diff -u -r2.69 -r2.70 rpmpgp.c
  --- rpm/rpmio/rpmpgp.c        15 Nov 2007 16:29:02 -0000      2.69
  +++ rpm/rpmio/rpmpgp.c        15 Nov 2007 17:27:59 -0000      2.70
  @@ -713,7 +713,7 @@
        case 0x03:
            pgpPrtVal(" iterated/salted ", pgpHashTbl, p[2]);
            /[EMAIL PROTECTED] -shiftimplementation @*/ /* FIX: unsigned cast */
  -         i = (16 + (p[11] & 0xf)) << ((p[11] >> 4) + 6);
  +         i = (int)(16 + (p[11] & 0xf)) << ((p[11] >> 4) + 6);
            /[EMAIL PROTECTED] =shiftimplementation @*/
            pgpPrtHex("", p+3, 8);
            pgpPrtInt(" iter", i);
  @@ -869,7 +869,7 @@
   
   int pgpPktLen(const byte *pkt, size_t pleft, pgpPkt pp)
   {
  -    unsigned int val = *pkt;
  +    unsigned int val = (unsigned int)*pkt;
       unsigned int plen;
   
       memset(pp, 0, sizeof(*pp));
  @@ -887,7 +887,7 @@
       }
   
       pp->pktlen = 1 + plen + pp->hlen;
  -    if (pleft > 0 && pp->pktlen > pleft)
  +    if (pleft > 0 && pp->pktlen > (unsigned)pleft)
        return -1;
   
   /[EMAIL PROTECTED] -temptrans @*/
  @@ -1219,14 +1219,14 @@
       return rc;
   }
   
  -static int pgpGrabPkts(const byte * pkts, unsigned int pktlen,
  +static int pgpGrabPkts(const byte * pkts, size_t pktlen,
                /[EMAIL PROTECTED]@*/ byte *** pppkts, /[EMAIL PROTECTED]@*/ 
int * pnpkts)
        /[EMAIL PROTECTED] *pppkts, *pnpkts @*/
   {
       pgpPkt pp = alloca(sizeof(*pp));
       const byte *p;
  -    unsigned int pleft;
  -    int len;
  +    size_t pleft;
  +    size_t len;
       int npkts = 0;
       byte ** ppkts;
   
  @@ -1266,7 +1266,7 @@
        /[EMAIL PROTECTED] _dig, _digp, *_digp, _print @*/
   {
       pgpPkt pp = alloca(sizeof(*pp));
  -    unsigned int val = *pkts;
  +    unsigned int val = (unsigned int)*pkts;
       size_t pleft;
       int len;
       byte ** ppkts = NULL;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmrpc.c
  ============================================================================
  $ cvs diff -u -r2.60 -r2.61 rpmrpc.c
  --- rpm/rpmio/rpmrpc.c        15 Nov 2007 16:29:02 -0000      2.60
  +++ rpm/rpmio/rpmrpc.c        15 Nov 2007 17:27:59 -0000      2.61
  @@ -208,7 +208,7 @@
       int fdno;
   
   if (_rpmio_debug)
  -fprintf(stderr, "*** Open(%s, 0x%x, 0%o)\n", path, flags, mode);
  +fprintf(stderr, "*** Open(%s, 0x%x, 0%o)\n", path, flags, (unsigned)mode);
       switch (ut) {
       case URL_IS_PATH:
        path = lpath;
  @@ -536,17 +536,17 @@
        /[EMAIL PROTECTED]/
   {
       switch (c) {
  -        case 'd': return S_IFDIR;
  -        case 'b': return S_IFBLK;
  -        case 'c': return S_IFCHR;
  -        case 'l': return S_IFLNK;
  +        case 'd': return (int)S_IFDIR;
  +        case 'b': return (int)S_IFBLK;
  +        case 'c': return (int)S_IFCHR;
  +        case 'l': return (int)S_IFLNK;
           case 's':
   #ifdef IS_IFSOCK /* And if not, we fall through to IFIFO, which is pretty 
close */
  -               return S_IFSOCK;
  +               return (int)S_IFSOCK;
   #endif
  -        case 'p': return S_IFIFO;
  +        case 'p': return (int)S_IFIFO;
           case 'm': case 'n':          /* Don't know what these are :-) */
  -        case '-': case '?': return S_IFREG;
  +        case '-': case '?': return (int)S_IFREG;
           default: return -1;
       }
   }
  @@ -854,8 +854,9 @@
   
       if (((S_ISLNK (st->st_mode) ||
           (num_cols == idx + 3 && st->st_nlink > 1))) /* Maybe a hardlink? (in 
extfs) */
  -        && idx2){
  -     int tlen;
  +        && idx2)
  +    {
  +     size_t tlen;
        char *t;
   
        if (filename){
  @@ -886,7 +887,7 @@
            /*
            *filename = g_strdup (columns [idx++]);
            */
  -         int tlen;
  +         size_t tlen;
            char *t;
   
            t = g_strdup (p_copy + column_ptr [idx]); idx++;
  @@ -960,7 +961,7 @@
       char * se;
       const char * urldn;
       char * bn = NULL;
  -    int nbn = 0;
  +    size_t nbn = 0;
       urlinfo u;
       int rc;
   
  @@ -998,7 +999,7 @@
        /* XXX possibly should do "NLST -lais" to get st_ino/st_blocks also */
        u->openError = ftpReq(fd, "NLST", "-la");
   
  -     if (bn == NULL || nbn <= 0) {
  +     if (bn == NULL || nbn == 0) {
            rc = -2;
            goto exit;
        }
  @@ -1114,10 +1115,11 @@
            rc = -1;
        } else {
            rc = oe - o;
  -         if (rc > rlbufsiz)
  -             rc = rlbufsiz;
  -         memcpy(rlbuf, o, rc);
  -         if (rc < rlbufsiz)
  +assert(rc >= 0);
  +         if (rc > (int)rlbufsiz)
  +             rc = (int)rlbufsiz;
  +         memcpy(rlbuf, o, (size_t)rc);
  +         if (rc < (int)rlbufsiz)
                rlbuf[rc] = '\0';
        }
        break;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmsq.c
  ============================================================================
  $ cvs diff -u -r1.29 -r1.30 rpmsq.c
  --- rpm/rpmio/rpmsq.c 15 Nov 2007 14:56:21 -0000      1.29
  +++ rpm/rpmio/rpmsq.c 15 Nov 2007 17:27:59 -0000      1.30
  @@ -477,13 +477,13 @@
        /* Block to permit parent time to wait. */
        xx = close(sq->pipes[1]);
        if (sq->reaper)
  -         xx = read(sq->pipes[0], &yy, sizeof(yy));
  +         xx = (int)read(sq->pipes[0], &yy, sizeof(yy));
        xx = close(sq->pipes[0]);
        sq->pipes[0] = sq->pipes[1] = -1;
   
   #ifdef _RPMSQ_DEBUG
   if (_rpmsq_debug)
  -fprintf(stderr, "     Child(%p): %p child %d\n", ME(), sq, getpid());
  +fprintf(stderr, "     Child(%p): %p child %d\n", ME(), sq, (int)getpid());
   #endif
   
       } else {                         /* Parent. */
  @@ -492,7 +492,7 @@
   
   #ifdef _RPMSQ_DEBUG
   if (_rpmsq_debug)
  -fprintf(stderr, "    Parent(%p): %p child %d\n", ME(), sq, sq->child);
  +fprintf(stderr, "    Parent(%p): %p child %d\n", ME(), sq, (int)sq->child);
   #endif
   
       }
  @@ -559,7 +559,7 @@
   
   #ifdef _RPMSQ_DEBUG
   if (_rpmsq_debug)
  -fprintf(stderr, "      Wake(%p): %p child %d reaper %d ret %d\n", ME(), sq, 
sq->child, sq->reaper, ret);
  +fprintf(stderr, "      Wake(%p): %p child %d reaper %d ret %d\n", ME(), sq, 
(int)sq->child, sq->reaper, ret);
   #endif
   
       /* Remove processed SIGCHLD item from queue. */
  @@ -580,7 +580,7 @@
   
   #ifdef _RPMSQ_DEBUG
   if (_rpmsq_debug)
  -fprintf(stderr, "      Wait(%p): %p child %d reaper %d\n", ME(), sq, 
sq->child, sq->reaper);
  +fprintf(stderr, "      Wait(%p): %p child %d reaper %d\n", ME(), sq, 
(int)sq->child, sq->reaper);
   #endif
   
       if (sq->reaper) {
  @@ -595,13 +595,13 @@
        sq->status = status;
   #ifdef _RPMSQ_DEBUG
   if (_rpmsq_debug)
  -fprintf(stderr, "   Waitpid(%p): %p child %d reaped %d\n", ME(), sq, 
sq->child, sq->reaped);
  +fprintf(stderr, "   Waitpid(%p): %p child %d reaped %d\n", ME(), sq, 
(int)sq->child, (int)sq->reaped);
   #endif
       }
   
   #ifdef _RPMSQ_DEBUG
   if (_rpmsq_debug)
  -fprintf(stderr, "      Fini(%p): %p child %d status 0x%x\n", ME(), sq, 
sq->child, sq->status);
  +fprintf(stderr, "      Fini(%p): %p child %d status 0x%x\n", ME(), sq, 
(int)sq->child, sq->status);
   #endif
   
       return sq->reaped;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmsw.c
  ============================================================================
  $ cvs diff -u -r2.13 -r2.14 rpmsw.c
  --- rpm/rpmio/rpmsw.c 3 Nov 2007 23:44:04 -0000       2.13
  +++ rpm/rpmio/rpmsw.c 15 Nov 2007 17:27:59 -0000      2.14
  @@ -113,7 +113,7 @@
       secs = etv->tv_sec - btv->tv_sec;
       for (usecs = etv->tv_usec - btv->tv_usec; usecs < 0; usecs += 1000000)
        secs--;
  -    return ((secs * 1000000) + usecs);
  +    return (rpmtime_t) ((secs * 1000000) + usecs);
   }
   
   rpmtime_t rpmswDiff(rpmsw end, rpmsw begin)
  @@ -138,7 +138,7 @@
        ticks -= rpmsw_overhead;
       if (rpmsw_cycles > 1)
        ticks /= rpmsw_cycles;
  -    return ticks;
  +    return (rpmtime_t) ticks;
   }
   
   #if defined(HP_TIMING_NOW)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/url.c
  ============================================================================
  $ cvs diff -u -r1.42 -r1.43 url.c
  --- rpm/rpmio/url.c   11 Oct 2007 19:44:24 -0000      1.42
  +++ rpm/rpmio/url.c   15 Nov 2007 17:27:59 -0000      1.43
  @@ -495,7 +495,7 @@
        serv = getservbyname(u->scheme, "tcp");
   /[EMAIL PROTECTED] =moduncon @*/
        if (serv != NULL)
  -         u->port = ntohs(serv->s_port);
  +         u->port = (int) ntohs(serv->s_port);
        else if (u->urltype == URL_IS_FTP)
            u->port = IPPORT_FTP;
        else if (u->urltype == URL_IS_HKP)
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to