summaryrefslogtreecommitdiff
path: root/opcodes/ns32k-dis.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2002-12-02 13:13:37 +0000
committerAlan Modra <amodra@bigpond.net.au>2002-12-02 13:13:37 +0000
commite3f52ead91b111334d16e87df989e99ae138d612 (patch)
treef2eb50b98acf496bc061f867ce6ef9d476f63eca /opcodes/ns32k-dis.c
parentf687939c214181fd52c48b777a5c8d72cccc773d (diff)
downloadbinutils-redhat-e3f52ead91b111334d16e87df989e99ae138d612.tar.gz
* arm-dis.c (print_insn_arm): Constify "insn". Formatting.
(print_insn_thumb): Likewise. * h8500-dis.c (print_insn_h8500): Constify "opcode". * mcore-dis.c (print_insn_mcore): Constify "op". Formatting. * ns32k-dis.c (print_insn_arg <case 'F'>): Use a union to avoid type-punned pointer warnings. <case 'L'>: Likewise. Fix error message too. * pdp11-dis.c (print_reg): Warning fix. * sh-dis.c (print_movxy): Constify "op" param. (print_insn_ddt): Constify sh_opcode_info vars. (print_insn_ppi): Likewise. (print_insn_sh): Likewise. * tic30-dis.c (cnvt_tmsfloat_ieee): Use a union to avoid type-punned pointer warnings. * w65-dis.c (print_insn_w65): Constify "op".
Diffstat (limited to 'opcodes/ns32k-dis.c')
-rw-r--r--opcodes/ns32k-dis.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/opcodes/ns32k-dis.c b/opcodes/ns32k-dis.c
index 49facb358c..bc51dafeb6 100644
--- a/opcodes/ns32k-dis.c
+++ b/opcodes/ns32k-dis.c
@@ -1,5 +1,5 @@
/* Print National Semiconductor 32000 instructions.
- Copyright 1986, 1988, 1991, 1992, 1994, 1998, 2001
+ Copyright 1986, 1988, 1991, 1992, 1994, 1998, 2001, 2002
Free Software Foundation, Inc.
This file is part of opcodes library.
@@ -556,10 +556,13 @@ print_insn_arg (d, ioffset, aoffsetp, buffer, addr, result, index_offset)
char *result;
int index_offset;
{
- int addr_mode;
- float Fvalue;
- double Lvalue;
+ union {
+ float f;
+ double d;
+ int i[2];
+ } value;
int Ivalue;
+ int addr_mode;
int disp1, disp2;
int index;
int size;
@@ -647,23 +650,23 @@ print_insn_arg (d, ioffset, aoffsetp, buffer, addr, result, index_offset)
sprintf (result, "$%d", Ivalue);
break;
case 'F':
- bit_copy (buffer, *aoffsetp, 32, (char *) &Fvalue);
- flip_bytes ((char *) & Fvalue, 4);
+ bit_copy (buffer, *aoffsetp, 32, (char *) &value.f);
+ flip_bytes ((char *) &value.f, 4);
*aoffsetp += 32;
- if (INVALID_FLOAT (&Fvalue, 4))
- sprintf (result, "<<invalid float 0x%.8x>>", *(int *) &Fvalue);
+ if (INVALID_FLOAT (&value.f, 4))
+ sprintf (result, "<<invalid float 0x%.8x>>", value.i[0]);
else /* assume host has ieee float */
- sprintf (result, "$%g", Fvalue);
+ sprintf (result, "$%g", value.f);
break;
case 'L':
- bit_copy (buffer, *aoffsetp, 64, (char *) &Lvalue);
- flip_bytes ((char *) & Lvalue, 8);
+ bit_copy (buffer, *aoffsetp, 64, (char *) &value.d);
+ flip_bytes ((char *) &value.d, 8);
*aoffsetp += 64;
- if (INVALID_FLOAT (&Lvalue, 8))
- sprintf (result, "<<invalid long 0x%.8x%.8x>>",
- *(((int *) &Lvalue) + 1), *(int *) &Lvalue);
+ if (INVALID_FLOAT (&value.d, 8))
+ sprintf (result, "<<invalid double 0x%.8x%.8x>>",
+ value.i[1], value.i[0]);
else /* assume host has ieee float */
- sprintf (result, "$%g", Lvalue);
+ sprintf (result, "$%g", value.d);
break;
}
break;