opcodes: blackfin: constify formatting related structures

No need for these local structures related to formatting of output to
be writable, so constify the whole shebang.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
Mike Frysinger 2010-09-22 20:32:40 +00:00
parent 1b182c3c15
commit 528c6277f7
2 changed files with 30 additions and 22 deletions

View File

@ -1,3 +1,11 @@
2010-09-22 Mike Frysinger <vapier@gentoo.org>
* bfin-dis.c (constant_formats): Constify the whole structure.
(fmtconst): Add const to return value.
(reg_names): Mark const.
(decode_multfunc): Mark s0/s1 as const.
(decode_macfunc): Mark a/sop as const.
2010-09-17 Tejas Belagod <tejas.belagod@arm.com> 2010-09-17 Tejas Belagod <tejas.belagod@arm.com>
* arm_dis.c (coprocessor_opcodes): Add MRC entry for APSR_nzcv. * arm_dis.c (coprocessor_opcodes): Add MRC entry for APSR_nzcv.

View File

@ -53,6 +53,9 @@ typedef long TIword;
typedef unsigned int bu32; typedef unsigned int bu32;
static char comment = 0;
static char parallel = 0;
typedef enum typedef enum
{ {
c_0, c_1, c_4, c_2, c_uimm2, c_uimm3, c_imm3, c_pcrel4, c_0, c_1, c_4, c_2, c_uimm2, c_uimm3, c_imm3, c_pcrel4,
@ -62,20 +65,20 @@ typedef enum
c_uimm16s4d, c_uimm16, c_pcrel24, c_uimm32, c_imm32, c_huimm32, c_huimm32e, c_uimm16s4d, c_uimm16, c_pcrel24, c_uimm32, c_imm32, c_huimm32, c_huimm32e,
} const_forms_t; } const_forms_t;
static struct static const struct
{ {
char *name; const char *name;
int nbits; const int nbits;
char reloc; const char reloc;
char issigned; const char issigned;
char pcrel; const char pcrel;
char scale; const char scale;
char offset; const char offset;
char negative; const char negative;
char positive; const char positive;
char decimal; const char decimal;
char leading; const char leading;
char exact; const char exact;
} constant_formats[] = } constant_formats[] =
{ {
{ "0", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, { "0", 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0},
@ -123,11 +126,8 @@ static struct
{ "huimm32e", 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1}, { "huimm32e", 32, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
}; };
static char comment = 0; static const char *
static char parallel = 0; fmtconst (const_forms_t cf, TIword x, bfd_vma pc, disassemble_info *outf)
static char *
fmtconst (const_forms_t cf, TIword x, bfd_vma pc, disassemble_info * outf)
{ {
static char buf[60]; static char buf[60];
@ -254,7 +254,7 @@ enum reg_class
LIM_REG_CLASSES LIM_REG_CLASSES
}; };
static char *reg_names[] = static const char *reg_names[] =
{ {
"R0.L", "R1.L", "R2.L", "R3.L", "R4.L", "R5.L", "R6.L", "R7.L", "R0.L", "R1.L", "R2.L", "R3.L", "R4.L", "R5.L", "R6.L", "R7.L",
"R0.H", "R1.H", "R2.H", "R3.H", "R4.H", "R5.H", "R6.H", "R7.H", "R0.H", "R1.H", "R2.H", "R3.H", "R4.H", "R5.H", "R6.H", "R7.H",
@ -557,7 +557,7 @@ aligndir (int r0, disassemble_info *outf)
static int static int
decode_multfunc (int h0, int h1, int src0, int src1, disassemble_info * outf) decode_multfunc (int h0, int h1, int src0, int src1, disassemble_info * outf)
{ {
char *s0, *s1; const char *s0, *s1;
if (h0) if (h0)
s0 = dregs_hi (src0); s0 = dregs_hi (src0);
@ -578,8 +578,8 @@ decode_multfunc (int h0, int h1, int src0, int src1, disassemble_info * outf)
static int static int
decode_macfunc (int which, int op, int h0, int h1, int src0, int src1, disassemble_info * outf) decode_macfunc (int which, int op, int h0, int h1, int src0, int src1, disassemble_info * outf)
{ {
char *a; const char *a;
char *sop = "<unknown op>"; const char *sop = "<unknown op>";
if (which) if (which)
a = "A1"; a = "A1";