Re: [PATCH 3/5] opcode: add arity info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 25, 2018 at 10:17:52PM +0100, Ramsay Jones wrote:
> 
> 
> On 25/08/18 16:43, Luc Van Oostenryck wrote:
> > The arity is a useful property of each opcode.
> > 
> > Add this information to the opcode definitions.
> > 
> > Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
> > ---
> >  opcode.c   |   3 +-
> >  opcode.def | 164 ++++++++++++++++++++++++++---------------------------
> >  opcode.h   |   3 +-
> >  3 files changed, 86 insertions(+), 84 deletions(-)
> > 
> > diff --git a/opcode.c b/opcode.c
> > index 67cede02d..0e41bc068 100644
> > --- a/opcode.c
> > +++ b/opcode.c
> > @@ -23,11 +23,12 @@
> >  #include "opcode.h"
> >  
> >  const struct opcode_table opcode_table[OP_LAST] = {
> > -#define OPCODE(OP,NG,SW,TF)		\
> > +#define OPCODE(OP,NG,SW,TF,N)		\
> >  	[OP_##OP] = {			\
> >  		.negate   = OP_##NG,	\
> >  		.swap     = OP_##SW,	\
> >  		.to_float = OP_##TF,	\
> > +		.arity    = N,		\
> >  	},
> >  #define OPCODE_RANGE(OP,S,E)
> >  #include "opcode.def"
> > diff --git a/opcode.def b/opcode.def
> > index 7add0b879..9a668bb34 100644
> > --- a/opcode.def
> > +++ b/opcode.def
> > @@ -1,114 +1,114 @@
> > -//	OPCODE		negated		swaped		float
> > +//	OPCODE		negated   swaped    float
> 
> add an arity header?

Yup, there was one, it has just crept in the next patch ...
I'll correct.
 
> >  
> > -OPCODE(BADOP,		BADOP,		BADOP,		BADOP)
> > +OPCODE(BADOP,    	BADOP,    BADOP,    BADOP, 0)
> 
> This table is just all over the place! (what tabstop are you
> using? hint: the only correct answer is 8! ;-P ).

and it would be even better it it would not be adjustable ;)

Of course, I use 8. You're just seeing the effect of the first
character added on each line by patch, no? And the the email quotes?
 
-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux