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:   23-Oct-2007 18:43:14
  Branch: rpm-4_5                          Handle: 2007102317431201

  Modified files:           (Branch: rpm-4_5)
    rpm                     CHANGES
    rpm/rpmdb               header.c header.h header_internal.h

  Log:
    - jbj: eliminate warnings.

  Summary:
    Revision    Changes     Path
    1.1360.2.47 +2  -0      rpm/CHANGES
    1.48.2.5    +33 -31     rpm/rpmdb/header.c
    1.13.2.4    +4  -2      rpm/rpmdb/header.h
    1.13.2.3    +2  -2      rpm/rpmdb/header_internal.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1360.2.46 -r1.1360.2.47 CHANGES
  --- rpm/CHANGES       23 Oct 2007 15:53:07 -0000      1.1360.2.46
  +++ rpm/CHANGES       23 Oct 2007 16:43:12 -0000      1.1360.2.47
  @@ -1,4 +1,6 @@
   4.4.9 -> 4.5:
  +    - jbj: eliminate warnings.
  +    - jbj: keep the headerFoo() API invariant, eliminate warnings.
       - jbj: backport (and enable) tag data cache.
       - jbj: backport tag data typedef's, and add tag container.
       - jbj: convert rel to abs linkto dependency iff directory is known.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.c
  ============================================================================
  $ cvs diff -u -r1.48.2.4 -r1.48.2.5 header.c
  --- rpm/rpmdb/header.c        23 Oct 2007 15:53:08 -0000      1.48.2.4
  +++ rpm/rpmdb/header.c        23 Oct 2007 16:43:13 -0000      1.48.2.5
  @@ -467,7 +467,7 @@
    */
   static int regionSwab(/[EMAIL PROTECTED]@*/ indexEntry entry, int il, int dl,
                entryInfo pe,
  -             unsigned char * dataStart,
  +             void * dataStart,
                /[EMAIL PROTECTED]@*/ const unsigned char * dataEnd,
                int regionid)
        /[EMAIL PROTECTED] *entry, *dataStart @*/
  @@ -501,7 +501,7 @@
            return -1;
   /[EMAIL PROTECTED]@*/
   
  -     ie.data = t = dataStart + ie.info.offset;
  +     ie.data = t = ((unsigned char *)dataStart) + ie.info.offset;
        if (dataEnd && t >= dataEnd)
            return -1;
   
  @@ -539,7 +539,7 @@
        if (ie.info.tag >= HEADER_I18NTABLE) {
            tprev = t;
        } else {
  -         tprev = dataStart;
  +         tprev = (unsigned char *)dataStart;
            /* XXX HEADER_IMAGE tags don't include region sub-tag. */
            /[EMAIL PROTECTED]@*/
            if (ie.info.tag == HEADER_IMAGE)
  @@ -561,7 +561,7 @@
                if (b[1] != ((int_32 *)it)[0])
                    memcpy(it, b, sizeof(b));
            }
  -         t = (char *) it;
  +         t = (unsigned char *) it;
        }   /[EMAIL PROTECTED]@*/ break;
        case RPM_INT32_TYPE:
        {   int_32 * it = (int_32 *)t;
  @@ -570,7 +570,7 @@
                    return -1;
                *it = htonl(*it);
            }
  -         t = (char *) it;
  +         t = (unsigned char *) it;
        }   /[EMAIL PROTECTED]@*/ break;
        case RPM_INT16_TYPE:
        {   int_16 * it = (int_16 *) t;
  @@ -579,7 +579,7 @@
                    return -1;
                *it = htons(*it);
            }
  -         t = (char *) it;
  +         t = (unsigned char *) it;
        }   /[EMAIL PROTECTED]@*/ break;
   /[EMAIL PROTECTED]@*/
        default:
  @@ -588,7 +588,7 @@
        }
   
        dl += ie.length;
  -     if (dataEnd && dataStart + dl > dataEnd) return -1;
  +     if (dataEnd && ((unsigned char *)dataStart) + dl > dataEnd) return -1;
        tl += tdel;
        ieprev = ie;    /* structure assignment */
   
  @@ -1886,7 +1886,7 @@
        return 0;
       }
   
  -    rc = copyEntry(entry, type, p, c, 0);
  +    rc = copyEntry(entry, (int_32 *)type, p, c, 0);
   
       /* XXX 1 on success */
       return ((rc == 1) ? 1 : 0);
  @@ -2584,7 +2584,7 @@
            hsa->i++;
        } else {
            HE_t he = rpmheClean(&tag->he);
  -         if (!headerNextIterator(hsa->hi, &he->tag, &he->t, &he->p, &he->c))
  +         if (!headerNextIterator(hsa->hi, &he->tag, (hTAG_t)&he->t, (hPTR_t 
*)&he->p.ptr, &he->c))
                fmt = NULL;
            he = rpmheMark(he);
            he->avail = 1;
  @@ -3140,9 +3140,9 @@
    * @return           0 on success, 1 on failure
    */
   static int getExtension(headerSprintfArgs hsa, headerTagTagFunction fn,
  -             /[EMAIL PROTECTED]@*/ hTYP_t typeptr,
  -             /[EMAIL PROTECTED]@*/ hPTR_t * data,
  -             /[EMAIL PROTECTED]@*/ hCNT_t countptr,
  +             /[EMAIL PROTECTED]@*/ rpmTagType * typeptr,
  +             /[EMAIL PROTECTED]@*/ rpmTagData * data,
  +             /[EMAIL PROTECTED]@*/ rpmTagCount * countptr,
                rpmec ec)
        /[EMAIL PROTECTED] *typeptr, *data, *countptr, ec @*/
        /[EMAIL PROTECTED] maxSet(typeptr) >= 0 /\ maxSet(data) >= 0
  @@ -3155,7 +3155,7 @@
       }
   
       if (typeptr) *typeptr = ec->type;
  -    if (data) *data = ec->data;
  +    if (data) (*data).ptr = (void *)ec->data;
       if (countptr) *countptr = ec->count;
   
       return 0;
  @@ -3196,7 +3196,7 @@
       } else
       if (!he->avail) {
        he->tag = tag->tagno;
  -     if (!headerGetEntry(hsa->h, he->tag, &he->t, &he->p, &he->c)) {
  +     if (!headerGetEntry(hsa->h, he->tag, (hTYP_t)&he->t, &he->p, &he->c)) {
            he->c = 1;
            he->t = RPM_STRING_TYPE;    
            he->p.str = "(none)";
  @@ -3388,15 +3388,15 @@
                int element)
        /[EMAIL PROTECTED] hsa @*/
   {
  +    HE_t he;
       char numbuf[64]; /* XXX big enuf for "Tag_0x01234567" */
       char * t, * te;
       int i, j;
       int numElements;
  -    int_32 type;
  -    int_32 count;
       sprintfToken spft;
       int condNumFormats;
       size_t need;
  +    int xx;
   
       /* we assume the token and header have been validated already! */
   
  @@ -3451,24 +3451,26 @@
                spft->u.tag.arrayCount ||
                spft->u.tag.justOne) continue;
   
  +         he = &spft->u.tag.he;
            if (spft->u.tag.ext) {
  -/[EMAIL PROTECTED]@*/
  -             if (getExtension(hsa, spft->u.tag.ext, &type, NULL, &count, 
  -                              hsa->ec + spft->u.tag.extNum))
  -                  continue;
  -/[EMAIL PROTECTED]@*/
  +             xx = getExtension(hsa, spft->u.tag.ext, &he->t, &he->p, &he->c, 
  +                              hsa->ec + spft->u.tag.extNum);
            } else {
  -/[EMAIL PROTECTED]@*/
  -             if (!headerGetEntry(hsa->h, spft->u.tag.tagno, &type, NULL, 
&count))
  -                 continue;
  -/[EMAIL PROTECTED]@*/
  +             xx = headerGetEntry(hsa->h, spft->u.tag.tagno, (hTYP_t)&he->t, 
&he->p, &he->c);
  +             xx = (xx == 0); /* XXX invert headerGetEntry return. */
            } 
  +         if (xx) {
  +             (void) rpmheClean(he);
  +             continue;
  +         }
  +         (void) rpmheMark(he);
  +         he->avail = 1;
   
  -         if (type == RPM_BIN_TYPE || type == RPM_ASN1_TYPE || type == 
RPM_OPENPGP_TYPE)
  -             count = 1;      /* XXX count abused as no. of bytes. */
  +         if (he->t == RPM_BIN_TYPE || he->t == RPM_ASN1_TYPE || he->t == 
RPM_OPENPGP_TYPE)
  +             he->c = 1;      /* XXX count abused as no. of bytes. */
   
  -         if (numElements > 1 && count != numElements)
  -         switch (type) {
  +         if (numElements > 1 && he->c != numElements)
  +         switch (he->t) {
            default:
                hsa->errmsg =
                        _("array iterator used with different sized arrays");
  @@ -3480,8 +3482,8 @@
            case RPM_STRING_TYPE:
                /[EMAIL PROTECTED]@*/ break;
            }
  -         if (count > numElements)
  -             numElements = count;
  +         if (he->c > numElements)
  +             numElements = he->c;
        }
   
        if (numElements == -1) {
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.h
  ============================================================================
  $ cvs diff -u -r1.13.2.3 -r1.13.2.4 header.h
  --- rpm/rpmdb/header.h        23 Oct 2007 15:53:08 -0000      1.13.2.3
  +++ rpm/rpmdb/header.h        23 Oct 2007 16:43:13 -0000      1.13.2.4
  @@ -168,13 +168,15 @@
   /** \ingroup header
    */
   typedef int_32 *     hTAG_t;
  -typedef rpmTagType * hTYP_t;
   #ifdef       NOTYET
  +typedef rpmTagType * hTYP_t;
   typedef rpmTagData * hPTR_t;
  +typedef rpmTagCount *        hCNT_t;
   #else
  +typedef int_32 *     hTYP_t;
   typedef const void * hPTR_t;
  +typedef int_32 *     hCNT_t;
   #endif
  -typedef rpmTagCount *        hCNT_t;
   
   /** \ingroup header
    */
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header_internal.h
  ============================================================================
  $ cvs diff -u -r1.13.2.2 -r1.13.2.3 header_internal.h
  --- rpm/rpmdb/header_internal.h       23 Oct 2007 15:53:08 -0000      1.13.2.2
  +++ rpm/rpmdb/header_internal.h       23 Oct 2007 16:43:13 -0000      1.13.2.3
  @@ -172,9 +172,9 @@
   /[EMAIL PROTECTED]@*/
   /[EMAIL PROTECTED]@*/
   int headerGetRawEntry(Header h, int_32 tag,
  -                     /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ hTYP_t type,
  +                     /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ rpmTagType 
* type,
                        /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ void * p, 
  -                     /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ hCNT_t c)
  +                     /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ rpmTagCount 
* c)
        /[EMAIL PROTECTED] *type, *p, *c @*/
        /[EMAIL PROTECTED] maxSet(type) >= 0 /\ maxSet(p) >= 0 /\ maxSet(c) >= 
0 @*/;
   /[EMAIL PROTECTED]@*/
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                [email protected]

Reply via email to