From c8e503bfe4136506c95da755e0400990f539bb6a Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 18 Jul 2009 19:32:50 +0100 Subject: [PATCH] Eliminate *_ALLOCATED_HEAD and *_HEAD macros which are now used only once. --- av.h | 15 +++------------ hv.h | 15 +++------------ perl.h | 1 - sv.h | 7 ++----- 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/av.h b/av.h index c8ff2a3..f8c9d1b 100644 --- a/av.h +++ b/av.h @@ -8,22 +8,13 @@ * */ -#define _XPVAV_ALLOCATED_HEAD \ - SSize_t xav_fill; /* Index of last element present */ \ - SSize_t xav_max /* max index for which array has space */ - -#define _XPVAV_HEAD \ - union _xnvu xnv_u; \ - _XPVAV_ALLOCATED_HEAD - struct xpvav { - _XPVAV_HEAD; + union _xnvu xnv_u; + SSize_t xav_fill; /* Index of last element present */ + SSize_t xav_max; /* max index for which array has space */ _XPVMG_HEAD; }; -#undef _XPVAV_ALLOCATED_HEAD -#undef _XPVAV_HEAD - /* SV** xav_alloc; */ #define xav_alloc xiv_u.xivu_p1 /* SV* xav_arylen; */ diff --git a/hv.h b/hv.h index 7a2e63f..3906496 100644 --- a/hv.h +++ b/hv.h @@ -80,26 +80,17 @@ struct xpvhv_aux { struct mro_meta *xhv_mro_meta; }; -#define _XPVHV_ALLOCATED_HEAD \ - STRLEN xhv_fill; /* how full xhv_array currently is */ \ - STRLEN xhv_max /* subscript of last element of xhv_array */ - -#define _XPVHV_HEAD \ - union _xnvu xnv_u; \ - _XPVHV_ALLOCATED_HEAD - /* hash structure: */ /* This structure must match the beginning of struct xpvmg in sv.h. */ struct xpvhv { - _XPVHV_HEAD; + union _xnvu xnv_u; + STRLEN xhv_fill; /* how full xhv_array currently is */ + STRLEN xhv_max; /* subscript of last element of xhv_array */ _XPVMG_HEAD; }; #define xhv_keys xiv_u.xivu_iv -#undef _XPVHV_ALLOCATED_HEAD -#undef _XPVHV_HEAD - /* hash a key */ /* FYI: This is the "One-at-a-Time" algorithm by Bob Jenkins * from requirements by Colin Plumb. diff --git a/perl.h b/perl.h index 136bd53..41f4ab1 100644 --- a/perl.h +++ b/perl.h @@ -3407,7 +3407,6 @@ struct nexttoken { #include "utf8.h" /* defined in sv.c, but also used in [ach]v.c */ -#undef _XPV_ALLOCATED_HEAD #undef _XPV_HEAD #undef _XPVMG_HEAD #undef _XPVCV_COMMON diff --git a/sv.h b/sv.h index f8670c7..55674f6 100644 --- a/sv.h +++ b/sv.h @@ -398,13 +398,10 @@ perform the upgrade if necessary. See C. /* RV upwards. However, SVf_ROK and SVp_IOK are exclusive */ #define SVprv_WEAKREF 0x80000000 /* Weak reference */ -#define _XPV_ALLOCATED_HEAD \ - STRLEN xpv_cur; /* length of svu_pv as a C string */ \ - STRLEN xpv_len /* allocated size */ - #define _XPV_HEAD \ union _xnvu xnv_u; \ - _XPV_ALLOCATED_HEAD + STRLEN xpv_cur; /* length of svu_pv as a C string */ \ + STRLEN xpv_len /* allocated size */ union _xnvu { NV xnv_nv; /* numeric value, if any */ -- 2.7.4