From: Michael Schroeder Date: Tue, 9 Apr 2019 09:35:31 +0000 (+0200) Subject: Fix a couple of signed/unsigned comparisons X-Git-Tag: 0.7.5~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=058c89a5ccae129c7d4b72d87cdfae47d03ff484;p=thirdparty%2Flibsolv.git Fix a couple of signed/unsigned comparisons --- diff --git a/src/pool.c b/src/pool.c index a263e9cf..a5544531 100644 --- a/src/pool.c +++ b/src/pool.c @@ -1312,7 +1312,7 @@ pool_addrelproviders(Pool *pool, Id d) POOL_DEBUG(SOLV_DEBUG_STATS, "addrelproviders: what provides %s?\n", pool_dep2str(pool, name)); #endif pp = pool_whatprovides_ptr(pool, name); - if (!ISRELDEP(name) && name < pool->whatprovidesauxoff) + if (!ISRELDEP(name) && (Offset)name < pool->whatprovidesauxoff) ppaux = pool->whatprovidesaux[name] ? pool->whatprovidesauxdata + pool->whatprovidesaux[name] : 0; while (ISRELDEP(name)) { @@ -1926,7 +1926,7 @@ pool_set_whatprovides(Pool *pool, Id id, Id providers) else { pool->whatprovides[id] = providers; - if (id < pool->whatprovidesauxoff) + if ((Offset)id < pool->whatprovidesauxoff) pool->whatprovidesaux[id] = 0; /* sorry */ d = 1; } diff --git a/src/repo.c b/src/repo.c index d163f134..25fb01ba 100644 --- a/src/repo.c +++ b/src/repo.c @@ -391,7 +391,7 @@ repo_addid_dep_hash(Repo *repo, Offset olddeps, Id id, Id marker, int size) if (repo->lastidhash_idarraysize != repo->idarraysize || (Hashval)size * 2 > repo->lastidhash_mask || repo->lastmarker != marker) { repo->lastmarkerpos = 0; - if (size * 2 > (Hashval)repo->lastidhash_mask) + if ((Hashval)size * 2 > repo->lastidhash_mask) { repo->lastidhash_mask = mkmask(size < REPO_ADDID_DEP_HASHMIN ? REPO_ADDID_DEP_HASHMIN : size); repo->lastidhash = solv_realloc2(repo->lastidhash, repo->lastidhash_mask + 1, sizeof(Id)); diff --git a/src/repodata.c b/src/repodata.c index 54d5bb23..e7cbbf33 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -1138,7 +1138,7 @@ repodata_search_array(Repodata *data, Id solvid, Id keyname, int flags, Repokey if (!dp || kv->entry != -1) return 0; - while (++kv->entry < kv->num) + while (++kv->entry < (int)kv->num) { if (kv->entry) dp = data_skip_schema(data, dp, schema); @@ -3156,7 +3156,7 @@ compact_attrdata(Repodata *data, int entry, int nentry) break; case REPOKEY_TYPE_DIRSTRARRAY: for (v = attrs[1]; data->attriddata[v] ; v += 2) - if (data->attriddata[v + 1] < attrdatastart) + if ((unsigned int)data->attriddata[v + 1] < attrdatastart) attrdatastart = data->attriddata[v + 1]; /* FALLTHROUGH */ case REPOKEY_TYPE_IDARRAY: