Skip to content

Commit aa9490e

Browse files
committed
WS Cleanup Stage #8 - join short continuations
1 parent b164283 commit aa9490e

File tree

11 files changed

+58
-96
lines changed

11 files changed

+58
-96
lines changed

av.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ 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) \
97-
((SvRMAGICAL((const SV *) (av))) \
98-
? mg_size(MUTABLE_SV(av)) : AvFILLp(av))
96+
#define AvFILL(av) \
97+
((SvRMAGICAL((const SV *) (av))) ? mg_size(MUTABLE_SV(av)) : AvFILLp(av))
9998
#define av_top_index(av) AvFILL(av)
10099
#define av_tindex(av) av_top_index(av)
101100

cop.h

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -503,18 +503,15 @@ C string C<p>, creating the package if necessary.
503503

504504
# define CopFILE(c) ((c)->cop_file)
505505
# define CopFILEGV(c) \
506-
(CopFILE(c) \
507-
? gv_fetchfile(CopFILE(c)) : NULL)
506+
(CopFILE(c) ? gv_fetchfile(CopFILE(c)) : NULL)
508507

509508
# define CopFILE_set(c,pv) ((c)->cop_file = savesharedpv(pv))
510509
# define CopFILE_setn(c,pv,l) ((c)->cop_file = savesharedpvn((pv),(l)))
511510

512511
# define CopFILESV(c) \
513-
(CopFILE(c) \
514-
? GvSV(gv_fetchfile(CopFILE(c))) : NULL)
512+
(CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : NULL)
515513
# define CopFILEAV(c) \
516-
(CopFILE(c) \
517-
? GvAV(gv_fetchfile(CopFILE(c))) : NULL)
514+
(CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : NULL)
518515
# define CopFILEAVx(c) \
519516
(assert_(CopFILE(c)) \
520517
GvAV(gv_fetchfile(CopFILE(c))))
@@ -1042,22 +1039,17 @@ struct context {
10421039
#define CXp_ONCE 0x10 /* What was sbu_once in struct subst */
10431040

10441041
#define CxTYPE(c) ((c)->cx_type & CXTYPEMASK)
1045-
#define CxTYPE_is_LOOP(c) \
1046-
( CxTYPE(cx) >= CXt_LOOP_ARY \
1047-
&& CxTYPE(cx) <= CXt_LOOP_PLAIN)
1042+
#define CxTYPE_is_LOOP(c) \
1043+
( CxTYPE(cx) >= CXt_LOOP_ARY && CxTYPE(cx) <= CXt_LOOP_PLAIN)
10481044
#define CxMULTICALL(c) ((c)->cx_type & CXp_MULTICALL)
1049-
#define CxREALEVAL(c) \
1050-
(((c)->cx_type & (CXTYPEMASK|CXp_REAL)) \
1051-
== (CXt_EVAL|CXp_REAL))
1052-
#define CxEVALBLOCK(c) \
1053-
(((c)->cx_type & (CXTYPEMASK|CXp_EVALBLOCK)) \
1054-
== (CXt_EVAL|CXp_EVALBLOCK))
1055-
#define CxTRY(c) \
1056-
(((c)->cx_type & (CXTYPEMASK|CXp_TRY)) \
1057-
== (CXt_EVAL|CXp_TRY))
1058-
#define CxFOREACH(c) \
1059-
( CxTYPE(cx) >= CXt_LOOP_ARY \
1060-
&& CxTYPE(cx) <= CXt_LOOP_LIST)
1045+
#define CxREALEVAL(c) \
1046+
(((c)->cx_type & (CXTYPEMASK|CXp_REAL)) == (CXt_EVAL|CXp_REAL))
1047+
#define CxEVALBLOCK(c) \
1048+
(((c)->cx_type & (CXTYPEMASK|CXp_EVALBLOCK)) == (CXt_EVAL|CXp_EVALBLOCK))
1049+
#define CxTRY(c) \
1050+
(((c)->cx_type & (CXTYPEMASK|CXp_TRY)) == (CXt_EVAL|CXp_TRY))
1051+
#define CxFOREACH(c) \
1052+
( CxTYPE(cx) >= CXt_LOOP_ARY && CxTYPE(cx) <= CXt_LOOP_LIST)
10611053

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

handy.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,8 +1403,7 @@ or casts
14031403
/* The '| 0' part in ASSERT_NOT_PTR ensures a compiler error
14041404
* if c is not integer (like e.g., a pointer) */
14051405
# define FITS_IN_8_BITS(c) \
1406-
( (sizeof(c) == 1) \
1407-
|| (((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) >> 8) == 0)
1406+
( (sizeof(c) == 1) || (((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) >> 8) == 0)
14081407
#else
14091408
# define FITS_IN_8_BITS(c) (1)
14101409
#endif
@@ -2730,9 +2729,8 @@ PoisonWith(0xEF) for catching access to freed memory.
27302729
((_MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) ? (MEM_SIZE)(n) : \
27312730
MEM_SIZE_MAX/sizeof(t)) > MEM_SIZE_MAX/sizeof(t))
27322731

2733-
# define MEM_WRAP_CHECK(n,t) \
2734-
(void)(UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t)) \
2735-
&& (croak_memory_wrap(),0))
2732+
# define MEM_WRAP_CHECK(n,t) \
2733+
(void)(UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t)) && (croak_memory_wrap(),0))
27362734

