fix for .unions so h2 compiles again.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4426 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
236e08f9fb
commit
7d4c88814e
2 changed files with 11 additions and 12 deletions
|
@ -5280,7 +5280,7 @@ QCC_def_t *QCC_PR_ParseValue (QCC_type_t *assumeclass, pbool allowarrayassign, p
|
|||
if (!expandmemberfields && assumeclass)
|
||||
{
|
||||
if (!d)
|
||||
QCC_PR_ParseError (ERR_UNKNOWNVALUE, "Unknown value \"%s\" in class \"%s\"", name, assumeclass->name);
|
||||
QCC_PR_ParseError (ERR_UNKNOWNVALUE, "Unknown field \"%s\" in class \"%s\"", name, assumeclass->name);
|
||||
else if (!assumeclass->parentclass && assumeclass != type_entity)
|
||||
{
|
||||
QCC_PR_ParseWarning (ERR_UNKNOWNVALUE, "Class \"%s\" is not defined, cannot access memeber \"%s\"", assumeclass->name, name);
|
||||
|
@ -5289,7 +5289,7 @@ QCC_def_t *QCC_PR_ParseValue (QCC_type_t *assumeclass, pbool allowarrayassign, p
|
|||
}
|
||||
else
|
||||
{
|
||||
QCC_PR_ParseWarning (ERR_UNKNOWNVALUE, "Unknown value \"%s\" in class \"%s\"", name, assumeclass->name);
|
||||
QCC_PR_ParseWarning (ERR_UNKNOWNVALUE, "Unknown field \"%s\" in class \"%s\"", name, assumeclass->name);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -9195,10 +9195,10 @@ QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, char *name, QCC_def_t *scope,
|
|||
{
|
||||
case ev_union:
|
||||
case ev_struct:
|
||||
if (*name)
|
||||
if (*name && *name != '<')
|
||||
sprintf(newname, "%s%s.%s", name, array, type->params[partnum].paramname);
|
||||
else
|
||||
sprintf(newname, "%s%s", parttype->name, array);
|
||||
sprintf(newname, "%s%s", type->params[partnum].paramname, array);
|
||||
def = QCC_PR_DummyFieldDef(parttype, newname, scope, 1, fieldofs, saved);
|
||||
break;
|
||||
case ev_float:
|
||||
|
@ -9209,10 +9209,10 @@ QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, char *name, QCC_def_t *scope,
|
|||
case ev_pointer:
|
||||
case ev_integer:
|
||||
case ev_variant:
|
||||
if (*name)
|
||||
if (*name && *name != '<')
|
||||
sprintf(newname, "%s%s.%s", name, array, type->params[partnum].paramname);
|
||||
else
|
||||
sprintf(newname, "%s%s", parttype->name, array);
|
||||
sprintf(newname, "%s%s", type->params[partnum].paramname, array);
|
||||
ftype = QCC_PR_NewType("FIELD_TYPE", ev_field, false);
|
||||
ftype->aux_type = parttype;
|
||||
if (parttype->type == ev_vector)
|
||||
|
@ -9230,7 +9230,7 @@ QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, char *name, QCC_def_t *scope,
|
|||
break;
|
||||
|
||||
case ev_function:
|
||||
if (*name)
|
||||
if (*name && *name != '<')
|
||||
sprintf(newname, "%s%s.%s", name, array, parttype->name);
|
||||
else
|
||||
sprintf(newname, "%s%s", parttype->name, array);
|
||||
|
@ -9248,8 +9248,6 @@ QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, char *name, QCC_def_t *scope,
|
|||
maxfield = *fieldofs;
|
||||
if (isunion)
|
||||
*fieldofs = startfield;
|
||||
|
||||
type = parttype;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2908,10 +2908,11 @@ void QCC_PR_ParsePrintDef (int type, QCC_def_t *def)
|
|||
return;
|
||||
if (def->s_file)
|
||||
{
|
||||
char buffer[512];
|
||||
if (flag_msvcstyle)
|
||||
printf ("%s(%i) : %s is defined here\n", strings + def->s_file, def->s_line, def->name);
|
||||
printf ("%s(%i) : %s %s is defined here\n", strings + def->s_file, def->s_line, TypeName(def->type, buffer, sizeof(buffer)), def->name);
|
||||
else
|
||||
printf ("%s:%i: %s is defined here\n", strings + def->s_file, def->s_line, def->name);
|
||||
printf ("%s:%i: %s %s is defined here\n", strings + def->s_file, def->s_line, TypeName(def->type, buffer, sizeof(buffer)), def->name);
|
||||
}
|
||||
}
|
||||
void *errorscope;
|
||||
|
@ -4211,7 +4212,7 @@ QCC_type_t *QCC_PR_ParseType (int newtype, pbool silentfail)
|
|||
if (QCC_PR_CheckToken("{"))
|
||||
{
|
||||
//nameless struct
|
||||
newt = QCC_PR_NewType(structtype==ev_union?"union":"struct", structtype, false);
|
||||
newt = QCC_PR_NewType(structtype==ev_union?"<union>":"<struct>", structtype, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue