From: Michael Schroeder Date: Thu, 19 May 2011 10:33:35 +0000 (+0200) Subject: - make peace with gcc46 X-Git-Tag: BASE-SuSE-Code-12_1-Branch~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=685d3d75c18e5c33f40879b46905b0aac788b73e;p=thirdparty%2Flibsolv.git - make peace with gcc46 --- diff --git a/ext/repo_rpmdb.c b/ext/repo_rpmdb.c index 77d85424..1d17c809 100644 --- a/ext/repo_rpmdb.c +++ b/ext/repo_rpmdb.c @@ -1368,7 +1368,7 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags) DBC *dbc = 0; int byteswapped; unsigned int dbid; - unsigned char *dp, *dbidp; + unsigned char *dp; int dl, nrpmids; struct rpmid *rpmids, *rp; int i; @@ -1443,7 +1443,6 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags) perror("db->cursor"); exit(1); } - dbidp = (unsigned char *)&dbid; rpmheadsize = 0; rpmhead = 0; i = 0; @@ -1562,7 +1561,6 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags) perror("db->cursor"); exit(1); } - dbidp = (unsigned char *)&dbid; nrpmids = 0; rpmids = 0; while (dbc->c_get(dbc, &dbkey, &dbdata, DB_NEXT) == 0) @@ -1590,7 +1588,6 @@ repo_add_rpmdb(Repo *repo, Repo *ref, const char *rootdir, int flags) /* sort rpmids */ sat_sort(rpmids, nrpmids, sizeof(*rpmids), rpmids_sort_cmp, 0); - dbidp = (unsigned char *)&dbid; rpmheadsize = 0; rpmhead = 0; @@ -2387,7 +2384,7 @@ void * rpm_byfp(FILE *fp, const char *name, void **statep) { struct rpm_by_state *state = *statep; - int headerstart, headerend; + /* int headerstart, headerend; */ RpmHead *rpmhead; int sigdsize, sigcnt, l; unsigned char lead[4096]; @@ -2423,7 +2420,7 @@ rpm_byfp(FILE *fp, const char *name, void **statep) } sigdsize += sigcnt * 16; sigdsize = (sigdsize + 7) & ~7; - headerstart = 96 + 16 + sigdsize; + /* headerstart = 96 + 16 + sigdsize; */ while (sigdsize) { l = sigdsize > 4096 ? 4096 : sigdsize; @@ -2454,7 +2451,7 @@ rpm_byfp(FILE *fp, const char *name, void **statep) return 0; } l = sigdsize + sigcnt * 16; - headerend = headerstart + 16 + l; + /* headerend = headerstart + 16 + l; */ if (l > state->rpmheadsize) { state->rpmheadsize = l + 128; @@ -2648,9 +2645,11 @@ parsekeydata(Solvable *s, Repodata *data, unsigned char *p, int pl) unsigned char keyid[8]; unsigned int kcr = 0, maxex = 0; unsigned char *pubkey = 0; - int pubkeyl = 0; unsigned char *userid = 0; +#if 0 + int pubkeyl = 0; int useridl = 0; +#endif for (; pl; p += l, pl -= l) { @@ -2708,7 +2707,9 @@ parsekeydata(Solvable *s, Repodata *data, unsigned char *p, int pl) pubkey = sat_realloc(pubkey, l); if (l) memcpy(pubkey, p, l); +#if 0 pubkeyl = l; +#endif kcr = 0; if (p[0] == 3) { @@ -2814,7 +2815,10 @@ parsekeydata(Solvable *s, Repodata *data, unsigned char *p, int pl) { int j, ql, haveissuer; unsigned char *q; - unsigned int ex = 0, scr = 0; + unsigned int ex = 0; +#if 0 + unsigned int scr = 0; +#endif unsigned char issuer[8]; // printf("V4 signature packet\n"); @@ -2879,8 +2883,10 @@ parsekeydata(Solvable *s, Repodata *data, unsigned char *p, int pl) memcpy(issuer, q + 1, 8); haveissuer = 1; } +#if 0 if (x == 2 && j == 0) scr = q[1] << 24 | q[2] << 16 | q[3] << 8 | q[4]; +#endif if (x == 9 && j == 0) ex = q[1] << 24 | q[2] << 16 | q[3] << 8 | q[4]; q += sl; @@ -2951,7 +2957,9 @@ parsekeydata(Solvable *s, Repodata *data, unsigned char *p, int pl) userid = sat_realloc(userid, l); if (l) memcpy(userid, p, l); +#if 0 useridl = l; +#endif } } if (maxex) diff --git a/ext/repo_updateinfoxml.c b/ext/repo_updateinfoxml.c index 8ad8917d..7e87e2d5 100644 --- a/ext/repo_updateinfoxml.c +++ b/ext/repo_updateinfoxml.c @@ -275,13 +275,11 @@ startElement(void *userData, const char *name, const char **atts) */ case STATE_UPDATE: { - const char *from = 0, *status = 0, *type = 0, *version = 0; + const char *from = 0, *type = 0, *version = 0; for (; *atts; atts += 2) { if (!strcmp(*atts, "from")) from = atts[1]; - else if (!strcmp(*atts, "status")) - status = atts[1]; else if (!strcmp(*atts, "type")) type = atts[1]; else if (!strcmp(*atts, "version")) @@ -383,7 +381,7 @@ startElement(void *userData, const char *name, const char **atts) */ case STATE_PACKAGE: { - const char *arch = 0, *name = 0, *src = 0; + const char *arch = 0, *name = 0; Id evr = makeevr_atts(pool, pd, atts); /* parse "epoch", "version", "release" */ Id n, a = 0; Id rel_id; @@ -394,8 +392,6 @@ startElement(void *userData, const char *name, const char **atts) arch = atts[1]; else if (!strcmp(*atts, "name")) name = atts[1]; - else if (!strcmp(*atts, "src")) - src = atts[1]; } /* generated Id for name */ n = str2id(pool, name, 1); diff --git a/src/repodata.c b/src/repodata.c index 7e69155b..7b8682ee 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -630,6 +630,7 @@ repodata_lookup_num(Repodata *data, Id solvid, Id keyname, unsigned int *value) || key->type == REPOKEY_TYPE_U32 || key->type == REPOKEY_TYPE_CONSTANT) { + kv.num = 0; dp = data_fetch(dp, &kv, key); *value = kv.num; return 1; diff --git a/src/transaction.c b/src/transaction.c index 4efc4dad..4514f2c4 100644 --- a/src/transaction.c +++ b/src/transaction.c @@ -1930,7 +1930,7 @@ transaction_add_obsoleted(Transaction *trans) Repo *installed = pool->installed; Id p; Solvable *s; - int i, j, k, max, oldcount; + int i, j, k, max; Map done; Queue obsq, *steps; @@ -1945,7 +1945,6 @@ transaction_add_obsoleted(Transaction *trans) return; /* make room */ steps = &trans->steps; - oldcount = steps->count; queue_insertn(steps, 0, max); /* now add em */