27372735
# define MEM_WRAP_CHECK_1(n,t,a) \
27382736
(void)(UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t)) \

hv_macro.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@
3535
#define U8TO32_LE(ptr) (*((const U32*)(ptr)))
3636
#define U8TO64_LE(ptr) (*((const U64*)(ptr)))
3737
#else
38-
#define U8TO16_LE(ptr) \
39-
(_shifted_octet(U16,(ptr),0, 0)| \
40-
_shifted_octet(U16,(ptr),1, 8))
38+
#define U8TO16_LE(ptr) \
39+
(_shifted_octet(U16,(ptr),0, 0)| _shifted_octet(U16,(ptr),1, 8))
4140

4241
#define U8TO32_LE(ptr) \
4342
(_shifted_octet(U32,(ptr),0, 0)| \

op.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,12 +525,10 @@ typedef enum {
525525
# define IS_PADCONST(v) \
526526
(v && (SvREADONLY(v) || (SvIsCOW(v) && !SvLEN(v))))
527527
# endif
528-
# define cSVOPx_sv(v) \
529-
(cSVOPx(v)->op_sv \
530-
? cSVOPx(v)->op_sv : PAD_SVl((v)->op_targ))
531-
# define cSVOPx_svp(v) \
532-
(cSVOPx(v)->op_sv \
533-
? &cSVOPx(v)->op_sv : &PAD_SVl((v)->op_targ))
528+
# define cSVOPx_sv(v) \
529+
(cSVOPx(v)->op_sv ? cSVOPx(v)->op_sv : PAD_SVl((v)->op_targ))
530+
# define cSVOPx_svp(v) \
531+
(cSVOPx(v)->op_sv ? &cSVOPx(v)->op_sv : &PAD_SVl((v)->op_targ))
534532
# define cMETHOPx_meth(v) \
535533
(cMETHOPx(v)->op_u.op_meth_sv \
536534
? cMETHOPx(v)->op_u.op_meth_sv : PAD_SVl((v)->op_targ))

op_reg_common.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ get_regex_charset(const U32 flags)
113113
| RXf_PMf_STRICT )
114114

115115
#define RXf_PMf_FLAGCOPYMASK \
116-
( RXf_PMf_COMPILETIME \
117-
| RXf_PMf_SPLIT )
116+
( RXf_PMf_COMPILETIME | RXf_PMf_SPLIT )
118117

119118
/* Temporary to get Jenkins happy again See thread starting at
120119
* http://nntp.perl.org/group/perl.perl5.porters/220710

perl.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,8 @@ Now a synonym for C<L</dTHXa>>.
288288
# define CALLREGDUPE(prog,param) \
289289
Perl_re_dup(aTHX_ (prog),(param))
290290

291-
# define CALLREGDUPE_PVT(prog,param) \
292-
(prog ? RX_ENGINE(prog)->dupe(aTHX_ (prog),(param)) \
293-
: (REGEXP *)NULL)
291+
# define CALLREGDUPE_PVT(prog,param) \
292+
(prog ? RX_ENGINE(prog)->dupe(aTHX_ (prog),(param)) : (REGEXP *)NULL)
294293
#endif
295294

296295
/* some compilers impersonate gcc */
@@ -6849,8 +6848,7 @@ typedef struct am_table_short AMTS;
68496848
/* Returns TRUE if the plain locale pragma
68506849
* without a parameter is in effect. */
68516850
# define IN_LOCALE_RUNTIME \
6852-
(PL_curcop \
6853-
&& CopHINTS_get(PL_curcop) & HINT_LOCALE)
6851+
(PL_curcop && CopHINTS_get(PL_curcop) & HINT_LOCALE)
68546852

68556853
/* Returns TRUE if either form of the locale pragma is in effect */
68566854
# define IN_SOME_LOCALE_FORM_RUNTIME \
@@ -8121,8 +8119,7 @@ extern void moncontrol(int);
81218119
PERL_UNICODE_STDERR_FLAG)
81228120

