[patch] *-dis.c: Fix formatting.

Alan Modra amodra@bigpond.net.au
Mon Jul 23 17:10:00 GMT 2001


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;



More information about the Binutils mailing list