Add a new Porting/podtidy to reformat pod using Pod::Tidy
[p5sagit/p5-mst-13.2.git] / scope.h
diff --git a/scope.h b/scope.h
index c1fa4f9..70b7165 100644 (file)
--- a/scope.h
+++ b/scope.h
@@ -157,59 +157,25 @@ Closing bracket on a callback.  See C<ENTER> and L<perlcall>.
 
 #define SAVEOP()       save_op()
 
-#define SAVEHINTS() \
-    STMT_START {                                       \
-       SSCHECK(4);                                     \
-       if (PL_hints & HINT_LOCALIZE_HH) {              \
-           SSPUSHPTR(GvHV(PL_hintgv));                 \
-           GvHV(PL_hintgv) = Perl_hv_copy_hints_hv(aTHX_ GvHV(PL_hintgv)); \
-       }                                               \
-       if (PL_compiling.cop_hints_hash) {              \
-           HINTS_REFCNT_LOCK;                          \
-           PL_compiling.cop_hints_hash->refcounted_he_refcnt++;        \
-           HINTS_REFCNT_UNLOCK;                        \
-       }                                               \
-       SSPUSHPTR(PL_compiling.cop_hints_hash);         \
-       SSPUSHINT(PL_hints);                            \
-       SSPUSHINT(SAVEt_HINTS);                         \
-    } STMT_END
+#define SAVEHINTS()    save_hints()
 
-#define SAVECOMPPAD() \
-    STMT_START {                                               \
-       SSCHECK(2);                                             \
-       SSPUSHPTR(MUTABLE_SV(PL_comppad));                      \
-       SSPUSHINT(SAVEt_COMPPAD);                               \
-    } STMT_END
+#define SAVECOMPPAD() save_pushptr(MUTABLE_SV(PL_comppad), SAVEt_COMPPAD)
 
 #define SAVESWITCHSTACK(f,t) \
     STMT_START {                                       \
-       SSCHECK(3);                                     \
-       SSPUSHPTR(MUTABLE_SV(f));                       \
-       SSPUSHPTR(MUTABLE_SV(t));                       \
-       SSPUSHINT(SAVEt_SAVESWITCHSTACK);               \
+       save_pushptrptr(MUTABLE_SV(f), MUTABLE_SV(t), SAVEt_SAVESWITCHSTACK); \
        SWITCHSTACK((f),(t));                           \
        PL_curstackinfo->si_stack = (t);                \
     } STMT_END
 
-#define SAVECOPARYBASE(c) \
-    STMT_START {                                       \
-       SSCHECK(3);                                     \
-       SSPUSHINT(CopARYBASE_get(c));                   \
-       SSPUSHPTR(c);                                   \
-       SSPUSHINT(SAVEt_COP_ARYBASE);                   \
-    } STMT_END
+#define SAVECOPARYBASE(c) save_pushi32ptr(CopARYBASE_get(c), c, SAVEt_COP_ARYBASE);
 
 /* Need to do the cop warnings like this, rather than a "SAVEFREESHAREDPV",
    because realloc() means that the value can actually change. Possibly
    could have done savefreesharedpvREF, but this way actually seems cleaner,
    as it simplifies the code that does the saves, and reduces the load on the
    save stack.  */
-#define SAVECOMPILEWARNINGS() \
-    STMT_START {                                       \
-       SSCHECK(2);                                     \
-       SSPUSHPTR(PL_compiling.cop_warnings);           \
-       SSPUSHINT(SAVEt_COMPILE_WARNINGS);              \
-    } STMT_END
+#define SAVECOMPILEWARNINGS() save_pushptr(PL_compiling.cop_warnings, SAVEt_COMPILE_WARNINGS)
 
 #define SAVESTACK_CXPOS() \
     STMT_START {                                  \
@@ -219,12 +185,7 @@ Closing bracket on a callback.  See C<ENTER> and L<perlcall>.
         SSPUSHINT(SAVEt_STACK_CXPOS);             \
     } STMT_END
 
-#define SAVEPARSER(p) \
-    STMT_START {                                  \
-        SSCHECK(2);                               \
-        SSPUSHPTR(p);                            \
-        SSPUSHINT(SAVEt_PARSER);                 \
-    } STMT_END
+#define SAVEPARSER(p) save_pushptr((p), SAVEt_PARSER)
 
 #ifdef USE_ITHREADS
 #  define SAVECOPSTASH(c)      SAVEPPTR(CopSTASHPV(c))
@@ -260,6 +221,12 @@ Closing bracket on a callback.  See C<ENTER> and L<perlcall>.
 #define SSPTR(off,type)         ((type)  ((char*)PL_savestack + off))
 #define SSPTRt(off,type)        ((type*) ((char*)PL_savestack + off))
 
+#define save_freesv(op)                save_pushptr((void *)(op), SAVEt_FREESV)
+#define save_mortalizesv(op)   save_pushptr((void *)(op), SAVEt_MORTALIZESV)
+#define save_freeop(op)                save_pushptr((void *)(op), SAVEt_FREEOP)
+#define save_freepv(pv)                save_pushptr((void *)(pv), SAVEt_FREEPV)
+#define save_op()              save_pushptr((void *)(PL_op), SAVEt_OP)
+
 /*
  * Local variables:
  * c-indentation-style: bsd