diff --git a/av.h b/av.h index 945f1dda3912..1ad83d70493c 100644 --- a/av.h +++ b/av.h @@ -93,9 +93,8 @@ need is to look up an array element, then prefer C. #define AvREALISH(av) (SvFLAGS(av) & (SVpav_REAL|SVpav_REIFY)) -#define AvFILL(av) \ - ((SvRMAGICAL((const SV *) (av))) \ - ? mg_size(MUTABLE_SV(av)) : AvFILLp(av)) +#define AvFILL(av) \ + ((SvRMAGICAL((const SV *) (av))) ? mg_size(MUTABLE_SV(av)) : AvFILLp(av)) #define av_top_index(av) AvFILL(av) #define av_tindex(av) av_top_index(av) diff --git a/cop.h b/cop.h index 145e35f5768f..8c00671f7b78 100644 --- a/cop.h +++ b/cop.h @@ -503,18 +503,15 @@ C string C

, creating the package if necessary. # define CopFILE(c) ((c)->cop_file) # define CopFILEGV(c) \ - (CopFILE(c) \ - ? gv_fetchfile(CopFILE(c)) : NULL) + (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : NULL) # define CopFILE_set(c,pv) ((c)->cop_file = savesharedpv(pv)) # define CopFILE_setn(c,pv,l) ((c)->cop_file = savesharedpvn((pv),(l))) # define CopFILESV(c) \ - (CopFILE(c) \ - ? GvSV(gv_fetchfile(CopFILE(c))) : NULL) + (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : NULL) # define CopFILEAV(c) \ - (CopFILE(c) \ - ? GvAV(gv_fetchfile(CopFILE(c))) : NULL) + (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : NULL) # define CopFILEAVx(c) \ (assert_(CopFILE(c)) \ GvAV(gv_fetchfile(CopFILE(c)))) @@ -1042,22 +1039,17 @@ struct context { #define CXp_ONCE 0x10 /* What was sbu_once in struct subst */ #define CxTYPE(c) ((c)->cx_type & CXTYPEMASK) -#define CxTYPE_is_LOOP(c) \ - ( CxTYPE(cx) >= CXt_LOOP_ARY \ - && CxTYPE(cx) <= CXt_LOOP_PLAIN) +#define CxTYPE_is_LOOP(c) \ + ( CxTYPE(cx) >= CXt_LOOP_ARY && CxTYPE(cx) <= CXt_LOOP_PLAIN) #define CxMULTICALL(c) ((c)->cx_type & CXp_MULTICALL) -#define CxREALEVAL(c) \ - (((c)->cx_type & (CXTYPEMASK|CXp_REAL)) \ - == (CXt_EVAL|CXp_REAL)) -#define CxEVALBLOCK(c) \ - (((c)->cx_type & (CXTYPEMASK|CXp_EVALBLOCK)) \ - == (CXt_EVAL|CXp_EVALBLOCK)) -#define CxTRY(c) \ - (((c)->cx_type & (CXTYPEMASK|CXp_TRY)) \ - == (CXt_EVAL|CXp_TRY)) -#define CxFOREACH(c) \ - ( CxTYPE(cx) >= CXt_LOOP_ARY \ - && CxTYPE(cx) <= CXt_LOOP_LIST) +#define CxREALEVAL(c) \ + (((c)->cx_type & (CXTYPEMASK|CXp_REAL)) == (CXt_EVAL|CXp_REAL)) +#define CxEVALBLOCK(c) \ + (((c)->cx_type & (CXTYPEMASK|CXp_EVALBLOCK)) == (CXt_EVAL|CXp_EVALBLOCK)) +#define CxTRY(c) \ + (((c)->cx_type & (CXTYPEMASK|CXp_TRY)) == (CXt_EVAL|CXp_TRY)) +#define CxFOREACH(c) \ + ( CxTYPE(cx) >= CXt_LOOP_ARY && CxTYPE(cx) <= CXt_LOOP_LIST) /* private flags for CXt_DEFER */ #define CXp_FINALLY 0x20 /* `finally` block; semantically identical diff --git a/handy.h b/handy.h index 682a51706b75..300369b4fe29 100644 --- a/handy.h +++ b/handy.h @@ -1403,8 +1403,7 @@ or casts /* The '| 0' part in ASSERT_NOT_PTR ensures a compiler error * if c is not integer (like e.g., a pointer) */ # define FITS_IN_8_BITS(c) \ - ( (sizeof(c) == 1) \ - || (((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) >> 8) == 0) + ( (sizeof(c) == 1) || (((WIDEST_UTYPE) ASSERT_NOT_PTR(c)) >> 8) == 0) #else # define FITS_IN_8_BITS(c) (1) #endif @@ -2730,9 +2729,8 @@ PoisonWith(0xEF) for catching access to freed memory. ((_MEM_WRAP_NEEDS_RUNTIME_CHECK(n,t) ? (MEM_SIZE)(n) : \ MEM_SIZE_MAX/sizeof(t)) > MEM_SIZE_MAX/sizeof(t)) -# define MEM_WRAP_CHECK(n,t) \ - (void)(UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t)) \ - && (croak_memory_wrap(),0)) +# define MEM_WRAP_CHECK(n,t) \ + (void)(UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t)) && (croak_memory_wrap(),0)) # define MEM_WRAP_CHECK_1(n,t,a) \ (void)(UNLIKELY(_MEM_WRAP_WILL_WRAP(n,t)) \ diff --git a/hv_macro.h b/hv_macro.h index 2e815273342d..d642fc031e49 100644 --- a/hv_macro.h +++ b/hv_macro.h @@ -35,9 +35,8 @@ #define U8TO32_LE(ptr) (*((const U32*)(ptr))) #define U8TO64_LE(ptr) (*((const U64*)(ptr))) #else - #define U8TO16_LE(ptr) \ - (_shifted_octet(U16,(ptr),0, 0)| \ - _shifted_octet(U16,(ptr),1, 8)) + #define U8TO16_LE(ptr) \ + (_shifted_octet(U16,(ptr),0, 0)| _shifted_octet(U16,(ptr),1, 8)) #define U8TO32_LE(ptr) \ (_shifted_octet(U32,(ptr),0, 0)| \ diff --git a/op.h b/op.h index fb14486ba18e..cf14df3cf0e6 100644 --- a/op.h +++ b/op.h @@ -525,12 +525,10 @@ typedef enum { # define IS_PADCONST(v) \ (v && (SvREADONLY(v) || (SvIsCOW(v) && !SvLEN(v)))) # endif -# define cSVOPx_sv(v) \ - (cSVOPx(v)->op_sv \ - ? cSVOPx(v)->op_sv : PAD_SVl((v)->op_targ)) -# define cSVOPx_svp(v) \ - (cSVOPx(v)->op_sv \ - ? &cSVOPx(v)->op_sv : &PAD_SVl((v)->op_targ)) +# define cSVOPx_sv(v) \ + (cSVOPx(v)->op_sv ? cSVOPx(v)->op_sv : PAD_SVl((v)->op_targ)) +# define cSVOPx_svp(v) \ + (cSVOPx(v)->op_sv ? &cSVOPx(v)->op_sv : &PAD_SVl((v)->op_targ)) # define cMETHOPx_meth(v) \ (cMETHOPx(v)->op_u.op_meth_sv \ ? cMETHOPx(v)->op_u.op_meth_sv : PAD_SVl((v)->op_targ)) diff --git a/op_reg_common.h b/op_reg_common.h index d42be39122b8..8ecb8f57a0b0 100644 --- a/op_reg_common.h +++ b/op_reg_common.h @@ -113,8 +113,7 @@ get_regex_charset(const U32 flags) | RXf_PMf_STRICT ) #define RXf_PMf_FLAGCOPYMASK \ - ( RXf_PMf_COMPILETIME \ - | RXf_PMf_SPLIT ) + ( RXf_PMf_COMPILETIME | RXf_PMf_SPLIT ) /* Temporary to get Jenkins happy again See thread starting at * http://nntp.perl.org/group/perl.perl5.porters/220710 diff --git a/perl.h b/perl.h index 611715311fb6..20c8fa34e7d9 100644 --- a/perl.h +++ b/perl.h @@ -288,9 +288,8 @@ Now a synonym for C>. # define CALLREGDUPE(prog,param) \ Perl_re_dup(aTHX_ (prog),(param)) -# define CALLREGDUPE_PVT(prog,param) \ - (prog ? RX_ENGINE(prog)->dupe(aTHX_ (prog),(param)) \ - : (REGEXP *)NULL) +# define CALLREGDUPE_PVT(prog,param) \ + (prog ? RX_ENGINE(prog)->dupe(aTHX_ (prog),(param)) : (REGEXP *)NULL) #endif /* some compilers impersonate gcc */ @@ -6849,8 +6848,7 @@ typedef struct am_table_short AMTS; /* Returns TRUE if the plain locale pragma * without a parameter is in effect. */ # define IN_LOCALE_RUNTIME \ - (PL_curcop \ - && CopHINTS_get(PL_curcop) & HINT_LOCALE) + (PL_curcop && CopHINTS_get(PL_curcop) & HINT_LOCALE) /* Returns TRUE if either form of the locale pragma is in effect */ # define IN_SOME_LOCALE_FORM_RUNTIME \ @@ -8121,8 +8119,7 @@ extern void moncontrol(int); PERL_UNICODE_STDERR_FLAG) #define PERL_UNICODE_INOUT_FLAG \ - (PERL_UNICODE_IN_FLAG | \ - PERL_UNICODE_OUT_FLAG) + (PERL_UNICODE_IN_FLAG | PERL_UNICODE_OUT_FLAG) #define PERL_UNICODE_DEFAULT_FLAGS \ (PERL_UNICODE_STD_FLAG | \ diff --git a/regcomp.h b/regcomp.h index 723b554ae979..222ed5f1a97b 100644 --- a/regcomp.h +++ b/regcomp.h @@ -405,12 +405,10 @@ struct regnode_ssc { (((struct regnode_lstring *)p)->string)) #define OPERANDl(p) STRINGl(p) -#define STR_LEN(p) \ - ((OP(p) == LEXACT || OP(p) == LEXACT_REQ8) \ - ? STR_LENl(p) : STR_LENs(p)) -#define STRING(p) \ - ((OP(p) == LEXACT || OP(p) == LEXACT_REQ8) \ - ? STRINGl(p) : STRINGs(p)) +#define STR_LEN(p) \ + ((OP(p) == LEXACT || OP(p) == LEXACT_REQ8) ? STR_LENl(p) : STR_LENs(p)) +#define STRING(p) \ + ((OP(p) == LEXACT || OP(p) == LEXACT_REQ8) ? STRINGl(p) : STRINGs(p)) #define OPERAND(p) STRING(p) /* The number of (smallest) regnode equivalents that a string of length l bytes diff --git a/regexp.h b/regexp.h index 30bae0d68876..6bacafb13879 100644 --- a/regexp.h +++ b/regexp.h @@ -533,17 +533,14 @@ SvRX instead and check for NULL. /* For source compatibility. We used to store these explicitly. */ # define RX_PRECOMP(rx_sv) \ - (RX_WRAPPED(rx_sv) \ - + ReANY(rx_sv)->pre_prefix) + (RX_WRAPPED(rx_sv) + ReANY(rx_sv)->pre_prefix) # define RX_PRECOMP_const(rx_sv) \ - (RX_WRAPPED_const(rx_sv) \ - + ReANY(rx_sv)->pre_prefix) + (RX_WRAPPED_const(rx_sv) + ReANY(rx_sv)->pre_prefix) /* FIXME? Are we hardcoding too much here and constraining plugin extension writers? Specifically, the value 1 assumes that the wrapped version always has exactly one character at the end, a ')'. Will that always be true? */ # define RX_PRELEN(rx_sv) \ - (RX_WRAPLEN(rx_sv) \ - - ReANY(rx_sv)->pre_prefix - 1) + (RX_WRAPLEN(rx_sv) - ReANY(rx_sv)->pre_prefix - 1) # define RX_WRAPPED(rx_sv) SvPVX(rx_sv) # define RX_WRAPPED_const(rx_sv) SvPVX_const(rx_sv) diff --git a/sv.h b/sv.h index 219eb915329f..8da08deed55f 100644 --- a/sv.h +++ b/sv.h @@ -431,13 +431,11 @@ the upgrade if necessary. See C>. -#define SVf_THINKFIRST \ - (SVf_READONLY|SVf_PROTECT|SVf_ROK|SVf_FAKE \ - |SVs_RMG|SVf_IsCOW) +#define SVf_THINKFIRST \ + (SVf_READONLY|SVf_PROTECT|SVf_ROK|SVf_FAKE |SVs_RMG|SVf_IsCOW) -#define SVf_OK \ - (SVf_IOK|SVf_NOK|SVf_POK|SVf_ROK| \ - SVp_IOK|SVp_NOK|SVp_POK|SVpgv_GP) +#define SVf_OK \ + (SVf_IOK|SVf_NOK|SVf_POK|SVf_ROK| SVp_IOK|SVp_NOK|SVp_POK|SVpgv_GP) #define PRIVSHIFT 4 /* (SVp_?OK >> PRIVSHIFT) == SVf_?OK */ @@ -922,9 +920,8 @@ Set the size of the string buffer for the SV. See C>. #define SvNIOK(sv) (SvFLAGS(sv) & (SVf_IOK|SVf_NOK)) #define SvNIOKp(sv) (SvFLAGS(sv) & (SVp_IOK|SVp_NOK)) -#define SvNIOK_off(sv) \ - (SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK| \ - SVp_IOK|SVp_NOK|SVf_IVisUV)) +#define SvNIOK_off(sv) \ + (SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK| SVp_IOK|SVp_NOK|SVf_IVisUV)) #define assert_not_ROK(sv) assert_(!SvROK(sv) || !SvRV(sv)) #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>. SvFLAGS(sv) |= (SVf_IOK|SVp_IOK)) #define SvIOK_off(sv) (SvFLAGS(sv) &= ~(SVf_IOK|SVp_IOK|SVf_IVisUV)) #define SvIOK_only(sv) \ - (SvOK_off(sv), \ - SvFLAGS(sv) |= (SVf_IOK|SVp_IOK)) + (SvOK_off(sv), SvFLAGS(sv) |= (SVf_IOK|SVp_IOK)) #define SvIOK_only_UV(sv) \ (assert_not_glob(sv) SvOK_off_exc_UV(sv), \ SvFLAGS(sv) |= (SVf_IOK|SVp_IOK)) -#define SvIOK_UV(sv) \ - ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \ - == (SVf_IOK|SVf_IVisUV)) +#define SvIOK_UV(sv) \ + ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) == (SVf_IOK|SVf_IVisUV)) #define SvUOK(sv) SvIOK_UV(sv) -#define SvIOK_notUV(sv) \ - ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) \ - == SVf_IOK) +#define SvIOK_notUV(sv) \ + ((SvFLAGS(sv) & (SVf_IOK|SVf_IVisUV)) == SVf_IOK) #define SvIandPOK(sv) \ ((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>. (SvIsCOW_static(sv) && \ (SvPVX_const(sv) == PL_Yes || SvPVX_const(sv) == PL_No)) #define BOOL_INTERNALS_sv_isbool_true(sv) \ - (SvIsCOW_static(sv) && \ - (SvPVX_const(sv) == PL_Yes)) + (SvIsCOW_static(sv) && (SvPVX_const(sv) == PL_Yes)) #define BOOL_INTERNALS_sv_isbool_false(sv) \ - (SvIsCOW_static(sv) && \ - (SvPVX_const(sv) == PL_No)) + (SvIsCOW_static(sv) && (SvPVX_const(sv) == PL_No)) #define SvIsUV(sv) (SvFLAGS(sv) & SVf_IVisUV) #define SvIsUV_on(sv) (SvFLAGS(sv) |= SVf_IVisUV) @@ -1003,8 +995,7 @@ Set the size of the string buffer for the SV. See C>. SvFLAGS(sv) |= (SVf_NOK|SVp_NOK)) #define SvNOK_off(sv) (SvFLAGS(sv) &= ~(SVf_NOK|SVp_NOK)) #define SvNOK_only(sv) \ - (SvOK_off(sv), \ - SvFLAGS(sv) |= (SVf_NOK|SVp_NOK)) + (SvOK_off(sv), SvFLAGS(sv) |= (SVf_NOK|SVp_NOK)) /* =for apidoc Am|U32|SvUTF8|SV* sv @@ -1054,8 +1045,7 @@ the UTF-8 status as it was. SvFLAGS(sv) |= (SVf_POK|SVp_POK)) #define SvVOK(sv) \ - (SvMAGICAL(sv) \ - && mg_find(sv,PERL_MAGIC_vstring)) + (SvMAGICAL(sv) && mg_find(sv,PERL_MAGIC_vstring)) /* =for apidoc Am|MAGIC*|SvVSTRING_mg|SV * sv @@ -1064,8 +1054,7 @@ Returns the vstring magic, or NULL if none =cut */ #define SvVSTRING_mg(sv) \ - (SvMAGICAL(sv) \ - ? mg_find(sv,PERL_MAGIC_vstring) : NULL) + (SvMAGICAL(sv) ? mg_find(sv,PERL_MAGIC_vstring) : NULL) #define SvOOK(sv) (SvFLAGS(sv) & SVf_OOK) #define SvOOK_on(sv) (SvFLAGS(sv) |= SVf_OOK) @@ -1114,9 +1103,8 @@ Returns a boolean as to whether C has overloading =cut */ -#define SvAMAGIC(sv) \ - (SvROK(sv) && SvOBJECT(SvRV(sv)) && \ - HvAMAGIC(SvSTASH(SvRV(sv)))) +#define SvAMAGIC(sv) \ + (SvROK(sv) && SvOBJECT(SvRV(sv)) && HvAMAGIC(SvSTASH(SvRV(sv)))) /* To be used on the stashes themselves: */ #define HvAMAGIC(hv) (SvFLAGS(hv) & SVf_AMAGIC) @@ -1190,9 +1178,8 @@ is true then the scalar's value cannot change unless written to. ? 1 \ : (HvAMAGIC_off(stash), 0)) -#define SvWEAKREF(sv) \ - ((SvFLAGS(sv) & (SVf_ROK|SVprv_WEAKREF)) \ - == (SVf_ROK|SVprv_WEAKREF)) +#define SvWEAKREF(sv) \ + ((SvFLAGS(sv) & (SVf_ROK|SVprv_WEAKREF)) == (SVf_ROK|SVprv_WEAKREF)) #define SvWEAKREF_on(sv) (SvFLAGS(sv) |= (SVf_ROK|SVprv_WEAKREF)) #define SvWEAKREF_off(sv) (SvFLAGS(sv) &= ~(SVf_ROK|SVprv_WEAKREF)) @@ -2404,8 +2391,7 @@ already have a PV buffer allocated, but no SvTHINKFIRST. /* the SvREADONLY() test is to quickly reject most SVs */ #define SvIMMORTAL(sv) \ - ( SvREADONLY(sv) \ - && (SvIMMORTAL_INTERP(sv) || (sv) == &PL_sv_placeholder)) + ( SvREADONLY(sv) && (SvIMMORTAL_INTERP(sv) || (sv) == &PL_sv_placeholder)) #ifdef DEBUGGING /* exercise the immortal resurrection code in sv_free2() */ diff --git a/util.h b/util.h index 52f20f932a5c..214169696c04 100644 --- a/util.h +++ b/util.h @@ -25,8 +25,7 @@ || ((f)[0] && (f)[1] == ':')) /* drive name */ #elif defined(DOSISH) # define PERL_FILE_IS_ABSOLUTE(f) \ - (*(f) == '/' \ - || ((f)[0] && (f)[1] == ':')) /* drive name */ + (*(f) == '/' || ((f)[0] && (f)[1] == ':')) /* drive name */ #else /* NOT DOSISH */ # define PERL_FILE_IS_ABSOLUTE(f) (*(f) == '/') #endif