Skip to content

Commit 7a4bd46

Browse files
committed
WS Cleanup Stage #3 - break multiline define
1 parent 329ee83 commit 7a4bd46

27 files changed

+828
-567
lines changed

XSUB.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ is a lexical C<$_> in scope.
186186
I32 ax = XS_SETXSUBFN_POPMARK; \
187187
SV **mark = PL_stack_base + ax - 1; dSP; dITEMS
188188

189-
#define dXSTARG SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG) \
190-
? PAD_SV(PL_op->op_targ) : sv_newmortal())
189+
#define dXSTARG \
190+
SV * const targ = ((PL_op->op_private & OPpENTERSUB_HASTARG)\
191+
? PAD_SV(PL_op->op_targ) : sv_newmortal())
191192

192193
/* Should be used before final PUSHi etc. if not in PPCODE section. */
193194
#define XSprePUSH (sp = PL_stack_base + ax - 1)

av.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ If all you need is to look up an array element, then prefer C<av_fetch>.
9393

9494
#define AvREALISH(av) (SvFLAGS(av) & (SVpav_REAL|SVpav_REIFY))
9595

96-
#define AvFILL(av) ((SvRMAGICAL((const SV *) (av))) \
97-
? mg_size(MUTABLE_SV(av)) : AvFILLp(av))
96+
#define AvFILL(av) \
97+
((SvRMAGICAL((const SV *) (av)))\
98+
? mg_size(MUTABLE_SV(av)) : AvFILLp(av))
9899
#define av_top_index(av) AvFILL(av)
99100
#define av_tindex(av) av_top_index(av)
100101

cop.h

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,9 @@ typedef struct rcpv RCPV;
563563

564564
# define CopFILE(c) ((c)->cop_file)
565565
# define CopFILE_LEN(c) (CopFILE(c) ? RCPV_LEN(CopFILE(c)) : 0)
566-
# define CopFILEGV(c) (CopFILE(c) \
567-
? gv_fetchfile(CopFILE(c)) : NULL)
566+
# define CopFILEGV(c) \
567+
(CopFILE(c)\
568+
? gv_fetchfile(CopFILE(c)) : NULL)
568569

569570
# define CopFILE_set_x(c,pv) ((c)->cop_file = rcpv_new((pv),0,RCPVf_USE_STRLEN))
570571
# define CopFILE_setn_x(c,pv,l) ((c)->cop_file = rcpv_new((pv),(l),0))
@@ -608,17 +609,21 @@ typedef struct rcpv RCPV;
608609
} STMT_END
609610

610611

611-
# define CopFILESV(c) (CopFILE(c) \
612-
? GvSV(gv_fetchfile(CopFILE(c))) : NULL)
613-
# define CopFILEAV(c) (CopFILE(c) \
614-
? GvAV(gv_fetchfile(CopFILE(c))) : NULL)
615-
# define CopFILEAVx(c) (assert_(CopFILE(c)) \
616-
GvAV(gv_fetchfile(CopFILE(c))))
612+
# define CopFILESV(c) \
613+
(CopFILE(c)\
614+
? GvSV(gv_fetchfile(CopFILE(c))) : NULL)
615+
# define CopFILEAV(c) \
616+
(CopFILE(c)\
617+
? GvAV(gv_fetchfile(CopFILE(c))) : NULL)
618+
# define CopFILEAVx(c) \
619+
(assert_(CopFILE(c))\
620+
GvAV(gv_fetchfile(CopFILE(c))))
617621
# define CopFILEAVn(c) (cop_file_avn(c))
618622
# define CopSTASH(c) PL_stashpad[(c)->cop_stashoff]
619-
# define CopSTASH_set(c,hv) ((c)->cop_stashoff = (hv) \
620-
? alloccopstash(hv) \
621-
: 0)
623+
# define CopSTASH_set(c,hv) \
624+
((c)->cop_stashoff = (hv)\
625+
? alloccopstash(hv) \
626+
: 0)
622627

623628
#else /* Above: yes threads; Below no threads */
624629

