Fix a couple of bugs.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4406 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2013-06-26 03:35:29 +00:00
parent 56131015c6
commit 986d21f10c
2 changed files with 15 additions and 11 deletions

View File

@ -4818,8 +4818,8 @@ QCC_def_t *QCC_PR_ParseArrayPointer (QCC_def_t *d, pbool allowarrayassign)
else
idx = tmp;
}
t = t->params[i].type;
arraysize = t->params[i].arraysize;
t = t->params[i].type;
}
else
break;

View File

@ -3862,18 +3862,22 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail)
if (QCC_PR_CheckToken ("."))
{
newt = QCC_PR_NewType("FIELD_TYPE", ev_field, false);
newt->aux_type = QCC_PR_ParseType (false, false);
newt->size = newt->aux_type->size;
//.float *foo; is annoying.
//technically it is a pointer to a .float
//most people will want a .(float*) foo;
//so .*float will give you that.
//however, we can't cope parsing that with regular types, so we support that ONLY when . was already specified.
//this is pretty much an evil syntax hack.
if (QCC_PR_CheckToken ("*"))
{
newt->aux_type = QCC_PR_NewType("POINTER TYPE", ev_pointer, false);
newt->aux_type->aux_type = QCC_PR_ParseType (false, false);
if (newtype)
return newt;
return QCC_PR_FindType (newt);
}
if (QCC_PR_CheckToken ("*"))
{
newt = QCC_PR_NewType("POINTER TYPE", ev_pointer, false);
newt->aux_type = QCC_PR_ParseType (false, false);
newt->aux_type->size = newt->aux_type->aux_type->size;
}
else
newt->aux_type = QCC_PR_ParseType (false, false);
newt->size = newt->aux_type->size;