This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Devel::PPPort: Use prefix D_PPP_ for helper macros
authorPali <pali@cpan.org>
Thu, 15 Mar 2018 19:51:30 +0000 (20:51 +0100)
committerKarl Williamson <khw@cpan.org>
Wed, 21 Mar 2018 00:16:11 +0000 (18:16 -0600)
Prefix D_PPP_ is already handled by ppptools.pl. This change cleanups code,
makes code more consistent and avoids specifying helper macros in =dontwarn
section.

dist/Devel-PPPort/parts/inc/SvPV
dist/Devel-PPPort/parts/inc/mess
dist/Devel-PPPort/parts/inc/version

index e99bfa0..4f0ded3 100644 (file)
@@ -21,7 +21,6 @@ sv_pvn_force_flags
 
 NEED_sv_2pv_flags
 NEED_sv_2pv_flags_GLOBAL
-DPPP_SVPV_NOLEN_LP_ARG
 
 =implementation
 
@@ -127,9 +126,9 @@ sv_pvn_force_flags(pTHX_ SV *sv, STRLEN *lp, I32 flags)
 #endif
 
 #if { VERSION < 5.8.8 } || ( { VERSION >= 5.9.0 } && { VERSION < 5.9.3 } )
-# define DPPP_SVPV_NOLEN_LP_ARG &PL_na
+# define D_PPP_SVPV_NOLEN_LP_ARG &PL_na
 #else
-# define DPPP_SVPV_NOLEN_LP_ARG 0
+# define D_PPP_SVPV_NOLEN_LP_ARG 0
 #endif
 
 __UNDEFINED__  SvPV_const(sv, lp)      SvPV_flags_const(sv, lp, SV_GMAGIC)
@@ -147,7 +146,7 @@ __UNDEFINED__  SvPV_flags_const(sv, lp, flags) \
 __UNDEFINED__  SvPV_flags_const_nolen(sv, flags) \
                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
                   ? SvPVX_const(sv) : \
-                  (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
+                  (const char*) sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
 
 __UNDEFINED__  SvPV_flags_mutable(sv, lp, flags) \
                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
@@ -166,7 +165,7 @@ __UNDEFINED__  SvPV_force_flags(sv, lp, flags) \
 
 __UNDEFINED__  SvPV_force_flags_nolen(sv, flags) \
                  ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
-                 ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
+                 ? SvPVX(sv) : sv_pvn_force_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, flags))
 
 __UNDEFINED__  SvPV_force_flags_mutable(sv, lp, flags) \
                  ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
@@ -175,17 +174,17 @@ __UNDEFINED__  SvPV_force_flags_mutable(sv, lp, flags) \
 
 __UNDEFINED__  SvPV_nolen(sv) \
                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
-                  ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
+                  ? SvPVX(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
 
 __UNDEFINED__  SvPV_nolen_const(sv) \
                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
-                  ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
+                  ? SvPVX_const(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
 
 __UNDEFINED__  SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
 __UNDEFINED__  SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
 __UNDEFINED__  SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
 __UNDEFINED__  SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
-                                    ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0))
+                                    ? SvPVX(sv) : sv_2pv_flags(sv, D_PPP_SVPV_NOLEN_LP_ARG, 0))
 
 __UNDEFINED__  SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \
                  SvPV_set((sv), (char *) saferealloc(          \
index eb2de7b..59a6d68 100644 (file)
@@ -35,7 +35,6 @@ PERL_ARGS_ASSERT_CROAK_XS_USAGE
 NEED_mess
 NEED_mess_nocontext
 NEED_vmess
-_dppp_fix_utf8_errsv
 
 =implementation
 
@@ -51,14 +50,14 @@ _dppp_fix_utf8_errsv
 #ifndef croak_sv
 #if { VERSION >= 5.7.3 } || ( { VERSION >= 5.6.1 } && { VERSION < 5.7.0 } )
 #  if ( { VERSION >= 5.8.0 } && { VERSION < 5.8.9 } ) || ( { VERSION >= 5.9.0 } && { VERSION < 5.10.1 } )
-#    define _dppp_fix_utf8_errsv(errsv, sv)                     \
+#    define D_PPP_FIX_UTF8_ERRSV(errsv, sv)                     \
         STMT_START {                                            \
             if (sv != ERRSV)                                    \
                 SvFLAGS(ERRSV) = (SvFLAGS(ERRSV) & ~SVf_UTF8) | \
                                  (SvFLAGS(sv) & SVf_UTF8);      \
         } STMT_END
 #  else
-#    define _dppp_fix_utf8_errsv(errsv, sv) STMT_START {} STMT_END
+#    define D_PPP_FIX_UTF8_ERRSV(errsv, sv) STMT_START {} STMT_END
 #  endif
 #  define croak_sv(sv)                        \
     STMT_START {                              \
@@ -66,7 +65,7 @@ _dppp_fix_utf8_errsv
             sv_setsv(ERRSV, sv);              \
             croak(NULL);                      \
         } else {                              \
-            _dppp_fix_utf8_errsv(ERRSV, sv);  \
+            D_PPP_FIX_UTF8_ERRSV(ERRSV, sv);  \
             croak("%" SVf, SVfARG(sv));       \
         }                                     \
     } STMT_END
index 1d5c556..c321b20 100644 (file)
@@ -19,7 +19,6 @@ PERL_BCDVERSION
 =dontwarn
 
 PERL_PATCHLEVEL_H_IMPLICIT
-_dpppDEC2BCD
 
 =implementation
 
@@ -41,8 +40,8 @@ _dpppDEC2BCD
 #  endif
 #endif
 
-#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
-#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
+#define D_PPP_DEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
+#define PERL_BCDVERSION ((D_PPP_DEC2BCD(PERL_REVISION)<<24)|(D_PPP_DEC2BCD(PERL_VERSION)<<12)|D_PPP_DEC2BCD(PERL_SUBVERSION))
 
 /* It is very unlikely that anyone will try to use this with Perl 6
    (or greater), but who knows.