Skip to content

Commit

Permalink
WS Cleanup Stage #5 - break long define
Browse files Browse the repository at this point in the history
For long define statements put the replacement part on their own line.
Also wrap comments on long lines.
  • Loading branch information
demerphq committed Nov 5, 2022
1 parent 980e8b9 commit 0abefab
Show file tree
Hide file tree
Showing 29 changed files with 426 additions and 209 deletions.
3 changes: 2 additions & 1 deletion XSUB.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ Rethrows a previously caught exception. See L<perlguts/"Exception Handling">.
HS_CXT, __FILE__, "v" PERL_API_VERSION_STRING, XS_VERSION)
#else
/* should this be a #error? if you want both checked, you better supply XS_VERSION right? */
# define XS_BOTHVERSION_SETXSUBFN_POPMARK_BOOTCHECK XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK
# define XS_BOTHVERSION_SETXSUBFN_POPMARK_BOOTCHECK \
XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK
#endif

/* For a normal bootstrap without API or XS version checking.
Expand Down
24 changes: 16 additions & 8 deletions cop.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ typedef struct rcpv RCPV;

#define RCPVf_USE_STRLEN 1
#define RCPVf_NO_COPY 2
#define RCPVx(pv_arg) ((RCPV *)((pv_arg) - STRUCT_OFFSET(struct rcpv, pv)))
#define RCPVx(pv_arg) \
((RCPV *)((pv_arg) - STRUCT_OFFSET(struct rcpv, pv)))
#define RCPV_REFCOUNT(pv) (RCPVx(pv)->refcount)
#define RCPV_LEN(pv) (RCPVx(pv)->len)

Expand All @@ -561,10 +562,12 @@ typedef struct rcpv RCPV;
(CopFILE(c) \
? gv_fetchfile(CopFILE(c)) : NULL)

# define CopFILE_set_x(c,pv) ((c)->cop_file = rcpv_new((pv),0,RCPVf_USE_STRLEN))
# define CopFILE_set_x(c,pv) \
((c)->cop_file = rcpv_new((pv),0,RCPVf_USE_STRLEN))
# define CopFILE_setn_x(c,pv,l) ((c)->cop_file = rcpv_new((pv),(l),0))
# define CopFILE_free_x(c) ((c)->cop_file = rcpv_free((c)->cop_file))
# define CopFILE_copy_x(dst,src) ((dst)->cop_file = rcpv_copy((src)->cop_file))
# define CopFILE_copy_x(dst,src) \
((dst)->cop_file = rcpv_copy((src)->cop_file))

/* change condition to 1 && to enable this debugging */
# define CopFILE_debug(c,t,rk) \
Expand Down Expand Up @@ -625,7 +628,8 @@ typedef struct rcpv RCPV;
# define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
# define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
# define CopFILE_copy(dst,src) CopFILEGV_set((dst),CopFILEGV(src))
# define CopFILE_setn(c,pv,l) CopFILEGV_set((c), gv_fetchfile_flags((pv),(l),0))
# define CopFILE_setn(c,pv,l) \
CopFILEGV_set((c), gv_fetchfile_flags((pv),(l),0))
# define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : NULL)
# define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : NULL)
# ifdef DEBUGGING
Expand All @@ -642,7 +646,8 @@ typedef struct rcpv RCPV;
? GvNAMELEN(CopFILEGV(c))-2 : 0)
# define CopSTASH(c) ((c)->cop_stash)
# define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
# define CopFILE_free(c) (SvREFCNT_dec(CopFILEGV(c)),(CopFILEGV(c) = NULL))
# define CopFILE_free(c) \
(SvREFCNT_dec(CopFILEGV(c)),(CopFILEGV(c) = NULL))

#endif /* USE_ITHREADS */

Expand All @@ -654,7 +659,8 @@ typedef struct rcpv RCPV;
#define CopHINTHASH_get(c) ((COPHH*)((c)->cop_hints_hash))
#define CopHINTHASH_set(c,h) ((c)->cop_hints_hash = (h))

#define CopFEATURES_setfrom(dst, src) ((dst)->cop_features = (src)->cop_features)
#define CopFEATURES_setfrom(dst, src) \
((dst)->cop_features = (src)->cop_features)

