rename MRB_ARGS_XXX to MRB_ASPEC_XXX; ref #1206

This commit is contained in:
Yukihiro "Matz" Matsumoto
2013-04-25 08:00:48 +09:00
parent 4faaef437d
commit 953eec60db
2 changed files with 10 additions and 10 deletions
+7 -7
View File
@@ -31,13 +31,13 @@ struct RProc {
};
/* aspec access */
#define MRB_ARGS_REQ(a) (((a) >> 19) & 0x1f)
#define MRB_ARGS_OPT(a) (((a) >> 14) & 0x1f)
#define MRB_ARGS_REST(a) ((a) & (1<<13))
#define MRB_ARGS_POST(a) (((a) >> 8) & 0x1f)
#define MRB_ARGS_KEY(a) (((a) >> 3) & 0x1f))
#define MRB_ARGS_KDICT(a) ((a) & (1<<2))
#define MRB_ARGS_BLOCK(a) ((a) & (1<<1))
#define MRB_ASPEC_REQ(a) (((a) >> 19) & 0x1f)
#define MRB_ASPEC_OPT(a) (((a) >> 14) & 0x1f)
#define MRB_ASPEC_REST(a) ((a) & (1<<13))
#define MRB_ASPEC_POST(a) (((a) >> 8) & 0x1f)
#define MRB_ASPEC_KEY(a) (((a) >> 3) & 0x1f))
#define MRB_ASPEC_KDICT(a) ((a) & (1<<2))
#define MRB_ASPEC_BLOCK(a) ((a) & (1<<1))
#define MRB_PROC_CFUNC 128
#define MRB_PROC_CFUNC_P(p) ((p)->flags & MRB_PROC_CFUNC)
+3 -3
View File
@@ -140,9 +140,9 @@ mrb_proc_arity(mrb_state *mrb, mrb_value self)
mrb_aspec aspec = *iseq >> 6;
int ma, ra, pa, arity;
ma = MRB_ARGS_REQ(aspec);
ra = MRB_ARGS_REST(aspec);
pa = MRB_ARGS_POST(aspec);
ma = MRB_ASPEC_REQ(aspec);
ra = MRB_ASPEC_REST(aspec);
pa = MRB_ASPEC_POST(aspec);
arity = ra ? -(ma + pa + 1) : ma + pa;
return mrb_fixnum_value(arity);