summaryrefslogtreecommitdiff
path: root/binutils/srconv.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-12-11 13:41:59 +0000
committerNick Clifton <nickc@redhat.com>2009-12-11 13:41:59 +0000
commit5413b5486ba77949122a8bfd6067d31626e330f3 (patch)
tree6956d71f05d79d40e52fed28668bf9db104a4a04 /binutils/srconv.c
parentf28844f209b0de6783df75e402dd1c26f3edb0c7 (diff)
downloadbinutils-redhat-5413b5486ba77949122a8bfd6067d31626e330f3.tar.gz
Add -Wshadow to the gcc command line options used when compiling the binutils.
Fix up all warnings generated by the addition of this switch.
Diffstat (limited to 'binutils/srconv.c')
-rw-r--r--binutils/srconv.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/binutils/srconv.c b/binutils/srconv.c
index efccd66439..c288fd5df8 100644
--- a/binutils/srconv.c
+++ b/binutils/srconv.c
@@ -1,6 +1,6 @@
/* srconv.c -- Sysroff conversion program
Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2007, 2008 Free Software Foundation, Inc.
+ 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -158,17 +158,17 @@ strip_suffix (const char *name)
/* IT LEN stuff CS */
static void
-checksum (FILE *file, unsigned char *ptr, int size, int code)
+checksum (FILE *ffile, unsigned char *ptr, int size, int ccode)
{
int j;
int last;
int sum = 0;
int bytes = size / 8;
- last = !(code & 0xff00);
+ last = !(ccode & 0xff00);
if (size & 0x7)
abort ();
- ptr[0] = code | (last ? 0x80 : 0);
+ ptr[0] = ccode | (last ? 0x80 : 0);
ptr[1] = bytes + 1;
for (j = 0; j < bytes; j++)
@@ -176,14 +176,14 @@ checksum (FILE *file, unsigned char *ptr, int size, int code)
/* Glue on a checksum too. */
ptr[bytes] = ~sum;
- if (fwrite (ptr, bytes + 1, 1, file) != 1)
+ if (fwrite (ptr, bytes + 1, 1, ffile) != 1)
/* FIXME: Return error status. */
abort ();
}
static void
-writeINT (int n, unsigned char *ptr, int *idx, int size, FILE *file)
+writeINT (int n, unsigned char *ptr, int *idx, int size, FILE *ffile)
{
int byte = *idx / 8;
@@ -195,7 +195,7 @@ writeINT (int n, unsigned char *ptr, int *idx, int size, FILE *file)
if (byte > 240)
{
/* Lets write out that record and do another one. */
- checksum (file, ptr, *idx, code | 0x1000);
+ checksum (ffile, ptr, *idx, code | 0x1000);
*idx = 16;
byte = *idx / 8;
}
@@ -242,24 +242,24 @@ writeBITS (int val, unsigned char *ptr, int *idx, int size)
static void
writeBARRAY (barray data, unsigned char *ptr, int *idx,
- int size ATTRIBUTE_UNUSED, FILE *file)
+ int size ATTRIBUTE_UNUSED, FILE *ffile)
{
int i;
- writeINT (data.len, ptr, idx, 1, file);
+ writeINT (data.len, ptr, idx, 1, ffile);
for (i = 0; i < data.len; i++)
- writeINT (data.data[i], ptr, idx, 1, file);
+ writeINT (data.data[i], ptr, idx, 1, ffile);
}
static void
-writeCHARS (char *string, unsigned char *ptr, int *idx, int size, FILE *file)
+writeCHARS (char *string, unsigned char *ptr, int *idx, int size, FILE *ffile)
{
int i = *idx / 8;
if (i > 240)
{
/* Lets write out that record and do another one. */
- checksum (file, ptr, *idx, code | 0x1000);
+ checksum (ffile, ptr, *idx, code | 0x1000);
*idx = 16;
i = *idx / 8;
}
@@ -1697,21 +1697,22 @@ align (int x)
ordinary defs - dunno why, but thats what hitachi does with 'em. */
static void
-prescan (struct coff_ofile *tree)
+prescan (struct coff_ofile *otree)
{
struct coff_symbol *s;
struct coff_section *common_section;
/* Find the common section - always section 3. */
- common_section = tree->sections + 3;
+ common_section = otree->sections + 3;
- for (s = tree->symbol_list_head;
+ for (s = otree->symbol_list_head;
s;
s = s->next_in_ofile_list)
{
if (s->visible->type == coff_vis_common)
{
struct coff_where *w = s->where;
+
/* s->visible->type = coff_vis_ext_def; leave it as common */
common_section->size = align (common_section->size);
w->offset = common_section->size + common_section->address;
@@ -1725,11 +1726,11 @@ prescan (struct coff_ofile *tree)
char *program_name;
static void
-show_usage (FILE *file, int status)
+show_usage (FILE *ffile, int status)
{
- fprintf (file, _("Usage: %s [option(s)] in-file [out-file]\n"), program_name);
- fprintf (file, _("Convert a COFF object file into a SYSROFF object file\n"));
- fprintf (file, _(" The options are:\n\
+ fprintf (ffile, _("Usage: %s [option(s)] in-file [out-file]\n"), program_name);
+ fprintf (ffile, _("Convert a COFF object file into a SYSROFF object file\n"));
+ fprintf (ffile, _(" The options are:\n\
-q --quick (Obsolete - ignored)\n\
-n --noprescan Do not perform a scan to convert commons into defs\n\
-d --debug Display information about what is being done\n\
@@ -1738,7 +1739,7 @@ show_usage (FILE *file, int status)
-v --version Print the program's version number\n"));
if (REPORT_BUGS_TO[0] && status == 0)
- fprintf (file, _("Report bugs to %s\n"), REPORT_BUGS_TO);
+ fprintf (ffile, _("Report bugs to %s\n"), REPORT_BUGS_TO);
exit (status);
}