/*
=for apidoc Am|SV *|cop_hints_fetch_pv |const COP *cop|const char *key |U32 hash|U32 flags
Expand Down Expand Up @@ -775,7 +781,8 @@ by setting C<*flags> to 0 or C<SVf_UTF8>.

#define CopLABEL(c) Perl_cop_fetch_label(aTHX_ (c), NULL, NULL)
#define CopLABEL_len(c,len) Perl_cop_fetch_label(aTHX_ (c), len, NULL)
#define CopLABEL_len_flags(c,len,flags) Perl_cop_fetch_label(aTHX_ (c), len, flags)
#define CopLABEL_len_flags(c,len,flags) \
Perl_cop_fetch_label(aTHX_ (c), len, flags)
#define CopLABEL_alloc(pv) ((pv)?savepv(pv):NULL)

#define CopSTASH_ne(c,hv) (!CopSTASH_eq(c,hv))
Expand Down Expand Up @@ -933,7 +940,8 @@ struct block_loop {

#define CxLABEL(c) (CopLABEL((c)->blk_oldcop))
#define CxLABEL_len(c,len) (CopLABEL_len((c)->blk_oldcop, len))
#define CxLABEL_len_flags(c,len,flags) ((const char *)CopLABEL_len_flags((c)->blk_oldcop, len, flags))
#define CxLABEL_len_flags(c,len,flags) \
((const char *)CopLABEL_len_flags((c)->blk_oldcop, len, flags))
#define CxHASARGS(c) (((c)->cx_type & CXp_HASARGS) == CXp_HASARGS)

/* CxLVAL(): the lval flags of the call site: the relevant flag bits from
Expand Down
6 changes: 4 additions & 2 deletions cv.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ See L<perlguts/Autoloading with XSUBs>.
# define Nullcv Null(CV*)
#endif

#define CvSTASH(sv) (MUTABLE_HV(((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_stash))
#define CvSTASH(sv) \
(MUTABLE_HV(((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_stash))
#define CvSTASH_set(cv,st) Perl_cvstash_set(aTHX_ cv, st)
#define CvSTART(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_start_u.xcv_start
#define CvROOT(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_root_u.xcv_root
#define CvXSUB(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_root_u.xcv_xsub
#define CvXSUBANY(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_start_u.xcv_xsubany
#define CvXSUBANY(sv) \
((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_start_u.xcv_xsubany
#define CvGV(sv) Perl_CvGV(aTHX_ (CV *)(sv))
#define CvGV_set(cv,gv) Perl_cvgv_set(aTHX_ cv, gv)
#define CvHASGV(cv) cBOOL(SvANY(cv)->xcv_gv_u.xcv_gv)
Expand Down
3 changes: 2 additions & 1 deletion dosish.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#else
# define PERL_SYS_INIT_BODY(c,v) \
MALLOC_CHECK_TAINT2(*c,*v); PERLIO_INIT
# define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined, or somethin?" */
# define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined,
or somethin?" */
#endif

