Black's fix for #define macro parameters in fteqcc.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2868 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2008-01-23 00:37:56 +00:00
parent 004ffebb66
commit ae0a8461b7
1 changed files with 9 additions and 1 deletions

View File

@ -2026,6 +2026,13 @@ int QCC_PR_CheakCompConst(void)
start = pr_file_p;
while(1)
{
// handle strings correctly by ignoring them
if (*pr_file_p == '\"')
{
do {
pr_file_p++;
} while( (pr_file_p[-1] == '\\' || pr_file_p[0] != '\"') && *pr_file_p && *pr_file_p != '\n' );
}
if (*pr_file_p == '(')
plevel++;
else if (!plevel && (*pr_file_p == ',' || *pr_file_p == ')'))
@ -2042,6 +2049,8 @@ int QCC_PR_CheakCompConst(void)
pr_file_p++;
while(*pr_file_p == ' ' || *pr_file_p == '\t')
pr_file_p++;
// move back by one char because we move forward by one at the end of the loop
pr_file_p--;
if (param == MAXCONSTANTPARAMS)
QCC_PR_ParseError(ERR_TOOMANYPARAMS, "Too many parameters in macro call");
} else if (*pr_file_p == ')' )
@ -2110,7 +2119,6 @@ int QCC_PR_CheakCompConst(void)
for (p = 0; p < param; p++)
{
if (!STRCMP(qcc_token, c->params[p]))
{
strcat(buffer, paramoffset[p]);