summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorBen Morrow <ben@morrow.me.uk>2010-10-10 23:10:15 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-10-10 17:25:15 -0700
commita88d97bfe873ee5c93f51531b75b464dbf1c0222 (patch)
treef548c8249e79540b83a8425f1907b4a6c22cb4f7 /op.h
parentd908838680ec40ea0e85f59ee66f5f56a225f9b4 (diff)
downloadperl-a88d97bfe873ee5c93f51531b75b464dbf1c0222.tar.gz
Remove some excess cleverness from the Bhk macros.
Allowing BhkENTRY(bhk, start) to look up the bhk_start member defeats much of the point of having a bhk_ prefix in the first place: if a member is added later called (say) 'bhk_die', any invocation of BhkENTRY(bhk, die) will expand to BhkENTRY(bhk, Perl_die) because of the API macros. Requiring BhkENTRY(bhk, bhk_start), while tedious, is much safer.
Diffstat (limited to 'op.h')
-rw-r--r--op.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/op.h b/op.h
index e03468fc4b..71bab3e3b3 100644
--- a/op.h
+++ b/op.h
@@ -696,13 +696,13 @@ preprocessing token; the type of I<arg> depends on I<which>.
#define BhkFLAGS(hk) ((hk)->bhk_flags)
-#define BHKf_start 0x01
-#define BHKf_pre_end 0x02
-#define BHKf_post_end 0x04
-#define BHKf_eval 0x08
+#define BHKf_bhk_start 0x01
+#define BHKf_bhk_pre_end 0x02
+#define BHKf_bhk_post_end 0x04
+#define BHKf_bhk_eval 0x08
#define BhkENTRY(hk, which) \
- ((BhkFLAGS(hk) & BHKf_ ## which) ? ((hk)->bhk_ ## which) : NULL)
+ ((BhkFLAGS(hk) & BHKf_ ## which) ? ((hk)->which) : NULL)
#define BhkENABLE(hk, which) \
STMT_START { \
@@ -717,7 +717,7 @@ preprocessing token; the type of I<arg> depends on I<which>.
#define BhkENTRY_set(hk, which, ptr) \
STMT_START { \
- (hk)->bhk_ ## which = ptr; \
+ (hk)->which = ptr; \
BhkENABLE(hk, which); \
} STMT_END