[asperl] fixups to make it build and pass tests under both compilers
[p5sagit/p5-mst-13.2.git] / regcomp.c
index 4230b9c..b6d8b01 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
  * Forward declarations for pregcomp()'s friends.
  */
 
-static char* regwhite _((char *, char *));
 #ifndef PERL_OBJECT
 static regnode *reg _((I32, I32 *));
 static regnode *reganode _((U8, U32));
@@ -116,8 +115,8 @@ static regnode *regpiece _((I32 *));
 static void reginsert _((U8, regnode *));
 static void regoptail _((regnode *, regnode *));
 static void regtail _((regnode *, regnode *));
+static char* regwhite _((char *, char *));
 static char* nextchar _((void));
-
 static void re_croak2 _((const char* pat1,const char* pat2,...)) __attribute__((noreturn));
 #endif
 
@@ -1798,7 +1797,7 @@ tryagain:
     return(ret);
 }
 
-static char *
+STATIC char *
 regwhite(char *p, char *e)
 {
     while (p < e) {
@@ -2232,11 +2231,11 @@ regcurly(register char *s)
     return TRUE;
 }
 
-#ifdef DEBUGGING
 
 STATIC regnode *
 dumpuntil(regnode *start, regnode *node, regnode *last, SV* sv, I32 l)
 {
+#ifdef DEBUGGING
     register char op = EXACT;  /* Arbitrary non-END op. */
     register regnode *next, *onode;
 
@@ -2293,6 +2292,7 @@ dumpuntil(regnode *start, regnode *node, regnode *last, SV* sv, I32 l)
        else if (op == WHILEM)
            l--;
     }
+#endif /* DEBUGGING */
     return node;
 }
 
@@ -2302,6 +2302,7 @@ dumpuntil(regnode *start, regnode *node, regnode *last, SV* sv, I32 l)
 void
 regdump(regexp *r)
 {
+#ifdef DEBUGGING
     SV *sv = sv_newmortal();
 
     (void)dumpuntil(r->program, r->program + 1, NULL, sv, 0);
@@ -2354,6 +2355,7 @@ regdump(regexp *r)
        PerlIO_printf(Perl_debug_log, "implicit ");
     PerlIO_printf(Perl_debug_log, "minlen %ld ", (long) r->minlen);
     PerlIO_printf(Perl_debug_log, "\n");
+#endif /* DEBUGGING */
 }
 
 /*
@@ -2362,6 +2364,7 @@ regdump(regexp *r)
 void
 regprop(SV *sv, regnode *o)
 {
+#ifdef DEBUGGING
     register char *p = 0;
 
     sv_setpv(sv, ":");
@@ -2559,8 +2562,8 @@ regprop(SV *sv, regnode *o)
     }
     if (p)
        sv_catpv(sv, p);
+#endif /* DEBUGGING */
 }
-#endif /* DEBUGGING */
 
 void
 pregfree(struct regexp *r)
@@ -2630,17 +2633,8 @@ regnext(register regnode *p)
 #endif
 }
 
-#ifdef I_STDARG
 STATIC void    
 re_croak2(const char* pat1,const char* pat2,...)
-#else
-/*VARARGS0*/
-static void    
-re_croak2(const char* pat1,const char* pat2, va_alist)
-    const char* pat1;
-    const char* pat2;
-    va_dcl
-#endif 
 {
     va_list args;
     STRLEN l1 = strlen(pat1);
@@ -2656,11 +2650,7 @@ re_croak2(const char* pat1,const char* pat2, va_alist)
     Copy(pat2, buf + l1, l2 , char);
     buf[l1 + l2 + 1] = '\n';
     buf[l1 + l2 + 2] = '\0';
-#ifdef I_STDARG
     va_start(args, pat2);
-#else
-    va_start(args);
-#endif
     message = mess(buf, &args);
     va_end(args);
     l1 = strlen(message);