Commit b0c25b64 authored by Bernhard Link's avatar Bernhard Link

Silence some -Wextra warnings

parent ca44e118
......@@ -737,7 +737,7 @@ retvalue checksumsarray_parse(struct checksumsarray *out, const struct strlist l
}
}
}
assert( count == filenames.count );
assert( count == (size_t)filenames.count );
if( filenames.count == 0 ) {
strlist_done(&filenames);
......
......@@ -368,7 +368,7 @@ struct namelist {
const char **argv;
};
static retvalue by_name(struct package_list *list, struct database *database, struct distribution *into, struct distribution *from, struct target *desttarget, struct target *fromtarget, void *data) {
static retvalue by_name(struct package_list *list, struct database *database, UNUSED(struct distribution *into), UNUSED(struct distribution *from), struct target *desttarget, struct target *fromtarget, void *data) {
struct namelist *d = data;
retvalue result, r;
int i;
......@@ -428,9 +428,9 @@ retvalue copy_by_name(struct database *database, struct distribution *into, stru
return r;
}
static retvalue by_source(struct package_list *list, struct database *database, struct distribution *into, struct distribution *from, struct target *desttarget, struct target *fromtarget, void *data) {
static retvalue by_source(struct package_list *list, struct database *database, UNUSED(struct distribution *into), UNUSED(struct distribution *from), struct target *desttarget, struct target *fromtarget, void *data) {
struct namelist *d = data;
struct target_cursor iterator IFSTUPIDCC(={});
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
const char *packagename, *chunk;
retvalue result, r;
......@@ -507,9 +507,9 @@ retvalue copy_by_source(struct database *database, struct distribution *into, st
return r;
}
static retvalue by_formula(struct package_list *list, struct database *database, struct distribution *into, struct distribution *from, struct target *desttarget, struct target *fromtarget, void *data) {
static retvalue by_formula(struct package_list *list, struct database *database, UNUSED(struct distribution *into), UNUSED(struct distribution *from), struct target *desttarget, struct target *fromtarget, void *data) {
term *condition = data;
struct target_cursor iterator IFSTUPIDCC(={});
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
const char *packagename, *chunk;
retvalue result, r;
......@@ -601,7 +601,7 @@ static retvalue choose_by_source(void *data, const char *chunk) {
free(packagename);
if( !RET_IS_OK(r) )
return r;
assert( l->argv > 0 );
assert( l->argc > 0 );
/* only include if source name matches */
if( strcmp(source, l->argv[0]) != 0 ) {
free(source); free(sourceversion);
......
......@@ -470,7 +470,7 @@ retvalue distribution_foreach_roopenedpart(struct distribution *distribution,str
retvalue distribution_foreach_package(struct distribution *distribution, struct database *database, const char *component, const char *architecture, const char *packagetype, each_package_action action, each_target_action target_action, void *data) {
retvalue result,r;
struct target *t;
struct target_cursor iterator IFSTUPIDCC(={});
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
const char *package, *control;
result = RET_NOTHING;
......@@ -507,7 +507,7 @@ retvalue distribution_foreach_package_c(struct distribution *distribution, struc
retvalue result,r;
struct target *t;
const char *package, *control;
struct target_cursor iterator IFSTUPIDCC(={});
struct target_cursor iterator IFSTUPIDCC(=TARGET_CURSOR_ZERO);
result = RET_NOTHING;
for( t = distribution->targets ; t != NULL ; t = t->next ) {
......
......@@ -636,7 +636,7 @@ static retvalue candidate_addhashes(struct incoming *i, struct candidate *c, enu
return RET_OK;
}
static retvalue candidate_finalizechecksums(struct incoming *i, struct candidate *c) {
static retvalue candidate_finalizechecksums(struct candidate *c) {
struct candidate_file *f;
retvalue r;
......@@ -720,7 +720,7 @@ static retvalue candidate_parse(struct incoming *i, struct candidate *c) {
return r;
}
}
r = candidate_finalizechecksums(i, c);
r = candidate_finalizechecksums(c);
for( cs = cs_md5sum ; cs < cs_hashCOUNT ; cs++ )
strlist_done(&filelines[cs]);
R;
......
......@@ -1246,6 +1246,8 @@ ACTION_D(y, n, y, copyfilter) {
struct distribution *destination, *source;
retvalue result, r;
assert( argc == 3 );
result = distribution_get(alldistributions, argv[1], true, &destination);
assert( result != RET_NOTHING );
if( RET_WAS_ERROR(result) )
......@@ -1325,6 +1327,8 @@ ACTION_D(y, n, y, restorefilter) {
struct distribution *destination;
retvalue result, r;
assert( argc == 3 );
result = distribution_get(alldistributions, argv[1], true, &destination);
assert( result != RET_NOTHING );
if( RET_WAS_ERROR(result) )
......
......@@ -84,6 +84,7 @@ struct target_cursor {
const char *lastname;
const char *lastcontrol;
};
#define TARGET_CURSOR_ZERO {NULL, NULL, NULL, NULL}
/* wrapper around initpackagesdb and table_newglobalcursor */
static inline retvalue target_openiterator(struct target *t, struct database *db, bool readonly, /*@out@*/struct target_cursor *tc) {
retvalue r, r2;
......
......@@ -676,7 +676,7 @@ static retvalue read_dscfile(const char *fullfilename, struct dscfile **dsc) {
static retvalue parse_dsc(struct fileentry *dscfile, struct changes *changes) {
struct dscfile *n;
retvalue r;
size_t i;
int i;
if( dscfile->fullfilename == NULL )
return RET_NOTHING;
......@@ -704,7 +704,7 @@ static retvalue parse_dsc(struct fileentry *dscfile, struct changes *changes) {
static retvalue write_dsc_file(struct fileentry *dscfile, unsigned int flags) {
struct dscfile *dsc = dscfile->dsc;
unsigned int i;
int i;
struct chunkeditfield *cef;
retvalue r;
char *control; size_t controllen;
......@@ -1378,13 +1378,14 @@ static void verify_binary_name(const char *basename, const char *name, const cha
static retvalue verify(const char *changesfilename, struct changes *changes) {
retvalue r;
struct fileentry *file;
unsigned int j;
size_t k;
printf("Checking Source packages...\n");
for( file = changes->files; file != NULL ; file = file->next ) {
const char *name, *version, *p;
size_t namelen, versionlen, l;
bool has_tar, has_diff, has_orig, has_format_tar;
int i;
if( file->type != ft_DSC )
continue;
......@@ -1523,9 +1524,9 @@ static retvalue verify(const char *changesfilename, struct changes *changes) {
has_format_tar = false;
has_diff = false;
has_orig = false;
for( j = 0 ; j < file->dsc->expected.names.count ; j++ ) {
const char *basename = file->dsc->expected.names.values[j];
const struct fileentry *sfile = file->dsc->uplink[j];
for( i = 0 ; i < file->dsc->expected.names.count ; i++ ) {
const char *basename = file->dsc->expected.names.values[i];
const struct fileentry *sfile = file->dsc->uplink[i];
size_t expectedversionlen, expectedformatlen;
const char *expectedformat;
bool istar = false, versionok;
......@@ -1663,8 +1664,8 @@ static retvalue verify(const char *changesfilename, struct changes *changes) {
file->fullfilename);
}
printf("Checking Binary consistency...\n");
for( j = 0 ; j < changes->binarycount ; j++ ) {
struct binary *b = &changes->binaries[j];
for( k = 0 ; k < changes->binarycount ; k++ ) {
struct binary *b = &changes->binaries[k];
if( b->files == NULL && !b->uncheckable ) {
/* no files - not even conjectured -, headers must be wrong */
......@@ -1833,7 +1834,7 @@ static retvalue verify(const char *changesfilename, struct changes *changes) {
}
if( file->type == ft_DSC ) {
unsigned int i;
int i;
if( file->dsc == NULL ) {
fprintf(stderr,
......@@ -1905,7 +1906,7 @@ static retvalue updatechecksums(const char *changesfilename, struct changes *c,
return r;
/* first update all .dsc files and perhaps recalculate their checksums */
for( file = c->files; file != NULL ; file = file->next ) {
unsigned int i;
int i;
bool improvedhash[cs_hashCOUNT];
if( file->type != ft_DSC )
......@@ -2030,7 +2031,7 @@ static retvalue includeallsources(const char *changesfilename, struct changes *c
struct fileentry *file;
for( file = c->files; file != NULL ; file = file->next ) {
unsigned int i;
int i;
if( file->type != ft_DSC )
continue;
......@@ -2090,7 +2091,7 @@ static retvalue adddsc(struct changes *c, const char *dscfilename, const struct
struct dscfile *dsc;
char *fullfilename, *basename;
char *origdirectory;
size_t i;
int i;
r = findfile(dscfilename, c, searchpath, ".", &fullfilename);
if( RET_WAS_ERROR(r) )
......
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