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:50:13
  Branch: rpm-4_5                          Handle: 2007102317501200

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

  Log:
     - jbj: eliminate splint fluff.

  Summary:
    Revision    Changes     Path
    1.48.2.6    +0  -184    rpm/rpmdb/header.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/header.c
  ============================================================================
  $ cvs diff -u -r1.48.2.5 -r1.48.2.6 header.c
  --- rpm/rpmdb/header.c        23 Oct 2007 16:43:13 -0000      1.48.2.5
  +++ rpm/rpmdb/header.c        23 Oct 2007 16:50:12 -0000      1.48.2.6
  @@ -215,11 +215,9 @@
   {
       Header h = xcalloc(1, sizeof(*h));
   
  -/[EMAIL PROTECTED]@*/
       /[EMAIL PROTECTED]@*/
       h->hv = *hdrVec;         /* structure assignment */
       /[EMAIL PROTECTED]@*/
  -/[EMAIL PROTECTED]@*/
       h->blob = NULL;
       h->origin = NULL;
       h->instance = 0;
  @@ -257,9 +255,7 @@
        /[EMAIL PROTECTED] h @*/
   {
       if (!(h->flags & HEADERFLAG_SORTED)) {
  -/[EMAIL PROTECTED]@*/
        qsort(h->index, h->indexUsed, sizeof(*h->index), indexCmp);
  -/[EMAIL PROTECTED]@*/
        h->flags |= HEADERFLAG_SORTED;
       }
   }
  @@ -291,9 +287,7 @@
   void headerUnsort(Header h)
        /[EMAIL PROTECTED] h @*/
   {
  -/[EMAIL PROTECTED]@*/
       qsort(h->index, h->indexUsed, sizeof(*h->index), offsetCmp);
  -/[EMAIL PROTECTED]@*/
   }
   
   /** \ingroup header
  @@ -349,7 +343,6 @@
   
        /* Alignment */
        type = entry->info.type;
  -/[EMAIL PROTECTED]@*/
        if (typeSizes[type] > 1) {
            diff = typeSizes[type] - (size % typeSizes[type]);
            if (diff != typeSizes[type]) {
  @@ -357,7 +350,6 @@
                pad += diff;
            }
        }
  -/[EMAIL PROTECTED]@*/
   
        /[EMAIL PROTECTED]@*/
        size += sizeof(struct entryInfo_s) + entry->length;
  @@ -388,13 +380,11 @@
       case RPM_STRING_TYPE:
        if (count != 1)
            return -1;
  -/[EMAIL PROTECTED]@*/
        while (*s++) {
            if (se && s > se)
                return -1;
            length++;
        }
  -/[EMAIL PROTECTED]@*/
        length++;       /* count nul terminator too. */
        break;
   
  @@ -406,31 +396,25 @@
        if (onDisk) {
            while (count--) {
                length++;       /* count nul terminator too */
  -/[EMAIL PROTECTED]@*/
                  while (*s++) {
                    if (se && s > se)
                        return -1;
                    length++;
                }
  -/[EMAIL PROTECTED]@*/
            }
        } else {
            const char ** av = (const char **)p;
  -/[EMAIL PROTECTED]@*/
            while (count--) {
                /* add one for null termination */
                length += strlen(*av++) + 1;
            }
  -/[EMAIL PROTECTED]@*/
        }
        break;
   
       default:
  -/[EMAIL PROTECTED]@*/
        if (typeSizes[type] == -1)
            return -1;
        length = typeSizes[(type & 0xf)] * count;
  -/[EMAIL PROTECTED]@*/
        if (length < 0 || (se && (s + length) > se))
            return -1;
        break;
  @@ -478,9 +462,7 @@
       int tl = dl;
       struct indexEntry_s ieprev;
   
  -/[EMAIL PROTECTED]@*/
       memset(&ieprev, 0, sizeof(ieprev));
  -/[EMAIL PROTECTED]@*/
       for (; il > 0; il--, pe++) {
        struct indexEntry_s ie;
        int_32 type;
  @@ -496,10 +478,8 @@
            return -1;
        if (hdrchkData(ie.info.offset))
            return -1;
  -/[EMAIL PROTECTED]@*/
        if (hdrchkAlign(ie.info.type, ie.info.offset))
            return -1;
  -/[EMAIL PROTECTED]@*/
   
        ie.data = t = ((unsigned char *)dataStart) + ie.info.offset;
        if (dataEnd && t >= dataEnd)
  @@ -513,15 +493,12 @@
   
        if (entry) {
            ie.info.offset = regionid;
  -/[EMAIL PROTECTED]@*/
            *entry = ie;        /* structure assignment */
  -/[EMAIL PROTECTED]@*/
            entry++;
        }
   
        /* Alignment */
        type = ie.info.type;
  -/[EMAIL PROTECTED]@*/
        if (typeSizes[type] > 1) {
            unsigned diff;
            diff = typeSizes[type] - (dl % typeSizes[type]);
  @@ -531,7 +508,6 @@
                    ieprev.length += diff;
            }
        }
  -/[EMAIL PROTECTED]@*/
        tdel = (tprev ? (t - tprev) : 0);
        if (ieprev.info.type == RPM_I18NSTRING_TYPE)
            tdel = ieprev.length;
  @@ -549,7 +525,6 @@
   
        /* Perform endian conversions */
        switch (ntohl(pe->type)) {
  -/[EMAIL PROTECTED]@*/
        case RPM_INT64_TYPE:
        {   int_64 * it = (int_64 *)t;
            int_32 b[2];
  @@ -581,7 +556,6 @@
            }
            t = (unsigned char *) it;
        }   /[EMAIL PROTECTED]@*/ break;
  -/[EMAIL PROTECTED]@*/
        default:
            t += ie.length;
            /[EMAIL PROTECTED]@*/ break;
  @@ -709,11 +683,9 @@
   
       len = sizeof(il) + sizeof(dl) + (il * sizeof(*pe)) + dl;
   
  -/[EMAIL PROTECTED]@*/
       ei = xmalloc(len);
       ei[0] = htonl(il);
       ei[1] = htonl(dl);
  -/[EMAIL PROTECTED]@*/
   
       pe = (entryInfo) &ei[2];
       dataStart = te = (char *) (pe + il);
  @@ -746,10 +718,8 @@
                int_32 stei[4];
   
                legacy = 1;
  -/[EMAIL PROTECTED]@*/
                memcpy(pe+1, src, rdl);
                memcpy(te, src + rdl, rdlen);
  -/[EMAIL PROTECTED]@*/
                te += rdlen;
   
                pe->offset = htonl(te - dataStart);
  @@ -757,9 +727,7 @@
                stei[1] = pe->type;
                stei[2] = htonl(-rdl-entry->info.count);
                stei[3] = pe->count;
  -/[EMAIL PROTECTED]@*/
                memcpy(te, stei, entry->info.count);
  -/[EMAIL PROTECTED]@*/
                te += entry->info.count;
                ril++;
                rdlen += entry->info.count;
  @@ -770,10 +738,8 @@
   
            } else {
   
  -/[EMAIL PROTECTED]@*/
                memcpy(pe+1, src + sizeof(*pe), ((ril-1) * sizeof(*pe)));
                memcpy(te, src + (ril * sizeof(*pe)), 
rdlen+entry->info.count+drlen);
  -/[EMAIL PROTECTED]@*/
                te += rdlen;
                {   /[EMAIL PROTECTED]@*/
                    entryInfo se = (entryInfo)src;
  @@ -809,9 +775,7 @@
            unsigned diff;
            diff = typeSizes[type] - ((te - dataStart) % typeSizes[type]);
            if (diff != typeSizes[type]) {
  -/[EMAIL PROTECTED]@*/
                memset(te, 0, diff);
  -/[EMAIL PROTECTED]@*/
                te += diff;
                pad += diff;
            }
  @@ -820,7 +784,6 @@
        pe->offset = htonl(te - dataStart);
   
        /* copy data w/ endian conversions */
  -/[EMAIL PROTECTED]@*/
        switch (entry->info.type) {
        case RPM_INT64_TYPE:
        {   int_32 b[2];
  @@ -867,7 +830,6 @@
            te += entry->length;
            /[EMAIL PROTECTED]@*/ break;
        }
  -/[EMAIL PROTECTED]@*/
        pe++;
       }
      
  @@ -902,9 +864,7 @@
        /[EMAIL PROTECTED] h @*/
   {
       int length;
  -/[EMAIL PROTECTED]@*/
       void * uh = doHeaderUnload(h, &length);
  -/[EMAIL PROTECTED]@*/
       return uh;
   }
   
  @@ -927,10 +887,8 @@
   
       key.info.tag = tag;
   
  -/[EMAIL PROTECTED]@*/
       entry2 = entry = 
        bsearch(&key, h->index, h->indexUsed, sizeof(*h->index), indexCmp);
  -/[EMAIL PROTECTED]@*/
       if (entry == NULL)
        return NULL;
   
  @@ -997,10 +955,8 @@
       if (ne > 0) {
        h->indexUsed -= ne;
        ne = last - first;
  -/[EMAIL PROTECTED]@*/
        if (ne > 0)
            memmove(entry, first, (ne * sizeof(*entry)));
  -/[EMAIL PROTECTED]@*/
       }
   
       return 0;
  @@ -1162,12 +1118,10 @@
            }
   
            /* If any duplicate entries were replaced, move new entries down. */
  -/[EMAIL PROTECTED]@*/
            if (h->indexUsed < (save - ne)) {
                memmove(h->index + h->indexUsed, firstEntry,
                        (ne * sizeof(*entry)));
            }
  -/[EMAIL PROTECTED]@*/
            h->indexUsed += ne;
          }
        }
  @@ -1264,9 +1218,7 @@
       Header nh;
       int length;
       /[EMAIL PROTECTED]@*/
  -/[EMAIL PROTECTED]@*/
       void * uh = doHeaderUnload(h, &length);
  -/[EMAIL PROTECTED]@*/
       const char * origin;
       int_32 instance = h->instance;
       int xx;
  @@ -1285,10 +1237,8 @@
        uh = _free(uh);
       nh->flags |= HEADERFLAG_ALLOCATED;
       if (ENTRY_IS_REGION(nh->index)) {
  -/[EMAIL PROTECTED]@*/
        if (tag == HEADER_SIGNATURES || tag == HEADER_IMMUTABLE)
            nh->index[0].info.tag = tag;
  -/[EMAIL PROTECTED]@*/
       }
       if (origin != NULL) {
        xx = headerSetOrigin(nh, origin);
  @@ -1308,10 +1258,8 @@
        /[EMAIL PROTECTED]/
   {
       int_32 * ei = (int_32 *) uh;
  -/[EMAIL PROTECTED]@*/
       int_32 il = ntohl(ei[0]);                /* index length */
       int_32 dl = ntohl(ei[1]);                /* data length */
  -/[EMAIL PROTECTED]@*/
       /[EMAIL PROTECTED]@*/
       size_t pvlen = sizeof(il) + sizeof(dl) +
                        (il * sizeof(struct entryInfo_s)) + dl;
  @@ -1320,19 +1268,13 @@
       Header h = NULL;
   
       /* Sanity checks on header intro. */
  -    /[EMAIL PROTECTED]@*/
       if (!(hdrchkTags(il) || hdrchkData(dl)) && pvlen < headerMaxbytes) {
  -/[EMAIL PROTECTED]@*/
        nuh = memcpy(xmalloc(pvlen), uh, pvlen);
  -/[EMAIL PROTECTED]@*/
        if ((h = headerLoad(nuh)) != NULL)
            h->flags |= HEADERFLAG_ALLOCATED;
       }
  -    /[EMAIL PROTECTED]@*/
  -    /[EMAIL PROTECTED]@*/
       if (h == NULL)
        nuh = _free(nuh);
  -    /[EMAIL PROTECTED]@*/
       return h;
   }
   
  @@ -1369,7 +1311,6 @@
   
       i = 0;
   
  -/[EMAIL PROTECTED]@*/
       if (magicp == HEADER_MAGIC_YES) {
        magic = block[i++];
        if (memcmp(&magic, header_magic, sizeof(magic)))
  @@ -1379,7 +1320,6 @@
       
       il = ntohl(block[i]);    i++;
       dl = ntohl(block[i]);    i++;
  -/[EMAIL PROTECTED]@*/
   
       /[EMAIL PROTECTED]@*/
       len = sizeof(il) + sizeof(dl) + (il * sizeof(struct entryInfo_s)) + dl;
  @@ -1389,19 +1329,15 @@
       if (hdrchkTags(il) || hdrchkData(dl) || len > headerMaxbytes)
        goto exit;
   
  -/[EMAIL PROTECTED]@*/
       ei = xmalloc(len);
       ei[0] = htonl(il);
       ei[1] = htonl(dl);
       len -= sizeof(il) + sizeof(dl);
  -/[EMAIL PROTECTED]@*/
   
  -/[EMAIL PROTECTED]@*/
       /[EMAIL PROTECTED]@*/ /* FIX: cast? */
       if (timedRead(fd, (char *)&ei[2], len) != len)
        goto exit;
       /[EMAIL PROTECTED]@*/
  -/[EMAIL PROTECTED]@*/
       
       h = headerLoad(ei);
   
  @@ -1441,18 +1377,14 @@
   
       if (h == NULL)
        return 1;
  -/[EMAIL PROTECTED]@*/
       uh = doHeaderUnload(h, &length);
  -/[EMAIL PROTECTED]@*/
       if (uh == NULL)
        return 1;
       switch (magicp) {
       case HEADER_MAGIC_YES:
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        nb = Fwrite(header_magic, sizeof(char), sizeof(header_magic), fd);
        /[EMAIL PROTECTED]@*/
  -/[EMAIL PROTECTED]@*/
        if (nb != sizeof(header_magic))
            goto exit;
        break;
  @@ -1519,9 +1451,7 @@
            /[EMAIL PROTECTED]@*/
            entryInfo pe = (entryInfo) (ei + 2);
            /[EMAIL PROTECTED]@*/
  -/[EMAIL PROTECTED]@*/
            char * dataStart = (char *) (pe + ntohl(ei[0]));
  -/[EMAIL PROTECTED]@*/
            int_32 rdl = -entry->info.offset;   /* negative offset */
            int_32 ril = rdl/sizeof(*pe);
   
  @@ -1536,7 +1466,6 @@
                rdl += REGION_TAG_COUNT;
            }
   
  -/[EMAIL PROTECTED]@*/
            *p = xmalloc(count);
            ei = (int_32 *) *p;
            ei[0] = htonl(ril);
  @@ -1548,7 +1477,6 @@
   
            dataStart = (char *) memcpy(pe + ril, dataStart, rdl);
            /[EMAIL PROTECTED]@*/
  -/[EMAIL PROTECTED]@*/
   
            rc = regionSwab(NULL, ril, 0, pe, dataStart, NULL, 0);
            /* XXX 1 on success. */
  @@ -1575,7 +1503,6 @@
        char * t;
        int i;
   
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        if (minMem) {
            *p = xmalloc(tableSize);
  @@ -1589,11 +1516,8 @@
            memcpy(t, entry->data, entry->length);
        }
        /[EMAIL PROTECTED]@*/
  -/[EMAIL PROTECTED]@*/
        for (i = 0; i < count; i++) {
  -/[EMAIL PROTECTED]@*/
            *ptrEntry++ = t;
  -/[EMAIL PROTECTED]@*/
            t = strchr(t, 0);
            t++;
        }
  @@ -1719,7 +1643,6 @@
        return entry->data;
       /[EMAIL PROTECTED]@*/
   
  -/[EMAIL PROTECTED]@*/
       for (l = lang; *l != '\0'; l = le) {
        const char *td;
        char *ed;
  @@ -1742,7 +1665,6 @@
   
        }
       }
  -/[EMAIL PROTECTED]@*/
   
       return entry->data;
   }
  @@ -1809,7 +1731,6 @@
        /[EMAIL PROTECTED] data @*/
   {
       if (data) {
  -     /[EMAIL PROTECTED]@*/
        if (type == -1 ||
            type == RPM_STRING_ARRAY_TYPE ||
            type == RPM_I18NSTRING_TYPE ||
  @@ -1817,7 +1738,6 @@
            type == RPM_ASN1_TYPE ||
            type == RPM_OPENPGP_TYPE)
                data = _free(data);
  -     /[EMAIL PROTECTED]@*/
       }
       return NULL;
   }
  @@ -1904,7 +1824,6 @@
       {        const char ** av = (const char **) srcPtr;
        char * t = dstPtr;
   
  -/[EMAIL PROTECTED]@*/
        while (cnt-- > 0 && dataLength > 0) {
            const char * s;
            if ((s = *av++) == NULL)
  @@ -1913,13 +1832,10 @@
                *t++ = *s++;
            } while (s[-1] && --dataLength > 0);
        }
  -/[EMAIL PROTECTED]@*/
       }        break;
   
       default:
  -/[EMAIL PROTECTED]@*/
        memmove(dstPtr, srcPtr, dataLength);
  -/[EMAIL PROTECTED]@*/
        break;
       }
   }
  @@ -1942,12 +1858,10 @@
       int length;
   
       length = dataLength(type, p, c, 0, NULL);
  -/[EMAIL PROTECTED]@*/
       if (length > 0) {
        data = xmalloc(length);
        copyData(type, data, p, c, length);
       }
  -/[EMAIL PROTECTED]@*/
   
       if (lengthPtr)
        *lengthPtr = length;
  @@ -1986,9 +1900,7 @@
        return 0;
   
       length = 0;
  -/[EMAIL PROTECTED]@*/
       data = grabData(type, p, c, &length);
  -/[EMAIL PROTECTED]@*/
       if (data == NULL || length <= 0)
        return 0;
   
  @@ -2007,10 +1919,8 @@
       entry->data = data;
       entry->length = length;
   
  -/[EMAIL PROTECTED]@*/
       if (h->indexUsed > 0 && tag < h->index[h->indexUsed-1].info.tag)
        h->flags &= ~HEADERFLAG_SORTED;
  -/[EMAIL PROTECTED]@*/
       h->indexUsed++;
   
       return 1;
  @@ -2054,9 +1964,7 @@
   
       if (ENTRY_IN_REGION(entry)) {
        char * t = xmalloc(entry->length + length);
  -/[EMAIL PROTECTED]@*/
        memcpy(t, entry->data, entry->length);
  -/[EMAIL PROTECTED]@*/
        entry->data = t;
        entry->info.offset = 0;
       } else
  @@ -2149,9 +2057,7 @@
   
       if (!table)
        return 0;
  -    /[EMAIL PROTECTED]@*/
       if (!lang) lang = "C";
  -    /[EMAIL PROTECTED]@*/
   
       {        const char * l = table->data;
        for (langNum = 0; langNum < table->info.count; langNum++) {
  @@ -2288,12 +2194,10 @@
       entry->data = data;
       entry->length = length;
   
  -    /[EMAIL PROTECTED]@*/
       if (ENTRY_IN_REGION(entry)) {
        entry->info.offset = 0;
       } else
        oldData = _free(oldData);
  -    /[EMAIL PROTECTED]@*/
   
       return 1;
   }
  @@ -2500,7 +2404,6 @@
       int_32 tag, type, count;
       hPTR_t ptr;
      
  -    /[EMAIL PROTECTED]@*/
       for (hi = headerInitIterator(h);
        headerNextIterator(hi, &tag, &type, &ptr, &count);
        ptr = headerFreeData((void *)ptr, type))
  @@ -2508,7 +2411,6 @@
        if (ptr) (void) headerAddEntry(nh, tag, type, ptr, count);
       }
       hi = headerFreeIterator(hi);
  -    /[EMAIL PROTECTED]@*/
   
       return headerReload(nh, HEADER_IMAGE);
   }
  @@ -2708,15 +2610,11 @@
        goto bingo;
       }
   
  -/[EMAIL PROTECTED]@*/
       if (strncmp("RPMTAG_", name, sizeof("RPMTAG_")-1)) {
  -/[EMAIL PROTECTED]@*/
        char * t = alloca(strlen(name) + sizeof("RPMTAG_"));
        (void) stpcpy( stpcpy(t, "RPMTAG_"), name);
        name = t;
  -/[EMAIL PROTECTED]@*/
       }
  -/[EMAIL PROTECTED]@*/
   
       /* Search extensions for specific tag override. */
       for (ext = hsa->exts; ext != NULL && ext->type != HEADER_EXT_LAST;
  @@ -2820,29 +2718,23 @@
                    /[EMAIL PROTECTED] [EMAIL PROTECTED]/
                }
                start++;
  -/[EMAIL PROTECTED]@*/
                *dst++ = *start++;
  -/[EMAIL PROTECTED]@*/
                /[EMAIL PROTECTED]@*/ break;
            } 
   
            token = format + numTokens++;
  -/[EMAIL PROTECTED]@*/
            *dst++ = '\0';
  -/[EMAIL PROTECTED]@*/
            start++;
   
            if (*start == '|') {
                char * newEnd;
   
                start++;
  -/[EMAIL PROTECTED]@*/
                if (parseExpression(hsa, token, start, &newEnd))
                {
                    format = freeFormat(format, numTokens);
                    return 1;
                }
  -/[EMAIL PROTECTED]@*/
                start = newEnd;
                /[EMAIL PROTECTED]@*/ break;
            }
  @@ -2862,9 +2754,7 @@
                return 1;
            }
   
  -/[EMAIL PROTECTED]@*/
            *chptr++ = '\0';
  -/[EMAIL PROTECTED]@*/
   
            while (start < chptr) {
                if (xisdigit(*start)) {
  @@ -2891,17 +2781,13 @@
                format = freeFormat(format, numTokens);
                return 1;
            }
  -/[EMAIL PROTECTED]@*/
            *next++ = '\0';
  -/[EMAIL PROTECTED]@*/
   
            chptr = start;
            while (*chptr && *chptr != ':') chptr++;
   
            if (*chptr != '\0') {
  -/[EMAIL PROTECTED]@*/
                *chptr++ = '\0';
  -/[EMAIL PROTECTED]@*/
                if (!*chptr) {
                    hsa->errmsg = _("empty tag format");
                    format = freeFormat(format, numTokens);
  @@ -2933,13 +2819,10 @@
            /[EMAIL PROTECTED]@*/ break;
   
        case '[':
  -/[EMAIL PROTECTED]@*/
            *dst++ = '\0';
            *start++ = '\0';
  -/[EMAIL PROTECTED]@*/
            token = format + numTokens++;
   
  -/[EMAIL PROTECTED]@*/
            if (parseFormat(hsa, start,
                            &token->u.array.format,
                            &token->u.array.numTokens,
  @@ -2948,7 +2831,6 @@
                format = freeFormat(format, numTokens);
                return 1;
            }
  -/[EMAIL PROTECTED]@*/
   
            if (!start) {
                hsa->errmsg = _("] expected at end of array");
  @@ -2968,9 +2850,7 @@
                format = freeFormat(format, numTokens);
                return 1;
            }
  -/[EMAIL PROTECTED]@*/
            *start++ = '\0';
  -/[EMAIL PROTECTED]@*/
            if (endPtr) *endPtr = start;
            done = 1;
            /[EMAIL PROTECTED]@*/ break;
  @@ -2981,9 +2861,7 @@
                format = freeFormat(format, numTokens);
                return 1;
            }
  -/[EMAIL PROTECTED]@*/
            *start++ = '\0';
  -/[EMAIL PROTECTED]@*/
            if (endPtr) *endPtr = start;
            done = 1;
            /[EMAIL PROTECTED]@*/ break;
  @@ -2997,14 +2875,12 @@
                /[EMAIL PROTECTED] [EMAIL PROTECTED]/
            }
   
  -/[EMAIL PROTECTED]@*/
            if (*start == '\\') {
                start++;
                *dst++ = escapedChar(*start++);
            } else {
                *dst++ = *start++;
            }
  -/[EMAIL PROTECTED]@*/
            /[EMAIL PROTECTED]@*/ break;
        }
        if (done)
  @@ -3012,10 +2888,8 @@
       }
       /[EMAIL PROTECTED]@*/
   
  -/[EMAIL PROTECTED]@*/
       if (dst != NULL)
           *dst = '\0';
  -/[EMAIL PROTECTED]@*/
   
       for (i = 0; i < numTokens; i++) {
        token = format + i;
  @@ -3029,7 +2903,6 @@
       return 0;
   }
   
  -/[EMAIL PROTECTED]@*/
   static int parseExpression(headerSprintfArgs hsa, sprintfToken token,
                char * str, /[EMAIL PROTECTED]@*/ char ** endPtr)
   {
  @@ -3127,7 +3000,6 @@
   
       return 0;
   }
  -/[EMAIL PROTECTED]@*/
   
   /**
    * Call a header extension only once, saving results.
  @@ -3185,14 +3057,12 @@
   
       memset(buf, 0, sizeof(buf));
       if (tag->ext) {
  -/[EMAIL PROTECTED] -branchstate @*/
        if (getExtension(hsa, tag->ext, &he->t, &he->p, &he->c, hsa->ec + 
tag->extNum))
        {
            he->t = RPM_STRING_TYPE;    
            he->c = 1;
            he->p.str = "(none)";
        }
  -/[EMAIL PROTECTED] =branchstate @*/
       } else
       if (!he->avail) {
        he->tag = tag->tagno;
  @@ -3228,11 +3098,8 @@
       }
       he->avail = 1;
   
  -/[EMAIL PROTECTED]@*/
       (void) stpcpy( stpcpy(buf, "%"), tag->format);
  -/[EMAIL PROTECTED]@*/
   
  -    /[EMAIL PROTECTED]@*/
       if (he->p.ptr)
       switch (he->t) {
       case RPM_STRING_ARRAY_TYPE:
  @@ -3337,7 +3204,6 @@
            static char hex[] = "0123456789abcdef";
            const char * s = he->p.str;
   
  -/[EMAIL PROTECTED]@*/
            need = 2*he->c + tag->pad;
            val = t = xmalloc(need+1);
            while (he->c-- > 0) {
  @@ -3347,7 +3213,6 @@
                *t++ = hex[ (i     ) & 0xf ];
            }
            *t = '\0';
  -/[EMAIL PROTECTED]@*/
   #endif
        }
        break;
  @@ -3357,21 +3222,16 @@
        val = xstrdup("(unknown type)");
        break;
       }
  -    /[EMAIL PROTECTED]@*/
   
       if (!_tagcache)
        (void) rpmheClean(he);
   
  -    /[EMAIL PROTECTED]@*/
       if (val && need > 0) {
        t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
        te = stpcpy(t, val);
  -/[EMAIL PROTECTED]@*/
        hsa->vallen += (te - t);
        val = _free(val);
       }
  -    /[EMAIL PROTECTED]@*/
   
       return (hsa->val + hsa->vallen);
   }
  @@ -3408,9 +3268,7 @@
        need = token->u.string.len;
        if (need == 0) break;
        t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
        te = stpcpy(t, token->u.string.string);
  -/[EMAIL PROTECTED]@*/
        hsa->vallen += (te - t);
        break;
   
  @@ -3490,9 +3348,7 @@
   #ifdef       DYING   /* XXX lots of pugly "(none)" lines with --conflicts. */
            need = sizeof("(none)\n") - 1;
            t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
            te = stpcpy(t, "(none)\n");
  -/[EMAIL PROTECTED]@*/
            hsa->vallen += (te - t);
   #endif
        } else {
  @@ -3519,9 +3375,7 @@
                }
                need = sizeof("  <rpmTag name=\"\">\n") + strlen(tagN);
                te = t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
                te = stpcpy( stpcpy( stpcpy(te, "  <rpmTag name=\""), tagN), 
"\">\n");
  -/[EMAIL PROTECTED]@*/
                hsa->vallen += (te - t);
            }
            if (isyaml) {
  @@ -3538,7 +3392,6 @@
                }
                need = sizeof("  :     - ") + strlen(tagN);
                te = t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
                *te++ = ' ';
                *te++ = ' ';
                te = stpcpy(te, tagN);
  @@ -3553,7 +3406,6 @@
                        te = stpcpy(te, "- ");
                }
                *te = '\0';
  -/[EMAIL PROTECTED]@*/
                hsa->vallen += (te - t);
            }
   
  @@ -3571,18 +3423,14 @@
            if (isxml) {
                need = sizeof("  </rpmTag>\n") - 1;
                te = t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
                te = stpcpy(te, "  </rpmTag>\n");
  -/[EMAIL PROTECTED]@*/
                hsa->vallen += (te - t);
            }
            if (isyaml) {
   #if 0
                need = sizeof("\n") - 1;
                te = t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
                te = stpcpy(te, "\n");
  -/[EMAIL PROTECTED]@*/
                hsa->vallen += (te - t);
   #endif
            }
  @@ -3633,9 +3481,7 @@
       for (ext = exts; ext != NULL && ext->type != HEADER_EXT_LAST;
        ext = (ext->type == HEADER_EXT_MORE ? ext->u.more : ext+1))
       {
  -/[EMAIL PROTECTED]@*/
        if (ec[i].freeit) ec[i].data = _free(ec[i].data);
  -/[EMAIL PROTECTED]@*/
        i++;
       }
   
  @@ -3678,10 +3524,8 @@
   /[EMAIL PROTECTED]@*/
       hsa->errmsg = NULL;
   
  -/[EMAIL PROTECTED]@*/
       if (parseFormat(hsa, hsa->fmt, &hsa->format, &hsa->numTokens, NULL, 
PARSER_BEGIN))
        goto exit;
  -/[EMAIL PROTECTED]@*/
   
       hsa->ec = rpmecNew(hsa->exts);
       hsa->val = xstrdup("");
  @@ -3698,17 +3542,13 @@
       if (isxml) {
        need = sizeof("<rpmHeader>\n") - 1;
        t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
        te = stpcpy(t, "<rpmHeader>\n");
  -/[EMAIL PROTECTED]@*/
        hsa->vallen += (te - t);
       }
       if (isyaml) {
        need = sizeof("- !!omap\n") - 1;
        t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
        te = stpcpy(t, "- !!omap\n");
  -/[EMAIL PROTECTED]@*/
        hsa->vallen += (te - t);
       }
   
  @@ -3725,17 +3565,13 @@
       if (isxml) {
        need = sizeof("</rpmHeader>\n") - 1;
        t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
        te = stpcpy(t, "</rpmHeader>\n");
  -/[EMAIL PROTECTED]@*/
        hsa->vallen += (te - t);
       }
       if (isyaml) {
        need = sizeof("\n") - 1;
        t = hsaReserve(hsa, need);
  -/[EMAIL PROTECTED]@*/
        te = stpcpy(t, "\n");
  -/[EMAIL PROTECTED]@*/
        hsa->vallen += (te - t);
       }
   
  @@ -3772,17 +3608,13 @@
   
       if (type == RPM_INT32_TYPE) {
        val = xmalloc(20 + padding);
  -/[EMAIL PROTECTED]@*/
        strcat(formatPrefix, "o");
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        sprintf(val, formatPrefix, *((int_32 *) data));
        /[EMAIL PROTECTED]@*/
       } else if (type == RPM_INT64_TYPE) {
        val = xmalloc(40 + padding);
  -/[EMAIL PROTECTED]@*/
        strcat(formatPrefix, "llo");
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        sprintf(val, formatPrefix, *((int_64 *) data));
        /[EMAIL PROTECTED]@*/
  @@ -3809,17 +3641,13 @@
   
       if (type == RPM_INT32_TYPE) {
        val = xmalloc(20 + padding);
  -/[EMAIL PROTECTED]@*/
        strcat(formatPrefix, "x");
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        sprintf(val, formatPrefix, *((int_32 *) data));
        /[EMAIL PROTECTED]@*/
       } else if (type == RPM_INT64_TYPE) {
        val = xmalloc(40 + padding);
  -/[EMAIL PROTECTED]@*/
        strcat(formatPrefix, "llx");
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        sprintf(val, formatPrefix, *((int_64 *) data));
        /[EMAIL PROTECTED]@*/
  @@ -3853,9 +3681,7 @@
        char buf[50];
   
        val = xmalloc(50 + padding);
  -/[EMAIL PROTECTED]@*/
        strcat(formatPrefix, "s");
  -/[EMAIL PROTECTED]@*/
   
        /* this is important if sizeof(int_32) ! sizeof(time_t) */
        {   time_t dateint = *((int_32 *) data);
  @@ -3923,30 +3749,23 @@
   
       if (type == RPM_INT32_TYPE) {
        result = xmalloc(padding + 20);
  -/[EMAIL PROTECTED]@*/
        strcat(formatPrefix, "d");
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        sprintf(result, formatPrefix, *((int_32 *) data));
        /[EMAIL PROTECTED]@*/
       } else if (type == RPM_INT64_TYPE) {
        result = xmalloc(padding + 40);
  -/[EMAIL PROTECTED]@*/
        strcat(formatPrefix, "lld");
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        sprintf(result, formatPrefix, *((int_64 *) data));
        /[EMAIL PROTECTED]@*/
       } else {
        buf = alloca(strlen(data) + padding + 2);
  -/[EMAIL PROTECTED]@*/
        strcat(formatPrefix, "s");
  -/[EMAIL PROTECTED]@*/
        /[EMAIL PROTECTED]@*/
        sprintf(buf, formatPrefix, data);
        /[EMAIL PROTECTED]@*/
   
  -/[EMAIL PROTECTED]@*/
        result = dst = xmalloc(strlen(buf) * 4 + 3);
        *dst++ = '\'';
        for (src = buf; *src != '\0'; src++) {
  @@ -3961,7 +3780,6 @@
        }
        *dst++ = '\'';
        *dst = '\0';
  -/[EMAIL PROTECTED]@*/
   
       }
   
  @@ -4000,10 +3818,8 @@
        int_32 count;
        if (headerIsEntry(headerTo, *p))
            continue;
  -/[EMAIL PROTECTED]@*/
        if (!headerGetEntryMinMemory(headerFrom, *p, &type, &s, &count))
            continue;
  -/[EMAIL PROTECTED]@*/
        (void) headerAddEntry(headerTo, *p, type, s, count);
        s = headerFreeData(s, type);
       }
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                [email protected]

Reply via email to