[asperl] add AS patch#20 (exposes more global constants)
[p5sagit/p5-mst-13.2.git] / run.c
diff --git a/run.c b/run.c
index 2f8d8fa..ac9752b 100644 (file)
--- a/run.c
+++ b/run.c
  * know.  Run now!  Hope is in speed!"  --Gandalf
  */
 
-dEXT char **watchaddr = 0;
-dEXT char *watchok;
-
-#ifndef DEBUGGING
+#ifdef PERL_OBJECT
+#define CALLOP this->*op
+#else
+#define CALLOP *op
+#endif
 
 int
-runops() {
+runops_standard(void) {
     dTHR;
-    SAVEI32(runlevel);
-    runlevel++;
 
-    while ( op = (*op->op_ppaddr)(ARGS) ) ;
+    while ( op = (CALLOP->op_ppaddr)(ARGS) ) ;
 
     TAINT_NOT;
     return 0;
 }
 
-#else
+#ifdef DEBUGGING
 
+dEXT char **watchaddr = 0;
+dEXT char *watchok;
+
+#ifndef PERL_OBJECT
 static void debprof _((OP*o));
+#endif
 
 int
-runops() {
+runops_debug(void) {
     dTHR;
     if (!op) {
        warn("NULL OP IN RUN");
        return 0;
     }
 
-    SAVEI32(runlevel);
-    runlevel++;
-
     do {
        if (debug) {
            if (watchaddr != 0 && *watchaddr != watchok)
@@ -57,15 +58,14 @@ runops() {
            DEBUG_t(debop(op));
            DEBUG_P(debprof(op));
        }
-    } while ( op = (*op->op_ppaddr)(ARGS) );
+    } while ( op = (CALLOP->op_ppaddr)(ARGS) );
 
     TAINT_NOT;
     return 0;
 }
 
 I32
-debop(o)
-OP *o;
+debop(OP *o)
 {
     SV *sv;
     deb("%s", op_name[o->op_type]);
@@ -92,8 +92,7 @@ OP *o;
 }
 
 void
-watch(addr)
-char **addr;
+watch(char **addr)
 {
     watchaddr = addr;
     watchok = *addr;
@@ -101,9 +100,8 @@ char **addr;
        (long)watchaddr, (long)watchok);
 }
 
-static void
-debprof(o)
-OP* o;
+STATIC void
+debprof(OP *o)
 {
     if (!profiledata)
        New(000, profiledata, MAXO, U32);
@@ -111,7 +109,7 @@ OP* o;
 }
 
 void
-debprofdump()
+debprofdump(void)
 {
     unsigned i;
     if (!profiledata)
@@ -123,5 +121,5 @@ debprofdump()
     }
 }
 
-#endif
+#endif /* DEBUGGING */