[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Remove CONST from tc-arm.c
From: |
Nick Clifton |
Subject: |
Remove CONST from tc-arm.c |
Date: |
13 Oct 2001 10:45:30 +0100 |
Hi Guys,
I am applying the patch below to replace the use of the CONST macro
with const. CONST is obsolete....
Cheers
Nick
2001-10-13 Nick Clifton <address@hidden>
* config/tc-arm.c: Replace CONST with const.
Index: gas/config/tc-arm.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-arm.c,v
retrieving revision 1.95
diff -p -r1.95 tc-arm.c
*** tc-arm.c 2001/10/09 16:08:57 1.95
--- tc-arm.c 2001/10/13 09:48:27
*************** static boolean pic_code = false
*** 117,123 ****
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. */
! CONST char comment_chars[] = "@";
/* This array holds the chars that only start a comment at the beginning of
a line. If the line seems to have the form '# 123 filename'
--- 117,123 ----
/* This array holds the chars that always start a comment. If the
pre-processor is disabled, these aren't very useful. */
! const char comment_chars[] = "@;";
/* This array holds the chars that only start a comment at the beginning of
a line. If the line seems to have the form '# 123 filename'
*************** CONST char comment_chars[] = "@";
*** 126,144 ****
first line of the input file. This is because the compiler outputs
#NO_APP at the beginning of its output. */
/* Also note that comments like this one will always work. */
! CONST char line_comment_chars[] = "#";
! CONST char line_separator_chars[] = ";";
/* Chars that can be used to separate mant
from exp in floating point numbers. */
! CONST char EXP_CHARS[] = "eE";
/* Chars that mean this number is a floating point constant. */
/* As in 0f12.456 */
/* or 0d1.2345e12 */
! CONST char FLT_CHARS[] = "rRsSfFdDxXeEpP";
/* Prefix characters that indicate the start of an immediate
value. */
--- 126,144 ----
first line of the input file. This is because the compiler outputs
#NO_APP at the beginning of its output. */
/* Also note that comments like this one will always work. */
! const char line_comment_chars[] = "#";
! const char line_separator_chars[] = "|";
/* Chars that can be used to separate mant
from exp in floating point numbers. */
! const char EXP_CHARS[] = "eE";
/* Chars that mean this number is a floating point constant. */
/* As in 0f12.456 */
/* or 0d1.2345e12 */
! const char FLT_CHARS[] = "rRsSfFdDxXeEpP";
/* Prefix characters that indicate the start of an immediate
value. */
*************** symbolS * GOT_symbol;
*** 150,156 ****
#endif
/* Size of relocation record. */
! CONST int md_reloc_size = 8;
/* 0: assemble for ARM,
1: assemble for Thumb,
--- 150,156 ----
#endif
/* Size of relocation record. */
! const int md_reloc_size = 8;
/* 0: assemble for ARM,
1: assemble for Thumb,
*************** typedef struct arm_fix
*** 165,171 ****
struct arm_it
{
! CONST char * error;
unsigned long instruction;
int suffix;
int size;
--- 165,171 ----
struct arm_it
{
! const char * error;
unsigned long instruction;
int suffix;
int size;
*************** static const struct asm_shift_name shift
*** 232,238 ****
#define NUM_FLOAT_VALS 8
! CONST char * fp_const[] =
{
"0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0", 0
};
--- 232,238 ----
#define NUM_FLOAT_VALS 8
! const char * fp_const[] =
{
"0.0", "1.0", "2.0", "3.0", "4.0", "5.0", "0.5", "10.0", 0
};
*************** LITTLENUM_TYPE fp_values[NUM_FLOAT_VALS]
*** 264,277 ****
struct asm_cond
{
! CONST char * template;
unsigned long value;
};
/* This is to save a hash look-up in the common case. */
#define COND_ALWAYS 0xe0000000
! static CONST struct asm_cond conds[] =
{
{"eq", 0x00000000},
{"ne", 0x10000000},
--- 264,277 ----
struct asm_cond
{
! const char * template;
unsigned long value;
};
/* This is to save a hash look-up in the common case. */
#define COND_ALWAYS 0xe0000000
! static const struct asm_cond conds[] =
{
{"eq", 0x00000000},
{"ne", 0x10000000},
*************** static CONST struct asm_cond conds[] =
*** 296,312 ****
the set_bits: */
struct asm_flg
{
! CONST char * template; /* Basic flag string. */
unsigned long set_bits; /* Bits to set. */
};
! static CONST struct asm_flg s_flag[] =
{
{"s", CONDS_BIT},
{NULL, 0}
};
! static CONST struct asm_flg ldr_flags[] =
{
{"d", DOUBLE_LOAD_FLAG},
{"b", 0x00400000},
--- 296,312 ----
the set_bits: */
struct asm_flg
{
! const char * template; /* Basic flag string. */
unsigned long set_bits; /* Bits to set. */
};
! static const struct asm_flg s_flag[] =
{
{"s", CONDS_BIT},
{NULL, 0}
};
! static const struct asm_flg ldr_flags[] =
{
{"d", DOUBLE_LOAD_FLAG},
{"b", 0x00400000},
*************** static CONST struct asm_flg ldr_flags[]
*** 318,324 ****
{NULL, 0}
};
! static CONST struct asm_flg str_flags[] =
{
{"d", DOUBLE_LOAD_FLAG},
{"b", 0x00400000},
--- 318,324 ----
{NULL, 0}
};
! static const struct asm_flg str_flags[] =
{
{"d", DOUBLE_LOAD_FLAG},
{"b", 0x00400000},
*************** static CONST struct asm_flg str_flags[]
*** 328,347 ****
{NULL, 0}
};
! static CONST struct asm_flg byte_flag[] =
{
{"b", 0x00400000},
{NULL, 0}
};
! static CONST struct asm_flg cmp_flags[] =
{
{"s", CONDS_BIT},
{"p", 0x0010f000},
{NULL, 0}
};
! static CONST struct asm_flg ldm_flags[] =
{
{"ed", 0x01800000},
{"fd", 0x00800000},
--- 328,347 ----
{NULL, 0}
};
! static const struct asm_flg byte_flag[] =
{
{"b", 0x00400000},
{NULL, 0}
};
! static const struct asm_flg cmp_flags[] =
{
{"s", CONDS_BIT},
{"p", 0x0010f000},
{NULL, 0}
};
! static const struct asm_flg ldm_flags[] =
{
{"ed", 0x01800000},
{"fd", 0x00800000},
*************** static CONST struct asm_flg ldm_flags[]
*** 354,360 ****
{NULL, 0}
};
! static CONST struct asm_flg stm_flags[] =
{
{"ed", 0x00000000},
{"fd", 0x01000000},
--- 354,360 ----
{NULL, 0}
};
! static const struct asm_flg stm_flags[] =
{
{"ed", 0x00000000},
{"fd", 0x01000000},
*************** static CONST struct asm_flg stm_flags[]
*** 367,387 ****
{NULL, 0}
};
! static CONST struct asm_flg lfm_flags[] =
{
{"fd", 0x00800000},
{"ea", 0x01000000},
{NULL, 0}
};
! static CONST struct asm_flg sfm_flags[] =
{
{"fd", 0x01000000},
{"ea", 0x00800000},
{NULL, 0}
};
! static CONST struct asm_flg round_flags[] =
{
{"p", 0x00000020},
{"m", 0x00000040},
--- 367,387 ----
{NULL, 0}
};
! static const struct asm_flg lfm_flags[] =
{
{"fd", 0x00800000},
{"ea", 0x01000000},
{NULL, 0}
};
! static const struct asm_flg sfm_flags[] =
{
{"fd", 0x01000000},
{"ea", 0x00800000},
{NULL, 0}
};
! static const struct asm_flg round_flags[] =
{
{"p", 0x00000020},
{"m", 0x00000040},
*************** static CONST struct asm_flg round_flags[
*** 393,399 ****
in that it accepts a precision specifier as well as a rounding specifier,
despite the fact that this is meaningless. To be more compatible, we
accept it as well, though of course it does not set any bits. */
! static CONST struct asm_flg fix_flags[] =
{
{"p", 0x00000020},
{"m", 0x00000040},
--- 393,399 ----
in that it accepts a precision specifier as well as a rounding specifier,
despite the fact that this is meaningless. To be more compatible, we
accept it as well, though of course it does not set any bits. */
! static const struct asm_flg fix_flags[] =
{
{"p", 0x00000020},
{"m", 0x00000040},
*************** static CONST struct asm_flg fix_flags[]
*** 410,422 ****
{NULL, 0}
};
! static CONST struct asm_flg except_flag[] =
{
{"e", 0x00400000},
{NULL, 0}
};
! static CONST struct asm_flg long_flag[] =
{
{"l", 0x00400000},
{NULL, 0}
--- 410,422 ----
{NULL, 0}
};
! static const struct asm_flg except_flag[] =
{
{"e", 0x00400000},
{NULL, 0}
};
! static const struct asm_flg long_flag[] =
{
{"l", 0x00400000},
{NULL, 0}
*************** static CONST struct asm_flg long_flag[]
*** 424,430 ****
struct asm_psr
{
! CONST char * template;
boolean cpsr;
unsigned long field;
};
--- 424,430 ----
struct asm_psr
{
! const char * template;
boolean cpsr;
unsigned long field;
};
*************** struct asm_psr
*** 440,446 ****
#define PSR_s (1 << 2)
#define PSR_f (1 << 3)
! static CONST struct asm_psr psrs[] =
{
{"CPSR", true, PSR_c | PSR_f},
{"CPSR_all", true, PSR_c | PSR_f},
--- 440,446 ----
#define PSR_s (1 << 2)
#define PSR_f (1 << 3)
! static const struct asm_psr psrs[] =
{
{"CPSR", true, PSR_c | PSR_f},
{"CPSR_all", true, PSR_c | PSR_f},
*************** static int cirrus_parse_offset PARAMS ((
*** 682,689 ****
static void fix_new_arm PARAMS ((fragS *, int, short,
expressionS *, int, int));
static int arm_reg_parse PARAMS ((char **));
! static CONST struct asm_psr * arm_psr_parse PARAMS ((char **));
! static void symbol_locate PARAMS ((symbolS *, CONST char *, segT, valueT,
fragS *));
static int add_to_lit_pool PARAMS ((void));
static unsigned validate_immediate PARAMS ((unsigned));
static unsigned validate_immediate_twopart PARAMS ((unsigned int, unsigned
int *));
--- 682,689 ----
static void fix_new_arm PARAMS ((fragS *, int, short,
expressionS *, int, int));
static int arm_reg_parse PARAMS ((char **));
! static const struct asm_psr * arm_psr_parse PARAMS ((char **));
! static void symbol_locate PARAMS ((symbolS *, const char *, segT, valueT,
fragS *));
static int add_to_lit_pool PARAMS ((void));
static unsigned validate_immediate PARAMS ((unsigned));
static unsigned validate_immediate_twopart PARAMS ((unsigned int, unsigned
int *));
*************** static bfd_reloc_code_real_type arm_pars
*** 754,770 ****
struct asm_opcode
{
/* Basic string to match. */
! CONST char * template;
/* Basic instruction code. */
unsigned long value;
/* Compulsory suffix that must follow conds. If "", then the
instruction is not conditional and must have no suffix. */
! CONST char * comp_suffix;
/* Bits to toggle if flag 'n' set. */
! CONST struct asm_flg * flags;
/* Which CPU variants this exists for. */
unsigned long variants;
--- 754,770 ----
struct asm_opcode
{
/* Basic string to match. */
! const char * template;
/* Basic instruction code. */
unsigned long value;
/* Compulsory suffix that must follow conds. If "", then the
instruction is not conditional and must have no suffix. */
! const char * comp_suffix;
/* Bits to toggle if flag 'n' set. */
! const struct asm_flg * flags;
/* Which CPU variants this exists for. */
unsigned long variants;
*************** struct asm_opcode
*** 773,779 ****
void (* parms) PARAMS ((char *, unsigned long));
};
! static CONST struct asm_opcode insns[] =
{
/* Intel XScale extensions to ARM V5 ISA. */
{"mia", 0x0e200010, NULL, NULL, ARM_EXT_XSCALE, do_mia},
--- 773,779 ----
void (* parms) PARAMS ((char *, unsigned long));
};
! static const struct asm_opcode insns[] =
{
/* Intel XScale extensions to ARM V5 ISA. */
{"mia", 0x0e200010, NULL, NULL, ARM_EXT_XSCALE, do_mia},
*************** static int thumb_reg PARAMS ((char ** s
*** 1161,1167 ****
struct thumb_opcode
{
/* Basic string to match. */
! CONST char * template;
/* Basic instruction code. */
unsigned long value;
--- 1161,1167 ----
struct thumb_opcode
{
/* Basic string to match. */
! const char * template;
/* Basic instruction code. */
unsigned long value;
*************** struct thumb_opcode
*** 1175,1181 ****
void (* parms) PARAMS ((char *));
};
! static CONST struct thumb_opcode tinsns[] =
{
{"adc", 0x4140, 2, ARM_EXT_THUMB, do_t_arit},
{"add", 0x0000, 2, ARM_EXT_THUMB, do_t_add},
--- 1175,1181 ----
void (* parms) PARAMS ((char *));
};
! static const struct thumb_opcode tinsns[] =
{
{"adc", 0x4140, 2, ARM_EXT_THUMB, do_t_arit},
{"add", 0x0000, 2, ARM_EXT_THUMB, do_t_add},
*************** static CONST struct thumb_opcode tinsns[
*** 1241,1247 ****
struct reg_entry
{
! CONST char * name;
int number;
};
--- 1241,1247 ----
struct reg_entry
{
! const char * name;
int number;
};
*************** struct reg_entry
*** 1264,1270 ****
#define REG_SP 13
/* These are the standard names. Users can add aliases with .req. */
! static CONST struct reg_entry reg_table[] =
{
/* Processor Register Numbers. */
{"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3},
--- 1264,1270 ----
#define REG_SP 13
/* These are the standard names. Users can add aliases with .req. */
! static const struct reg_entry reg_table[] =
{
/* Processor Register Numbers. */
{"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3},
*************** static void s_arm_elf_cons PARAMS ((int)
*** 1357,1363 ****
static int my_get_expression PARAMS ((expressionS *, char **));
! CONST pseudo_typeS md_pseudo_table[] =
{
/* Never called becasue '.req' does not start line. */
{ "req", s_req, 0 },
--- 1357,1363 ----
static int my_get_expression PARAMS ((expressionS *, char **));
! const pseudo_typeS md_pseudo_table[] =
{
/* Never called becasue '.req' does not start line. */
{ "req", s_req, 0 },
*************** add_to_lit_pool ()
*** 1483,1489 ****
static void
symbol_locate (symbolP, name, segment, valu, frag)
symbolS * symbolP;
! CONST char * name; /* It is copied, the caller can modify.
*/
segT segment; /* Segment identifier (SEG_<something>). */
valueT valu; /* Symbol value. */
fragS * frag; /* Associated fragment. */
--- 1483,1489 ----
static void
symbol_locate (symbolP, name, segment, valu, frag)
symbolS * symbolP;
! const char * name; /* It is copied, the caller can modify.
*/
segT segment; /* Segment identifier (SEG_<something>). */
valueT valu; /* Symbol value. */
fragS * frag; /* Associated fragment. */
*************** reg_required_here (str, shift)
*** 2014,2027 ****
return FAIL;
}
! static CONST struct asm_psr *
arm_psr_parse (ccp)
register char ** ccp;
{
char * start = * ccp;
char c;
char * p;
! CONST struct asm_psr * psr;
p = start;
--- 2014,2027 ----
return FAIL;
}
! static const struct asm_psr *
arm_psr_parse (ccp)
register char ** ccp;
{
char * start = * ccp;
char c;
char * p;
! const struct asm_psr * psr;
p = start;
*************** arm_psr_parse (ccp)
*** 2043,2049 ****
strncpy (start, "SPSR", 4);
/* Now locate the word in the psr hash table. */
! psr = (CONST struct asm_psr *) hash_find (arm_psr_hsh, start);
/* Restore the input stream. */
*p = c;
--- 2043,2049 ----
strncpy (start, "SPSR", 4);
/* Now locate the word in the psr hash table. */
! psr = (const struct asm_psr *) hash_find (arm_psr_hsh, start);
/* Restore the input stream. */
*p = c;
*************** psr_required_here (str)
*** 2062,2068 ****
char ** str;
{
char * start = * str;
! CONST struct asm_psr * psr;
psr = arm_psr_parse (str);
--- 2062,2068 ----
char ** str;
{
char * start = * str;
! const struct asm_psr * psr;
psr = arm_psr_parse (str);
*************** md_assemble (str)
*** 8388,8398 ****
if (thumb_mode)
{
! CONST struct thumb_opcode * opcode;
c = *p;
*p = '\0';
! opcode = (CONST struct thumb_opcode *) hash_find (arm_tops_hsh, str);
*p = c;
if (opcode)
--- 8388,8398 ----
if (thumb_mode)
{
! const struct thumb_opcode * opcode;
c = *p;
*p = '\0';
! opcode = (const struct thumb_opcode *) hash_find (arm_tops_hsh, str);
*p = c;
if (opcode)
*************** md_assemble (str)
*** 8413,8419 ****
}
else
{
! CONST struct asm_opcode * opcode;
unsigned long cond_code;
inst.size = INSN_SIZE;
--- 8413,8419 ----
}
else
{
! const struct asm_opcode * opcode;
unsigned long cond_code;
inst.size = INSN_SIZE;
*************** md_assemble (str)
*** 8428,8434 ****
c = *q;
*q = '\0';
! opcode = (CONST struct asm_opcode *) hash_find (arm_ops_hsh, str);
*q = c;
if (opcode && opcode->template)
--- 8428,8434 ----
c = *q;
*q = '\0';
! opcode = (const struct asm_opcode *) hash_find (arm_ops_hsh, str);
*q = c;
if (opcode && opcode->template)
*************** md_assemble (str)
*** 8467,8477 ****
r = q;
if (p - r >= 2)
{
! CONST struct asm_cond *cond;
char d = *(r + 2);
*(r + 2) = '\0';
! cond = (CONST struct asm_cond *) hash_find (arm_cond_hsh, r);
*(r + 2) = d;
if (cond)
{
--- 8467,8477 ----
r = q;
if (p - r >= 2)
{
! const struct asm_cond *cond;
char d = *(r + 2);
*(r + 2) = '\0';
! cond = (const struct asm_cond *) hash_find (arm_cond_hsh, r);
*(r + 2) = d;
if (cond)
{
*************** _("Warning: Use of the 'nv' conditional
*** 8506,8512 ****
before any optional flags. */
if (opcode->comp_suffix && *opcode->comp_suffix != '\0')
{
! CONST char *s = opcode->comp_suffix;
while (*s)
{
--- 8506,8512 ----
before any optional flags. */
if (opcode->comp_suffix && *opcode->comp_suffix != '\0')
{
! const char *s = opcode->comp_suffix;
while (*s)
{
*************** _("Warning: Use of the 'nv' conditional
*** 8531,8537 ****
if (r != p)
{
char d;
! CONST struct asm_flg *flag = opcode->flags;
if (flag)
{
--- 8531,8537 ----
if (r != p)
{
char d;
! const struct asm_flg *flag = opcode->flags;
if (flag)
{
*************** _("Warning: Use of the 'nv' conditional
*** 8666,8672 ****
-matpcs ARM/Thumb Procedure Call Standard
-moabi Old ELF ABI */
! CONST char * md_shortopts = "m:k";
struct option md_longopts[] =
{
--- 8666,8672 ----
-matpcs ARM/Thumb Procedure Call Standard
-moabi Old ELF ABI */
! const char * md_shortopts = "m:k";
struct option md_longopts[] =
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Remove CONST from tc-arm.c,
Nick Clifton <=