Commit c1537d41 authored by Bernhard Link's avatar Bernhard Link

fix some more -Wunused-parameter and -Wsigned-compare warnings

parent 18efd694
......@@ -20,7 +20,7 @@ if [ "x$1" = "x--configure" ] ; then
cd "$1" || exit 1
shift
fi
"$repreprodir"/configure --enable-maintainer-mode CFLAGS="-Wall -O2 -g -Wmissing-prototypes -Wstrict-prototypes -Wshadow" CPPFLAGS="" "$@"
"$repreprodir"/configure --enable-maintainer-mode CFLAGS="-Wall -O2 -g -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wunused-parameter -Wsign-compare" CPPFLAGS="" "$@"
else
echo "unsupported option $1" >&2
exit 1
......
......@@ -235,7 +235,7 @@ CFstartparse(distribution) {
return RET_OK;
}
static bool notpropersuperset(const struct atomlist *allowed, const char *allowedname, const struct atomlist *check, const char *checkname, const char **atoms, const struct configiterator *iter, const struct distribution *d) {
static bool notpropersuperset(const struct atomlist *allowed, const char *allowedname, const struct atomlist *check, const char *checkname, const char **atoms, const struct distribution *d) {
atom_t missing;
if (!atomlist_subset(allowed, check, &missing)) {
......@@ -319,22 +319,18 @@ CFfinishparse(distribution) {
if (notpropersuperset(&n->architectures, "Architectures",
&n->contents_architectures, "ContentsArchitectures",
atoms_architectures,
iter, n) ||
atoms_architectures, n) ||
notpropersuperset(&n->components, "Components",
&n->contents_components, "ContentsComponents",
atoms_components,
iter, n) ||
atoms_components, n) ||
notpropersuperset(&n->udebcomponents, "UDebComponents",
&n->contents_ucomponents, "ContentsUComponents",
atoms_components,
iter, n) ||
atoms_components, n) ||
// TODO: instead of checking here make sure it can have more
// in the rest of the code...:
notpropersuperset(&n->components, "Components",
&n->udebcomponents, "UDebComponents",
atoms_components,
iter, n)) {
atoms_components, n)) {
(void)distribution_free(n);
return RET_ERROR;
}
......
......@@ -226,8 +226,8 @@ O(fast), O(x_morguedir), O(x_outdir), O(x_basedir), O(x_distdir), O(x_dbdir), O(
act(const struct atomlist *, packagetypes), \
a(int, argc), a(const char *, argv[]))
#define ACTION_RF(act, sp, u, name) static retvalue action_rf_ ## act ## _ ## sp ## _ ## name ( \
u(struct distribution *, alldistributions), \
#define ACTION_RF(act, sp, ud, u, name) static retvalue action_rf_ ## act ## _ ## sp ## _ ## name ( \
ud(struct distribution *, alldistributions), \
sp(const char *, section), \
sp(const char *, priority), \
act(const struct atomlist *, architectures), \
......@@ -542,7 +542,7 @@ static retvalue checkifreferenced(UNUSED(void *data), const char *filekey) {
return r;
}
ACTION_RF(n, n, n, dumpunreferenced) {
ACTION_RF(n, n, n, n, dumpunreferenced) {
retvalue result;
result = files_foreach(checkifreferenced, NULL);
......@@ -562,7 +562,7 @@ static retvalue deleteifunreferenced(UNUSED(void *data), const char *filekey) {
return r;
}
ACTION_RF(n, n, n, deleteunreferenced) {
ACTION_RF(n, n, n, n, deleteunreferenced) {
retvalue result;
if (keepunreferenced) {
......@@ -581,7 +581,7 @@ ACTION_RF(n, n, n, deleteunreferenced) {
return result;
}
ACTION_RF(n, n, y, deleteifunreferenced) {
ACTION_RF(n, n, n, y, deleteifunreferenced) {
char buffer[5000], *nl;
int i;
retvalue r, ret;
......@@ -1271,7 +1271,7 @@ static inline retvalue printlsparts(const char *pkgname, struct lspart *parts) {
versionlen = 0; codenamelen = 0; componentlen = 0;
for (p = parts ; p->codename != NULL ; p = p->next) {
struct lsversion *v;
size_t l;
int l;
l = strlen(p->codename);
if (l > codenamelen)
......@@ -2384,7 +2384,7 @@ ACTION_B(n, n, y, dumptracks) {
/***********************checking*************************/
ACTION_RF(y, n, y, check) {
ACTION_RF(y, n, y, y, check) {
retvalue result, r;
struct distribution *d;
......@@ -2509,7 +2509,7 @@ static retvalue repair_descriptions(struct target *target, bool force) {
result = RET_ERROR_INTERRUPTED;
break;
}
r = description_complete(package, controlchunk, false,
r = description_complete(package, controlchunk, force,
&newcontrolchunk);
RET_UPDATE(result, r);
if (RET_WAS_ERROR(r))
......@@ -2618,7 +2618,7 @@ ACTION_F(y, n, y, y, redochecksums) {
/*******************sizes of distributions***************/
ACTION_RF(n, n, y, sizes) {
ACTION_RF(n, n, y, y, sizes) {
retvalue result;
result = distribution_match(alldistributions, argc-1, argv+1,
......
......@@ -693,7 +693,7 @@ static const char * const ics[ic_count] = { "", ".gz"
#endif
};
static inline retvalue setfilename(struct release *release, struct filetorelease *n, const char *relfilename, /*@null@*/const char *symlinkas, enum indexcompression ic) {
static inline retvalue setfilename(struct filetorelease *n, const char *relfilename, /*@null@*/const char *symlinkas, enum indexcompression ic) {
n->f[ic].relativefilename = mprintf("%s%s", relfilename, ics[ic]);
if (FAILEDTOALLOC(n->f[ic].relativefilename))
return RET_ERROR_OOM;
......@@ -756,8 +756,7 @@ static retvalue startfile(struct release *release, const char *filename, /*@null
if ((compressions & IC_FLAG(ic_uncompressed)) != 0) {
retvalue r;
r = setfilename(release, n, filename, symlinkas,
ic_uncompressed);
r = setfilename(n, filename, symlinkas, ic_uncompressed);
if (!RET_WAS_ERROR(r))
r = openfile(release->dirofdist, &n->f[ic_uncompressed]);
if (RET_WAS_ERROR(r)) {
......@@ -776,8 +775,7 @@ static retvalue startfile(struct release *release, const char *filename, /*@null
if ((compressions & IC_FLAG(ic_gzip)) != 0) {
retvalue r;
r = setfilename(release, n, filename, symlinkas,
ic_gzip);
r = setfilename(n, filename, symlinkas, ic_gzip);
if (!RET_WAS_ERROR(r))
r = openfile(release->dirofdist, &n->f[ic_gzip]);
if (RET_WAS_ERROR(r)) {
......@@ -794,8 +792,7 @@ static retvalue startfile(struct release *release, const char *filename, /*@null
#ifdef HAVE_LIBBZ2
if ((compressions & IC_FLAG(ic_bzip2)) != 0) {
retvalue r;
r = setfilename(release, n, filename, symlinkas,
ic_bzip2);
r = setfilename(n, filename, symlinkas, ic_bzip2);
if (!RET_WAS_ERROR(r))
r = openfile(release->dirofdist, &n->f[ic_bzip2]);
if (RET_WAS_ERROR(r)) {
......
......@@ -800,7 +800,7 @@ retvalue signature_check_inline(const struct signature_requirement *requirements
free(plain_data);
#endif
assert (len <= plain_len);
if (plain_len != n - plain_data) {
if (plain_len != (size_t)(n - plain_data)) {
fprintf(stderr,
"Cannot parse '%s': extraced signed data looks malformed.\n",
filename);
......
......@@ -2479,7 +2479,7 @@ retvalue updates_predelete(struct update_distribution *distributions, bool nolis
* downloaded again, so that the rest can be deleted *
******************************************************************************/
static void marktargetsneeded(struct cachedlistfile *files, const struct distribution *d, component_t flat, /*@null@*/const struct strlist *a_from, /*@null@*/const struct strlist *a_into, /*@null@*/const struct strlist *c_from, /*@null@*/const struct strlist *c_into, /*@null@*/const struct strlist *uc_from, /*@null@*/const struct strlist *uc_into, const char *repository, const char *suite, const struct update_pattern *p) {
static void marktargetsneeded(struct cachedlistfile *files, const struct distribution *d, component_t flat, /*@null@*/const struct strlist *a_from, /*@null@*/const struct strlist *a_into, /*@null@*/const struct strlist *c_from, /*@null@*/const struct strlist *uc_from, const char *repository, const char *suite) {
struct target *t;
int i, ai;
......@@ -2604,8 +2604,8 @@ retvalue updates_cleanlists(const struct distribution *distributions, const stru
struct cachedlistfile *files;
int i;
bool isflat;
const struct strlist *uc_from = NULL, *uc_into = NULL;
const struct strlist *c_from = NULL, *c_into = NULL;
const struct strlist *uc_from = NULL;
const struct strlist *c_from = NULL;
const struct strlist *a_from = NULL, *a_into = NULL;
const char *repository;
char *suite;
......@@ -2653,17 +2653,13 @@ retvalue updates_cleanlists(const struct distribution *distributions, const stru
q = p;
while (q != NULL && !q->components_set)
q = q->pattern_from;
if (q != NULL) {
if (q != NULL)
c_from = &q->components_from;
c_into = &q->components_into;
}
q = p;
while (q != NULL && !q->udebcomponents_set)
q = q->pattern_from;
if (q != NULL) {
if (q != NULL)
uc_from = &q->udebcomponents_from;
uc_into = &q->udebcomponents_into;
}
suite = translate_suite_pattern(p, d->codename);
if (FAILEDTOALLOC(suite)) {
cachedlistfile_freelist(files);
......@@ -2673,8 +2669,7 @@ retvalue updates_cleanlists(const struct distribution *distributions, const stru
* Release, Release.gpg, compressed files, hook processed
* files is deleted */
marktargetsneeded(files, d, isflat, a_from, a_into,
c_from, c_into, uc_from, uc_into,
repository, suite, p);
c_from, uc_from, repository, suite);
free(suite);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment