X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCast.c;h=235ee0376df623e51d8ccc51e1c871825af84b2f;hb=d7ea4ed7cf4844be678bacdf2ed38e4073335013;hp=25640f80b516a75ac0f34a730d41a3c8fbd5fdef;hpb=0b9d8951b4695de31eb6a9471df839a2e689c05d;p=fw%2Fsdcc diff --git a/src/SDCCast.c b/src/SDCCast.c index 25640f80..235ee037 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -23,7 +23,6 @@ -------------------------------------------------------------------------*/ #include "common.h" -#include "newalloc.h" int currLineno = 0; set *astList = NULL; @@ -75,7 +74,7 @@ newAst (int type, void *op) ast *ex; static int oldLineno = 0; - Safe_calloc (1, ex, sizeof (ast)); + ex = Safe_alloc ( sizeof (ast)); ex->type = type; ex->lineno = (noLineno ? oldLineno : yylineno); @@ -110,7 +109,7 @@ newAst_ (unsigned type) ast *ex; static int oldLineno = 0; - ex = Safe_calloc (1, sizeof (ast)); + ex = Safe_alloc ( sizeof (ast)); ex->type = type; ex->lineno = (noLineno ? oldLineno : yylineno); @@ -221,7 +220,7 @@ copyAstValues (ast * dest, ast * src) break; case INLINEASM: - dest->values.inlineasm = Safe_calloc (1, strlen (src->values.inlineasm) + 1); + dest->values.inlineasm = Safe_alloc (strlen (src->values.inlineasm) + 1); strcpy (dest->values.inlineasm, src->values.inlineasm); break; @@ -252,7 +251,7 @@ copyAst (ast * src) if (!src) return NULL; - dest = Safe_calloc (1, sizeof (ast)); + dest = Safe_alloc ( sizeof (ast)); dest->type = src->type; dest->lineno = src->lineno; @@ -634,9 +633,9 @@ processParms (ast * func, /* if defined parameters ended but actual parameters */ /* exist and this is not defined as a variable arg */ - /* also check if statckAuto option is specified */ - if ((!defParm) && actParm && (!func->hasVargs) && - !options.stackAuto && !IS_RENT (fetype)) + /* also check if statckAuto option is specified */ // jwk: WHY? + if ((!defParm) && actParm && (!func->hasVargs) + /* && !options.stackAuto && !IS_RENT (fetype) */) { werror (E_TOO_MANY_PARMS); return 1; @@ -752,6 +751,7 @@ processParms (ast * func, fprintf (stderr, "assigned to type --> '"); printTypeChain (defParm->type, stderr); fprintf (stderr, "'\n"); + return 1; } /* if the parameter is castable then add the cast */