81238121
#define PERL_UNICODE_INOUT_FLAG \
8124-
(PERL_UNICODE_IN_FLAG | \
8125-
PERL_UNICODE_OUT_FLAG)
8122+
(PERL_UNICODE_IN_FLAG | PERL_UNICODE_OUT_FLAG)
81268123

81278124
#define PERL_UNICODE_DEFAULT_FLAGS \
81288125
(PERL_UNICODE_STD_FLAG | \

regcomp.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,12 +405,10 @@ struct regnode_ssc {
405405
(((struct regnode_lstring *)p)->string))
406406
#define OPERANDl(p) STRINGl(p)
407407

408-
#define STR_LEN(p) \
409-
((OP(p) == LEXACT || OP(p) == LEXACT_REQ8) \
410-
? STR_LENl(p) : STR_LENs(p))
411-
#define STRING(p) \
412-
((OP(p) == LEXACT || OP(p) == LEXACT_REQ8) \
413-
? STRINGl(p) : STRINGs(p))
408+
#define STR_LEN(p) \
409+
((OP(p) == LEXACT || OP(p) == LEXACT_REQ8) ? STR_LENl(p) : STR_LENs(p))
410+
#define STRING(p) \
411+
((OP(p) == LEXACT || OP(p) == LEXACT_REQ8) ? STRINGl(p) : STRINGs(p))
414412
#define OPERAND(p) STRING(p)
415413

416414
/* The number of (smallest) regnode equivalents that a string of length l bytes

regexp.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,17 +533,14 @@ SvRX instead and check for NULL.
533533

534534
/* For source compatibility. We used to store these explicitly. */
535535
# define RX_PRECOMP(rx_sv) \
536-
(RX_WRAPPED(rx_sv) \
537-
+ ReANY(rx_sv)->pre_prefix)
536+
(RX_WRAPPED(rx_sv) + ReANY(rx_sv)->pre_prefix)
538537
# define RX_PRECOMP_const(rx_sv) \
539-
(RX_WRAPPED_const(rx_sv) \
540-
+ ReANY(rx_sv)->pre_prefix)
538+
(RX_WRAPPED_const(rx_sv) + ReANY(rx_sv)->pre_prefix)
541539
/* FIXME? Are we hardcoding too much here and constraining plugin extension
542540
writers? Specifically, the value 1 assumes that the wrapped version always
543541
has exactly one character at the end, a ')'. Will that always be true? */
544542
# define RX_PRELEN(rx_sv) \
545-
(RX_WRAPLEN(rx_sv) \
546-
- ReANY(rx_sv)->pre_prefix - 1)
543+
(RX_WRAPLEN(rx_sv) - ReANY(rx_sv)->pre_prefix - 1)
547544

548545
# define RX_WRAPPED(rx_sv) SvPVX(rx_sv)
549546
# define RX_WRAPPED_const(rx_sv) SvPVX_const(rx_sv)

sv.h

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,11 @@ the upgrade if necessary. See C<L</svtype>>.
431431

432432

433433

434-
#define SVf_THINKFIRST \
435-
(SVf_READONLY|SVf_PROTECT|SVf_ROK|SVf_FAKE \
436-
|SVs_RMG|SVf_IsCOW)
434+
#define SVf_THINKFIRST \
435+
(SVf_READONLY|SVf_PROTECT|SVf_ROK|SVf_FAKE |SVs_RMG|SVf_IsCOW)
437436

438-
#define SVf_OK \
439-
(SVf_IOK|SVf_NOK|SVf_POK|SVf_ROK| \
440-
SVp_IOK|SVp_NOK|SVp_POK|SVpgv_GP)
437+
#define SVf_OK \
438+
(SVf_IOK|SVf_NOK|SVf_POK|SVf_ROK| SVp_IOK|SVp_NOK|SVp_POK|SVpgv_GP)
441439

442440
#define PRIVSHIFT 4 /* (SVp_?OK >> PRIVSHIFT) == SVf_?OK */
443441

@@ -922,9 +920,8 @@ Set the size of the string buffer for the SV. See C<L</SvLEN>>.
922920

923921
#define SvNIOK(sv) (SvFLAGS(sv) & (SVf_IOK|SVf_NOK))
924922
#define SvNIOKp(sv) (SvFLAGS(sv) & (SVp_IOK|SVp_NOK))
925-
#define SvNIOK_off(sv) \
926-
(SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK| \
927-
SVp_IOK|SVp_NOK|SVf_IVisUV))
923+
#define SvNIOK_off(sv) \
924+
(SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK| SVp_IOK|SVp_NOK|SVf_IVisUV))
928925

