@@ -158,7 +158,8 @@ required, but is kept for backwards compatibility.
158
158
* XXX Should really be a Configure probe, with HAS__FUNCTION__
159
159
* and FUNCTION__ as results.
160
160
* XXX Similarly, a Configure probe for __FILE__ and __LINE__ is needed. */
161
- #if (defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || (defined(__SUNPRO_C )) /* C99 or close enough. */
161
+ #if (defined(__STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L ) || \
162
+ (defined(__SUNPRO_C )) /* C99 or close enough. */
162
163
# define FUNCTION__ __func__
163
164
# define SAFE_FUNCTION__ __func__
164
165
#elif (defined(__DECC_VER )) /* Tru64 or VMS, and strict C89 being used, but not modern enough cc (in Tru64, -c99 not known, only -std1). */
@@ -485,7 +486,8 @@ Perl_xxx(aTHX_ ...) form for any API calls where it's used.
485
486
Perl_sv_catxmlpvn(aTHX_ dsv, STR_WITH_LEN(str), utf8)
486
487
487
488
488
- #define lex_stuff_pvs (pv ,flags ) Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)
489
+ #define lex_stuff_pvs (pv ,flags ) \
490
+ Perl_lex_stuff_pvn(aTHX_ STR_WITH_LEN(pv), flags)
489
491
490
492
#define get_cvs (str , flags ) \
491
493
Perl_get_cvn_flags(aTHX_ STR_WITH_LEN(str), (flags))
@@ -712,7 +714,8 @@ based on the underlying C library functions):
712
714
#define strnNE (s1 ,s2 ,l ) (strncmp(s1,s2,l) != 0)
713
715
#define strnEQ (s1 ,s2 ,l ) (strncmp(s1,s2,l) == 0)
714
716
715
- #define memEQ (s1 ,s2 ,l ) (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
717
+ #define memEQ (s1 ,s2 ,l ) \
718
+ (memcmp(((const void *) (s1)), ((const void *) (s2)), l) == 0)
716
719
#define memNE (s1 ,s2 ,l ) (! memEQ(s1,s2,l))
717
720
718
721
/* memEQ and memNE where second comparand is a string constant */
@@ -744,7 +747,8 @@ based on the underlying C library functions):
744
747
#define memGT (s1 ,s2 ,l ) (memcmp(s1,s2,l) > 0)
745
748
#define memGE (s1 ,s2 ,l ) (memcmp(s1,s2,l) >= 0)
746
749
747
- #define memCHRs (s1 ,c ) ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))
750
+ #define memCHRs (s1 ,c ) \
751
+ ((const char *) memchr(ASSERT_IS_LITERAL(s1) , c, sizeof(s1)-1))
748
752
749
753
/*
750
754
* Character classes.
@@ -1666,7 +1670,8 @@ END_EXTERN_C
1666
1670
# define isPUNCT_A (c ) generic_isCC_A_(c, CC_PUNCT_)
1667
1671
# define isSPACE_A (c ) generic_isCC_A_(c, CC_SPACE_)
1668
1672
# define isWORDCHAR_A (c ) generic_isCC_A_(c, CC_WORDCHAR_)
1669
- # define isXDIGIT_A (c ) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII xdigits */
1673
+ # define isXDIGIT_A (c ) generic_isCC_(c, CC_XDIGIT_) /* No non-ASCII
1674
+ xdigits */
1670
1675
# define isIDFIRST_A (c ) generic_isCC_A_(c, CC_IDFIRST_)
1671
1676
# define isALPHA_L1 (c ) generic_isCC_(c, CC_ALPHA_)
1672
1677
# define isALPHANUMERIC_L1 (c ) generic_isCC_(c, CC_ALPHANUMERIC_)
@@ -2204,11 +2209,13 @@ END_EXTERN_C
2204
2209
#define isPRINT_uvchr (c ) generic_invlist_uvchr_(CC_PRINT_, c)
2205
2210
2206
2211
#define isPUNCT_uvchr (c ) generic_invlist_uvchr_(CC_PUNCT_, c)
2207
- #define isSPACE_uvchr (c ) generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
2212
+ #define isSPACE_uvchr (c ) \
2213
+ generic_uvchr_(CC_SPACE_, is_XPERLSPACE_cp_high, c)
2208
2214
#define isPSXSPC_uvchr (c ) isSPACE_uvchr(c)
2209
2215
2210
2216
#define isUPPER_uvchr (c ) generic_invlist_uvchr_(CC_UPPER_, c)
2211
- #define isVERTWS_uvchr (c ) generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
2217
+ #define isVERTWS_uvchr (c ) \
2218
+ generic_uvchr_(CC_VERTSPACE_, is_VERTWS_cp_high, c)
2212
2219
#define isWORDCHAR_uvchr (c ) generic_invlist_uvchr_(CC_WORDCHAR_, c)
2213
2220
#define isXDIGIT_uvchr (c ) generic_uvchr_(CC_XDIGIT_, is_XDIGIT_cp_high, c)
2214
2221
@@ -2749,7 +2756,8 @@ PoisonWith(0xEF) for catching access to freed memory.
2749
2756
2750
2757
#define MEM_SIZE_MAX ((MEM_SIZE)-1)
2751
2758
2752
- #define _PERL_STRLEN_ROUNDUP_UNCHECKED (n ) (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))
2759
+ #define _PERL_STRLEN_ROUNDUP_UNCHECKED (n ) \
2760
+ (((n) - 1 + PERL_STRLEN_ROUNDUP_QUANTUM) & ~((MEM_SIZE)PERL_STRLEN_ROUNDUP_QUANTUM - 1))
2753
2761
2754
2762
#ifdef PERL_MALLOC_WRAP
2755
2763
@@ -2803,7 +2811,8 @@ PoisonWith(0xEF) for catching access to freed memory.
2803
2811
2804
2812
# define MEM_WRAP_CHECK_ (n ,t ) MEM_WRAP_CHECK(n,t),
2805
2813
2806
- # 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))
2814
+ # define PERL_STRLEN_ROUNDUP (n ) \
2815
+ ((void)(((n) > MEM_SIZE_MAX - 2 * PERL_STRLEN_ROUNDUP_QUANTUM) ? (croak_memory_wrap(),0) : 0), _PERL_STRLEN_ROUNDUP_UNCHECKED(n))
2807
2816
#else
2808
2817
2809
2818
# define MEM_WRAP_CHECK (n ,t )
@@ -2863,9 +2872,12 @@ enum mem_log_type {
2863
2872
#endif
2864
2873
2865
2874
#ifdef PERL_MEM_LOG
2866
- #define MEM_LOG_ALLOC (n ,t ,a ) Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
2867
- #define MEM_LOG_REALLOC (n ,t ,v ,a ) Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
2868
- #define MEM_LOG_FREE (a ) Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
2875
+ #define MEM_LOG_ALLOC (n ,t ,a ) \
2876
+ Perl_mem_log_alloc(n,sizeof(t),STRINGIFY(t),a,__FILE__,__LINE__,FUNCTION__)
2877
+ #define MEM_LOG_REALLOC (n ,t ,v ,a ) \
2878
+ Perl_mem_log_realloc(n,sizeof(t),STRINGIFY(t),v,a,__FILE__,__LINE__,FUNCTION__)
2879
+ #define MEM_LOG_FREE (a ) \
2880
+ Perl_mem_log_free(a,__FILE__,__LINE__,FUNCTION__)
2869
2881
#endif
2870
2882
2871
2883
#ifndef MEM_LOG_ALLOC
@@ -2878,9 +2890,12 @@ enum mem_log_type {
2878
2890
#define MEM_LOG_FREE (a ) (a)
2879
2891
#endif
2880
2892
2881
- #define Newx (v ,n ,t ) (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2882
- #define Newxc (v ,n ,t ,c ) (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2883
- #define Newxz (v ,n ,t ) (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))
2893
+ #define Newx (v ,n ,t ) \
2894
+ (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2895
+ #define Newxc (v ,n ,t ,c ) \
2896
+ (v = (MEM_WRAP_CHECK_(n,t) (c*)MEM_LOG_ALLOC(n,t,safemalloc((MEM_SIZE)((n)*sizeof(t))))))
2897
+ #define Newxz (v ,n ,t ) \
2898
+ (v = (MEM_WRAP_CHECK_(n,t) (t*)MEM_LOG_ALLOC(n,t,safecalloc((n),sizeof(t)))))
2884
2899
2885
2900
#ifndef PERL_CORE
2886
2901
/* pre 5.9.x compatibility */
@@ -2907,16 +2922,23 @@ enum mem_log_type {
2907
2922
#define perl_assert_ptr (p ) assert( ((void*)(p)) != 0 )
2908
2923
2909
2924
2910
- #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)))
2911
- #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)))
2912
- #define Zero (d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))
2925
+ #define Move (s ,d ,n ,t ) \
2926
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
2927
+ #define Copy (s ,d ,n ,t ) \
2928
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), (void)memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
2929
+ #define Zero (d ,n ,t ) \
2930
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), (void)memzero((char*)(d), (n) * sizeof(t)))
2913
2931
2914
2932
/* Like above, but returns a pointer to 'd' */
2915
- #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)))
2916
- #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)))
2917
- #define ZeroD (d ,n ,t ) (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))
2918
-
2919
- #define PoisonWith (d ,n ,t ,b ) (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
2933
+ #define MoveD (s ,d ,n ,t ) \
2934
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memmove((char*)(d),(const char*)(s), (n) * sizeof(t)))
2935
+ #define CopyD (s ,d ,n ,t ) \
2936
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), perl_assert_ptr(s), memcpy((char*)(d),(const char*)(s), (n) * sizeof(t)))
2937
+ #define ZeroD (d ,n ,t ) \
2938
+ (MEM_WRAP_CHECK_(n,t) perl_assert_ptr(d), memzero((char*)(d), (n) * sizeof(t)))
2939
+
2940
+ #define PoisonWith (d ,n ,t ,b ) \
2941
+ (MEM_WRAP_CHECK_(n,t) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)))
2920
2942
#define PoisonNew (d ,n ,t ) PoisonWith(d,n,t,0xAB)
2921
2943
#define PoisonFree (d ,n ,t ) PoisonWith(d,n,t,0xEF)
2922
2944
#define Poison (d ,n ,t ) PoisonFree(d,n,t)
0 commit comments