This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] *-dis.c: Fix formatting.
- To: Kazu Hirata <kazu at hxi dot com>
- Subject: Re: [patch] *-dis.c: Fix formatting.
- From: Alan Modra <amodra at bigpond dot net dot au>
- Date: Tue, 24 Jul 2001 09:40:23 +0930
- Cc: binutils at sources dot redhat dot com
On Mon, Jul 23, 2001 at 10:49:04PM +0000, Kazu Hirata wrote:
> * m68k-dis.c: Fix formatting.
> * pj-dis.c: Likewise.
> * z8k-dis.c: Likewise.
OK, thanks. A few extra nits below.
> --- z8k-dis.c 2001/06/06 17:01:35 1.6
> +++ z8k-dis.c 2001/07/23 14:44:22
> @@ -339,15 +335,17 @@
> {
> case ARG_DISP16:
> instr_data->displacement = instr_data->insn_start + 4 +
> - (signed short)(instr_word & 0xffff);
> + (signed short) (instr_word & 0xffff);
> nibl_count += 3;
> break;
> case ARG_DISP12:
> - if (instr_word & 0x800) { /* neg. 12 bit displacement */
> - instr_data->displacement = instr_data->insn_start + 2 -
> - (signed short)((instr_word & 0xfff) | 0xf000) * 2;
> - }
> - else {
> + if (instr_word & 0x800)
> + { /* neg. 12 bit displacement */
I'm not too sure exactly what the coding standard says about the above,
but most other places don't put the comment with the opening brace.
Better to split this to two lines, I think.
> + instr_data->displacement = instr_data->insn_start + 2 -
> + (signed short) ((instr_word & 0xfff) | 0xf000) * 2;
Don't break a line to leave a trailing operator.
> + }
> + else
> + {
> instr_data->displacement = instr_data->insn_start + 2 - (instr_word & 0x0fff) * 2;
This line should be split too.
> }
> nibl_count += 2;