929926
#define assert_not_ROK(sv) assert_(!SvROK(sv) || !SvRV(sv))
930927
#define assert_not_glob(sv) assert_(!isGV_with_GP(sv))
@@ -959,19 +956,16 @@ Set the size of the string buffer for the SV. See C<L</SvLEN>>.
959956
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
960957
#define SvIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVp_IOK|SVf_IVisUV))
961958
#define SvIOK_only(sv) \
962-
(SvOK_off(sv), \
963-
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
959+
(SvOK_off(sv), SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
964960
#define SvIOK_only_UV(sv) \
965961
(assert_not_glob(sv) SvOK_off_exc_UV(sv), \
966962
SvFLAGS(sv) |= (SVf_IOK|SVp_IOK))
967963

968-
#define SvIOK_UV(sv) \
969-
((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \
970-
== (SVf_IOK|SVf_IVisUV))
964+
#define SvIOK_UV(sv) \
965+
((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) == (SVf_IOK|SVf_IVisUV))
971966
#define SvUOK(sv) SvIOK_UV(sv)
972-
#define SvIOK_notUV(sv) \
973-
((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \
974-
== SVf_IOK)
967+
#define SvIOK_notUV(sv) \
968+
((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) == SVf_IOK)
975969

976970
#define SvIandPOK(sv) \
977971
((SvFLAGS(sv) & (SVf_IOK|SVf_POK)) == (SVf_IOK|SVf_POK))
@@ -987,11 +981,9 @@ Set the size of the string buffer for the SV. See C<L</SvLEN>>.
987981
(SvIsCOW_static(sv) && \
988982
(SvPVX_const(sv) == PL_Yes || SvPVX_const(sv) == PL_No))
989983
#define BOOL_INTERNALS_sv_isbool_true(sv) \
990-
(SvIsCOW_static(sv) && \
991-
(SvPVX_const(sv) == PL_Yes))
984+
(SvIsCOW_static(sv) && (SvPVX_const(sv) == PL_Yes))
992985
#define BOOL_INTERNALS_sv_isbool_false(sv) \
993-
(SvIsCOW_static(sv) && \
994-
(SvPVX_const(sv) == PL_No))
986+
(SvIsCOW_static(sv) && (SvPVX_const(sv) == PL_No))
995987

996988
#define SvIsUV(sv) (SvFLAGS(sv) & SVf_IVisUV)
997989
#define SvIsUV_on(sv) (SvFLAGS(sv) |= SVf_IVisUV)
@@ -1003,8 +995,7 @@ Set the size of the string buffer for the SV. See C<L</SvLEN>>.
1003995
SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
1004996
#define SvNOK_off(sv) (SvFLAGS(sv) &= ~(SVf_NOK|SVp_NOK))
1005997
#define SvNOK_only(sv) \
1006-
(SvOK_off(sv), \
1007-
SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
998+
(SvOK_off(sv), SvFLAGS(sv) |= (SVf_NOK|SVp_NOK))
1008999

10091000
/*
10101001
=for apidoc Am|U32|SvUTF8|SV* sv
@@ -1054,8 +1045,7 @@ the UTF-8 status as it was.
10541045
SvFLAGS(sv) |= (SVf_POK|SVp_POK))
10551046

10561047
#define SvVOK(sv) \
1057-
(SvMAGICAL(sv) \
1058-
&& mg_find(sv,PERL_MAGIC_vstring))
1048+
(SvMAGICAL(sv) && mg_find(sv,PERL_MAGIC_vstring))
10591049
/*
10601050
=for apidoc Am|MAGIC*|SvVSTRING_mg|SV * sv
10611051
@@ -1064,8 +1054,7 @@ Returns the vstring magic, or NULL if none
10641054
=cut
10651055
*/
10661056
#define SvVSTRING_mg(sv) \
1067-
(SvMAGICAL(sv) \
1068-
? mg_find(sv,PERL_MAGIC_vstring) : NULL)
1057+
(SvMAGICAL(sv) ? mg_find(sv,PERL_MAGIC_vstring) : NULL)
10691058

10701059
#define SvOOK(sv) (SvFLAGS(sv) & SVf_OOK)
10711060
#define SvOOK_on(sv) (SvFLAGS(sv) |= SVf_OOK)
@@ -1114,9 +1103,8 @@ Returns a boolean as to whether C<sv> has overloading
11141103
=cut
11151104
*/
11161105

1117-
#define SvAMAGIC(sv) \
1118-
(SvROK(sv) && SvOBJECT(SvRV(sv)) && \
1119-
HvAMAGIC(SvSTASH(SvRV(sv))))
1106+
#define SvAMAGIC(sv) \
1107+
(SvROK(sv) && SvOBJECT(SvRV(sv)) && HvAMAGIC(SvSTASH(SvRV(sv))))
11201108

11211109
/* To be used on the stashes themselves: */
11221110
#define HvAMAGIC(hv) (SvFLAGS(hv) & SVf_AMAGIC)
@@ -1190,9 +1178,8 @@ is true then the scalar's value cannot change unless written to.
11901178
? 1 \
11911179
: (HvAMAGIC_off(stash), 0))
11921180

1193-
#define SvWEAKREF(sv) \
1194-
((SvFLAGS(sv) & (SVf_ROK|SVprv_WEAKREF)) \
1195-
== (SVf_ROK|SVprv_WEAKREF))
1181+
#define SvWEAKREF(sv) \
1182+
((SvFLAGS(sv) & (SVf_ROK|SVprv_WEAKREF)) == (SVf_ROK|SVprv_WEAKREF))
11961183
#define SvWEAKREF_on(sv) (SvFLAGS(sv) |= (SVf_ROK|SVprv_WEAKREF))
11971184
#define SvWEAKREF_off(sv) (SvFLAGS(sv) &= ~(SVf_ROK|SVprv_WEAKREF))
11981185

@@ -2404,8 +2391,7 @@ already have a PV buffer allocated, but no SvTHINKFIRST.
24042391

24052392
/* the SvREADONLY() test is to quickly reject most SVs */
24062393
#define SvIMMORTAL(sv) \
2407-
( SvREADONLY(sv) \
2408-
&& (SvIMMORTAL_INTERP(sv) || (sv) == &PL_sv_placeholder))
2394+
( SvREADONLY(sv) && (SvIMMORTAL_INTERP(sv) || (sv) == &PL_sv_placeholder))
24092395

24102396
#ifdef DEBUGGING
24112397
/* exercise the immortal resurrection code in sv_free2() */

util.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
|| ((f)[0] && (f)[1] == ':')) /* drive name */
2626
#elif defined(DOSISH)
2727
# define PERL_FILE_IS_ABSOLUTE(f) \
28-
(*(f) == '/' \
29-
|| ((f)[0] && (f)[1] == ':')) /* drive name */
28+
(*(f) == '/' || ((f)[0] && (f)[1] == ':')) /* drive name */
3029
#else /* NOT DOSISH */
3130
# define PERL_FILE_IS_ABSOLUTE(f) (*(f) == '/')
3231
#endif

0 commit comments

Comments
 (0)