@@ -635,10 +640,12 @@ typedef struct rcpv RCPV;
635640
# define CopFILEAVx(c) (GvAV(CopFILEGV(c)))
636641
# endif
637642
# define CopFILEAVn(c) (CopFILEGV(c) ? GvAVn(CopFILEGV(c)) : NULL)
638-
# define CopFILE(c) (CopFILEGV(c) /* +2 for '_<' */ \
639-
? GvNAME(CopFILEGV(c))+2 : NULL)
640-
# define CopFILE_LEN(c) (CopFILEGV(c) /* -2 for '_<' */ \
641-
? GvNAMELEN(CopFILEGV(c))-2 : 0)
643+
# define CopFILE(c) \
644+
(CopFILEGV(c) /* +2 for '_<' */\
645+
? GvNAME(CopFILEGV(c))+2 : NULL)
646+
# define CopFILE_LEN(c) \
647+
(CopFILEGV(c) /* -2 for '_<' */\
648+
? GvNAMELEN(CopFILEGV(c))-2 : 0)
642649
# define CopSTASH(c) ((c)->cop_stash)
643650
# define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
644651
# define CopFILE_free(c) (SvREFCNT_dec(CopFILEGV(c)),(CopFILEGV(c) = NULL))
@@ -787,9 +794,10 @@ by setting C<*flags> to 0 or C<SVf_UTF8>.
787794
#define OutCopFILE(c) CopFILE(c)
788795

789796
#define CopHINTS_get(c) ((c)->cop_hints + 0)
790-
#define CopHINTS_set(c, h) STMT_START { \
791-
(c)->cop_hints = (h); \
792-
} STMT_END
797+
#define CopHINTS_set(c, h) \
798+
STMT_START {\
799+
(c)->cop_hints = (h); \
800+
} STMT_END
793801

794802
/*
795803
* Here we have some enormously heavy (or at least ponderous) wizardry.
@@ -1042,7 +1050,8 @@ struct subst {
10421050
#define sb_rxres cx_u.cx_subst.sbu_rxres
10431051
#define sb_rx cx_u.cx_subst.sbu_rx
10441052

1045-
# define CX_PUSHSUBST(cx) CXINC, cx = CX_CUR(), \
1053+
# define CX_PUSHSUBST(cx) \
1054+
CXINC, cx = CX_CUR(),\
10461055
cx->blk_oldsaveix = oldsave, \
10471056
cx->sb_iters = iters, \
10481057
cx->sb_maxiters = maxiters, \
@@ -1137,17 +1146,22 @@ struct context {
11371146
#define CXp_ONCE 0x10 /* What was sbu_once in struct subst */
11381147

11391148
#define CxTYPE(c) ((c)->cx_type & CXTYPEMASK)
1140-
#define CxTYPE_is_LOOP(c) ( CxTYPE(cx) >= CXt_LOOP_ARY \
1141-
&& CxTYPE(cx) <= CXt_LOOP_PLAIN)
1149+
#define CxTYPE_is_LOOP(c) \
1150+
( CxTYPE(cx) >= CXt_LOOP_ARY\
1151+
&& CxTYPE(cx) <= CXt_LOOP_PLAIN)
11421152
#define CxMULTICALL(c) ((c)->cx_type & CXp_MULTICALL)
1143-
#define CxREALEVAL(c) (((c)->cx_type & (CXTYPEMASK|CXp_REAL)) \
1144-
== (CXt_EVAL|CXp_REAL))
1145-
#define CxEVALBLOCK(c) (((c)->cx_type & (CXTYPEMASK|CXp_EVALBLOCK)) \
1146-
== (CXt_EVAL|CXp_EVALBLOCK))
1147-
#define CxTRY(c) (((c)->cx_type & (CXTYPEMASK|CXp_TRY)) \
1148-
== (CXt_EVAL|CXp_TRY))
1149-
#define CxFOREACH(c) ( CxTYPE(cx) >= CXt_LOOP_ARY \
1150-
&& CxTYPE(cx) <= CXt_LOOP_LIST)
1153+
#define CxREALEVAL(c) \
1154+
(((c)->cx_type & (CXTYPEMASK|CXp_REAL))\
1155+
== (CXt_EVAL|CXp_REAL))
1156+
#define CxEVALBLOCK(c) \
1157+
(((c)->cx_type & (CXTYPEMASK|CXp_EVALBLOCK))\
1158+
== (CXt_EVAL|CXp_EVALBLOCK))
1159+
#define CxTRY(c) \
1160+
(((c)->cx_type & (CXTYPEMASK|CXp_TRY))\
1161+
== (CXt_EVAL|CXp_TRY))
1162+
#define CxFOREACH(c) \
1163+
( CxTYPE(cx) >= CXt_LOOP_ARY\
1164+
&& CxTYPE(cx) <= CXt_LOOP_LIST)
11511165

11521166
/* private flags for CXt_DEFER */
11531167
#define CXp_FINALLY 0x20 /* `finally` block; semantically identical

