aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2000-10-11 20:24:32 +0000
committerKazu Hirata <kazu@codesourcery.com>2000-10-11 20:24:32 +0000
commit30a2b4ef8f28ad15ea6bfb17bdf54e164607d8db (patch)
tree0fdbca6ec40201ce02ba14d5149215753ededfb7
parentd01e2a23a35139d64687b473b93d7f39b54b9d56 (diff)
downloadgdb-30a2b4ef8f28ad15ea6bfb17bdf54e164607d8db.zip
gdb-30a2b4ef8f28ad15ea6bfb17bdf54e164607d8db.tar.gz
gdb-30a2b4ef8f28ad15ea6bfb17bdf54e164607d8db.tar.bz2
2000-10-12 Kazu Hirata <kazu@hxi.com>
* app.c: Fix formatting. * as.c: Likewise. * as.h: Likewise. * bit_fix.h: Likewise. * cgen.c: Likewise. * cgen.h: Likewise. * cond.c: Likewise.
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/app.c78
-rw-r--r--gas/as.c35
-rw-r--r--gas/as.h156
-rw-r--r--gas/bit_fix.h21
-rw-r--r--gas/cgen.c7
-rw-r--r--gas/cgen.h8
-rw-r--r--gas/cond.c6
8 files changed, 159 insertions, 162 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 23d4b7a..7bbaff0 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,13 @@
+2000-10-12 Kazu Hirata <kazu@hxi.com>
+
+ * app.c: Fix formatting.
+ * as.c: Likewise.
+ * as.h: Likewise.
+ * bit_fix.h: Likewise.
+ * cgen.c: Likewise.
+ * cgen.h: Likewise.
+ * cond.c: Likewise.
+
2000-10-11 Alan Modra <alan@linuxcare.com.au>
* config/obj-elf.c (elf_frob_symbol): Revert 2000-10-07 change.
diff --git a/gas/app.c b/gas/app.c
index 3a1b417..46273c2 100644
--- a/gas/app.c
+++ b/gas/app.c
@@ -211,24 +211,23 @@ static char mri_last_ch;
state at the time .include is interpreted is completely unrelated.
That's why we have to save it all. */
-struct app_save
- {
- int state;
- int old_state;
- char * out_string;
- char out_buf[sizeof (out_buf)];
- int add_newlines;
- char * saved_input;
- int saved_input_len;
+struct app_save {
+ int state;
+ int old_state;
+ char * out_string;
+ char out_buf[sizeof (out_buf)];
+ int add_newlines;
+ char * saved_input;
+ int saved_input_len;
#ifdef TC_M68K
- int scrub_m68k_mri;
+ int scrub_m68k_mri;
#endif
- const char * mri_state;
- char mri_last_ch;
+ const char * mri_state;
+ char mri_last_ch;
#if defined TC_ARM && defined OBJ_ELF
- const char * symver_state;
+ const char * symver_state;
#endif
- };
+};
char *
app_push ()
@@ -779,19 +778,20 @@ do_scrub_chars (get, tostart, tolen)
}
#ifdef KEEP_WHITE_AROUND_COLON
- if (lex[ch] == LEX_IS_COLON)
- {
- /* only keep this white if there's no white *after* the colon */
- ch2 = GET ();
- UNGET (ch2);
- if (!IS_WHITESPACE (ch2))
- {
- state = 9;
- UNGET (ch);
- PUT (' ');
- break;
- }
- }
+ if (lex[ch] == LEX_IS_COLON)
+ {
+ /* Only keep this white if there's no white *after* the
+ colon. */
+ ch2 = GET ();
+ UNGET (ch2);
+ if (!IS_WHITESPACE (ch2))
+ {
+ state = 9;
+ UNGET (ch);
+ PUT (' ');
+ break;
+ }
+ }
#endif
if (IS_COMMENT (ch)
|| ch == '/'
@@ -1014,7 +1014,7 @@ do_scrub_chars (get, tostart, tolen)
case LEX_IS_COLON:
#ifdef KEEP_WHITE_AROUND_COLON
- state = 9;
+ state = 9;
#else
if (state == 9 || state == 10)
state = 3;
@@ -1040,7 +1040,7 @@ do_scrub_chars (get, tostart, tolen)
#ifdef TC_V850
case LEX_IS_DOUBLEDASH_1ST:
- ch2 = GET();
+ ch2 = GET ();
if (ch2 != '-')
{
UNGET (ch2);
@@ -1062,7 +1062,7 @@ do_scrub_chars (get, tostart, tolen)
#endif
#ifdef DOUBLEBAR_PARALLEL
case LEX_IS_DOUBLEBAR_1ST:
- ch2 = GET();
+ ch2 = GET ();
if (ch2 != '|')
{
UNGET (ch2);
@@ -1140,12 +1140,14 @@ do_scrub_chars (get, tostart, tolen)
Trap is the only short insn that has a first operand that is
neither register nor label.
We must prevent exef0f ||trap #1 to degenerate to exef0f ||trap#1 .
- We can't make '#' LEX_IS_SYMBOL_COMPONENT because it is already
- LEX_IS_LINE_COMMENT_START. However, it is the only character in
- line_comment_chars for d10v, hence we can recognize it as such. */
+ We can't make '#' LEX_IS_SYMBOL_COMPONENT because it is
+ already LEX_IS_LINE_COMMENT_START. However, it is the
+ only character in line_comment_chars for d10v, hence we
+ can recognize it as such. */
/* An alternative approach would be to reset the state to 1 when
we see '||', '<'- or '->', but that seems to be overkill. */
- if (state == 10) PUT (' ');
+ if (state == 10)
+ PUT (' ');
#endif
/* We have a line comment character which is not at the
start of a line. If this is also a normal comment
@@ -1165,9 +1167,9 @@ do_scrub_chars (get, tostart, tolen)
#if defined TC_ARM && defined OBJ_ELF
/* On the ARM, `@' is the comment character.
Unfortunately this is also a special character in ELF .symver
- directives (and .type, though we deal with those another way). So
- we check if this line is such a directive, and treat the character
- as default if so. This is a hack. */
+ directives (and .type, though we deal with those another way).
+ So we check if this line is such a directive, and treat
+ the character as default if so. This is a hack. */
if ((symver_state != NULL) && (*symver_state == 0))
goto de_fault;
#endif
@@ -1217,7 +1219,7 @@ do_scrub_chars (get, tostart, tolen)
{
int type;
- ch2 = * (unsigned char *) s;
+ ch2 = *(unsigned char *) s;
type = lex[ch2];
if (type != 0
&& type != LEX_IS_SYMBOL_COMPONENT)
diff --git a/gas/as.c b/gas/as.c
index 2f78cad..425829e 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -91,8 +91,7 @@ int debug_memory = 0;
/* We build a list of defsyms as we read the options, and then define
them after we have initialized everything. */
-struct defsym_list
-{
+struct defsym_list {
struct defsym_list *next;
char *name;
valueT value;
@@ -102,8 +101,7 @@ static struct defsym_list *defsyms;
/* Keep a record of the itbl files we read in. */
-struct itbl_file_list
-{
+struct itbl_file_list {
struct itbl_file_list *next;
char *name;
};
@@ -350,24 +348,23 @@ parse_args (pargc, pargv)
char *shortopts;
extern CONST char *md_shortopts;
- static const char std_shortopts[] =
- {
- '-', 'J',
+ static const char std_shortopts[] = {
+ '-', 'J',
#ifndef WORKING_DOT_WORD
- /* -K is not meaningful if .word is not being hacked. */
- 'K',
+ /* -K is not meaningful if .word is not being hacked. */
+ 'K',
#endif
- 'L', 'M', 'R', 'W', 'Z', 'f', 'a', ':', ':', 'D', 'I', ':', 'o', ':',
+ 'L', 'M', 'R', 'W', 'Z', 'f', 'a', ':', ':', 'D', 'I', ':', 'o', ':',
#ifndef VMS
- /* -v takes an argument on VMS, so we don't make it a generic
- option. */
- 'v',
+ /* -v takes an argument on VMS, so we don't make it a generic
+ option. */
+ 'v',
#endif
- 'w', 'X',
- /* New option for extending instruction set (see also --itbl below) */
- 't', ':',
- '\0'
- };
+ 'w', 'X',
+ /* New option for extending instruction set (see also --itbl below) */
+ 't', ':',
+ '\0'
+ };
struct option *longopts;
extern struct option md_longopts[];
extern size_t md_longopts_size;
@@ -474,7 +471,7 @@ parse_args (pargc, pargv)
VMS code in md_parse_option can return 0 in that case,
but it has no way of pushing the filename argument back. */
if (optarg && *optarg)
- new_argv[new_argc++] = optarg, new_argv[new_argc] = NULL;
+ new_argv[new_argc++] = optarg, new_argv[new_argc] = NULL;
else
#else
case 'v':
diff --git a/gas/as.h b/gas/as.h
index b5f054b..a7ca131 100644
--- a/gas/as.h
+++ b/gas/as.h
@@ -21,8 +21,7 @@
#ifndef GAS
#define GAS 1
-/*
- * I think this stuff is largely out of date. xoxorich.
+/* I think this stuff is largely out of date. xoxorich.
*
* CAPITALISED names are #defined.
* "lowercaseH" is #defined if "lowercase.h" has been #include-d.
@@ -221,11 +220,11 @@ extern char **environ;
#include "asintl.h"
-#define BAD_CASE(val) \
-{ \
- as_fatal(_("Case value %ld unexpected at line %d of file \"%s\"\n"), \
- (long) val, __LINE__, __FILE__); \
- }
+#define BAD_CASE(val) \
+ { \
+ as_fatal (_("Case value %ld unexpected at line %d of file \"%s\"\n"), \
+ (long) val, __LINE__, __FILE__); \
+ }
#include "flonum.h"
@@ -262,12 +261,9 @@ typedef addressT valueT;
/* input_scrub.c */
-/*
- * Supplies sanitised buffers to read.c.
- * Also understands printing line-number part of error messages.
- */
+/* Supplies sanitised buffers to read.c.
+ Also understands printing line-number part of error messages. */
-
/* subsegs.c Sub-segments. Also, segment(=expression type)s.*/
#ifndef BFD_ASSEMBLER
@@ -290,20 +286,19 @@ typedef addressT valueT;
#define SEG_LIST SEG_TEXT,SEG_DATA,SEG_BSS
#endif
-typedef enum _segT
- {
- SEG_ABSOLUTE = 0,
- SEG_LIST,
- SEG_UNKNOWN,
- SEG_GOOF, /* Only happens if AS has a logic error. */
- /* Invented so we don't crash printing */
- /* error message involving weird segment. */
- SEG_EXPR, /* Intermediate expression values. */
- SEG_DEBUG, /* Debug segment */
- SEG_NTV, /* Transfert vector preload segment */
- SEG_PTV, /* Transfert vector postload segment */
- SEG_REGISTER /* Mythical: a register-valued expression */
- } segT;
+typedef enum _segT {
+ SEG_ABSOLUTE = 0,
+ SEG_LIST,
+ SEG_UNKNOWN,
+ SEG_GOOF, /* Only happens if AS has a logic error. */
+ /* Invented so we don't crash printing */
+ /* error message involving weird segment. */
+ SEG_EXPR, /* Intermediate expression values. */
+ SEG_DEBUG, /* Debug segment */
+ SEG_NTV, /* Transfert vector preload segment */
+ SEG_PTV, /* Transfert vector postload segment */
+ SEG_REGISTER /* Mythical: a register-valued expression */
+} segT;
#define SEG_MAXIMUM_ORDINAL (SEG_REGISTER)
#else
@@ -350,51 +345,50 @@ extern segT text_section, data_section, bss_section;
/* relax() */
-enum _relax_state
- {
- /* Variable chars to be repeated fr_offset times.
- Fr_symbol unused. Used with fr_offset == 0 for a
- constant length frag. */
- rs_fill = 1,
-
- /* Align. The fr_offset field holds the power of 2 to which to
- align. The fr_var field holds the number of characters in the
- fill pattern. The fr_subtype field holds the maximum number of
- bytes to skip when aligning, or 0 if there is no maximum. */
- rs_align,
-
- /* Align code. The fr_offset field holds the power of 2 to which
- to align. This type is only generated by machine specific
- code, which is normally responsible for handling the fill
- pattern. The fr_subtype field holds the maximum number of
- bytes to skip when aligning, or 0 if there is no maximum. */
- rs_align_code,
-
- /* Org: Fr_offset, fr_symbol: address. 1 variable char: fill
- character. */
- rs_org,
+enum _relax_state {
+ /* Variable chars to be repeated fr_offset times.
+ Fr_symbol unused. Used with fr_offset == 0 for a
+ constant length frag. */
+ rs_fill = 1,
+
+ /* Align. The fr_offset field holds the power of 2 to which to
+ align. The fr_var field holds the number of characters in the
+ fill pattern. The fr_subtype field holds the maximum number of
+ bytes to skip when aligning, or 0 if there is no maximum. */
+ rs_align,
+
+ /* Align code. The fr_offset field holds the power of 2 to which
+ to align. This type is only generated by machine specific
+ code, which is normally responsible for handling the fill
+ pattern. The fr_subtype field holds the maximum number of
+ bytes to skip when aligning, or 0 if there is no maximum. */
+ rs_align_code,
+
+ /* Org: Fr_offset, fr_symbol: address. 1 variable char: fill
+ character. */
+ rs_org,
#ifndef WORKING_DOT_WORD
- /* JF: gunpoint */
- rs_broken_word,
+ /* JF: gunpoint */
+ rs_broken_word,
#endif
- /* machine-specific relaxable (or similarly alterable) instruction */
- rs_machine_dependent,
+ /* machine-specific relaxable (or similarly alterable) instruction */
+ rs_machine_dependent,
- /* .space directive with expression operand that needs to be computed
- later. Similar to rs_org, but different.
- fr_symbol: operand
- 1 variable char: fill character */
- rs_space,
+ /* .space directive with expression operand that needs to be computed
+ later. Similar to rs_org, but different.
+ fr_symbol: operand
+ 1 variable char: fill character */
+ rs_space,
- /* A DWARF leb128 value; only ELF uses this. The subtype is 0 for
- unsigned, 1 for signed. */
- rs_leb128,
+ /* A DWARF leb128 value; only ELF uses this. The subtype is 0 for
+ unsigned, 1 for signed. */
+ rs_leb128,
- /* Exception frame information which we may be able to optimize. */
- rs_cfa
- };
+ /* Exception frame information which we may be able to optimize. */
+ rs_cfa
+};
typedef enum _relax_state relax_stateT;
@@ -463,15 +457,14 @@ extern int listing;
/* Type of debugging information we should generate. We currently
support stabs, ECOFF, and DWARF2. */
-enum debug_info_type
- {
- DEBUG_UNSPECIFIED,
- DEBUG_NONE,
- DEBUG_STABS,
- DEBUG_ECOFF,
- DEBUG_DWARF,
- DEBUG_DWARF2
- };
+enum debug_info_type {
+ DEBUG_UNSPECIFIED,
+ DEBUG_NONE,
+ DEBUG_STABS,
+ DEBUG_ECOFF,
+ DEBUG_DWARF,
+ DEBUG_DWARF2
+};
extern enum debug_info_type debug_type;
@@ -482,15 +475,14 @@ extern int max_macro_nest;
increase malloc calls for monitoring memory allocation. */
extern int chunksize;
-struct _pseudo_type
- {
- /* assembler mnemonic, lower case, no '.' */
- const char *poc_name;
- /* Do the work */
- void (*poc_handler) PARAMS ((int));
- /* Value to pass to handler */
- int poc_val;
- };
+struct _pseudo_type {
+ /* assembler mnemonic, lower case, no '.' */
+ const char *poc_name;
+ /* Do the work */
+ void (*poc_handler) PARAMS ((int));
+ /* Value to pass to handler */
+ int poc_val;
+};
typedef struct _pseudo_type pseudo_typeS;
diff --git a/gas/bit_fix.h b/gas/bit_fix.h
index da5769d..b9768fd 100644
--- a/gas/bit_fix.h
+++ b/gas/bit_fix.h
@@ -33,17 +33,16 @@
#ifndef __bit_fix_h__
#define __bit_fix_h__
-struct bit_fix
- {
- int fx_bit_size; /* Length of bitfield */
- int fx_bit_offset; /* Bit offset to bitfield */
- long fx_bit_base; /* Where do we apply the bitfix.
- If this is zero, default is assumed. */
- long fx_bit_base_adj; /* Adjustment of base */
- long fx_bit_max; /* Signextended max for bitfield */
- long fx_bit_min; /* Signextended min for bitfield */
- long fx_bit_add; /* Or mask, used for huffman prefix */
- };
+struct bit_fix {
+ int fx_bit_size; /* Length of bitfield */
+ int fx_bit_offset; /* Bit offset to bitfield */
+ long fx_bit_base; /* Where do we apply the bitfix.
+ If this is zero, default is assumed. */
+ long fx_bit_base_adj; /* Adjustment of base */
+ long fx_bit_max; /* Signextended max for bitfield */
+ long fx_bit_min; /* Signextended min for bitfield */
+ long fx_bit_add; /* Or mask, used for huffman prefix */
+};
typedef struct bit_fix bit_fixS;
#endif /* __bit_fix_h__ */
diff --git a/gas/cgen.c b/gas/cgen.c
index 9c94971..e3cb1c8 100644
--- a/gas/cgen.c
+++ b/gas/cgen.c
@@ -57,8 +57,7 @@ cgen_asm_record_register (name, number)
OPINDEX is the index in the operand table.
OPINFO is something the caller chooses to help in reloc determination. */
-struct fixup
-{
+struct fixup {
int opindex;
int opinfo;
expressionS exp;
@@ -87,7 +86,7 @@ queue_fixup (opindex, opinfo, expP)
/* We need to generate a fixup for this expression. */
if (num_fixups >= GAS_CGEN_MAX_FIXUPS)
as_fatal (_("too many fixups"));
- fixups[num_fixups].exp = * expP;
+ fixups[num_fixups].exp = *expP;
fixups[num_fixups].opindex = opindex;
fixups[num_fixups].opinfo = opinfo;
++ num_fixups;
@@ -315,7 +314,7 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP)
*resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER;
break;
default:
- queue_fixup (opindex, opinfo, & exp);
+ queue_fixup (opindex, opinfo, &exp);
*valueP = 0;
*resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED;
break;
diff --git a/gas/cgen.h b/gas/cgen.h
index 12d5f72..b2b1963 100644
--- a/gas/cgen.h
+++ b/gas/cgen.h
@@ -33,13 +33,13 @@ extern CGEN_CPU_DESC gas_cgen_cpu_desc;
/* Struct defining result of gas_cgen_finish_insn. */
typedef struct {
/* frag containing the insn */
- fragS * frag;
+ fragS *frag;
/* Address of insn in frag. */
- char * addr;
+ char *addr;
/* Number of fixups this insn has. */
int num_fixups;
/* Array of fixups. */
- fixS * fixups[GAS_CGEN_MAX_FIXUPS];
+ fixS *fixups[GAS_CGEN_MAX_FIXUPS];
} finished_insnS;
/* Callback for operand parsing.
@@ -56,7 +56,7 @@ extern void gas_cgen_init_parse PARAMS ((void));
extern void gas_cgen_save_fixups PARAMS ((void));
extern void gas_cgen_restore_fixups PARAMS ((void));
extern void gas_cgen_swap_fixups PARAMS ((void));
-
+
/* Add a register to the assembler's hash table.
This makes lets GAS parse registers for us.
??? This isn't currently used, but it could be in the future. */
diff --git a/gas/cond.c b/gas/cond.c
index 88ab0d2..b42da90 100644
--- a/gas/cond.c
+++ b/gas/cond.c
@@ -28,8 +28,7 @@
scanned. */
struct obstack cond_obstack;
-struct file_line
-{
+struct file_line {
char *file;
unsigned int line;
};
@@ -37,8 +36,7 @@ struct file_line
/* We push one of these structures for each .if, and pop it at the
.endif. */
-struct conditional_frame
-{
+struct conditional_frame {
/* The source file & line number of the "if". */
struct file_line if_file_line;
/* The source file & line of the "else". */