From 682221438e242486b4672cb7bf3297418f836dcd Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 18 Nov 2007 22:18:09 -0800 Subject: [PATCH] Clean up remaining build warnings Clean up remaining build warnings. None of this should affect code operations. The only warnings which were actually relevant might have been the ones in ldrdf.c, but it's not clear if anyone ever uses that. --- output/outobj.c | 2 +- parser.c | 7 ++++--- rdoff/ldrdf.c | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/output/outobj.c b/output/outobj.c index 3dfbf965..9592464b 100644 --- a/output/outobj.c +++ b/output/outobj.c @@ -1995,7 +1995,7 @@ static void obj_write_file(int debuginfo) orp->parm[0] = 0; orp->parm[1] = 0; for (pub = fpubhead; pub; pub = pub->next) { /* pub-crawl :-) */ - if ((uint64_t)orp->parm[2] != pub->segment) { + if (orp->parm[2] != (uint32_t)pub->segment) { obj_emit(orp); orp->parm[2] = pub->segment; } diff --git a/parser.c b/parser.c index 8011733c..bd9d3801 100644 --- a/parser.c +++ b/parser.c @@ -802,6 +802,7 @@ restart_parse: } } } else { /* it's a register */ + unsigned int rs; if (value->type >= EXPR_SIMPLE || value->value != 1) { error(ERR_NONFATAL, "invalid operand type"); @@ -825,16 +826,16 @@ restart_parse: * we want to produce a warning iff the specified size * is different from the register size */ - i = result->oprs[operand].type & SIZE_MASK; + rs = result->oprs[operand].type & SIZE_MASK; } else - i = 0; + rs = 0; result->oprs[operand].type &= TO; result->oprs[operand].type |= REGISTER; result->oprs[operand].type |= reg_flags[value->type]; result->oprs[operand].basereg = value->type; - if (i && (result->oprs[operand].type & SIZE_MASK) != i) + if (rs && (result->oprs[operand].type & SIZE_MASK) != rs) error(ERR_WARNING | ERR_PASS1, "register size specification ignored"); } diff --git a/rdoff/ldrdf.c b/rdoff/ldrdf.c index ece8c3f1..046139b3 100644 --- a/rdoff/ldrdf.c +++ b/rdoff/ldrdf.c @@ -218,6 +218,8 @@ void processmodule(const char *filename, struct modulenode *mod) int32_t bssamount = 0; int bss_was_referenced = 0; + memset(&sconf, 0, sizeof sconf); + for (seg = 0; seg < mod->f.nsegs; seg++) { /* * get the segment configuration for this type from the segment @@ -720,7 +722,7 @@ void write_output(const char *filename) } i = fread(hr->g.data, 1, sizeof(hr->g.data), ff); fseek(ff, 0, SEEK_END); - if (ftell(ff) > sizeof(hr->g.data)) { + if (ftell(ff) > (long)sizeof(hr->g.data)) { fprintf(error_file, "warning: maximum generic record size is %u, " "rest of file ignored\n",