silence a warning in perly.c
[p5sagit/p5-mst-13.2.git] / perly.c
diff --git a/perly.c b/perly.c
index af09290..a9e569d 100644 (file)
--- a/perly.c
+++ b/perly.c
@@ -1,6 +1,6 @@
 /*    perly.c
  *
- *    Copyright (c) 2004, 2005, 2006 Larry Wall and others
+ *    Copyright (c) 2004, 2005, 2006, 2007, 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.
@@ -111,7 +111,7 @@ yy_stack_print (pTHX_ const yy_parser *parser)
 
     PerlIO_printf(Perl_debug_log, "\nindex:");
     for (ps = min; ps <= parser->ps; ps++)
-       PerlIO_printf(Perl_debug_log, " %8d", ps - parser->stack);
+       PerlIO_printf(Perl_debug_log, " %8d", (int)(ps - parser->stack));
 
     PerlIO_printf(Perl_debug_log, "\nstate:");
     for (ps = min; ps <= parser->ps; ps++)
@@ -296,14 +296,18 @@ S_clear_yystack(pTHX_  const yy_parser *parser)
 
 /* delete a parser object */
 
+#ifndef PERL_IN_MADLY_C
 void
 Perl_parser_free(pTHX_  const yy_parser *parser)
 {
     S_clear_yystack(aTHX_ parser);
     Safefree(parser->stack);
+    Safefree(parser->lex_brackstack);
+    Safefree(parser->lex_casestack);
     PL_parser = parser->old_parser;
+    Safefree(parser);
 }
-
+#endif
 
 /*----------.
 | yyparse.  |
@@ -347,7 +351,7 @@ Perl_yyparse (pTHX)
     ps = parser->ps;
 
     ENTER;  /* force parser free before we return */
-    SAVEDESTRUCTOR_X(Perl_parser_free, (void*) parser);
+    SAVEPARSER(parser);
 
 /*------------------------------------------------------------.
 | yynewstate -- Push a new state, which is found in yystate.  |
@@ -371,7 +375,7 @@ Perl_yyparse (pTHX)
        /* grow the stack? We always leave 1 spare slot,
         * in case of a '' -> 'foo' reduction */
 
-       if (size >= parser->stack_size - 1) {
+       if (size >= (size_t)parser->stack_size - 1) {
            /* this will croak on insufficient memory */
            parser->stack_size *= 2;
            Renew(parser->stack, parser->stack_size, yy_stack_frame);