fix a couple of issues.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4386 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2013-06-04 15:41:21 +00:00
parent d0c7e83b62
commit 40a72c7bac
2 changed files with 9 additions and 15 deletions

View File

@ -3981,24 +3981,17 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could
param[arg] = e;
paramtypes[arg] = p;
/* if (e->type->size>1)
QCC_PR_Statement (&pr_opcodes[OP_STORE_V], e, d, (QCC_dstatement_t **)0xffffffff);
else
QCC_PR_Statement (&pr_opcodes[OP_STORE_F], e, d, (QCC_dstatement_t **)0xffffffff);
*/
arg++;
} while (QCC_PR_CheckToken (","));
//don't warn if we omited optional arguments
while (np > arg && func->type->params[np-1].optional)
np--;
if (arg < np)
QCC_PR_ParseWarning (WARN_TOOFEWPARAMS, "too few parameters on call to %s", func->name);
QCC_PR_Expect (")");
}
else if (np)
//don't warn if we omited optional arguments
while (np > arg && func->type->params[np-1].optional)
np--;
if (arg < np)
{
QCC_PR_ParseWarning (WARN_TOOFEWPARAMS, "%s: Too few parameters", func->name);
QCC_PR_ParseWarning (WARN_TOOFEWPARAMS, "too few parameters on call to %s", func->name);
QCC_PR_ParsePrintDef (WARN_TOOFEWPARAMS, func);
}
@ -4470,6 +4463,7 @@ void QCC_PR_EmitClassFromFunction(QCC_def_t *scope, char *tname)
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[OP_STORE_ENT], self, oself, NULL));
constructed = true;
}
constructor->references++;
QCC_FreeTemp(QCC_PR_Statement(&pr_opcodes[OP_STORE_ENT], ed, self, NULL)); //return to our old self. boom boom.
QCC_PR_SimpleStatement(OP_CALL0, constructor->ofs, 0, 0, false);
}

View File

@ -3553,7 +3553,7 @@ char pr_parm_names[MAX_PARMS+MAX_EXTRA_PARMS][MAX_NAME];
char pr_parm_names[MAX_PARMS][MAX_NAME];
#endif
pbool recursivefunctiontype;
int recursivefunctiontype;
//expects a ( to have already been parsed.
QCC_type_t *QCC_PR_ParseFunctionType (int newtype, QCC_type_t *returntype)
@ -3913,7 +3913,7 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail)
QCC_Error(ERR_INTERNAL, "Can only initialise member functions");
else
{
extern int locals_end, locals_start;
extern unsigned int locals_end, locals_start;
extern QCC_type_t *pr_classtype;
QCC_function_t *QCC_PR_ParseImmediateStatements (QCC_type_t *type);