/* Generally add things last-in first-terminated. IO and memory terminations
Expand Down
24 changes: 16 additions & 8 deletions gv.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@ struct gp {
assert(SvTYPE(_gvname_hek) == SVt_PVGV || SvTYPE(_gvname_hek) >= SVt_PVLV); \
&(GvXPVGV(_gvname_hek)->xiv_u.xivu_namehek); \
}))
# define GvNAME_get(gv) ({ assert(GvNAME_HEK(gv)); (char *)HEK_KEY(GvNAME_HEK(gv)); })
# define GvNAMELEN_get(gv) ({ assert(GvNAME_HEK(gv)); HEK_LEN(GvNAME_HEK(gv)); })
# define GvNAMEUTF8(gv) ({ assert(GvNAME_HEK(gv)); HEK_UTF8(GvNAME_HEK(gv)); })
# define GvNAME_get(gv) \
({ assert(GvNAME_HEK(gv)); (char *)HEK_KEY(GvNAME_HEK(gv)); })
# define GvNAMELEN_get(gv) \
({ assert(GvNAME_HEK(gv)); HEK_LEN(GvNAME_HEK(gv)); })
# define GvNAMEUTF8(gv) \
({ assert(GvNAME_HEK(gv)); HEK_UTF8(GvNAME_HEK(gv)); })
#else
# define GvGP(gv) (0+(gv)->sv_u.svu_gp)
# define GvGP_set(gv,gp) ((gv)->sv_u.svu_gp = (gp))
Expand Down Expand Up @@ -228,9 +231,11 @@ Return the CV from the GV.
time, so don't try to free what's there. */
#define GV_ADDMULTI 0x02 /* add, pretending it has been added
already; used also by gv_init_* */
#define GV_ADDWARN 0x04 /* add, but warn if symbol wasn't already there */
#define GV_ADDWARN 0x04 /* add, but warn if symbol wasn't
already there */
/* 0x08 UNUSED */
#define GV_NOINIT 0x10 /* add, but don't init symbol, if type != PVGV */
#define GV_NOINIT 0x10 /* add, but don't init symbol,
if type != PVGV */
/* This is used by toke.c to avoid turing placeholder constants in the symbol
table into full PVGVs with attached constant subroutines. */
#define GV_NOADD_NOINIT 0x20 /* Don't add the symbol if it's not there.
Expand Down Expand Up @@ -273,9 +278,12 @@ Return the CV from the GV.
#define gv_fetchsv_nomg(n,f,t) gv_fetchsv(n,(f)|GV_NO_SVGMAGIC,t)
#define gv_init(gv,stash,name,len,multi) \
gv_init_pvn(gv,stash,name,len,GV_ADDMULTI*cBOOL(multi))
#define gv_fetchmeth(stash,name,len,level) gv_fetchmeth_pvn(stash, name, len, level, 0)
#define gv_fetchmeth_autoload(stash,name,len,level) gv_fetchmeth_pvn_autoload(stash, name, len, level, 0)
#define gv_fetchmethod_flags(stash,name,flags) gv_fetchmethod_pv_flags(stash, name, flags)
#define gv_fetchmeth(stash,name,len,level) \
gv_fetchmeth_pvn(stash, name, len, level, 0)
#define gv_fetchmeth_autoload(stash,name,len,level) \
gv_fetchmeth_pvn_autoload(stash, name, len, level, 0)
#define gv_fetchmethod_flags(stash,name,flags) \
gv_fetchmethod_pv_flags(stash, name, flags)

/*
=for apidoc gv_autoload4
Expand Down
68 changes: 45 additions & 23 deletions handy.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ required, but is kept for backwards compatibility.
* XXX Should really be a Configure probe, with HAS__FUNCTION__
* and FUNCTION__ as results.
* XXX Similarly, a Configure probe for __FILE__ and __LINE__ is needed. */
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__SUNPRO_C)) /* C99 or close enough. */
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) ||\
(defined(__SUNPRO_C)) /* C99 or close enough. */
# define FUNCTION__ __func__
# define SAFE_FUNCTION__ __func__
#elif (defined(__DECC_VER)) /* Tru64 or VMS, and strict C89 being used, but not modern enough cc (in Tru64, -c99 not known, only -std1). */
Expand Down Expand Up @@ -485,7 +486,8 @@ Perl_xxx(aTHX_ ...) form for any API calls where it's used.
Perl_sv_catxmlpvn(aTHX_ dsv, STR_WITH_LEN(str), utf8)


#define lex_stuff_pvs(pv,flags) Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)
#define lex_stuff_pvs(pv,flags) \
Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)

#define get_cvs(str, flags) \
Perl_get_cvn_flags(aTHX_ STR_WITH_LEN(str), (flags))
Expand Down Expand Up @@ -712,7 +714,8 @@ based on the underlying C library functions):
#define strnNE(s1,s2,l) (strncmp(s1,s2,l) != 0)
#define strnEQ(s1,s2,l) (strncmp(s1,s2,l) == 0)

#define memEQ(s1,s2,l) (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
#define memEQ(s1,s2,l) \
(memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
#define memNE(s1,s2,l) (! memEQ(s1,s2,l))

/* memEQ and memNE where second comparand is a string constant */
Expand Down Expand Up @@ -744,7 +747,8 @@ based on the underlying C library functions):
#define memGT(s1,s2,l) (memcmp(s1,s2,l) > 0)
#define memGE(s1,s2,l) (memcmp(s1,s2,l) >= 0)

