This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
restore_magic needs to undo COW
[perl5.git] / pp.h
diff --git a/pp.h b/pp.h
index 61fadc3..3893c10 100644 (file)
--- a/pp.h
+++ b/pp.h
@@ -1,23 +1,18 @@
 /*    pp.h
  *
- *    Copyright (c) 1991-2001, Larry Wall
+ *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999,
+ *    2000, 2001, by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
  *
  */
 
-#ifdef USE_THREADS
-#define ARGS thr
-#define dARGS struct perl_thread *thr;
-#else
-#define ARGS
-#define dARGS
-#endif /* USE_THREADS */
-
 #define PP(s) OP * Perl_##s(pTHX)
 
 /*
+=head1 Stack Manipulation Macros
+
 =for apidoc AmU||SP
 Stack pointer.  This is usually handled by C<xsubpp>.  See C<dSP> and
 C<SPAGAIN>.
@@ -210,12 +205,12 @@ See C<PUSHu>.
 =cut
 */
 
-#define EXTEND(p,n)    STMT_START { if (PL_stack_max - p < (n)) {              \
+#define EXTEND(p,n)    STMT_START { if (PL_stack_max - p < (int)(n)) {         \
                            sp = stack_grow(sp,p, (int) (n));           \
                        } } STMT_END
 
 /* Same thing, but update mark register too. */
-#define MEXTEND(p,n)   STMT_START {if (PL_stack_max - p < (n)) {               \
+#define MEXTEND(p,n)   STMT_START {if (PL_stack_max - p < (int)(n)) {          \
                            int markoff = mark - PL_stack_base;         \
                            sp = stack_grow(sp,p,(int) (n));            \
                            mark = PL_stack_base + markoff;             \
@@ -344,6 +339,7 @@ See C<PUSHu>.
           if (PL_amagic_generation) { \
            SV* tmpsv; \
            SV* arg= sp[shift]; \
+          if(0) goto am_again;  /* shut up unused warning */ \
          am_again: \
            if ((SvAMAGIC(arg))&&\
                (tmpsv=AMG_CALLun(arg,meth))) {\
@@ -389,8 +385,8 @@ See C<PUSHu>.
    changed SV* ref to SV* tmpRef */
 #define RvDEEPCP(rv) STMT_START { SV* tmpRef=SvRV(rv);      \
   if (SvREFCNT(tmpRef)>1) {                 \
+    SvRV(rv)=AMG_CALLun(rv,copy);      \
     SvREFCNT_dec(tmpRef);                   \
-    SvRV(rv)=AMG_CALLun(rv,copy);        \
   } } STMT_END
 
 /*