diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index eb12d8e27..429879799 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -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); } diff --git a/engine/qclib/qcc_pr_lex.c b/engine/qclib/qcc_pr_lex.c index 845c44cb9..bd44cb2e4 100644 --- a/engine/qclib/qcc_pr_lex.c +++ b/engine/qclib/qcc_pr_lex.c @@ -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);