This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[PATCH] Reformat 'else if' code
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH] Reformat 'else if' code
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Mon, 12 Jun 2000 10:05:52 -0400 (EDT)
FYI,
I committed the following.
Elena
2000-06-12 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* symfile.c (add_symbol_file_command): Properly reformat "else if"
code.
* coffread.c (coff_symtab_read): Ditto.
Index: coffread.c
===================================================================
RCS file: /cvs/src/src/gdb/coffread.c,v
retrieving revision 1.8
diff -u -p -r1.8 coffread.c
--- coffread.c 2000/05/28 01:12:26 1.8
+++ coffread.c 2000/06/12 14:02:23
@@ -982,22 +982,20 @@ coff_symtab_read (symtab_offset, nsyms,
SMASH_TEXT_ADDRESS (tmpaddr);
#endif
}
- else
- if (sec == SECT_OFF_DATA (objfile))
- {
+ else if (sec == SECT_OFF_DATA (objfile))
+ {
ms_type =
cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ?
mst_data : mst_file_data;
- }
- else
- if (sec == SECT_OFF_BSS (objfile))
- {
+ }
+ else if (sec == SECT_OFF_BSS (objfile))
+ {
ms_type =
cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXT ?
mst_data : mst_file_data;
- }
- else
- ms_type = mst_unknown;
+ }
+ else
+ ms_type = mst_unknown;
}
if (cs->c_name[0] != '@' /* Skip tdesc symbols */ )
Index: symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.12
diff -u -p -r1.12 symfile.c
--- symfile.c 2000/06/04 00:41:09 1.12
+++ symfile.c 2000/06/12 14:03:35
@@ -1492,54 +1492,51 @@ add_symbol_file_command (args, from_tty)
filename = tilde_expand (arg);
my_cleanups = make_cleanup (free, filename);
}
+ else if (argcnt == 1)
+ {
+ /* The second argument is always the text address at which
+ to load the program. */
+ sect_opts[section_index].name = ".text";
+ sect_opts[section_index].value = arg;
+ section_index++;
+ }
else
- if (argcnt == 1)
- {
- /* The second argument is always the text address at which
- to load the program. */
- sect_opts[section_index].name = ".text";
- sect_opts[section_index].value = arg;
- section_index++;
- }
- else
- {
- /* It's an option (starting with '-') or it's an argument
- to an option */
+ {
+ /* It's an option (starting with '-') or it's an argument
+ to an option */
- if (*arg == '-')
- {
- if (strcmp (arg, "-mapped") == 0)
- flags |= OBJF_MAPPED;
- else
- if (strcmp (arg, "-readnow") == 0)
- flags |= OBJF_READNOW;
- else
- if (strcmp (arg, "-s") == 0)
- {
- if (section_index >= SECT_OFF_MAX)
- error ("Too many sections specified.");
- expecting_sec_name = 1;
- expecting_sec_addr = 1;
- }
- }
- else
- {
- if (expecting_sec_name)
+ if (*arg == '-')
+ {
+ if (strcmp (arg, "-mapped") == 0)
+ flags |= OBJF_MAPPED;
+ else if (strcmp (arg, "-readnow") == 0)
+ flags |= OBJF_READNOW;
+ else if (strcmp (arg, "-s") == 0)
+ {
+ if (section_index >= SECT_OFF_MAX)
+ error ("Too many sections specified.");
+ expecting_sec_name = 1;
+ expecting_sec_addr = 1;
+ }
+ }
+ else
+ {
+ if (expecting_sec_name)
+ {
+ sect_opts[section_index].name = arg;
+ expecting_sec_name = 0;
+ }
+ else
+ if (expecting_sec_addr)
{
- sect_opts[section_index].name = arg;
- expecting_sec_name = 0;
+ sect_opts[section_index].value = arg;
+ expecting_sec_addr = 0;
+ section_index++;
}
else
- if (expecting_sec_addr)
- {
- sect_opts[section_index].value = arg;
- expecting_sec_addr = 0;
- section_index++;
- }
- else
- error ("USAGE: add-symbol-file <filename> <textaddress> [-mapped] [-readnow] [-s <secname> <addr>]*");
- }
- }
+ error ("USAGE: add-symbol-file <filename> <textaddress> [-mapped] [-readnow] [-s <secname> <addr>]*");
+ }
+ }
argcnt++;
}