#define memCHRs(s1,c) ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))
#define memCHRs(s1,c) \
((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))

/*
* Character classes.
Expand Down Expand Up @@ -1666,7 +1670,8 @@ END_EXTERN_C
# define isPUNCT_A(c) generic_isCC_A_(c, CC_PUNCT_)
# define isSPACE_A(c) generic_isCC_A_(c, CC_SPACE_)
# define isWORDCHAR_A(c) generic_isCC_A_(c, CC_WORDCHAR_)
# define isXDIGIT_A(c) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII xdigits */
# define isXDIGIT_A(c) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII
xdigits */
# define isIDFIRST_A(c) generic_isCC_A_(c, CC_IDFIRST_)
# define isALPHA_L1(c) generic_isCC_(c, CC_ALPHA_)
# define isALPHANUMERIC_L1(c) generic_isCC_(c, CC_ALPHANUMERIC_)
Expand Down Expand Up @@ -2204,11 +2209,13 @@ END_EXTERN_C
#define isPRINT_uvchr(c) generic_invlist_uvchr_(CC_PRINT_, c)

#define isPUNCT_uvchr(c) generic_invlist_uvchr_(CC_PUNCT_, c)
#define isSPACE_uvchr(c) generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
#define isSPACE_uvchr(c) \
generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
#define isPSXSPC_uvchr(c) isSPACE_uvchr(c)

#define isUPPER_uvchr(c) generic_invlist_uvchr_(CC_UPPER_, c)
#define isVERTWS_uvchr(c) generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
#define isVERTWS_uvchr(c) \
generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
#define isWORDCHAR_uvchr(c) generic_invlist_uvchr_(CC_WORDCHAR_, c)
#define isXDIGIT_uvchr(c) generic_uvchr_(CC_XDIGIT_, is_XDIGIT_cp_high, c)

Expand Down Expand Up @@ -2749,7 +2756,8 @@ PoisonWith(0xEF) for catching access to freed memory.

#define MEM_SIZE_MAX ((MEM_SIZE)-1)

