* arc-dis.c: Formatting fixes.
(my_sprintf): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, VA_CLOSE.
This commit is contained in:
parent
af6166c063
commit
86caa542b1
2 changed files with 52 additions and 36 deletions
|
@ -1,3 +1,8 @@
|
|||
2001-09-26 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* arc-dis.c: Formatting fixes.
|
||||
(my_sprintf): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, VA_CLOSE.
|
||||
|
||||
2001-09-21 Bruno Haible <haible@clisp.cons.org>
|
||||
|
||||
* arc-dis.c: Don't include <ctype.h>.
|
||||
|
|
|
@ -97,7 +97,7 @@
|
|||
#define CHECK_FIELD_A() \
|
||||
do \
|
||||
{ \
|
||||
fieldA = FIELDA(state->words[0]); \
|
||||
fieldA = FIELDA (state->words[0]); \
|
||||
if (fieldA > 60) \
|
||||
{ \
|
||||
fieldAisReg = 0; \
|
||||
|
@ -233,20 +233,22 @@ post_address (state, addr)
|
|||
return "";
|
||||
}
|
||||
|
||||
static void my_sprintf PARAMS ((struct arcDisState *, char *, const char *,
|
||||
...));
|
||||
|
||||
static void
|
||||
my_sprintf (
|
||||
struct arcDisState * state,
|
||||
char * buf,
|
||||
const char * format,
|
||||
...)
|
||||
my_sprintf VPARAMS ((struct arcDisState *state, char *buf, const char *format,
|
||||
...))
|
||||
{
|
||||
char *bp;
|
||||
const char *p;
|
||||
int size, leading_zero, regMap[2];
|
||||
long auxNum;
|
||||
va_list ap;
|
||||
|
||||
va_start (ap, format);
|
||||
VA_OPEN (ap, format);
|
||||
VA_FIXEDARG (ap, struct arcDisState *, state);
|
||||
VA_FIXEDARG (ap, char *, buf);
|
||||
VA_FIXEDARG (ap, const char *, format);
|
||||
|
||||
bp = buf;
|
||||
*bp = 0;
|
||||
|
@ -409,6 +411,7 @@ my_sprintf (
|
|||
}
|
||||
|
||||
DOCOMM: *bp = 0;
|
||||
VA_CLOSE (ap);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -435,7 +438,8 @@ write_comments_(state, shimm, is_limm, limm_value)
|
|||
strcpy (state->commentBuffer, comment_prefix);
|
||||
else
|
||||
strcat (state->commentBuffer, ", ");
|
||||
strncat (state->commentBuffer, state->comm[i], sizeof (state->commentBuffer));
|
||||
strncat (state->commentBuffer, state->comm[i],
|
||||
sizeof (state->commentBuffer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -724,7 +728,7 @@ dsmOneArcInst (addr, state)
|
|||
instrName = instruction_name (state,
|
||||
state->_opcode,
|
||||
FIELDC (state->words[0]),
|
||||
& flags);
|
||||
&flags);
|
||||
if (!instrName)
|
||||
{
|
||||
instrName = "???";
|
||||
|
@ -839,14 +843,16 @@ dsmOneArcInst (addr, state)
|
|||
if (!repeatsOp)
|
||||
WRITE_FORMAT_COMMA_x (C);
|
||||
WRITE_NOP_COMMENT ();
|
||||
my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC);
|
||||
my_sprintf (state, state->operandBuffer, formatString,
|
||||
fieldA, fieldB, fieldC);
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITE_FORMAT_x (B);
|
||||
if (!repeatsOp)
|
||||
WRITE_FORMAT_COMMA_x (C);
|
||||
my_sprintf (state, state->operandBuffer, formatString, fieldB, fieldC);
|
||||
my_sprintf (state, state->operandBuffer, formatString,
|
||||
fieldB, fieldC);
|
||||
}
|
||||
write_comments ();
|
||||
break;
|
||||
|
@ -862,7 +868,8 @@ dsmOneArcInst (addr, state)
|
|||
WRITE_FORMAT_x (A);
|
||||
WRITE_FORMAT_COMMA_x (B);
|
||||
WRITE_NOP_COMMENT ();
|
||||
my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB);
|
||||
my_sprintf (state, state->operandBuffer, formatString,
|
||||
fieldA, fieldB);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -903,7 +910,8 @@ dsmOneArcInst (addr, state)
|
|||
}
|
||||
|
||||
strcat (formatString, "%s"); /* address/label name */
|
||||
my_sprintf (state, state->operandBuffer, formatString, post_address (state, fieldA));
|
||||
my_sprintf (state, state->operandBuffer, formatString,
|
||||
post_address (state, fieldA));
|
||||
write_comments ();
|
||||
break;
|
||||
|
||||
|
@ -986,7 +994,8 @@ dsmOneArcInst (addr, state)
|
|||
fieldB = fieldC;
|
||||
|
||||
WRITE_FORMAT_x_RB (C);
|
||||
my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC);
|
||||
my_sprintf (state, state->operandBuffer, formatString,
|
||||
fieldA, fieldB, fieldC);
|
||||
write_comments ();
|
||||
break;
|
||||
|
||||
|
@ -1031,7 +1040,8 @@ dsmOneArcInst (addr, state)
|
|||
else
|
||||
WRITE_FORMAT_RB ();
|
||||
}
|
||||
my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC);
|
||||
my_sprintf (state, state->operandBuffer, formatString,
|
||||
fieldA, fieldB, fieldC);
|
||||
write_comments ();
|
||||
break;
|
||||
|
||||
|
@ -1076,7 +1086,8 @@ dsmOneArcInst (addr, state)
|
|||
else
|
||||
WRITE_FORMAT_RB();
|
||||
}
|
||||
my_sprintf (state, state->operandBuffer, formatString, fieldC, fieldB, fieldA);
|
||||
my_sprintf (state, state->operandBuffer, formatString,
|
||||
fieldC, fieldB, fieldA);
|
||||
write_comments2(fieldA);
|
||||
break;
|
||||
case 8:
|
||||
|
|
Loading…
Reference in a new issue