Should fix the problem with "effectless statement" lines being off-by-a-statement.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1692 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-12-09 19:35:25 +00:00
parent cbea9f9a9e
commit c7e7a3ac86

View file

@ -4582,6 +4582,7 @@ void QCC_PR_ParseStatement (void)
int i;
QCC_def_t *e, *e2;
QCC_dstatement_t *patch1, *patch2, *patch3;
int statementstart = pr_source_line;
if (QCC_PR_CheckToken ("{"))
{
@ -5402,7 +5403,10 @@ void QCC_PR_ParseStatement (void)
}
if (QCC_PR_CheckToken(";"))
{
int osl = pr_source_line;
pr_source_line = statementstart;
QCC_PR_ParseWarning(WARN_POINTLESSSTATEMENT, "Hanging ';'");
pr_source_line = osl;
return;
}
@ -5413,7 +5417,12 @@ void QCC_PR_ParseStatement (void)
QCC_PR_Expect (";");
if (e->type->type != ev_void && !qcc_usefulstatement)
{
int osl = pr_source_line;
pr_source_line = statementstart;
QCC_PR_ParseWarning(WARN_POINTLESSSTATEMENT, "Effectless statement");
pr_source_line = osl;
}
QCC_FreeTemp(e);