#define _PERL_STRLEN_ROUNDUP_UNCHECKED(n) (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))
#define _PERL_STRLEN_ROUNDUP_UNCHECKED(n) \
(((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))

#ifdef PERL_MALLOC_WRAP

Expand Down Expand Up @@ -2803,7 +2811,8 @@ PoisonWith(0xEF) for catching access to freed memory.

# define MEM_WRAP_CHECK_(n,t) MEM_WRAP_CHECK(n,t),

# define PERL_STRLEN_ROUNDUP(n) ((void)(((n) > MEM_SIZE_MAX - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (croak_memory_wrap(),0) : 0), _PERL_STRLEN_ROUNDUP_UNCHECKED(n))
# define PERL_STRLEN_ROUNDUP(n) \
((void)(((n) > MEM_SIZE_MAX - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (croak_memory_wrap(),0) : 0), _PERL_STRLEN_ROUNDUP_UNCHECKED(n))
#else

# define MEM_WRAP_CHECK(n,t)
Expand Down Expand Up @@ -2863,9 +2872,12 @@ enum mem_log_type {
#endif

#ifdef PERL_MEM_LOG
#define MEM_LOG_ALLOC(n,t,a) Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
#define MEM_LOG_REALLOC(n,t,v,a) Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
#define MEM_LOG_FREE(a) Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
#define MEM_LOG_ALLOC(n,t,a) \
Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
#define MEM_LOG_REALLOC(n,t,v,a) \
Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
#define MEM_LOG_FREE(a) \
Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
#endif

#ifndef MEM_LOG_ALLOC
Expand All @@ -2878,9 +2890,12 @@ enum mem_log_type {
#define MEM_LOG_FREE(a) (a)
#endif

#define Newx(v,n,t) (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
#define Newxc(v,n,t,c) (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
#define Newxz(v,n,t) (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))
#define Newx(v,n,t) \
(v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
#define Newxc(v,n,t,c) \
(v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
#define Newxz(v,n,t) \
(v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))

#ifndef PERL_CORE
/* pre 5.9.x compatibility */
Expand All @@ -2907,16 +2922,23 @@ enum mem_log_type {
#define perl_assert_ptr(p) assert( ((void*)(p)) != 0 )


#define Move(s,d,n,t) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define Copy(s,d,n,t) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define Zero(d,n,t) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))
#define Move(s,d,n,t) \
(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define Copy(s,d,n,t) \
(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define Zero(d,n,t) \
(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))

/* Like above, but returns a pointer to 'd' */
#define MoveD(s,d,n,t) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define CopyD(s,d,n,t) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define ZeroD(d,n,t) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))

#define PoisonWith(d,n,t,b) (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
#define MoveD(s,d,n,t) \
(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define CopyD(s,d,n,t) \
(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
#define ZeroD(d,n,t) \
(MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))

#define PoisonWith(d,n,t,b) \
(MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
#define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
#define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
#define Poison(d,n,t) PoisonFree(d,n,t)
Expand Down
15 changes: 10 additions & 5 deletions hv.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
# define USE_PERL_PERTURB_KEYS 1
# define PL_HASH_RAND_BITS_ENABLED PL_hash_rand_bits_enabled
# endif
# define PERL_HASH_ITER_BUCKET(iter) (((iter)->xhv_riter) ^ ((iter)->xhv_rand))
# define PERL_HASH_ITER_BUCKET(iter) \
(((iter)->xhv_riter) ^ ((iter)->xhv_rand))
#endif

#ifdef PERL_USE_UNSHARED_KEYS_IN_LARGE_HASHES
#define LARGE_HASH_HEURISTIC(hv,new_max) S_large_hash_heuristic(aTHX_ (hv), (new_max))
#define LARGE_HASH_HEURISTIC(hv,new_max) \
S_large_hash_heuristic(aTHX_ (hv), (new_max))
#else
#define LARGE_HASH_HEURISTIC(hv,new_max) 0
#endif
Expand Down Expand Up @@ -366,8 +368,10 @@ whether it is valid to call C<HvAUX()>.
#define HvUSEDKEYS(hv) (HvTOTALKEYS(hv) - HvPLACEHOLDERS_get(hv))
#define HvTOTALKEYS(hv) (((XPVHV*) SvANY(hv))->xhv_keys)
#define HvPLACEHOLDERS(hv) (*Perl_hv_placeholders_p(aTHX_ MUTABLE_HV(hv)))
#define HvPLACEHOLDERS_get(hv) (SvMAGIC(hv) ? Perl_hv_placeholders_get(aTHX_ (const HV *)hv) : 0)
#define HvPLACEHOLDERS_set(hv,p) Perl_hv_placeholders_set(aTHX_ MUTABLE_HV(hv), p)
#define HvPLACEHOLDERS_get(hv) \
(SvMAGIC(hv) ? Perl_hv_placeholders_get(aTHX_ (const HV *)hv) : 0)
#define HvPLACEHOLDERS_set(hv,p) \
Perl_hv_placeholders_set(aTHX_ MUTABLE_HV(hv), p)

/* This (now) flags whether *new* keys in the hash will be allocated from the
* shared string table. We have a heuristic to call HvSHAREKEYS_off() if a hash
Expand Down Expand Up @@ -481,7 +485,8 @@ whether it is valid to call C<HvAUX()>.
#define HV_ITERNEXT_WANTPLACEHOLDERS 0x01 /* Don't skip placeholders. */

#define hv_iternext(hv) hv_iternext_flags(hv, 0)
#define hv_magic(hv, gv, how) sv_magic(MUTABLE_SV(hv), MUTABLE_SV(gv), how, NULL, 0)
#define hv_magic(hv, gv, how) \
sv_magic(MUTABLE_SV(hv), MUTABLE_SV(gv), how, NULL, 0)
#define hv_undef(hv) Perl_hv_undef_flags(aTHX_ hv, 0)

#define Perl_sharepvn(pv, len, hash) HEK_KEY(share_hek(pv, len, hash))
Expand Down
Loading

0 comments on commit 0abefab

Please sign in to comment.