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

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   25-Mar-2009 21:27:17
  Branch: rpm-5_1                          Handle: 2009032520271501

  Modified files:           (Branch: rpm-5_1)
    rpm                     CHANGES
    rpm/rpmio               .splintrc bzdio.c gzdio.c iosm.c rpmbz.h rpmdav.h
                            rpmhash.c rpmhash.h rpmio.c rpmio.h
                            rpmio_internal.h rpmmalloc.c rpmmg.c rpmmg.h
                            rpmpgp.c rpmpgp.h rpmurl.h rpmxar.c rpmxar.h url.c

  Log:
    - jbj: rpmio: rescusitate splint annotations.

  Summary:
    Revision    Changes     Path
    1.2288.2.246+1  -0      rpm/CHANGES
    1.22.2.3    +11 -8      rpm/rpmio/.splintrc
    2.2.2.5     +7  -2      rpm/rpmio/bzdio.c
    2.12.2.4    +4  -4      rpm/rpmio/gzdio.c
    1.22.2.4    +2  -0      rpm/rpmio/iosm.c
    1.3.2.3     +1  -1      rpm/rpmio/rpmbz.h
    2.28.2.2    +1  -5      rpm/rpmio/rpmdav.h
    1.10.2.2    +11 -3      rpm/rpmio/rpmhash.c
    1.5.2.2     +5  -3      rpm/rpmio/rpmhash.h
    1.127.2.18  +18 -6      rpm/rpmio/rpmio.c
    1.68.2.12   +46 -36     rpm/rpmio/rpmio.h
    2.102.2.6   +16 -3      rpm/rpmio/rpmio_internal.h
    1.13.4.8    +27 -5      rpm/rpmio/rpmmalloc.c
    2.7.2.2     +8  -3      rpm/rpmio/rpmmg.c
    2.3.4.3     +4  -0      rpm/rpmio/rpmmg.h
    2.90.2.7    +7  -5      rpm/rpmio/rpmpgp.c
    2.72.2.7    +6  -1      rpm/rpmio/rpmpgp.h
    1.25.2.8    +7  -2      rpm/rpmio/rpmurl.h
    2.17.2.5    +7  -3      rpm/rpmio/rpmxar.c
    2.9.4.4     +5  -2      rpm/rpmio/rpmxar.h
    1.51.2.9    +5  -3      rpm/rpmio/url.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2288.2.245 -r1.2288.2.246 CHANGES
  --- rpm/CHANGES       25 Mar 2009 20:14:47 -0000      1.2288.2.245
  +++ rpm/CHANGES       25 Mar 2009 20:27:15 -0000      1.2288.2.246
  @@ -1,4 +1,5 @@
   5.1.7 -> 5.1.8:
  +    - jbj: rpmio: rescusitate splint annotations.
       - jbj: getdate: ignore internalState changes.
       - jbj: zlog: use struct rpmioItem_s use/pool container.
       - jbj: poptIO: add --htdebug.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/.splintrc
  ============================================================================
  $ cvs diff -u -r1.22.2.2 -r1.22.2.3 .splintrc
  --- rpm/rpmio/.splintrc       11 Jan 2009 03:30:56 -0000      1.22.2.2
  +++ rpm/rpmio/.splintrc       25 Mar 2009 20:27:15 -0000      1.22.2.3
  @@ -13,27 +13,30 @@
   
   # --- in progress
   -bounds
  --checkpost           # 7 *read ensures annotations
   -branchstate
   -bufferoverflowhigh
   
  +-castexpose          # 14
   -compdef             # 82
   -compmempass         # 15
  --moduncon            # 260
  +-evalorder           # 47
  +-moduncon            # 261
   -noeffect            # 9
  --noeffectuncon               # 268
  +-noeffectuncon               # 260
   -nullderef           # 14 rpmlua annotations
  --nullpass            # 171
  +-nullpass            # 177
   -nullstate           # 33 indirections hard to annotate
  --protoparammatch     # 16
  --type                        # 156
  +-protoparammatch     # 4
  +-type                        # 259
   
  --onlytrans           # 20 only <=> newref confusions
  +-newreftrans         # 19
  +-onlytrans           # 29 only <=> newref confusions
   -readonlytrans               # 10 digest names
  --refcounttrans               # 19 only <=> newref confusions
  +-refcounttrans               # 44 only <=> newref confusions
   
   # --- +partial artifacts
   -declundef           # 442
  +-exportheader
   -exportheadervar     # 5
   -exportlocal         # 62
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/bzdio.c
  ============================================================================
  $ cvs diff -u -r2.2.2.4 -r2.2.2.5 bzdio.c
  --- rpm/rpmio/bzdio.c 16 Mar 2009 10:54:18 -0000      2.2.2.4
  +++ rpm/rpmio/bzdio.c 25 Mar 2009 20:27:15 -0000      2.2.2.5
  @@ -25,6 +25,7 @@
       return BZ2_bzerror(bz->bzfile, &bz->bzerr);
   }
   
  +/*...@-mustmod@*/
   static void rpmbzClose(rpmbz bz, int abort, /*...@null@*/ const char ** 
errmsg)
        /*...@modifies bz, *errmsg @*/
   {
  @@ -41,6 +42,7 @@
       }
       bz->bzfile = NULL;
   }
  +/*...@=mustmod@*/
   
   /*...@only@*/ /*...@null@*/
   static rpmbz rpmbzFree(/*...@only@*/ rpmbz bz, int abort)
  @@ -55,6 +57,7 @@
       return rpmbzFini(bz);
   }
   
  +/*...@-mustmod@*/
   /*...@only@*/
   static rpmbz rpmbzNew(const char * path, const char * fmode, int fdno)
        /*...@globals fileSystem @*/
  @@ -128,8 +131,11 @@
                : BZ2_bzWriteOpen(&bz->bzerr, bz->fp, bz->B, bz->V, bz->W);
       }
   
  +/*...@-usereleased@*/
       return (bz->bzfile != NULL ? bz : rpmbzFree(bz, 0));
  +/*...@=usereleased@*/
   }
  +/*...@=mustmod@*/
   
   #ifdef       NOTYET
   /*...@-mustmod -nullst...@*/
  @@ -302,8 +308,7 @@
   }
   
   static int rpmbzFlush(void * _bz)
  -     /*...@globals fileSystem @*/
  -     /*...@modifies fileSystem @*/
  +     /*...@*/
   {
       rpmbz bz = _bz;
       return BZ2_bzflush(bz->bzfile);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/gzdio.c
  ============================================================================
  $ cvs diff -u -r2.12.2.3 -r2.12.2.4 gzdio.c
  --- rpm/rpmio/gzdio.c 11 Jan 2009 03:18:33 -0000      2.12.2.3
  +++ rpm/rpmio/gzdio.c 25 Mar 2009 20:27:15 -0000      2.12.2.4
  @@ -188,8 +188,7 @@
   
   static ssize_t
   rsyncable_gzwrite(rpmGZFILE rpmgz, const unsigned char *const buf, const 
size_t len)
  -     /*...@globals fileSystem @*/
  -     /*...@modifies rpmgz, fileSystem @*/
  +     /*...@modifies rpmgz @*/
   {
       ssize_t rc;
       size_t n;
  @@ -291,8 +290,7 @@
   }
   
   static int gzdFlush(void * cookie)
  -     /*...@globals fileSystem @*/
  -     /*...@modifies fileSystem @*/
  +     /*...@*/
   {
       FD_t fd = c2f(cookie);
       rpmGZFILE rpmgz;
  @@ -302,6 +300,7 @@
   }
   
   /* =============================================================== */
  +/*...@-mustmod@*/
   static ssize_t gzdRead(void * cookie, /*...@out@*/ char * buf, size_t count)
        /*...@globals fileSystem, internalState @*/
        /*...@modifies buf, fileSystem, internalState @*/
  @@ -331,6 +330,7 @@
       }
       return rc;
   }
  +/*...@=mustmod@*/
   
   static ssize_t gzdWrite(void * cookie, const char * buf, size_t count)
        /*...@globals fileSystem, internalState @*/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/iosm.c
  ============================================================================
  $ cvs diff -u -r1.22.2.3 -r1.22.2.4 iosm.c
  --- rpm/rpmio/iosm.c  6 Oct 2008 19:50:09 -0000       1.22.2.3
  +++ rpm/rpmio/iosm.c  25 Mar 2009 20:27:16 -0000      1.22.2.4
  @@ -714,7 +714,9 @@
   
       iosm->goal = goal;
       if (cfd != NULL) {
  +/*...@-assignexpose@*/
        iosm->cfd = fdLink(cfd, "persist (iosm)");
  +/*...@=assignexpose@*/
        pos = fdGetCpioPos(iosm->cfd);
        fdSetCpioPos(iosm->cfd, 0);
       }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmbz.h
  ============================================================================
  $ cvs diff -u -r1.3.2.2 -r1.3.2.3 rpmbz.h
  --- rpm/rpmio/rpmbz.h 16 Mar 2009 10:54:18 -0000      1.3.2.2
  +++ rpm/rpmio/rpmbz.h 25 Mar 2009 20:27:16 -0000      1.3.2.3
  @@ -4,7 +4,7 @@
   #include <bzlib.h>
   
   #if defined(__LCLINT__)
  -/*...@=incondefs =protoparamma...@*/
  +/*...@-incondefs =protoparamma...@*/
   /*...@-exportheader@*/
   
   BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmdav.h
  ============================================================================
  $ cvs diff -u -r2.28.2.1 -r2.28.2.2 rpmdav.h
  --- rpm/rpmio/rpmdav.h        30 Oct 2008 15:57:20 -0000      2.28.2.1
  +++ rpm/rpmio/rpmdav.h        25 Mar 2009 20:27:16 -0000      2.28.2.2
  @@ -189,13 +189,9 @@
   
   /**
    */
  -/*...@-incondefs@*/
   ssize_t davRead(void * cookie, /*...@out@*/ char * buf, size_t count)
           /*...@globals fileSystem, internalState @*/
  -        /*...@modifies buf, fileSystem, internalState @*/
  -     /*...@requires maxSet(buf) >= (count - 1) @*/
  -     /*...@ensures maxRead(buf) == result @*/;
  -/*...@=incondefs@*/
  +        /*...@modifies buf, errno, fileSystem, internalState @*/;
   
   /**
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmhash.c
  ============================================================================
  $ cvs diff -u -r1.10.2.1 -r1.10.2.2 rpmhash.c
  --- rpm/rpmio/rpmhash.c       24 Mar 2009 20:58:27 -0000      1.10.2.1
  +++ rpm/rpmio/rpmhash.c       25 Mar 2009 20:27:16 -0000      1.10.2.2
  @@ -8,6 +8,7 @@
   #include <rpmhash.h>
   #include "debug.h"
   
  +/*...@unchecked@*/
   int _ht_debug = 0;
   
   typedef /*...@owned@*/ const void * voidptr;
  @@ -33,6 +34,10 @@
       hashBucket * buckets;            /*!< hash bucket array */
       hashFunctionType fn;             /*!< generate hash value for key */
       hashEqualityType eq;             /*!< compare hash keys for equality */
  +#if defined(__LCLINT__)
  +/*...@refs@*/
  +    int nrefs;                               /*!< (unused) keep splint happy 
*/
  +#endif
   };
   
   /**
  @@ -188,8 +193,9 @@
       return 0;
   }
   
  +/*...@-mustmod@*/    /* XXX splint on crack */
   static void htFini(void * _ht)
  -     /*...@modifies *_ht @*/
  +     /*...@modifies _ht @*/
   {
       hashTable ht = _ht;
       hashBucket b, n;
  @@ -215,12 +221,14 @@
   
       ht->buckets = _free(ht->buckets);
   }
  +/*...@=mustmod@*/
   
  -/*...@unchecked@*/ /*...@null@*/
  +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/
   rpmioPool _htPool;
   
   static hashTable htGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  +     /*...@globals _htPool, fileSystem @*/
  +     /*...@modifies pool, _htPool, fileSystem @*/
   {
       hashTable ht;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmhash.h
  ============================================================================
  $ cvs diff -u -r1.5.2.1 -r1.5.2.2 rpmhash.h
  --- rpm/rpmio/rpmhash.h       24 Mar 2009 20:58:27 -0000      1.5.2.1
  +++ rpm/rpmio/rpmhash.h       25 Mar 2009 20:27:16 -0000      1.5.2.2
  @@ -8,7 +8,7 @@
   
   /**
    */
  -typedef /*...@abstract@*/ struct hashTable_s * hashTable;
  +typedef /*...@abstract@*/ /*...@refcounted@*/ struct hashTable_s * hashTable;
   
   #ifdef __cplusplus
   extern "C" {
  @@ -93,7 +93,7 @@
    * @return           NULL if free'd
    */
   /*...@unused@*/ /*...@null@*/
  -hashTable htUnlink (/*...@killref@*/ /*...@only@*/ /*...@null@*/ hashTable 
ht);
  +hashTable htUnlink (/*...@killref@*/ /*...@null@*/ hashTable ht)
        /*...@modifies ht @*/;
   #define      htUnlink(_ht)   \
       ((hashTable)rpmioUnlinkPoolItem((rpmioItem)(_ht), __FUNCTION__, 
__FILE__, __LINE__))
  @@ -131,9 +131,11 @@
    * @param eq            function to compare keys for equality (NULL for 
default)
    * @return           pointer to initialized hash table
    */
  +/*...@newref@*/ /*...@null@*/
   hashTable htCreate(int numBuckets, size_t keySize, int freeData,
                /*...@null@*/ hashFunctionType fn, /*...@null@*/ 
hashEqualityType eq)
  -     /*...@*/; 
  +     /*...@globals fileSystem @*/
  +     /*...@modifies fileSystem @*/;
   
   #ifdef __cplusplus
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmio.c
  ============================================================================
  $ cvs diff -u -r1.127.2.17 -r1.127.2.18 rpmio.c
  --- rpm/rpmio/rpmio.c 24 Mar 2009 20:58:27 -0000      1.127.2.17
  +++ rpm/rpmio/rpmio.c 25 Mar 2009 20:27:16 -0000      1.127.2.18
  @@ -117,6 +117,8 @@
   /*...@access FILE @*/        /* XXX to permit comparison/conversion with 
void *. */
   /*...@access urlinfo @*/
   /*...@access FDSTAT_t @*/
  +/*...@access rpmxar @*/
  +/*...@access pgpDig @*/
   
   #define FDTO(fd)     (fd ? ((FD_t)fd)->rd_timeoutsecs : -99)
   #define FDCPIOPOS(fd)        (fd ? ((FD_t)fd)->fd_cpioPos : -99)
  @@ -290,7 +292,8 @@
   
   /* =============================================================== */
   static void fdFini(void * _fd)
  -     /*...@modifies _fd @*/
  +     /*...@globals fileSystem @*/
  +     /*...@modifies _fd, fileSystem @*/
   {
       FD_t fd = _fd;
       int i;
  @@ -314,11 +317,12 @@
   /*...@=onlytrans@*/
   }
   
  -/*...@unchecked@*/ /*...@null@*/
  +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/
   rpmioPool _fdPool;
   
   static FD_t fdGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  +     /*...@globals _fdPool, fileSystem @*/
  +     /*...@modifies pool, _fdPool, fileSystem @*/
   {
       FD_t fd;
   
  @@ -375,7 +379,6 @@
        /*...@globals errno, fileSystem, internalState @*/
        /*...@modifies buf, errno, fileSystem, internalState @*/
        /*...@requires maxSet(buf) >= (count - 1) @*/
  -     /*...@ensures maxRead(buf) == result @*/
   {
       FD_t fd = c2f(cookie);
       ssize_t rc;
  @@ -1687,8 +1690,10 @@
        tosecs = data->rd_timeoutsecs;
        data->rd_timeoutsecs = 10;
        if (fdReadable(data, data->rd_timeoutsecs) > 0) {
  +/*...@-infloopsuncon@*/
            while ((ufdio->read)(data, u->buf, u->bufAlloced) > 0)
                u->buf[0] = '\0';
  +/*...@=infloopsuncon@*/
        }
        data->rd_timeoutsecs = tosecs;
        /* XXX ftp abort needs to close the data channel to receive status */
  @@ -1877,7 +1882,9 @@
       FDSANE(fd);
       if (fd->url == NULL)
        return NULL;
  +/*...@-retexpose@*/
       return urlLink(fd->url, "ufdGetUrlinfo");
  +/*...@=retexpose@*/
   }
   
   /* =============================================================== */
  @@ -1885,7 +1892,6 @@
        /*...@globals fileSystem, internalState @*/
        /*...@modifies buf, fileSystem, internalState @*/
        /*...@requires maxSet(buf) >= (count - 1) @*/
  -     /*...@ensures maxRead(buf) == result @*/
   {
       FD_t fd = c2f(cookie);
       size_t bytesRead;
  @@ -2198,6 +2204,7 @@
   if (_rpmio_debug)
   fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, (unsigned)flags, 
(unsigned)mode);
   
  +/*...@-usereleased@*/
       switch (urlType) {
       case URL_IS_FTP:
        fd = ftpOpen(url, flags, mode, &u);
  @@ -2278,6 +2285,7 @@
        (void) ufdClose(fd);
        return NULL;
       }
  +/*...@=usereleased@*/
   DBGIO(fd, (stderr, "==>\tufdOpen(\"%s\",%x,0%o) %s\n", url, (unsigned)flags, 
(unsigned)mode, fdbg(fd)));
       return fd;
   }
  @@ -2422,6 +2430,7 @@
       FDSANE(fd);
   DBGIO(fd, (stderr, "==> Fclose(%p) %s\n", (fd ? fd : NULL), fdbg(fd)));
   
  +/*...@-usereleased@*/
       fd = fdLink(fd, "Fclose");
       while (fd->nfps >= 0) {
        FDSTACK_t * fps = &fd->fps[fd->nfps];
  @@ -2448,7 +2457,6 @@
                /*...@-refcounttrans@*/
                rc = ufdClose(fd);
                /*...@=refcounttrans@*/
  -/*...@-usereleased@*/
                if (fdGetFdno(fd) >= 0)
                    break;
                if (!fd->persist)
  @@ -3151,11 +3159,15 @@
   
   void rpmioClean(void)
   {
  +/*...@-nestedextern@*/
       extern rpmioPool _digPool;
       extern rpmioPool _xarPool;
       extern rpmioPool _urlPool;
       extern rpmioPool _rpmmgPool;
  +/*...@-shadow@*/
       extern rpmioPool _htPool;
  +/*...@=shadow@*/
  +/*...@=nestedextern@*/
   
   #if defined(WITH_LUA)
       (void) rpmluaFree(NULL);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmio.h
  ============================================================================
  $ cvs diff -u -r1.68.2.11 -r1.68.2.12 rpmio.h
  --- rpm/rpmio/rpmio.h 20 Mar 2009 22:04:01 -0000      1.68.2.11
  +++ rpm/rpmio/rpmio.h 25 Mar 2009 20:27:16 -0000      1.68.2.12
  @@ -16,7 +16,6 @@
   #include <stdlib.h>
   #include <unistd.h>
   
  -#include <rpmzlog.h>
   #include <yarn.h>
   
   /** \ingroup rpmio
  @@ -144,8 +143,7 @@
   size_t Fread(/*...@out@*/ void * buf, size_t size, size_t nmemb, FD_t fd)
        /*...@globals fileSystem @*/
        /*...@modifies fd, *buf, fileSystem @*/
  -     /*...@requires maxSet(buf) >= (nmemb - 1) @*/
  -     /*...@ensures maxRead(buf) == result @*/;
  +     /*...@requires maxSet(buf) >= (nmemb - 1) @*/;
   /*...@=incondefs@*/
   
   /**
  @@ -504,14 +502,10 @@
   /*...@-exportlocal@*/
   /**
    */
  -/*...@-incondefs@*/
   ssize_t fdRead(void * cookie, /*...@out@*/ char * buf, size_t count)
        /*...@globals errno, fileSystem, internalState @*/
  -     /*...@modifies *cookie, *buf, errno, fileSystem, internalState @*/
  -     /*...@requires maxSet(buf) >= (count - 1) @*/
  -     /*...@ensures maxRead(buf) == result @*/ ;
  +     /*...@modifies *cookie, *buf, errno, fileSystem, internalState @*/;
   #define      fdRead(_fd, _buf, _count)       fdio->read((_fd), (_buf), 
(_count))
  -/*...@=incondefs@*/
   
   /**
    */
  @@ -537,8 +531,8 @@
   /**
    */
   /*...@unused@*/
  -/*...@only@*/ /*...@null@*/
  -FD_t fdLink (/*...@only@*/ void * cookie, const char * msg)
  +/*...@newref@*/ /*...@null@*/
  +FD_t fdLink (void * cookie, const char * msg)
        /*...@globals fileSystem @*/
        /*...@modifies *cookie, fileSystem @*/;
   #define      fdLink(_fd, _msg)       \
  @@ -546,8 +540,8 @@
   
   /**
    */
  -/*...@unused@*/ /*...@only@*/ /*...@null@*/
  -FD_t fdFree(/*...@only@*/ FD_t fd, const char * msg)
  +/*...@unused@*/ /*...@null@*/
  +FD_t fdFree(/*...@killref@*/ FD_t fd, const char * msg)
        /*...@globals fileSystem @*/
        /*...@modifies fd, fileSystem @*/;
   #define      fdFree(_fd, _msg)       \
  @@ -556,12 +550,11 @@
   /**
    */
   /*...@unused@*/
  -/*...@only@*/ /*...@null@*/
  +/*...@newref@*/ /*...@null@*/
   FD_t fdNew (const char * msg)
        /*...@globals fileSystem @*/
        /*...@modifies fileSystem @*/;
  -/*...@unused@*/
  -/*...@only@*/ /*...@null@*/
  +/*...@newref@*/ /*...@null@*/
   FD_t XfdNew (const char * msg, const char * fn, unsigned ln)
        /*...@globals fileSystem @*/
        /*...@modifies fileSystem @*/;
  @@ -648,21 +641,25 @@
   /**
    */
   /*...@-redecl@*/
  -/*...@observer@*/ const char * ftpStrerror(int errorNumber)
  +/*...@observer@*/
  +const char * ftpStrerror(int errorNumber)
        /*...@*/;
   /*...@=redecl@*/
   
   /**
    */
   /*...@unused@*/
  -/*...@dependent@*/ /*...@null@*/ void * ufdGetUrlinfo(FD_t fd)
  -     /*...@modifies fd @*/;
  +/*...@dependent@*/ /*...@null@*/
  +void * ufdGetUrlinfo(FD_t fd)
  +     /*...@globals fileSystem @*/
  +     /*...@modifies fd, fileSystem @*/;
   
   /**
    */
   /*...@-redecl@*/
   /*...@unused@*/
  -/*...@observer@*/ const char * urlStrerror(const char * url)
  +/*...@observer@*/
  +const char * urlStrerror(const char * url)
        /*...@globals h_errno, internalState @*/
        /*...@modifies internalState @*/;
   /*...@=redecl@*/
  @@ -794,13 +791,6 @@
   #endif
   
   /**
  - * Free all memory allocated by rpmio usage.
  - */
  -void rpmioClean(void)
  -     /*...@globals internalState, fileSystem @*/
  -     /*...@modifies internalState, fileSystem @*/;
  -
  -/**
    */
   typedef      struct rpmioItem_s * rpmioItem;
   struct rpmioItem_s {
  @@ -808,10 +798,22 @@
       void *pool;
   };
   
  +#include <rpmzlog.h>
  +
   /**
    */
   typedef struct rpmioPool_s * rpmioPool;
   
  +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/
  +extern rpmioPool _fdPool;
  +
  +/**
  + * Free all memory allocated by rpmio usage.
  + */
  +void rpmioClean(void)
  +     /*...@globals _fdPool, fileSystem, internalState @*/
  +     /*...@modifies _fdPool, fileSystem, internalState @*/;
  +
   /**
    * Reclaim memory pool items.
    * @param pool               memory pool (NULL uses global rpmio pool)
  @@ -819,7 +821,8 @@
    */
   /*...@null@*/
   rpmioPool rpmioFreePool(/*...@only@*//*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/;
  +     /*...@globals fileSystem, internalState @*/
  +     /*...@modifies pool, fileSystem, internalState @*/;
   
   /**
    * Create a memory pool.
  @@ -832,11 +835,13 @@
    * @param (*fini)()  destroy item contents
    * @return           memory pool
    */
  -rpmioPool rpmioNewPool(const char * name, size_t size, int limit, int flags,
  +rpmioPool rpmioNewPool(/*...@observer@*/ const char * name,
  +             size_t size, int limit, int flags,
                /*...@null@*/ const char * (*dbg) (void *item), 
                /*...@null@*/ void (*init) (void *item),
                /*...@null@*/ void (*fini) (void *item))
  -        /*...@*/;
  +     /*...@globals fileSystem @*/
  +     /*...@modifies fileSystem @*/;
   
   /**
    * Decrement a pool item refcount.
  @@ -849,7 +854,8 @@
   /*...@null@*/
   rpmioItem rpmioUnlinkPoolItem(/*...@killref@*/ /*...@null@*/ rpmioItem item,
                const char * msg, const char * fn, unsigned ln)
  -     /*...@modifies item @*/;
  +     /*...@globals fileSystem @*/
  +     /*...@modifies item, fileSystem @*/;
   
   /**
    * Increment a pool item refcount.
  @@ -862,7 +868,8 @@
   /*...@newref@*/ /*...@null@*/
   rpmioItem rpmioLinkPoolItem(/*...@returned@*/ /*...@null@*/ rpmioItem item,
                const char * msg, const char * fn, unsigned ln)
  -     /*...@modifies item @*/;
  +     /*...@globals fileSystem @*/
  +     /*...@modifies item, fileSystem @*/;
   
   /**
    * Free a pool item.
  @@ -873,9 +880,10 @@
    * @return           pool item
    */
   /*...@null@*/
  -rpmioItem rpmioFreePoolItem(/*...@killref@*/ /*...@null@*/ rpmioItem item,
  +void * rpmioFreePoolItem(/*...@killref@*/ /*...@null@*/ rpmioItem item,
                const char * msg, const char * fn, unsigned ln)
  -     /*...@modifies item @*/;
  +     /*...@globals fileSystem @*/
  +     /*...@modifies item, fileSystem @*/;
   
   /**
    * Get unused item from pool, or alloc a new item.
  @@ -883,8 +891,9 @@
    * @param size               item size
    * @return           new item
    */
  -rpmioItem rpmioGetPool(/*...@null@*/ rpmioPool pool, size_t size)
  -        /*...@modifies pool @*/;
  +rpmioItem rpmioGetPool(/*...@kept@*/ /*...@null@*/ rpmioPool pool, size_t 
size)
  +     /*...@globals fileSystem @*/
  +        /*...@modifies pool, fileSystem @*/;
   
   /**
    * Put unused item into pool (or free).
  @@ -893,7 +902,8 @@
    */
   /*...@null@*/
   rpmioItem rpmioPutPool(rpmioItem item)
  -        /*...@modifies item @*/;
  +     /*...@globals fileSystem @*/
  +        /*...@modifies item, fileSystem @*/;
   
   #ifdef __cplusplus
   }
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmio_internal.h
  ============================================================================
  $ cvs diff -u -r2.102.2.5 -r2.102.2.6 rpmio_internal.h
  --- rpm/rpmio/rpmio_internal.h        21 Mar 2009 15:26:25 -0000      
2.102.2.5
  +++ rpm/rpmio/rpmio_internal.h        25 Mar 2009 20:27:16 -0000      
2.102.2.6
  @@ -13,6 +13,9 @@
   
   #include <rpmxar.h>
   
  +/*...@access pgpDig @*/      /* XXX FIXME: (by refactoring to foo.c) */
  +/*...@access rpmxar @*/      /* XXX FIXME: (by refactoring to foo.c) */
  +
   /** \ingroup rpmio
    */
   typedef struct _FDSTACK_s {
  @@ -63,7 +66,7 @@
       FDSTACK_t        fps[8];
       int              urlType;        /* ufdio: */
   
  -/*...@dependent@*/
  +/*...@dependent@*/ /*...@relnull@*/
       void *   url;            /* ufdio: URL info */
   /*...@relnull@*/
       void *   req;            /* ufdio: HTTP request */
  @@ -96,6 +99,10 @@
   
       int              ftpFileDoneNeeded; /* ufdio: (FTP) */
       unsigned long long       fd_cpioPos;     /* cpio: */
  +#if defined(__LCLINT__)
  +/*...@refs@*/
  +    int nrefs;                       /*!< (unused) keep splint happy */
  +#endif
   };
   /*...@access f...@*/
   
  @@ -224,11 +231,14 @@
    */
   /*...@unused@*/ static inline
   void fdSetDig(FD_t fd, pgpDig dig)
  -     /*...@modifies fd, dig @*/
  +     /*...@globals fileSystem @*/
  +     /*...@modifies fd, dig, fileSystem @*/
   {
       FDSANE(fd);
  +/*...@-assignexpose@*/
       fd->dig = pgpDigFree(fd->dig, "fdSetDig");
       fd->dig = pgpDigLink(dig, "fdSetDig");
  +/*...@=assignexpose@*/
   }
   
   /** \ingroup rpmio
  @@ -247,10 +257,13 @@
    */
   /*...@unused@*/ static inline
   void fdSetXAR(FD_t fd, rpmxar xar)
  -     /*...@modifies fd, xar @*/
  +     /*...@globals fileSystem @*/
  +     /*...@modifies fd, xar, fileSystem @*/
   {
       FDSANE(fd);
  +/*...@-assignexpose@*/
       fd->xar = rpmxarLink(xar, "fdSetXAR");
  +/*...@=assignexpose@*/
   }
   
   /** \ingroup rpmio
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmmalloc.c
  ============================================================================
  $ cvs diff -u -r1.13.4.7 -r1.13.4.8 rpmmalloc.c
  --- rpm/rpmio/rpmmalloc.c     24 Mar 2009 16:46:43 -0000      1.13.4.7
  +++ rpm/rpmio/rpmmalloc.c     25 Mar 2009 20:27:16 -0000      1.13.4.8
  @@ -35,9 +35,11 @@
    */
   struct rpmioPool_s {
       yarnLock have;           /*!< unused items available, lock for list */
  +/*...@relnull@*/
       void *pool;
   /*...@relnull@*/
       rpmioItem head;          /*!< linked list of available items */
  +/*...@dependent@*/
       rpmioItem * tail;
       size_t size;             /*!< size of items in this pool */
       int limit;                       /*!< number of new items allowed, or -1 
*/
  @@ -45,8 +47,10 @@
   /*...@null@*/
       const char * (*dbg) (void *item)
        /*...@*/;                       /*!< generate string w Unlink/Link 
debugging */
  +/*...@null@*/
       void (*init) (void *item)
        /*...@modifies *item @*/;       /*!< create item contents. */
  +/*...@null@*/
       void (*fini) (void *item)
        /*...@modifies *item @*/;       /*!< destroy item contents. */
       int reused;                      /*!< number of items reused */
  @@ -57,10 +61,12 @@
       void * zlog;
   };
   
  -/*...@unchecked@*/
  +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/
   static rpmioPool _rpmioPool;
   
   rpmioPool rpmioFreePool(rpmioPool pool)
  +     /*...@globals _rpmioPool @*/
  +     /*...@modifies _rpmioPool @*/
   {
       if (pool == NULL) {
        pool = _rpmioPool;
  @@ -79,7 +85,7 @@
        }
        yarnRelease(pool->have);
        pool->have = yarnFreeLock(pool->have);
  -     rpmlog(RPMLOG_DEBUG, ("pool %s:\treused %d, alloc'd %d, free'd %d 
items.\n"), pool->name, pool->reused, pool->made, count);
  +     rpmlog(RPMLOG_DEBUG, D_("pool %s:\treused %d, alloc'd %d, free'd %d 
items.\n"), pool->name, pool->reused, pool->made, count);
   #ifdef       NOTYET
   assert(pool->made == count);
   #else
  @@ -91,6 +97,7 @@
       return NULL;
   }
   
  +/*...@-internalglobs@*/
   rpmioPool rpmioNewPool(const char * name, size_t size, int limit, int flags,
                const char * (*dbg) (void *item),
                void (*init) (void *item),
  @@ -112,10 +119,12 @@
       pool->made = 0;
       pool->name = name;
       pool->zlog = NULL;
  -    rpmlog(RPMLOG_DEBUG, ("pool %s:\tcreated size %u limit %d flags %d\n"), 
pool->name, (unsigned)pool->size, pool->limit, pool->flags);
  +    rpmlog(RPMLOG_DEBUG, D_("pool %s:\tcreated size %u limit %d flags 
%d\n"), pool->name, (unsigned)pool->size, pool->limit, pool->flags);
       return pool;
   }
  +/*...@=internalglobs@*/
   
  +/*...@-internalglobs@*/
   rpmioItem rpmioUnlinkPoolItem(rpmioItem item, const char * msg,
                const char * fn, unsigned ln)
   {
  @@ -130,9 +139,13 @@
   /*...@=modfilesys@*/
       }
       yarnTwist(item->use, BY, -1);
  +/*...@-retalias@*/   /* XXX returning the deref'd item is used to detect 
nrefs = 0 */
       return item;
  +/*...@=retalias@*/
   }
  +/*...@=internalglobs@*/
   
  +/*...@-internalglobs@*/
   rpmioItem rpmioLinkPoolItem(rpmioItem item, const char * msg,
                const char * fn, unsigned ln)
   {
  @@ -149,9 +162,11 @@
       yarnTwist(item->use, BY, 1);
       return item;
   }
  +/*...@=internalglobs@*/
   
  +/*...@-internalglobs@*/
   /*...@null@*/
  -rpmioItem rpmioFreePoolItem(/*...@killref@*/ /*...@null@*/ rpmioItem item,
  +void * rpmioFreePoolItem(/*...@killref@*/ /*...@null@*/ rpmioItem item,
                   const char * msg, const char * fn, unsigned ln)
           /*...@modifies item @*/
   {
  @@ -175,9 +190,13 @@
        item = rpmioPutPool(item);
       } else
        yarnTwist(item->use, BY, -1);
  -    return item;
  +/*...@-retalias@*/   /* XXX returning the deref'd item is used to detect 
nrefs = 0 */
  +    return (void *) item;
  +/*...@=retalias@*/
   }
  +/*...@=internalglobs@*/
   
  +/*...@-internalglobs@*/
   rpmioItem rpmioGetPool(rpmioPool pool, size_t size)
   {
       rpmioItem item;
  @@ -213,7 +232,9 @@
       item->pool = pool;
       return item;
   }
  +/*...@=internalglobs@*/
   
  +/*...@-internalglobs@*/
   rpmioItem rpmioPutPool(rpmioItem item)
   {
       rpmioPool pool;
  @@ -236,6 +257,7 @@
       item = _free(item);
       return NULL;
   }
  +/*...@=internalglobs@*/
   
   #if !(HAVE_MCHECK_H && defined(__GNUC__)) && !defined(__LCLINT__)
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmmg.c
  ============================================================================
  $ cvs diff -u -r2.7.2.1 -r2.7.2.2 rpmmg.c
  --- rpm/rpmio/rpmmg.c 24 Mar 2009 20:13:40 -0000      2.7.2.1
  +++ rpm/rpmio/rpmmg.c 25 Mar 2009 20:27:16 -0000      2.7.2.2
  @@ -18,7 +18,10 @@
   /*...@unchecked@*/
   int _rpmmg_debug = 0;
   
  +/*...@-mustmod@*/    /* XXX splint on crack */
   static void rpmmgFini(void * _mg)
  +     /*...@globals fileSystem @*/
  +     /*...@modifies *_mg, fileSystem @*/
   {
       rpmmg mg = _mg;
   
  @@ -29,13 +32,15 @@
        }
   #endif
        mg->fn = _free(mg->fn);
  -    }
  +}
  +/*...@=mustmod@*/
   
  -/*...@unchecked@*/ /*...@null@*/
  +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/
   rpmioPool _rpmmgPool;
   
   static rpmmg rpmmgGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  +     /*...@globals _rpmmgPool, fileSystem @*/
  +     /*...@modifies pool, _rpmmgPool, fileSystem @*/
   {
       rpmmg mg;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmmg.h
  ============================================================================
  $ cvs diff -u -r2.3.4.2 -r2.3.4.3 rpmmg.h
  --- rpm/rpmio/rpmmg.h 24 Mar 2009 20:13:40 -0000      2.3.4.2
  +++ rpm/rpmio/rpmmg.h 25 Mar 2009 20:27:16 -0000      2.3.4.3
  @@ -24,6 +24,10 @@
       int flags;
   /*...@relnull@*/
       void * ms;
  +#if defined(__LCLINT__)
  +/*...@refs@*/
  +    int nrefs;                       /*!< (unused) keep splint happy */
  +#endif
   };
   #endif       /* _RPMMG_INTERNAL */
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmpgp.c
  ============================================================================
  $ cvs diff -u -r2.90.2.6 -r2.90.2.7 rpmpgp.c
  --- rpm/rpmio/rpmpgp.c        21 Mar 2009 15:26:25 -0000      2.90.2.6
  +++ rpm/rpmio/rpmpgp.c        25 Mar 2009 20:27:16 -0000      2.90.2.7
  @@ -1040,10 +1040,11 @@
   /*...@=nullstate@*/
   }
   
  -static void pgpDigFini(void * _dig)
  -     /*...@modifies _dig @*/
  +static void pgpDigFini(void * __dig)
  +     /*...@globals fileSystem, internalState @*/
  +     /*...@modifies __dig, fileSystem, internalState @*/
   {
  -    pgpDig dig = _dig;
  +    pgpDig dig = __dig;
   
        /* Lose the header tag data. */
        /* XXX this free should be done somewhere else. */
  @@ -1081,11 +1082,12 @@
   
   }
   
  -/*...@unchecked@*/ /*...@null@*/
  +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/
   rpmioPool _digPool;
   
   static pgpDig digGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  +     /*...@globals _digPool, fileSystem @*/
  +     /*...@modifies pool, _digPool, fileSystem @*/
   {
       pgpDig dig;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmpgp.h
  ============================================================================
  $ cvs diff -u -r2.72.2.6 -r2.72.2.7 rpmpgp.h
  --- rpm/rpmio/rpmpgp.h        21 Mar 2009 15:26:25 -0000      2.72.2.6
  +++ rpm/rpmio/rpmpgp.h        25 Mar 2009 20:27:16 -0000      2.72.2.7
  @@ -147,6 +147,10 @@
       size_t md5len;           /*!< (rsa) V3 signature hash length. */
   /*...@owned@*/ /*...@relnull@*/
       void * impl;             /*!< Implementation data */
  +#if defined(__LCLINT__)
  +/*...@refs@*/
  +    int nrefs;                       /*!< (unused) keep splint happy */
  +#endif
   };
   #endif
   
  @@ -1505,7 +1509,8 @@
    */
   /*...@relnull@*/
   pgpDig pgpDigNew(/*...@unused@*/ pgpVSFlags vsflags)
  -     /*...@*/;
  +     /*...@globals fileSystem @*/
  +     /*...@modifies fileSystem @*/;
   
   /** \ingroup rpmpgp
    * Release (malloc'd) data from container.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmurl.h
  ============================================================================
  $ cvs diff -u -r1.25.2.7 -r1.25.2.8 rpmurl.h
  --- rpm/rpmio/rpmurl.h        21 Mar 2009 14:21:22 -0000      1.25.2.7
  +++ rpm/rpmio/rpmurl.h        25 Mar 2009 20:27:16 -0000      1.25.2.8
  @@ -92,6 +92,10 @@
   
   #define      RPMURL_SERVER_HASDAV    
(RPMURL_SERVER_HASDAVCLASS1|RPMURL_SERVER_HASDAVCLASS2|RPMURL_SERVER_HASDAVEXEC)
       unsigned magic;
  +#if defined(__LCLINT__)
  +/*...@refs@*/
  +    int nrefs;                       /*!< (unused) keep splint happy */
  +#endif
   };
   
   #ifdef __cplusplus
  @@ -124,7 +128,9 @@
   
   /** @todo Remove debugging entry from the ABI. */
   /*...@newref@*/
  -urlinfo      XurlNew(const char * msg, const char * fn, unsigned ln) 
/*...@*/;
  +urlinfo      XurlNew(const char * msg, const char * fn, unsigned ln)
  +     /*...@globals fileSystem @*/
  +     /*...@modifies fileSystem @*/;
   #define      urlNew(_msg) XurlNew(_msg, __FILE__, __LINE__)
   
   /**
  @@ -175,7 +181,6 @@
    */
   /*...@-incondefs@*/
   urltype      urlPath(const char * url, /*...@out@*/ const char ** pathp)
  -     /*...@ensures maxSet(*pathp) == 0 /\ maxRead(*pathp) == 0 @*/
        /*...@modifies *pathp @*/;
   /*...@=incondefs@*/
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmxar.c
  ============================================================================
  $ cvs diff -u -r2.17.2.4 -r2.17.2.5 rpmxar.c
  --- rpm/rpmio/rpmxar.c        21 Mar 2009 15:26:25 -0000      2.17.2.4
  +++ rpm/rpmio/rpmxar.c        25 Mar 2009 20:27:16 -0000      2.17.2.5
  @@ -69,11 +69,13 @@
   /*...@unchecked@*/
   int _xar_debug = 0;
   
  -/*...@unchecked@*/ /*...@null@*/
  +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/
   rpmioPool _xarPool;
   
  +/*...@-globuse -must...@*/
   static void rpmxarFini(void * _xar)
  -        /*@ modifies *_xar @*/
  +     /*...@globals fileSystem @*/
  +        /*...@modifies _xar, fileSystem @*/
   {
       rpmxar xar =_xar;
        if (xar->i) {
  @@ -89,9 +91,11 @@
        xar->member = _free(xar->member);
        xar->b = _free(xar->b);
   }
  +/*...@=globuse =must...@*/
   
   static rpmxar rpmxarGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  +     /*...@globals _xarPool, fileSystem @*/
  +     /*...@modifies pool, _xarPool, fileSystem @*/
   {
       rpmxar xar;
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmxar.h
  ============================================================================
  $ cvs diff -u -r2.9.4.3 -r2.9.4.4 rpmxar.h
  --- rpm/rpmio/rpmxar.h        21 Mar 2009 15:26:25 -0000      2.9.4.3
  +++ rpm/rpmio/rpmxar.h        25 Mar 2009 20:27:16 -0000      2.9.4.4
  @@ -28,6 +28,10 @@
       size_t bsize;            /*!< No. bytes of data. */
       size_t bx;                       /*!< Data byte index. */
       int first;
  +#if defined(__LCLINT__)
  +/*...@refs@*/
  +    int nrefs;                       /*!< (unused) keep splint happy */
  +#endif
   };
   #endif
   
  @@ -95,8 +99,7 @@
   ssize_t xarRead(void * cookie, /*...@out@*/ char * buf, size_t count)
           /*...@globals fileSystem, internalState @*/
           /*...@modifies buf, fileSystem, internalState @*/
  -     /*...@requires maxSet(buf) >= (count - 1) @*/
  -     /*...@ensures maxRead(buf) == result @*/;
  +     /*...@requires maxSet(buf) >= (count - 1) @*/;
   /*...@=incondefs@*/
   
   #ifdef __cplusplus
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/url.c
  ============================================================================
  $ cvs diff -u -r1.51.2.8 -r1.51.2.9 url.c
  --- rpm/rpmio/url.c   21 Mar 2009 14:21:22 -0000      1.51.2.8
  +++ rpm/rpmio/url.c   25 Mar 2009 20:27:16 -0000      1.51.2.9
  @@ -53,7 +53,8 @@
   urlinfo *_url_cache = NULL;
   
   static void urlFini(void * _u)
  -     /*@ modifies *_u @*/
  +     /*...@globals fileSystem, internalState @*/
  +     /*...@modifies _u, fileSystem, internalState @*/
   {
       urlinfo u =_u;
       int xx;
  @@ -119,11 +120,12 @@
   /*...@unchecked@*/
   int _url_count = 0;
   
  -/*...@unchecked@*/ /*...@null@*/
  +/*...@unchecked@*/ /*...@only@*/ /*...@null@*/
   rpmioPool _urlPool;
   
   static urlinfo urlGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  +     /*...@globals _urlPool, fileSystem @*/
  +     /*...@modifies pool, _urlPool, fileSystem @*/
   {
       urlinfo u;
   
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to