mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-10 17:50:54 +00:00
Rename qfot_type_t.ty to meta
When I did up a ruamoko implementation of a type encoding dumper, I named the field meta, which feels much better than ty.
This commit is contained in:
parent
f093516962
commit
2ee36e8b99
5 changed files with 11 additions and 11 deletions
|
@ -84,7 +84,7 @@ typedef struct qfot_array_s {
|
||||||
arrays.
|
arrays.
|
||||||
*/
|
*/
|
||||||
typedef struct qfot_type_s {
|
typedef struct qfot_type_s {
|
||||||
pr_int_t ty; ///< meta type: ty_meta_e
|
pr_int_t meta; ///< meta type: ty_meta_e
|
||||||
pr_int_t size; ///< total word size of this encoding
|
pr_int_t size; ///< total word size of this encoding
|
||||||
string_t encoding; ///< Objective-QC encoding
|
string_t encoding; ///< Objective-QC encoding
|
||||||
union {
|
union {
|
||||||
|
|
|
@ -445,17 +445,17 @@ dump_qfo_types (qfo_t *qfo, int base_address)
|
||||||
qfo->spaces[qfo_type_space].data_size);
|
qfo->spaces[qfo_type_space].data_size);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (type->ty < 0 || type->ty >= NUM_META)
|
if (type->meta < 0 || type->meta >= NUM_META)
|
||||||
meta = va ("invalid meta: %d", type->ty);
|
meta = va ("invalid meta: %d", type->meta);
|
||||||
else
|
else
|
||||||
meta = ty_meta_names[type->ty];
|
meta = ty_meta_names[type->meta];
|
||||||
printf ("%-5x %-9s %-20s", type_ptr + base_address, meta,
|
printf ("%-5x %-9s %-20s", type_ptr + base_address, meta,
|
||||||
QFO_TYPESTR (qfo, type_ptr));
|
QFO_TYPESTR (qfo, type_ptr));
|
||||||
if (type->ty < 0 || type->ty >= NUM_META) {
|
if (type->meta < 0 || type->meta >= NUM_META) {
|
||||||
puts ("");
|
puts ("");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch ((ty_meta_e) type->ty) {
|
switch ((ty_meta_e) type->meta) {
|
||||||
case ty_none:
|
case ty_none:
|
||||||
printf (" %-10s", (type->t.type < 0
|
printf (" %-10s", (type->t.type < 0
|
||||||
|| type->t.type >= ev_type_count)
|
|| type->t.type >= ev_type_count)
|
||||||
|
|
|
@ -414,7 +414,7 @@ process_type_def (defref_t *ref, qfo_mspace_t *space, qfo_def_t *old)
|
||||||
// mark the old type encoding as having been transfered, and save the
|
// mark the old type encoding as having been transfered, and save the
|
||||||
// new address in the encoding's class field so def and function types
|
// new address in the encoding's class field so def and function types
|
||||||
// can be updated easily.
|
// can be updated easily.
|
||||||
old_type->ty = -1;
|
old_type->meta = -1;
|
||||||
old_type->t.class = REF (ref)->offset;
|
old_type->t.class = REF (ref)->offset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -646,7 +646,7 @@ get_def_type (qfo_t *qfo, pointer_t type)
|
||||||
if (type >= qfo->spaces[qfo_type_space].data_size)
|
if (type >= qfo->spaces[qfo_type_space].data_size)
|
||||||
return ev_void;
|
return ev_void;
|
||||||
type_def = QFO_POINTER (qfo, qfo_type_space, qfot_type_t, type);
|
type_def = QFO_POINTER (qfo, qfo_type_space, qfot_type_t, type);
|
||||||
switch ((ty_meta_e)type_def->ty) {
|
switch ((ty_meta_e)type_def->meta) {
|
||||||
case ty_none:
|
case ty_none:
|
||||||
// field, pointer and function types store their basic type in
|
// field, pointer and function types store their basic type in
|
||||||
// the same location.
|
// the same location.
|
||||||
|
@ -673,7 +673,7 @@ get_type_size (qfo_t *qfo, pointer_t type)
|
||||||
if (type >= qfo->spaces[qfo_type_space].data_size)
|
if (type >= qfo->spaces[qfo_type_space].data_size)
|
||||||
return 1;
|
return 1;
|
||||||
type_def = QFO_POINTER (qfo, qfo_type_space, qfot_type_t, type);
|
type_def = QFO_POINTER (qfo, qfo_type_space, qfot_type_t, type);
|
||||||
switch ((ty_meta_e)type_def->ty) {
|
switch ((ty_meta_e)type_def->meta) {
|
||||||
case ty_none:
|
case ty_none:
|
||||||
// field, pointer and function types store their basic type in
|
// field, pointer and function types store their basic type in
|
||||||
// the same location.
|
// the same location.
|
||||||
|
@ -711,7 +711,7 @@ function_params (qfo_t *qfo, qfo_func_t *func, dfunction_t *df)
|
||||||
if (func->type >= qfo->spaces[qfo_type_space].data_size)
|
if (func->type >= qfo->spaces[qfo_type_space].data_size)
|
||||||
return;
|
return;
|
||||||
type = QFO_POINTER (qfo, qfo_type_space, qfot_type_t, func->type);
|
type = QFO_POINTER (qfo, qfo_type_space, qfot_type_t, func->type);
|
||||||
if (type->ty != ty_none && type->t.type != ev_func)
|
if (type->meta != ty_none && type->t.type != ev_func)
|
||||||
return;
|
return;
|
||||||
df->numparms = num_params = type->t.func.num_params;
|
df->numparms = num_params = type->t.func.num_params;
|
||||||
if (num_params < 0)
|
if (num_params < 0)
|
||||||
|
|
|
@ -87,7 +87,7 @@ qfo_new_encoding (type_t *type, int size)
|
||||||
def->offset = defspace_alloc_loc (pr.type_data, size);
|
def->offset = defspace_alloc_loc (pr.type_data, size);
|
||||||
|
|
||||||
enc = D_POINTER (qfot_type_t, def);
|
enc = D_POINTER (qfot_type_t, def);
|
||||||
enc->ty = type->meta;
|
enc->meta = type->meta;
|
||||||
enc->size = size;
|
enc->size = size;
|
||||||
ENC_STR (enc->encoding, type->encoding);
|
ENC_STR (enc->encoding, type->encoding);
|
||||||
return def;
|
return def;
|
||||||
|
|
Loading…
Reference in a new issue