diff options
Diffstat (limited to 'gas/symbols.c')
-rw-r--r-- | gas/symbols.c | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/gas/symbols.c b/gas/symbols.c index 6a4dea8..275d056 100644 --- a/gas/symbols.c +++ b/gas/symbols.c @@ -194,8 +194,8 @@ hash_symbol_entry (const void *e) static int eq_symbol_entry (const void *a, const void *b) { - const symbol_entry_t *ea = (const symbol_entry_t *) a; - const symbol_entry_t *eb = (const symbol_entry_t *) b; + const symbol_entry_t *ea = a; + const symbol_entry_t *eb = b; return (ea->sy.hash == eb->sy.hash && strcmp (ea->sy.name, eb->sy.name) == 0); @@ -464,7 +464,7 @@ local_symbol_make (const char *name, segT section, fragS *frag, valueT val) static symbolS * local_symbol_convert (void *sym) { - symbol_entry_t *ent = (symbol_entry_t *) sym; + symbol_entry_t *ent = sym; struct xsymbol *xtra; valueT val; @@ -491,7 +491,7 @@ static void define_sym_at_dot (symbolS *symbolP) { symbolP->frag = frag_now; - S_SET_VALUE (symbolP, (valueT) frag_now_fix ()); + S_SET_VALUE (symbolP, frag_now_fix ()); S_SET_SEGMENT (symbolP, now_seg); } @@ -531,13 +531,8 @@ colon (/* Just seen "x:" - rattle symbols & frags. */ + new_broken_words * md_long_jump_size); frag_tmp = frag_now; - frag_opcode = frag_var (rs_broken_word, - possible_bytes, - possible_bytes, - (relax_substateT) 0, - (symbolS *) broken_words, - (offsetT) 0, - NULL); + frag_opcode = frag_var (rs_broken_word, possible_bytes, possible_bytes, + 0, (symbolS *) broken_words, 0, NULL); /* We want to store the pointer to where to insert the jump table in the fr_opcode of the rs_broken_word frag. This @@ -631,11 +626,8 @@ colon (/* Just seen "x:" - rattle symbols & frags. */ If the new size is larger we just change its value. If the new size is smaller, we ignore this symbol. */ - if (S_GET_VALUE (symbolP) - < ((unsigned) frag_now_fix ())) - { - S_SET_VALUE (symbolP, (valueT) frag_now_fix ()); - } + if (S_GET_VALUE (symbolP) < frag_now_fix ()) + S_SET_VALUE (symbolP, frag_now_fix ()); } else { @@ -754,7 +746,7 @@ symbol_find_or_make (const char *name) symbol_table_insert (symbolP); } /* if symbol wasn't found */ - return (symbolP); + return symbolP; } symbolS * @@ -768,7 +760,7 @@ symbol_make (const char *name) if (!symbolP) symbolP = symbol_new (name, undefined_section, &zero_address_frag, 0); - return (symbolP); + return symbolP; } symbolS * @@ -2064,7 +2056,7 @@ static size_t fb_label_max; static void fb_label_init (void) { - memset ((void *) fb_low_counter, '\0', sizeof (fb_low_counter)); + memset (fb_low_counter, 0, sizeof (fb_low_counter)); } /* Add one to the instance number of this fb label. */ @@ -2177,10 +2169,10 @@ fb_label_name (unsigned int n, unsigned int augend) If the name wasn't generated by foo_label_name(), then return it unaltered. This is used for error messages. */ -char * -decode_local_label_name (char *s) +const char * +decode_local_label_name (const char *s) { - char *p; + const char *p; char *symbol_decode; unsigned int label_number; unsigned int instance_number; @@ -2249,7 +2241,7 @@ S_GET_VALUE_WHERE (symbolS *s, const char * file, unsigned int line) S_GET_NAME (s)); } } - return (valueT) s->x->value.X_add_number; + return s->x->value.X_add_number; } valueT @@ -2370,7 +2362,7 @@ int S_IS_DEFINED (const symbolS *s) { if (s->flags.local_symbol) - return ((struct local_symbol *) s)->section != undefined_section; + return ((const struct local_symbol *) s)->section != undefined_section; return s->bsym->section != undefined_section; } @@ -2387,7 +2379,7 @@ S_FORCE_RELOC (const symbolS *s, int strict) { segT sec; if (s->flags.local_symbol) - sec = ((struct local_symbol *) s)->section; + sec = ((const struct local_symbol *) s)->section; else { if ((strict @@ -2461,7 +2453,7 @@ int S_CAN_BE_REDEFINED (const symbolS *s) { if (s->flags.local_symbol) - return (((struct local_symbol *) s)->frag + return (((const struct local_symbol *) s)->frag == &predefined_address_frag); /* Permit register names to be redefined. */ return s->x->value.X_op == O_register; @@ -2493,7 +2485,7 @@ segT S_GET_SEGMENT (const symbolS *s) { if (s->flags.local_symbol) - return ((struct local_symbol *) s)->section; + return ((const struct local_symbol *) s)->section; return s->bsym->section; } |