Change 34935 by [EMAIL PROTECTED] on 2008/11/26 22:25:18

        rxres_free() and rxres_restore() are only used in pp_ctl.c, so can be
        static. Macros PUSHSUBST() and POPSUBST() are only viable in PERL_CORE.

Affected files ...

... //depot/perl/cop.h#184 edit
... //depot/perl/embed.fnc#646 edit
... //depot/perl/embed.h#783 edit
... //depot/perl/pp_ctl.c#717 edit
... //depot/perl/proto.h#980 edit

Differences ...

==== //depot/perl/cop.h#184 (text) ====
Index: perl/cop.h
--- perl/cop.h#183~34621~       2008-10-28 12:51:07.000000000 -0700
+++ perl/cop.h  2008-11-26 14:25:18.000000000 -0800
@@ -610,7 +610,8 @@
 #define sb_rxres       cx_u.cx_subst.sbu_rxres
 #define sb_rx          cx_u.cx_subst.sbu_rx
 
-#define PUSHSUBST(cx) CXINC, cx = &cxstack[cxstack_ix],                        
\
+#ifdef PERL_CORE
+#  define PUSHSUBST(cx) CXINC, cx = &cxstack[cxstack_ix],              \
        cx->sb_iters            = iters,                                \
        cx->sb_maxiters         = maxiters,                             \
        cx->sb_rflags           = r_flags,                              \
@@ -628,11 +629,12 @@
        rxres_save(&cx->sb_rxres, rx);                                  \
        (void)ReREFCNT_inc(rx)
 
-#define CxONCE(cx)             ((cx)->cx_type & CXp_ONCE)
-
-#define POPSUBST(cx) cx = &cxstack[cxstack_ix--];                      \
+#  define POPSUBST(cx) cx = &cxstack[cxstack_ix--];                    \
        rxres_free(&cx->sb_rxres);                                      \
        ReREFCNT_dec(cx->sb_rx)
+#endif
+
+#define CxONCE(cx)             ((cx)->cx_type & CXp_ONCE)
 
 struct context {
     union {

==== //depot/perl/embed.fnc#646 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#645~34933~   2008-11-26 13:56:46.000000000 -0800
+++ perl/embed.fnc      2008-11-26 14:25:18.000000000 -0800
@@ -772,8 +772,11 @@
 p      |int    |rsignal_restore|int i|NULLOK Sigsave_t* t
 p      |int    |rsignal_save   |int i|Sighandler_t t1|NN Sigsave_t* save
 Ap     |Sighandler_t|rsignal_state|int i
-p      |void   |rxres_free     |NN void** rsp
-p      |void   |rxres_restore  |NN void **rsp|NN REGEXP *rx
+#if defined(PERL_IN_PP_CTL_C)
+s      |void   |rxres_free     |NN void** rsp
+s      |void   |rxres_restore  |NN void **rsp|NN REGEXP *rx
+#endif
+: Used in pp_hot.c
 p      |void   |rxres_save     |NN void **rsp|NN REGEXP *rx
 #if !defined(HAS_RENAME)
 p      |I32    |same_dirent    |NN const char* a|NN const char* b

==== //depot/perl/embed.h#783 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#782~34933~     2008-11-26 13:56:46.000000000 -0800
+++ perl/embed.h        2008-11-26 14:25:18.000000000 -0800
@@ -758,9 +758,13 @@
 #define rsignal_save           Perl_rsignal_save
 #endif
 #define rsignal_state          Perl_rsignal_state
+#if defined(PERL_IN_PP_CTL_C)
+#ifdef PERL_CORE
+#define rxres_free             S_rxres_free
+#define rxres_restore          S_rxres_restore
+#endif
+#endif
 #ifdef PERL_CORE
-#define rxres_free             Perl_rxres_free
-#define rxres_restore          Perl_rxres_restore
 #define rxres_save             Perl_rxres_save
 #endif
 #if !defined(HAS_RENAME)
@@ -3102,9 +3106,13 @@
 #define rsignal_save(a,b,c)    Perl_rsignal_save(aTHX_ a,b,c)
 #endif
 #define rsignal_state(a)       Perl_rsignal_state(aTHX_ a)
+#if defined(PERL_IN_PP_CTL_C)
+#ifdef PERL_CORE
+#define rxres_free(a)          S_rxres_free(aTHX_ a)
+#define rxres_restore(a,b)     S_rxres_restore(aTHX_ a,b)
+#endif
+#endif
 #ifdef PERL_CORE
-#define rxres_free(a)          Perl_rxres_free(aTHX_ a)
-#define rxres_restore(a,b)     Perl_rxres_restore(aTHX_ a,b)
 #define rxres_save(a,b)                Perl_rxres_save(aTHX_ a,b)
 #endif
 #if !defined(HAS_RENAME)

==== //depot/perl/pp_ctl.c#717 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#716~34886~    2008-11-18 12:32:23.000000000 -0800
+++ perl/pp_ctl.c       2008-11-26 14:25:18.000000000 -0800
@@ -357,8 +357,8 @@
     }
 }
 
-void
-Perl_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
+static void
+S_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
 {
     UV *p = (UV*)*rsp;
     U32 i;
@@ -387,8 +387,8 @@
     }
 }
 
-void
-Perl_rxres_free(pTHX_ void **rsp)
+static void
+S_rxres_free(pTHX_ void **rsp)
 {
     UV * const p = (UV*)*rsp;
 

==== //depot/perl/proto.h#980 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#979~34933~     2008-11-26 13:56:46.000000000 -0800
+++ perl/proto.h        2008-11-26 14:25:18.000000000 -0800
@@ -2705,17 +2705,19 @@
        assert(save)
 
 PERL_CALLCONV Sighandler_t     Perl_rsignal_state(pTHX_ int i);
-PERL_CALLCONV void     Perl_rxres_free(pTHX_ void** rsp)
+#if defined(PERL_IN_PP_CTL_C)
+STATIC void    S_rxres_free(pTHX_ void** rsp)
                        __attribute__nonnull__(pTHX_1);
 #define PERL_ARGS_ASSERT_RXRES_FREE    \
        assert(rsp)
 
-PERL_CALLCONV void     Perl_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
+STATIC void    S_rxres_restore(pTHX_ void **rsp, REGEXP *rx)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
 #define PERL_ARGS_ASSERT_RXRES_RESTORE \
        assert(rsp); assert(rx)
 
+#endif
 PERL_CALLCONV void     Perl_rxres_save(pTHX_ void **rsp, REGEXP *rx)
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2);
End of Patch.

Reply via email to