From 2ee36e8b9927f0a8fd6f37f38101ff1f92c402c0 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 9 Jun 2019 18:10:07 +0900 Subject: [PATCH] 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. --- include/QF/pr_type.h | 2 +- tools/qfcc/source/dump_globals.c | 10 +++++----- tools/qfcc/source/linker.c | 2 +- tools/qfcc/source/obj_file.c | 6 +++--- tools/qfcc/source/obj_type.c | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/QF/pr_type.h b/include/QF/pr_type.h index 8e3f771df..4cc6cf82e 100644 --- a/include/QF/pr_type.h +++ b/include/QF/pr_type.h @@ -84,7 +84,7 @@ typedef struct qfot_array_s { arrays. */ 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 string_t encoding; ///< Objective-QC encoding union { diff --git a/tools/qfcc/source/dump_globals.c b/tools/qfcc/source/dump_globals.c index 4361b7a57..71b769629 100644 --- a/tools/qfcc/source/dump_globals.c +++ b/tools/qfcc/source/dump_globals.c @@ -445,17 +445,17 @@ dump_qfo_types (qfo_t *qfo, int base_address) qfo->spaces[qfo_type_space].data_size); continue; } - if (type->ty < 0 || type->ty >= NUM_META) - meta = va ("invalid meta: %d", type->ty); + if (type->meta < 0 || type->meta >= NUM_META) + meta = va ("invalid meta: %d", type->meta); else - meta = ty_meta_names[type->ty]; + meta = ty_meta_names[type->meta]; printf ("%-5x %-9s %-20s", type_ptr + base_address, meta, QFO_TYPESTR (qfo, type_ptr)); - if (type->ty < 0 || type->ty >= NUM_META) { + if (type->meta < 0 || type->meta >= NUM_META) { puts (""); break; } - switch ((ty_meta_e) type->ty) { + switch ((ty_meta_e) type->meta) { case ty_none: printf (" %-10s", (type->t.type < 0 || type->t.type >= ev_type_count) diff --git a/tools/qfcc/source/linker.c b/tools/qfcc/source/linker.c index 4d1c86e31..3f07ba7b0 100644 --- a/tools/qfcc/source/linker.c +++ b/tools/qfcc/source/linker.c @@ -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 // new address in the encoding's class field so def and function types // can be updated easily. - old_type->ty = -1; + old_type->meta = -1; old_type->t.class = REF (ref)->offset; } } diff --git a/tools/qfcc/source/obj_file.c b/tools/qfcc/source/obj_file.c index 428b733dc..10ca126f9 100644 --- a/tools/qfcc/source/obj_file.c +++ b/tools/qfcc/source/obj_file.c @@ -646,7 +646,7 @@ get_def_type (qfo_t *qfo, pointer_t type) if (type >= qfo->spaces[qfo_type_space].data_size) return ev_void; 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: // field, pointer and function types store their basic type in // 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) return 1; 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: // field, pointer and function types store their basic type in // 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) return; 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; df->numparms = num_params = type->t.func.num_params; if (num_params < 0) diff --git a/tools/qfcc/source/obj_type.c b/tools/qfcc/source/obj_type.c index 2b77a864f..55da5c137 100644 --- a/tools/qfcc/source/obj_type.c +++ b/tools/qfcc/source/obj_type.c @@ -87,7 +87,7 @@ qfo_new_encoding (type_t *type, int size) def->offset = defspace_alloc_loc (pr.type_data, size); enc = D_POINTER (qfot_type_t, def); - enc->ty = type->meta; + enc->meta = type->meta; enc->size = size; ENC_STR (enc->encoding, type->encoding); return def;