X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=perly.fixer;h=951da0078fb4b0dcdcb5beb93858222f036c08c2;hb=dc45a647708b6c5442e1362e6b6e7a2583c30346;hp=156881657f001a367e55bd5aaf799418ae26b33a;hpb=25c49cb6c6f3bfa58236f2866fad8049f77a03df;p=p5sagit%2Fp5-mst-13.2.git diff --git a/perly.fixer b/perly.fixer index 1568816..951da00 100755 --- a/perly.fixer +++ b/perly.fixer @@ -105,8 +105,8 @@ short *maxyyps; /yypv *= *&yyv\[ *-1 *\];/c\ \ if (!yyv) {\ -\ yyv = (YYSTYPE*) safemalloc(yymaxdepth * sizeof(YYSTYPE));\ -\ yys = (short*) safemalloc(yymaxdepth * sizeof(short));\ +\ New(73, yyv, yymaxdepth, YYSTYPE);\ +\ New(73, yys, yymaxdepth, short);\ \ if ( !yyv || !yys ) {\ \ yyerror( "out of memory" );\ \ return(1);\ @@ -123,10 +123,8 @@ short *maxyyps; \ int ts = yyps - yys;\ \ \ yymaxdepth *= 2;\ -\ yyv = (YYSTYPE*)realloc((char*)yyv,\ -\ yymaxdepth*sizeof(YYSTYPE));\ -\ yys = (short*)realloc((char*)yys,\ -\ yymaxdepth*sizeof(short));\ +\ Renew(yyv, yymaxdepth, YYSTYPE);\ +\ Renew(yys, yymaxdepth, short);\ \ if ( !yyv || !yys ) {\ \ yyerror( "yacc stack overflow" );\ \ return(1);\ @@ -170,8 +168,8 @@ int *maxyyps; /yypv *= *&yyv\[ *-1 *\];/c\ \ if (!yyv) {\ -\ yyv = (YYSTYPE*) safemalloc(yymaxdepth * sizeof(YYSTYPE));\ -\ yys = (int*) safemalloc(yymaxdepth * sizeof(int));\ +\ New(73, yyv, yymaxdepth, YYSTYPE);\ +\ New(73, yys, yymaxdepth, int);\ \ maxyyps = &yys[yymaxdepth];\ \ }\ \ yyps = &yys[-1];\ @@ -183,10 +181,8 @@ int *maxyyps; \ int ts = yy_ps - yys;\ \ \ yymaxdepth *= 2;\ -\ yyv = (YYSTYPE*)realloc((char*)yyv,\ -\ yymaxdepth*sizeof(YYSTYPE));\ -\ yys = (int*)realloc((char*)yys,\ -\ yymaxdepth*sizeof(int));\ +\ Renew(yyv, yymaxdepth, YYSTYPE);\ +\ Renew(yys, yymaxdepth, int);\ \ yy_ps = yyps = yys + ts;\ \ yy_pv = yypv = yyv + tv;\ \ maxyyps = &yys[yymaxdepth];\