Fix some harmless compilation warnings

This commit is contained in:
Дмитрий Левин 2014-02-15 22:44:35 +00:00
parent ee25cc084b
commit 4efd5e5f44
3 changed files with 19 additions and 19 deletions

View File

@ -524,7 +524,6 @@ static /*@only@*/ /*@null@*/ void * doHeaderUnload(Header h,
int i;
int drlen, ndribbles;
int driplen, ndrips;
int legacy = 0;
/* Sort entries by (offset,tag). */
headerUnsort(h);
@ -634,7 +633,6 @@ t = te;
if (i == 0 && (h->flags & HEADERFLAG_LEGACY)) {
int_32 stei[4];
legacy = 1;
memcpy(pe+1, src, rdl);
memcpy(te, src + rdl, rdlen);
te += rdlen;
@ -886,7 +884,6 @@ Header headerLoad(/*@kept@*/ void * uh)
char * dataStart;
indexEntry entry;
int rdlen;
int i;
/* Sanity checks on header intro. */
if (hdrchkTags(il) || hdrchkData(dl))
@ -925,7 +922,6 @@ Header headerLoad(/*@kept@*/ void * uh)
}
entry = h->index;
i = 0;
if (!(htonl(pe->tag) < HEADER_I18NTABLE)) {
h->flags |= HEADERFLAG_LEGACY;
entry->info.type = REGION_TAG_TYPE;
@ -1139,11 +1135,9 @@ Header headerRead(FD_t fd, enum hMagic magicp)
/*@modifies fd @*/
{
int_32 block[4];
int_32 reserved;
int_32 * ei = NULL;
int_32 il;
int_32 dl;
int_32 magic;
Header h = NULL;
size_t len;
int i;
@ -1161,10 +1155,10 @@ Header headerRead(FD_t fd, enum hMagic magicp)
i = 0;
if (magicp == HEADER_MAGIC_YES) {
magic = block[i++];
int_32 magic = block[i++];
if (memcmp(&magic, header_magic, sizeof(magic)))
goto exit;
reserved = block[i++];
i++;
}
il = ntohl(block[i]); i++;
@ -3092,7 +3086,6 @@ char * headerSprintf(Header h, const char * fmt,
headerSprintfExtension exts = (headerSprintfExtension) extensions;
headerTagTableEntry tags = (headerTagTableEntry) tbltags;
/*@=castexpose@*/
char * t;
char * fmtString;
sprintfToken format;
int numTokens;
@ -3116,7 +3109,7 @@ char * headerSprintf(Header h, const char * fmt,
val = xstrdup("");
for (i = 0; i < numTokens; i++) {
/*@-mods@*/
t = singleSprintf(h, format + i, exts, extCache, 0,
singleSprintf(h, format + i, exts, extCache, 0,
&val, &vallen, &alloced);
/*@=mods@*/
}

View File

@ -866,7 +866,6 @@ static int openDatabase(/*@null@*/ const char * prefix,
{
rpmdb db;
int rc, xx;
unsigned int gflags = 0; /* dbiGet() flags */
static int _dbenv_removed = 0;
int justCheck = flags & RPMDB_FLAG_JUSTCHECK;
int minimal = flags & RPMDB_FLAG_MINIMAL;

View File

@ -381,7 +381,8 @@ ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
rc = read(fdFileno(fd), buf, (count > fd->bytesRemain ? fd->bytesRemain : count));
fdstat_exit(fd, FDSTAT_READ, rc);
if (fd->ndigests && rc > 0) fdUpdateDigests(fd, buf, rc);
if (fd->ndigests && rc > 0)
fdUpdateDigests(fd, (const unsigned char *)buf, rc);
/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tfdRead(%p,%p,%ld) rc %ld %s\n", cookie, buf, (long)count, (long)rc, fdbg(fd)));
@ -400,7 +401,8 @@ ssize_t fdWrite(void * cookie, const char * buf, size_t count)
if (fd->bytesRemain == 0) return 0; /* XXX simulate EOF */
if (fd->ndigests && count > 0) fdUpdateDigests(fd, buf, count);
if (fd->ndigests && count > 0)
fdUpdateDigests(fd, (const unsigned char *)buf, count);
if (fd->wr_chunked) {
char chunksize[20];
@ -2256,7 +2258,8 @@ DBGIO(fd, (stderr, "==>\tgzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)
} else if (rc >= 0) {
fdstat_exit(fd, FDSTAT_READ, rc);
/*@-compdef@*/
if (fd->ndigests && rc > 0) fdUpdateDigests(fd, buf, rc);
if (fd->ndigests && rc > 0)
fdUpdateDigests(fd, (const unsigned char *)buf, rc);
/*@=compdef@*/
}
return rc;
@ -2427,7 +2430,8 @@ static ssize_t gzdWrite(void * cookie, const char * buf, size_t count)
if (fd == NULL || fd->bytesRemain == 0) return 0; /* XXX simulate EOF */
if (fd->ndigests && count > 0) fdUpdateDigests(fd, buf, count);
if (fd->ndigests && count > 0)
fdUpdateDigests(fd, (const unsigned char *)buf, count);
rpmgz = gzdFileno(fd);
if (rpmgz == NULL) return -2; /* XXX can't happen */
@ -2654,7 +2658,8 @@ static ssize_t bzdRead(void * cookie, /*@out@*/ char * buf, size_t count)
} else if (rc >= 0) {
fdstat_exit(fd, FDSTAT_READ, rc);
/*@-compdef@*/
if (fd->ndigests && rc > 0) fdUpdateDigests(fd, buf, rc);
if (fd->ndigests && rc > 0)
fdUpdateDigests(fd, (const unsigned char *)buf, rc);
/*@=compdef@*/
}
return rc;
@ -2673,7 +2678,8 @@ static ssize_t bzdWrite(void * cookie, const char * buf, size_t count)
if (fd->bytesRemain == 0) return 0; /* XXX simulate EOF */
if (fd->ndigests && count > 0) fdUpdateDigests(fd, buf, count);
if (fd->ndigests && count > 0)
fdUpdateDigests(fd, (const unsigned char *)buf, count);
bzfile = bzdFileno(fd);
fdstat_enter(fd, FDSTAT_WRITE);
@ -3071,7 +3077,8 @@ static ssize_t lzdRead(void * cookie, /*@out@*/ char * buf, size_t count)
} else if (rc >= 0) {
fdstat_exit(fd, FDSTAT_READ, rc);
/*@-compdef@*/
if (fd->ndigests && rc > 0) fdUpdateDigests(fd, (void *)buf, rc);
if (fd->ndigests && rc > 0)
fdUpdateDigests(fd, (const unsigned char *)buf, rc);
/*@=compdef@*/
}
return rc;
@ -3090,7 +3097,8 @@ static ssize_t lzdWrite(void * cookie, const char * buf, size_t count)
if (fd == NULL || fd->bytesRemain == 0) return 0; /* XXX simulate EOF */
if (fd->ndigests && count > 0) fdUpdateDigests(fd, (void *)buf, count);
if (fd->ndigests && count > 0)
fdUpdateDigests(fd, (const unsigned char *)buf, count);
lzfile = lzdFileno(fd);