mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
[qfcc] Preserve requested alignment if larger
build_struct was unconditionally setting the type's alignment. This was not a problem before because no types were requesting alignments larger than those requested by their members (for structs). However, with the upcoming new instruction set, quaternions need to be 4-word aligned.
This commit is contained in:
parent
5fb28d7c38
commit
f56fd6ffb6
2 changed files with 4 additions and 2 deletions
|
@ -171,7 +171,9 @@ build_struct (int su, symbol_t *tag, symtab_t *symtab, type_t *type)
|
|||
if (!type)
|
||||
sym->type = find_type (sym->type); // checks the tag, not the symtab
|
||||
sym->type->t.symtab = symtab;
|
||||
sym->type->alignment = alignment;
|
||||
if (alignment > sym->type->alignment) {
|
||||
sym->type->alignment = alignment;
|
||||
}
|
||||
if (!type && sym->type->type_def->external) //FIXME should not be necessary
|
||||
sym->type->type_def = qfo_encode_type (sym->type, pr.type_data);
|
||||
return sym;
|
||||
|
|
|
@ -74,7 +74,7 @@ type_t type_function = { ev_func, "function", 1, ty_basic,
|
|||
{{&type_void}} };
|
||||
type_t type_pointer = { ev_pointer, "pointer", 1, ty_basic,
|
||||
{{&type_void}} };
|
||||
type_t type_quaternion = { ev_quat, "quaternion", 1 };
|
||||
type_t type_quaternion = { ev_quat, "quaternion", 4 };
|
||||
type_t type_integer = { ev_integer, "int", 1 };
|
||||
type_t type_uinteger = { ev_uinteger, "uint", 1 };
|
||||
type_t type_short = { ev_short, "short", 1 };
|
||||
|
|
Loading…
Reference in a new issue