make more variables const

gas/ChangeLog:

2016-03-22  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* config/tc-h8300.c (h8300_elf_section): Add const qualifiers.
	* config/tc-ia64.c (obj_elf_vms_common): Likewise.
	* config/tc-m68hc11.c (md_begin): Likewise.
	(print_opcode_list): Likewise.
	* config/tc-msp430.c (msp430_section): Likewise.
	* config/tc-score.c (struct s3_insn_to_dependency): Likewise.
	(s3_build_dependency_insn_hsh): Likewise.
	* config/tc-score7.c (struct s7_insn_to_dependency): Likewise.
	(s7_build_dependency_insn_hsh): Likewise.
	* config/tc-tic4x.c: Likewise.
	* config/tc-tic54x.c (tic54x_set_default_include): Likewise.
	(subsym_get_arg): Likewise.
	* config/tc-xtensa.c (struct suffix_reloc_map): Likewise.
	(get_directive): Likewise.
	(cache_literal_section): Likewise.
	* config/xtensa-relax.c: Likewise.
	* symbols.c (symbol_create): Likewise.
	(local_symbol_make): Likewise.
	(symbol_relc_make_expr): Likewise.

include/ChangeLog:

2016-03-22  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* opcode/i960.h: Add const qualifiers.
	* opcode/tic4x.h (struct tic4x_inst): Likewise.
This commit is contained in:
Trevor Saunders 2016-03-20 01:34:02 -04:00
parent 986d894b2a
commit b9bb4a9356
15 changed files with 63 additions and 33 deletions

View File

@ -1,3 +1,25 @@
2016-03-22 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-h8300.c (h8300_elf_section): Add const qualifiers.
* config/tc-ia64.c (obj_elf_vms_common): Likewise.
* config/tc-m68hc11.c (md_begin): Likewise.
(print_opcode_list): Likewise.
* config/tc-msp430.c (msp430_section): Likewise.
* config/tc-score.c (struct s3_insn_to_dependency): Likewise.
(s3_build_dependency_insn_hsh): Likewise.
* config/tc-score7.c (struct s7_insn_to_dependency): Likewise.
(s7_build_dependency_insn_hsh): Likewise.
* config/tc-tic4x.c: Likewise.
* config/tc-tic54x.c (tic54x_set_default_include): Likewise.
(subsym_get_arg): Likewise.
* config/tc-xtensa.c (struct suffix_reloc_map): Likewise.
(get_directive): Likewise.
(cache_literal_section): Likewise.
* config/xtensa-relax.c: Likewise.
* symbols.c (symbol_create): Likewise.
(local_symbol_make): Likewise.
(symbol_relc_make_expr): Likewise.
2016-03-22 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* config/tc-pdp11.c (md_assemble): Remove useless if and assignment to

View File

@ -152,7 +152,7 @@ h8300_elf_section (int push)
static const char * known_data_sections [] = { ".rodata", ".tdata", ".tbss" };
static const char * known_data_prefixes [] = { ".debug", ".zdebug", ".gnu.warning" };
char * saved_ilp = input_line_pointer;
char * name;
const char * name;
name = obj_elf_section_name ();
if (name == NULL)

View File

@ -1045,7 +1045,7 @@ ia64_cons_align (int nbytes)
static void
obj_elf_vms_common (int ignore ATTRIBUTE_UNUSED)
{
char *sec_name;
const char *sec_name;
char *sym_name;
char c;
offsetT size;

View File

@ -603,7 +603,7 @@ cmp_opcode (struct m68hc11_opcode *op1, struct m68hc11_opcode *op2)
void
md_begin (void)
{
char *prev_name = "";
const char *prev_name = "";
struct m68hc11_opcode *opcodes;
struct m68hc11_opcode_def *opc = 0;
int i, j;
@ -964,7 +964,7 @@ static void
print_opcode_list (void)
{
int i;
char *prev_name = "";
const char *prev_name = "";
struct m68hc11_opcode *opcodes;
int example = flag_print_opcodes == 2;

View File

@ -1497,7 +1497,7 @@ static void
msp430_section (int arg)
{
char * saved_ilp = input_line_pointer;
char * name = obj_elf_section_name ();
const char * name = obj_elf_section_name ();
msp430_make_init_symbols (name);

View File

@ -334,7 +334,7 @@ enum s3_insn_type_for_dependency
struct s3_insn_to_dependency
{
char *insn_name;
const char *insn_name;
enum s3_insn_type_for_dependency type;
};
@ -6344,14 +6344,15 @@ s3_build_dependency_insn_hsh (void)
const struct s3_insn_to_dependency *tmp = s3_insn_to_dependency_table + i;
size_t len = strlen (tmp->insn_name);
struct s3_insn_to_dependency *new_i2n;
char *buf;
new_i2n = (struct s3_insn_to_dependency *)
obstack_alloc (&dependency_obstack,
sizeof (struct s3_insn_to_dependency));
new_i2n->insn_name = (char *) obstack_alloc (&dependency_obstack,
len + 1);
buf = (char *) obstack_alloc (&dependency_obstack, len + 1);
strcpy (new_i2n->insn_name, tmp->insn_name);
strcpy (buf, tmp->insn_name);
new_i2n->insn_name = buf;
new_i2n->type = tmp->type;
hash_insert (s3_dependency_insn_hsh, new_i2n->insn_name,
(void *) new_i2n);

View File

@ -191,7 +191,7 @@ enum s7_insn_type_for_dependency
struct s7_insn_to_dependency
{
char *insn_name;
const char *insn_name;
enum s7_insn_type_for_dependency type;
};
@ -5121,14 +5121,15 @@ s7_build_dependency_insn_hsh (void)
const struct s7_insn_to_dependency *tmp = s7_insn_to_dependency_table + i;
size_t len = strlen (tmp->insn_name);
struct s7_insn_to_dependency *new_i2d;
char *insn_name;
new_i2d = (struct s7_insn_to_dependency *)
obstack_alloc (&dependency_obstack,
sizeof (struct s7_insn_to_dependency));
new_i2d->insn_name = (char *) obstack_alloc (&dependency_obstack,
len + 1);
insn_name = (char *) obstack_alloc (&dependency_obstack, len + 1);
strcpy (new_i2d->insn_name, tmp->insn_name);
strcpy (insn_name, tmp->insn_name);
new_i2d->insn_name = insn_name;
new_i2d->type = tmp->type;
hash_insert (s7_dependency_insn_hsh, new_i2d->insn_name,
(void *) new_i2d);

View File

@ -1239,7 +1239,7 @@ tic4x_inst_insert (const tic4x_inst_t *inst)
/* Make a new instruction template. */
static tic4x_inst_t *
tic4x_inst_make (const char *name, unsigned long opcode, char *args)
tic4x_inst_make (const char *name, unsigned long opcode, const char *args)
{
static tic4x_inst_t *insts = NULL;
static char *names = NULL;

View File

@ -1865,7 +1865,7 @@ tic54x_clink (int ignored ATTRIBUTE_UNUSED)
static void
tic54x_set_default_include (int dot)
{
char *dir = ".";
const char *dir = ".";
char *tmp = NULL;
if (!dot)
@ -2906,7 +2906,7 @@ math_tanh (float arg1, float ignore ATTRIBUTE_UNUSED)
/* Built-in substitution symbol functions and math functions. */
typedef struct
{
char *name;
const char *name;
int (*proc) (char *, char *);
int nargs;
} subsym_proc_entry;
@ -2930,7 +2930,7 @@ static const subsym_proc_entry subsym_procs[] =
typedef struct
{
char *name;
const char *name;
float (*proc) (float, float);
int nargs;
int int_return;
@ -4290,7 +4290,7 @@ tic54x_parse_parallel_insn_lastline (tic54x_insn *insn, char *line)
replacement on the value. */
static char *
subsym_get_arg (char *line, char *terminators, char **str, int nosub)
subsym_get_arg (char *line, const char *terminators, char **str, int nosub)
{
char *ptr = line;
char *endp;
@ -4322,7 +4322,7 @@ subsym_get_arg (char *line, char *terminators, char **str, int nosub)
}
else
{
char *term = terminators;
const char *term = terminators;
char *value = NULL;
while (*ptr && *ptr != *term)

View File

@ -361,7 +361,7 @@ op_placement_info_table op_placement_table;
struct suffix_reloc_map
{
char *suffix;
const char *suffix;
int length;
bfd_reloc_code_real_type reloc;
unsigned char operator;
@ -1244,7 +1244,7 @@ get_directive (directiveE *directive, bfd_boolean *negated)
{
int len;
unsigned i;
char *directive_string;
const char *directive_string;
if (strncmp (input_line_pointer, "no-", 3) != 0)
*negated = FALSE;
@ -2269,7 +2269,7 @@ xg_arg_is_constant (char *arg, offsetT *valp)
static void
xg_replace_opname (char **popname, char *newop)
xg_replace_opname (char **popname, const char *newop)
{
free (*popname);
*popname = (char *) xmalloc (strlen (newop) + 1);
@ -2439,8 +2439,8 @@ xtensa_translate_old_userreg_ops (char **popname)
static int
xtensa_translate_zero_immed (char *old_op,
char *new_op,
xtensa_translate_zero_immed (const char *old_op,
const char *new_op,
char **popname,
int *pnum_args,
char **arg_strings)
@ -11518,7 +11518,8 @@ static segT
cache_literal_section (bfd_boolean use_abs_literals)
{
const char *text_name, *group_name = 0;
char *base_name, *name, *suffix;
const char *base_name, *suffix;
char *name;
segT *pcached;
segT seg, current_section;
int current_subsec;

View File

@ -1572,7 +1572,7 @@ transition_applies (insn_pattern *initial_insn,
static bfd_boolean
wide_branch_opcode (const char *opcode_name,
char *suffix,
const char *suffix,
xtensa_opcode *popcode)
{
xtensa_isa isa = xtensa_default_isa;

View File

@ -66,7 +66,7 @@ struct obstack notes;
const char * an_external_name;
#endif
static char *save_symbol_name (const char *);
static const char *save_symbol_name (const char *);
static void fb_label_init (void);
static long dollar_label_instance (long);
static long fb_label_instance (long);
@ -101,7 +101,7 @@ symbol_new (const char *name, segT segment, valueT valu, fragS *frag)
/* Save a symbol name on a permanent obstack, and convert it according
to the object file format. */
static char *
static const char *
save_symbol_name (const char *name)
{
size_t name_length;
@ -132,7 +132,7 @@ symbol_create (const char *name, /* It is copied, the caller can destroy/modify.
valueT valu, /* Symbol value. */
fragS *frag /* Associated fragment. */)
{
char *preserved_copy_of_name;
const char *preserved_copy_of_name;
symbolS *symbolP;
preserved_copy_of_name = save_symbol_name (name);
@ -190,7 +190,7 @@ static unsigned long local_symbol_conversion_count;
struct local_symbol *
local_symbol_make (const char *name, segT section, valueT val, fragS *frag)
{
char *name_copy;
const char *name_copy;
struct local_symbol *ret;
++local_symbol_count;
@ -3109,7 +3109,7 @@ symbol_relc_make_value (offsetT val)
char *
symbol_relc_make_expr (expressionS * exp)
{
char * opstr = NULL; /* Operator prefix string. */
const char * opstr = NULL; /* Operator prefix string. */
int arity = 0; /* Arity of this operator. */
char * operands[3]; /* Up to three operands. */
char * concat_string = NULL;

View File

@ -1,3 +1,8 @@
2016-03-22 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* opcode/i960.h: Add const qualifiers.
* opcode/tic4x.h (struct tic4x_inst): Likewise.
2016-03-21 Andrew Burgess <andrew.burgess@embecosm.com>
* opcodes/arc.h (insn_class_t): Add BITOP type.

View File

@ -134,7 +134,7 @@
/* Description of a single i80960 instruction */
struct i960_opcode {
long opcode; /* 32 bits, constant fields filled in, rest zeroed */
char *name; /* Assembler mnemonic */
const char *name; /* Assembler mnemonic */
short iclass; /* Class: see #defines below */
char format; /* REG, COBR, CTRL, MEMn, COJ, FBRA, or CALLJ */
char num_ops; /* Number of operands */

View File

@ -226,7 +226,7 @@ struct tic4x_inst
const char * name;
unsigned long opcode;
unsigned long opmask;
char * args;
const char * args;
unsigned long oplevel;
};