cv.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,17 @@ See L<perlguts/Autoloading with XSUBs>.
6262
#define CvDEPTHunsafe(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_depth
6363

6464
/* these CvPADLIST/CvRESERVED asserts can be reverted one day, once stabilized */
65-
#define CvPADLIST(sv) (*(assert_(!CvISXSUB((CV*)(sv))) \
65+
#define CvPADLIST(sv) \
66+
(*(assert_(!CvISXSUB((CV*)(sv)))\
6667
&(((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_padlist_u.xcv_padlist)))
6768
/* CvPADLIST_set is not public API, it can be removed one day, once stabilized */
6869
#ifdef DEBUGGING
6970
# define CvPADLIST_set(sv, padlist) Perl_set_padlist((CV*)sv, padlist)
7071
#else
7172
# define CvPADLIST_set(sv, padlist) (CvPADLIST(sv) = (padlist))
7273
#endif
73-
#define CvHSCXT(sv) *(assert_(CvISXSUB((CV*)(sv))) \
74+
#define CvHSCXT(sv) \
75+
*(assert_(CvISXSUB((CV*)(sv)))\
7476
&(((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_padlist_u.xcv_hscxt))
7577
#ifdef DEBUGGING
7678
# if PTRSIZE == 8
@@ -286,15 +288,17 @@ CvNAME_HEK(CV *sv)
286288
/* helper for the common pattern:
287289
CvNAMED(sv) ? CvNAME_HEK((CV *)sv) : GvNAME_HEK(CvGV(sv))
288290
*/
289-
#define CvGvNAME_HEK(sv) ( \
291+
#define CvGvNAME_HEK(sv) \
292+
(\
290293
CvNAMED((CV*)sv) ? \
291294
((XPVCV*)MUTABLE_PTR(SvANY((SV*)sv)))->xcv_gv_u.xcv_hek\
292295
: GvNAME_HEK(CvGV( (SV*) sv)) \
293296
)
294297

295298
/* This lowers the reference count of the previous value, but does *not*
296299
increment the reference count of the new value. */
297-
#define CvNAME_HEK_set(cv, hek) ( \
300+
#define CvNAME_HEK_set(cv, hek) \
301+
(\
298302
CvNAME_HEK((CV *)(cv)) \
299303
? unshare_hek(SvANY((CV *)(cv))->xcv_gv_u.xcv_hek) \
300304
: (void)0, \

gv.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ Return the CV from the GV.
100100

101101
#define GvSV(gv) (GvGP(gv)->gp_sv)
102102
#ifdef PERL_DONT_CREATE_GVSV
103-
#define GvSVn(gv) (*(GvGP(gv)->gp_sv ? \
104-
&(GvGP(gv)->gp_sv) : \
105-
&(GvGP(gv_SVadd(gv))->gp_sv)))
103+
#define GvSVn(gv) \
104+
(*(GvGP(gv)->gp_sv ?\
105+
&(GvGP(gv)->gp_sv) : \
106+
&(GvGP(gv_SVadd(gv))->gp_sv)))
106107
#else
107108
#define GvSVn(gv) GvSV(gv)
108109
#endif
@@ -125,14 +126,16 @@ Return the CV from the GV.
125126
#define GvFORM(gv) (GvGP(gv)->gp_form)
126127
#define GvAV(gv) (GvGP(gv)->gp_av)
127128

128-
#define GvAVn(gv) (GvGP(gv)->gp_av ? \
129-
GvGP(gv)->gp_av : \
130-
GvGP(gv_AVadd(gv))->gp_av)
129+
#define GvAVn(gv) \
130+
(GvGP(gv)->gp_av ?\
131+
GvGP(gv)->gp_av : \
132+
GvGP(gv_AVadd(gv))->gp_av)
131133
#define GvHV(gv) ((GvGP(gv))->gp_hv)
132134

133-
#define GvHVn(gv) (GvGP(gv)->gp_hv ? \
134-
GvGP(gv)->gp_hv : \
135-
GvGP(gv_HVadd(gv))->gp_hv)
135+
#define GvHVn(gv) \
136+
(GvGP(gv)->gp_hv ?\
137+
GvGP(gv)->gp_hv : \
138+
GvGP(gv_HVadd(gv))->gp_hv)
136139

137140
#define GvCV(gv) ((CV*)GvGP(gv)->gp_cv)
138141
#define GvCV_set(gv,cv) (GvGP(gv)->gp_cv = (cv))

0 commit comments

Comments
 (0)