From afd1eb775bb9c47338a7b237ecc769b731685b7e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 18 Jan 2022 14:36:06 +0900 Subject: [PATCH] [gamecode] Rename ev_pointer to ev_ptr Rather short (no worse than ev_int, though) but more consistency is usually a good thing. --- include/QF/progs/pr_type.h | 4 +- include/QF/progs/pr_type_names.h | 2 +- libs/gamecode/opcodes.py | 2 +- libs/gamecode/pr_debug.c | 2 +- libs/gamecode/pr_v6p_opcode.c | 238 ++++++++++----------- libs/video/renderer/vulkan/vkgen/vkalias.r | 2 +- libs/video/renderer/vulkan/vkgen/vkgen.r | 2 +- libs/video/renderer/vulkan/vkgen/vktype.r | 8 +- nq/source/sv_progs.c | 2 +- qw/source/sv_progs.c | 2 +- ruamoko/lib/types.r | 2 +- ruamoko/qwaq/debugger/typeencodings.r | 2 +- tools/qfcc/source/class.c | 18 +- tools/qfcc/source/constfold.c | 32 +-- tools/qfcc/source/dags.c | 2 +- tools/qfcc/source/def.c | 2 +- tools/qfcc/source/dot_expr.c | 2 +- tools/qfcc/source/dot_type.c | 4 +- tools/qfcc/source/dump_globals.c | 4 +- tools/qfcc/source/expr.c | 21 +- tools/qfcc/source/expr_binary.c | 16 +- tools/qfcc/source/expr_bool.c | 2 +- tools/qfcc/source/flow.c | 2 +- tools/qfcc/source/obj_type.c | 2 +- tools/qfcc/source/statements.c | 8 +- tools/qfcc/source/type.c | 22 +- tools/qfcc/source/value.c | 6 +- tools/qfcc/test/typedef.r | 2 +- 28 files changed, 208 insertions(+), 205 deletions(-) diff --git a/include/QF/progs/pr_type.h b/include/QF/progs/pr_type.h index 328b2ff3e..02c591dfa 100644 --- a/include/QF/progs/pr_type.h +++ b/include/QF/progs/pr_type.h @@ -58,7 +58,7 @@ typedef struct qfot_alias_s { } qfot_alias_t; typedef struct qfot_fldptr_s { - etype_t type; ///< ev_field or ev_pointer + etype_t type; ///< ev_field or ev_ptr pr_ptr_t aux_type; ///< referenced type } qfot_fldptr_t; @@ -106,7 +106,7 @@ typedef struct qfot_type_s { pr_string_t encoding; ///< Objective-QC encoding union { etype_t type; ///< ty_basic: etype_t - qfot_fldptr_t fldptr; ///< ty_basic, ev_pointer/ev_field + qfot_fldptr_t fldptr; ///< ty_basic, ev_ptr/ev_field qfot_func_t func; ///< ty_basic, ev_func qfot_struct_t strct; ///< ty_struct/ty_union/ty_enum qfot_array_t array; ///< ty_array diff --git a/include/QF/progs/pr_type_names.h b/include/QF/progs/pr_type_names.h index ff190f2cd..712a3c74c 100644 --- a/include/QF/progs/pr_type_names.h +++ b/include/QF/progs/pr_type_names.h @@ -37,7 +37,7 @@ EV_TYPE(vector) EV_TYPE(entity) EV_TYPE(field) EV_TYPE(func) -EV_TYPE(pointer) // end of v6 types +EV_TYPE(ptr) // end of v6 types EV_TYPE(quat) EV_TYPE(int) EV_TYPE(uint) diff --git a/libs/gamecode/opcodes.py b/libs/gamecode/opcodes.py index 8734bb03c..f35067a7e 100644 --- a/libs/gamecode/opcodes.py +++ b/libs/gamecode/opcodes.py @@ -187,7 +187,7 @@ lea_formats = { "opname": "lea", "format": "{lea_fmt[mm]}", "widths": "0, 0, 1", - "types": "ev_pointer, ev_pointer, ev_pointer", + "types": "ev_ptr, ev_ptr, ev_ptr", "args": { "op_mode": "AECD", "lea_fmt": [ diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index 9e0b1b363..16d584e88 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -1050,7 +1050,7 @@ value_string (pr_debug_data_t *data, qfot_type_t *type, pr_type_t *value) case ev_func: raw_type_view.func_view (type, value, data); break; - case ev_pointer: + case ev_ptr: raw_type_view.pointer_view (type, value, data); break; case ev_quat: diff --git a/libs/gamecode/pr_v6p_opcode.c b/libs/gamecode/pr_v6p_opcode.c index c61821852..934a6ed69 100644 --- a/libs/gamecode/pr_v6p_opcode.c +++ b/libs/gamecode/pr_v6p_opcode.c @@ -335,182 +335,182 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { "%Ga.%Gb(%Ec), %gc", }, [OP_LOAD_P_v6p] = {".", "load.p", - ev_entity, ev_field, ev_pointer, + ev_entity, ev_field, ev_ptr, PROG_V6P_VERSION, "%Ga.%Gb(%Ec), %gc", }, [OP_LOADB_D_v6p] = {".", "loadb.d", - ev_pointer, ev_int, ev_double, + ev_ptr, ev_int, ev_double, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_F_v6p] = {".", "loadb.f", - ev_pointer, ev_int, ev_float, + ev_ptr, ev_int, ev_float, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_V_v6p] = {".", "loadb.v", - ev_pointer, ev_int, ev_vector, + ev_ptr, ev_int, ev_vector, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_Q_v6p] = {".", "loadb.q", - ev_pointer, ev_int, ev_quat, + ev_ptr, ev_int, ev_quat, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_S_v6p] = {".", "loadb.s", - ev_pointer, ev_int, ev_string, + ev_ptr, ev_int, ev_string, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_ENT_v6p] = {".", "loadb.ent", - ev_pointer, ev_int, ev_entity, + ev_ptr, ev_int, ev_entity, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_FLD_v6p] = {".", "loadb.fld", - ev_pointer, ev_int, ev_field, + ev_ptr, ev_int, ev_field, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_FN_v6p] = {".", "loadb.fn", - ev_pointer, ev_int, ev_func, + ev_ptr, ev_int, ev_func, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_I_v6p] = {".", "loadb.i", - ev_pointer, ev_int, ev_int, + ev_ptr, ev_int, ev_int, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADB_P_v6p] = {".", "loadb.p", - ev_pointer, ev_int, ev_pointer, + ev_ptr, ev_int, ev_ptr, PROG_V6P_VERSION, "*(%Ga + %Gb), %gc", }, [OP_LOADBI_D_v6p] = {".", "loadbi.d", - ev_pointer, ev_short, ev_double, + ev_ptr, ev_short, ev_double, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_F_v6p] = {".", "loadbi.f", - ev_pointer, ev_short, ev_float, + ev_ptr, ev_short, ev_float, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_V_v6p] = {".", "loadbi.v", - ev_pointer, ev_short, ev_vector, + ev_ptr, ev_short, ev_vector, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_Q_v6p] = {".", "loadbi.q", - ev_pointer, ev_short, ev_quat, + ev_ptr, ev_short, ev_quat, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_S_v6p] = {".", "loadbi.s", - ev_pointer, ev_short, ev_string, + ev_ptr, ev_short, ev_string, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_ENT_v6p] = {".", "loadbi.ent", - ev_pointer, ev_short, ev_entity, + ev_ptr, ev_short, ev_entity, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_FLD_v6p] = {".", "loadbi.fld", - ev_pointer, ev_short, ev_field, + ev_ptr, ev_short, ev_field, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_FN_v6p] = {".", "loadbi.fn", - ev_pointer, ev_short, ev_func, + ev_ptr, ev_short, ev_func, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_I_v6p] = {".", "loadbi.i", - ev_pointer, ev_short, ev_int, + ev_ptr, ev_short, ev_int, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_LOADBI_P_v6p] = {".", "loadbi.p", - ev_pointer, ev_short, ev_pointer, + ev_ptr, ev_short, ev_ptr, PROG_V6P_VERSION, "*(%Ga + %sb), %gc", }, [OP_ADDRESS_v6p] = {"&", "address", - ev_entity, ev_field, ev_pointer, + ev_entity, ev_field, ev_ptr, PROG_ID_VERSION, "%Ga.%Gb(%Ec), %gc", }, [OP_ADDRESS_VOID_v6p] = {"&", "address", - ev_void, ev_invalid, ev_pointer, + ev_void, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_D_v6p] = {"&", "address.d", - ev_double, ev_invalid, ev_pointer, + ev_double, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_F_v6p] = {"&", "address.f", - ev_float, ev_invalid, ev_pointer, + ev_float, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_V_v6p] = {"&", "address.v", - ev_vector, ev_invalid, ev_pointer, + ev_vector, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_Q_v6p] = {"&", "address.q", - ev_quat, ev_invalid, ev_pointer, + ev_quat, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_S_v6p] = {"&", "address.s", - ev_string, ev_invalid, ev_pointer, + ev_string, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_ENT_v6p] = {"&", "address.ent", - ev_entity, ev_invalid, ev_pointer, + ev_entity, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_FLD_v6p] = {"&", "address.fld", - ev_field, ev_invalid, ev_pointer, + ev_field, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_FN_v6p] = {"&", "address.fn", - ev_func, ev_invalid, ev_pointer, + ev_func, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_I_v6p] = {"&", "address.i", - ev_int, ev_invalid, ev_pointer, + ev_int, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_ADDRESS_P_v6p] = {"&", "address.p", - ev_pointer, ev_invalid, ev_pointer, + ev_ptr, ev_invalid, ev_ptr, PROG_V6P_VERSION, "%Ga, %gc", }, [OP_LEA_v6p] = {"&", "lea", - ev_pointer, ev_int, ev_pointer, + ev_ptr, ev_int, ev_ptr, PROG_V6P_VERSION, "(%Ga + %Gb), %gc", }, [OP_LEAI_v6p] = {"&", "leai", - ev_pointer, ev_short, ev_pointer, + ev_ptr, ev_short, ev_ptr, PROG_V6P_VERSION, "(%Ga + %sb), %gc", }, @@ -592,160 +592,160 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { "%Ga, %gb", }, [OP_STORE_P_v6p] = {"=", "store.p", - ev_pointer, ev_pointer, ev_invalid, + ev_ptr, ev_ptr, ev_invalid, PROG_V6P_VERSION, "%Ga, %gb", }, [OP_STOREP_D_v6p] = {".=", "storep.d", - ev_double, ev_pointer, ev_invalid, + ev_double, ev_ptr, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, [OP_STOREP_F_v6p] = {".=", "storep.f", - ev_float, ev_pointer, ev_invalid, + ev_float, ev_ptr, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, [OP_STOREP_V_v6p] = {".=", "storep.v", - ev_vector, ev_pointer, ev_invalid, + ev_vector, ev_ptr, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, [OP_STOREP_Q_v6p] = {".=", "storep.q", - ev_quat, ev_pointer, ev_invalid, + ev_quat, ev_ptr, ev_invalid, PROG_V6P_VERSION, "%Ga, *%Gb", }, [OP_STOREP_S_v6p] = {".=", "storep.s", - ev_string, ev_pointer, ev_invalid, + ev_string, ev_ptr, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, [OP_STOREP_ENT_v6p] = {".=", "storep.ent", - ev_entity, ev_pointer, ev_invalid, + ev_entity, ev_ptr, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, [OP_STOREP_FLD_v6p] = {".=", "storep.fld", - ev_field, ev_pointer, ev_invalid, + ev_field, ev_ptr, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, [OP_STOREP_FN_v6p] = {".=", "storep.fn", - ev_func, ev_pointer, ev_invalid, + ev_func, ev_ptr, ev_invalid, PROG_ID_VERSION, "%Ga, *%Gb", }, [OP_STOREP_I_v6p] = {".=", "storep.i", - ev_int, ev_pointer, ev_invalid, + ev_int, ev_ptr, ev_invalid, PROG_V6P_VERSION, "%Ga, *%Gb", }, [OP_STOREP_P_v6p] = {".=", "storep.p", - ev_pointer, ev_pointer, ev_invalid, + ev_ptr, ev_ptr, ev_invalid, PROG_V6P_VERSION, "%Ga, *%Gb", }, [OP_STOREB_D_v6p] = {".=", "storeb.d", - ev_double, ev_pointer, ev_int, + ev_double, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_F_v6p] = {".=", "storeb.f", - ev_float, ev_pointer, ev_int, + ev_float, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_V_v6p] = {".=", "storeb.v", - ev_vector, ev_pointer, ev_int, + ev_vector, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_Q_v6p] = {".=", "storeb.q", - ev_quat, ev_pointer, ev_int, + ev_quat, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_S_v6p] = {".=", "storeb.s", - ev_string, ev_pointer, ev_int, + ev_string, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_ENT_v6p] = {".=", "storeb.ent", - ev_entity, ev_pointer, ev_int, + ev_entity, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_FLD_v6p] = {".=", "storeb.fld", - ev_field, ev_pointer, ev_int, + ev_field, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_FN_v6p] = {".=", "storeb.fn", - ev_func, ev_pointer, ev_int, + ev_func, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_I_v6p] = {".=", "storeb.i", - ev_int, ev_pointer, ev_int, + ev_int, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREB_P_v6p] = {".=", "storeb.p", - ev_pointer, ev_pointer, ev_int, + ev_ptr, ev_ptr, ev_int, PROG_V6P_VERSION, "%Ga, *(%Gb + %Gc)", }, [OP_STOREBI_D_v6p] = {".=", "storebi.d", - ev_double, ev_pointer, ev_short, + ev_double, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_F_v6p] = {".=", "storebi.f", - ev_float, ev_pointer, ev_short, + ev_float, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_V_v6p] = {".=", "storebi.v", - ev_vector, ev_pointer, ev_short, + ev_vector, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_Q_v6p] = {".=", "storebi.q", - ev_quat, ev_pointer, ev_short, + ev_quat, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_S_v6p] = {".=", "storebi.s", - ev_string, ev_pointer, ev_short, + ev_string, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_ENT_v6p] = {".=", "storebi.ent", - ev_entity, ev_pointer, ev_short, + ev_entity, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_FLD_v6p] = {".=", "storebi.fld", - ev_field, ev_pointer, ev_short, + ev_field, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_FN_v6p] = {".=", "storebi.fn", - ev_func, ev_pointer, ev_short, + ev_func, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_I_v6p] = {".=", "storebi.i", - ev_int, ev_pointer, ev_short, + ev_int, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, [OP_STOREBI_P_v6p] = {".=", "storebi.p", - ev_pointer, ev_pointer, ev_short, + ev_ptr, ev_ptr, ev_short, PROG_V6P_VERSION, "%Ga, *(%Gb + %sc)", }, @@ -798,7 +798,7 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { "%Ga, %gc", }, [OP_NOT_P_v6p] = {"!", "not.p", - ev_pointer, ev_invalid, ev_int, + ev_ptr, ev_invalid, ev_int, PROG_V6P_VERSION, "%Ga, %gc", }, @@ -1112,27 +1112,27 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { }, [OP_GE_P_v6p] = {">=", "ge.p", - ev_pointer, ev_pointer, ev_int, + ev_ptr, ev_ptr, ev_int, PROG_V6P_VERSION, }, [OP_LE_P_v6p] = {"<=", "le.p", - ev_pointer, ev_pointer, ev_int, + ev_ptr, ev_ptr, ev_int, PROG_V6P_VERSION, }, [OP_GT_P_v6p] = {">", "gt.p", - ev_pointer, ev_pointer, ev_int, + ev_ptr, ev_ptr, ev_int, PROG_V6P_VERSION, }, [OP_LT_P_v6p] = {"<", "lt.p", - ev_pointer, ev_pointer, ev_int, + ev_ptr, ev_ptr, ev_int, PROG_V6P_VERSION, }, [OP_EQ_P_v6p] = {"==", "eq.p", - ev_pointer, ev_pointer, ev_int, + ev_ptr, ev_ptr, ev_int, PROG_V6P_VERSION, }, [OP_NE_P_v6p] = {"!=", "ne.p", - ev_pointer, ev_pointer, ev_int, + ev_ptr, ev_ptr, ev_int, PROG_V6P_VERSION, }, @@ -1142,12 +1142,12 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { "%Ga, %sb, %gc", }, [OP_MOVEP_v6p] = {"", "movep", - ev_pointer, ev_int, ev_pointer, + ev_ptr, ev_int, ev_ptr, PROG_V6P_VERSION, "%Ga, %Gb, %Gc", }, [OP_MOVEPI_v6p] = {"", "movepi", - ev_pointer, ev_short, ev_pointer, + ev_ptr, ev_short, ev_ptr, PROG_V6P_VERSION, "%Ga, %sb, %Gc", }, @@ -1157,12 +1157,12 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { "%Ga, %sb, %gc", }, [OP_MEMSETP_v6p] = {"", "memsetp", - ev_int, ev_int, ev_pointer, + ev_int, ev_int, ev_ptr, PROG_V6P_VERSION, "%Ga, %Gb, %Gc", }, [OP_MEMSETPI_v6p] = {"", "memsetpi", - ev_int, ev_short, ev_pointer, + ev_int, ev_short, ev_ptr, PROG_V6P_VERSION, "%Ga, %sb, %Gc", }, @@ -1198,7 +1198,7 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { "%Ga", }, [OP_PUSH_P_v6p] = {"", "push.p", - ev_pointer, ev_invalid, ev_invalid, + ev_ptr, ev_invalid, ev_invalid, PROG_V6P_VERSION, "%Ga", }, @@ -1219,103 +1219,103 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { }, [OP_PUSHB_S_v6p] = {"", "pushb.s", - ev_pointer, ev_int, ev_string, + ev_ptr, ev_int, ev_string, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_F_v6p] = {"", "pushb.f", - ev_pointer, ev_int, ev_float, + ev_ptr, ev_int, ev_float, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_V_v6p] = {"", "pushb.v", - ev_pointer, ev_int, ev_vector, + ev_ptr, ev_int, ev_vector, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_ENT_v6p] = {"", "pushb.ent", - ev_pointer, ev_int, ev_entity, + ev_ptr, ev_int, ev_entity, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_FLD_v6p] = {"", "pushb.fld", - ev_pointer, ev_int, ev_field, + ev_ptr, ev_int, ev_field, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_FN_v6p] = {"", "pushb.fn", - ev_pointer, ev_int, ev_func, + ev_ptr, ev_int, ev_func, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_P_v6p] = {"", "pushb.p", - ev_pointer, ev_int, ev_pointer, + ev_ptr, ev_int, ev_ptr, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_Q_v6p] = {"", "pushb.q", - ev_pointer, ev_int, ev_quat, + ev_ptr, ev_int, ev_quat, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_I_v6p] = {"", "pushb.i", - ev_pointer, ev_int, ev_int, + ev_ptr, ev_int, ev_int, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHB_D_v6p] = {"", "pushb.d", - ev_pointer, ev_int, ev_double, + ev_ptr, ev_int, ev_double, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_PUSHBI_S_v6p] = {"", "pushbi.s", - ev_pointer, ev_short, ev_string, + ev_ptr, ev_short, ev_string, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_F_v6p] = {"", "pushbi.f", - ev_pointer, ev_short, ev_float, + ev_ptr, ev_short, ev_float, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_V_v6p] = {"", "pushbi.v", - ev_pointer, ev_short, ev_vector, + ev_ptr, ev_short, ev_vector, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_ENT_v6p] = {"", "pushbi.ent", - ev_pointer, ev_short, ev_entity, + ev_ptr, ev_short, ev_entity, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_FLD_v6p] = {"", "pushbi.fld", - ev_pointer, ev_short, ev_field, + ev_ptr, ev_short, ev_field, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_FN_v6p] = {"", "pushbi.fn", - ev_pointer, ev_short, ev_func, + ev_ptr, ev_short, ev_func, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_P_v6p] = {"", "pushbi.p", - ev_pointer, ev_short, ev_pointer, + ev_ptr, ev_short, ev_ptr, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_Q_v6p] = {"", "pushbi.q", - ev_pointer, ev_short, ev_quat, + ev_ptr, ev_short, ev_quat, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_I_v6p] = {"", "pushbi.i", - ev_pointer, ev_short, ev_int, + ev_ptr, ev_short, ev_int, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_PUSHBI_D_v6p] = {"", "pushbi.d", - ev_pointer, ev_short, ev_double, + ev_ptr, ev_short, ev_double, PROG_V6P_VERSION, "*(%Ga + %sb)", }, @@ -1351,7 +1351,7 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { "%ga", }, [OP_POP_P_v6p] = {"", "pop.p", - ev_pointer, ev_invalid, ev_invalid, + ev_ptr, ev_invalid, ev_invalid, PROG_V6P_VERSION, "%ga", }, @@ -1372,103 +1372,103 @@ VISIBLE const v6p_opcode_t pr_v6p_opcodes[] = { }, [OP_POPB_S_v6p] = {"", "popb.s", - ev_pointer, ev_int, ev_string, + ev_ptr, ev_int, ev_string, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_F_v6p] = {"", "popb.f", - ev_pointer, ev_int, ev_float, + ev_ptr, ev_int, ev_float, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_V_v6p] = {"", "popb.v", - ev_pointer, ev_int, ev_vector, + ev_ptr, ev_int, ev_vector, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_ENT_v6p] = {"", "popb.ent", - ev_pointer, ev_int, ev_entity, + ev_ptr, ev_int, ev_entity, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_FLD_v6p] = {"", "popb.fld", - ev_pointer, ev_int, ev_field, + ev_ptr, ev_int, ev_field, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_FN_v6p] = {"", "popb.fn", - ev_pointer, ev_int, ev_func, + ev_ptr, ev_int, ev_func, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_P_v6p] = {"", "popb.p", - ev_pointer, ev_int, ev_pointer, + ev_ptr, ev_int, ev_ptr, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_Q_v6p] = {"", "popb.q", - ev_pointer, ev_int, ev_quat, + ev_ptr, ev_int, ev_quat, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_I_v6p] = {"", "popb.i", - ev_pointer, ev_int, ev_int, + ev_ptr, ev_int, ev_int, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPB_D_v6p] = {"", "popb.d", - ev_pointer, ev_int, ev_double, + ev_ptr, ev_int, ev_double, PROG_V6P_VERSION, "*(%Ga + %Gb)", }, [OP_POPBI_S_v6p] = {"", "popbi.s", - ev_pointer, ev_short, ev_string, + ev_ptr, ev_short, ev_string, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_F_v6p] = {"", "popbi.f", - ev_pointer, ev_short, ev_float, + ev_ptr, ev_short, ev_float, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_V_v6p] = {"", "popbi.v", - ev_pointer, ev_short, ev_vector, + ev_ptr, ev_short, ev_vector, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_ENT_v6p] = {"", "popbi.ent", - ev_pointer, ev_short, ev_entity, + ev_ptr, ev_short, ev_entity, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_FLD_v6p] = {"", "popbi.fld", - ev_pointer, ev_short, ev_field, + ev_ptr, ev_short, ev_field, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_FN_v6p] = {"", "popbi.fn", - ev_pointer, ev_short, ev_func, + ev_ptr, ev_short, ev_func, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_P_v6p] = {"", "popbi.p", - ev_pointer, ev_short, ev_pointer, + ev_ptr, ev_short, ev_ptr, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_Q_v6p] = {"", "popbi.q", - ev_pointer, ev_short, ev_quat, + ev_ptr, ev_short, ev_quat, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_I_v6p] = {"", "popbi.i", - ev_pointer, ev_short, ev_int, + ev_ptr, ev_short, ev_int, PROG_V6P_VERSION, "*(%Ga + %sb)", }, [OP_POPBI_D_v6p] = {"", "popbi.d", - ev_pointer, ev_short, ev_double, + ev_ptr, ev_short, ev_double, PROG_V6P_VERSION, "*(%Ga + %sb)", }, diff --git a/libs/video/renderer/vulkan/vkgen/vkalias.r b/libs/video/renderer/vulkan/vkgen/vkalias.r index e0aad2943..bbb7ffb21 100644 --- a/libs/video/renderer/vulkan/vkgen/vkalias.r +++ b/libs/video/renderer/vulkan/vkgen/vkalias.r @@ -33,7 +33,7 @@ } else if ([alias class] == [Enum class] || [alias class] == [Struct class]) { [alias addToQueue]; - } else if (alias.type.meta == ty_basic && alias.type.type == ev_pointer) { + } else if (alias.type.meta == ty_basic && alias.type.type == ev_ptr) { Type *type = [Type findType:alias.type.fldptr.aux_type]; if (!type) { // pointer to opaque struct. Probably diff --git a/libs/video/renderer/vulkan/vkgen/vkgen.r b/libs/video/renderer/vulkan/vkgen/vkgen.r index 4bcd74ee4..a3a5e426f 100644 --- a/libs/video/renderer/vulkan/vkgen/vkgen.r +++ b/libs/video/renderer/vulkan/vkgen/vkgen.r @@ -66,7 +66,7 @@ void print_type (qfot_type_t *type) case ty_basic: //printf (" %d", type.type); switch (type.type) { - case ev_pointer: + case ev_ptr: case ev_field: //printf (" "); print_type (type.fldptr.aux_type); diff --git a/libs/video/renderer/vulkan/vkgen/vktype.r b/libs/video/renderer/vulkan/vkgen/vktype.r index aa32f3a41..70de1fbc7 100644 --- a/libs/video/renderer/vulkan/vkgen/vktype.r +++ b/libs/video/renderer/vulkan/vkgen/vktype.r @@ -89,7 +89,7 @@ static string get_type_key (void *type, void *unused) -(void) addToQueue { string name = [self name]; - if (type.meta == ty_basic && type.type == ev_pointer) { + if (type.meta == ty_basic && type.type == ev_ptr) { [[Type findType: type.fldptr.aux_type] addToQueue]; } } @@ -134,7 +134,7 @@ static string get_type_key (void *type, void *unused) -(int) isPointer { if ((type.meta == ty_basic || type.meta == ty_alias) - && type.type == ev_pointer) { + && type.type == ev_ptr) { return 1; } return 0; @@ -143,10 +143,10 @@ static string get_type_key (void *type, void *unused) -(Type *) dereference { qfot_type_t *t = type; - if (t.meta == ty_alias && t.type == ev_pointer) { + if (t.meta == ty_alias && t.type == ev_ptr) { t = type.alias.full_type; } - if (t.meta == ty_basic && t.type == ev_pointer) { + if (t.meta == ty_basic && t.type == ev_ptr) { t = type.fldptr.aux_type; } return [Type findType:t]; diff --git a/nq/source/sv_progs.c b/nq/source/sv_progs.c index 5c94f8080..65c7ee495 100644 --- a/nq/source/sv_progs.c +++ b/nq/source/sv_progs.c @@ -354,7 +354,7 @@ set_address (sv_def_t *def, void *address) case ev_entity: case ev_field: case ev_func: - case ev_pointer: + case ev_ptr: case ev_int: case ev_uint: *(pr_int_t **)def->field = (pr_int_t *) address; diff --git a/qw/source/sv_progs.c b/qw/source/sv_progs.c index 8937e7fc8..4510ee339 100644 --- a/qw/source/sv_progs.c +++ b/qw/source/sv_progs.c @@ -387,7 +387,7 @@ set_address (sv_def_t *def, void *address) case ev_entity: case ev_field: case ev_func: - case ev_pointer: + case ev_ptr: case ev_int: case ev_uint: *(pr_int_t **)def->field = (pr_int_t *) address; diff --git a/ruamoko/lib/types.r b/ruamoko/lib/types.r index cecbe09bb..f732cc8d0 100644 --- a/ruamoko/lib/types.r +++ b/ruamoko/lib/types.r @@ -20,7 +20,7 @@ int pr_type_size[ev_type_count] = { 1, // ev_entity 1, // ev_field 1, // ev_func - 1, // ev_pointer + 1, // ev_ptr 4, // ev_quat 1, // ev_integer 1, // ev_uinteger diff --git a/ruamoko/qwaq/debugger/typeencodings.r b/ruamoko/qwaq/debugger/typeencodings.r index 64429b273..fe296a573 100644 --- a/ruamoko/qwaq/debugger/typeencodings.r +++ b/ruamoko/qwaq/debugger/typeencodings.r @@ -106,7 +106,7 @@ static void type_free (void *t, void *unused) } switch (type.meta) { case ty_basic: - if (type.type == ev_pointer || type.type == ev_field) { + if (type.type == ev_ptr || type.type == ev_field) { t = [TypeEncodings getType:(unsigned)type.fldptr.aux_type fromTarget:target]; if (!t) { diff --git a/tools/qfcc/source/class.c b/tools/qfcc/source/class.c index de0d473e6..b821135a7 100644 --- a/tools/qfcc/source/class.c +++ b/tools/qfcc/source/class.c @@ -72,12 +72,12 @@ static hashtab_t *static_instance_classes; // these will be built up further type_t type_selector = { ev_invalid, 0, 0, ty_struct}; -type_t type_SEL = { ev_pointer, "SEL", 1, ty_basic, {{&type_selector}}}; +type_t type_SEL = { ev_ptr, "SEL", 1, ty_basic, {{&type_selector}}}; type_t *IMP_params[] = {&type_id, &type_SEL}; type_t type_IMP = { ev_func, "IMP", 1, ty_basic, {{&type_id, -3, IMP_params}}}; type_t type_super = { ev_invalid, 0, 0 }; -type_t type_SuperPtr = { ev_pointer, 0, 1, ty_basic, {{&type_super}}}; +type_t type_SuperPtr = { ev_ptr, 0, 1, ty_basic, {{&type_super}}}; type_t *supermsg_params[] = {&type_SuperPtr, &type_SEL}; type_t type_supermsg = { ev_func, ".supermsg", 1, ty_basic, {{&type_id, -3, supermsg_params}}}; @@ -86,7 +86,7 @@ type_t type_method_description = { ev_invalid, 0, 0, ty_struct }; type_t type_category = { ev_invalid, 0, 0, ty_struct}; type_t type_ivar = { ev_invalid, 0, 0, ty_struct}; type_t type_module = { ev_invalid, 0, 0, ty_struct}; -type_t type_moduleptr = { ev_pointer, 0, 1, ty_basic, {{&type_module}}}; +type_t type_moduleptr = { ev_ptr, 0, 1, ty_basic, {{&type_module}}}; type_t *obj_exec_class_params[] = { &type_moduleptr }; type_t type_exec_class = { ev_func, 0, 1, ty_basic, {{&type_void, 1, obj_exec_class_params}}}; @@ -94,9 +94,9 @@ type_t type_exec_class = { ev_func, 0, 1, ty_basic, // are never misidentified as id. It will be set to the correct value // when the obj system is initialized. type_t type_object = {ev_invalid, 0, 0, ty_struct, {{(type_t *)1}}}; -type_t type_id = { ev_pointer, "id", 1, ty_basic, {{&type_object}}}; +type_t type_id = { ev_ptr, "id", 1, ty_basic, {{&type_object}}}; type_t type_class = { ev_invalid, 0, 0, ty_struct}; -type_t type_Class = { ev_pointer, 0, 1, ty_basic, {{&type_class}}}; +type_t type_Class = { ev_ptr, 0, 1, ty_basic, {{&type_class}}}; type_t type_protocol = { ev_invalid, 0, 0, ty_struct}; int obj_initialized = 0; @@ -229,7 +229,7 @@ emit_instance_defs (def_t *def, void *data, int index) { obj_static_instances_data_t *da = (obj_static_instances_data_t *)data; - if (!is_array (def->type) || def->type->t.array.type->type != ev_pointer) + if (!is_array (def->type) || def->type->t.array.type->type != ev_ptr) internal_error (0, "%s: expected array of pointers def", __FUNCTION__); if (index < 0 || index >= da->num_instances + 1) internal_error (0, "%s: out of bounds index: %d %d", @@ -325,7 +325,7 @@ is_id (const type_t *type) return 1; // type may be a qualified id, in which case it will be a pointer to // a qualified obj_object struct - if (type->type != ev_pointer) + if (type->type != ev_ptr) return 0; if (!is_struct (type->t.fldptr.type)) return 0; @@ -357,7 +357,7 @@ is_classptr (const type_t *type) // easy cases first :) if (is_id (type) || is_Class (type)) return 1; - if (type->type != ev_pointer) + if (type->type != ev_ptr) return 0; type = type->t.fldptr.type; if (is_class (type)) @@ -1455,7 +1455,7 @@ emit_symtab_defs (def_t *def, void *data, int index) { obj_symtab_data_t *da = (obj_symtab_data_t *)data; - if (!is_array (def->type) || def->type->t.array.type->type != ev_pointer) + if (!is_array (def->type) || def->type->t.array.type->type != ev_ptr) internal_error (0, "%s: expected array of pointers def", __FUNCTION__); if (index < 0 || index >= da->cls_def_cnt + da->cat_def_cnt + 1) internal_error (0, "%s: out of bounds index: %d %d", diff --git a/tools/qfcc/source/constfold.c b/tools/qfcc/source/constfold.c index 20a9c5716..8566e00b1 100644 --- a/tools/qfcc/source/constfold.c +++ b/tools/qfcc/source/constfold.c @@ -1060,7 +1060,7 @@ static operation_t op_void[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_invalid, // ev_quaternion do_op_invalid, // ev_int do_op_invalid, // ev_uint @@ -1079,7 +1079,7 @@ static operation_t op_string[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_invalid, // ev_quaternion do_op_invalid, // ev_int do_op_invalid, // ev_uint @@ -1098,7 +1098,7 @@ static operation_t op_float[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_quaternion, // ev_quaternion do_op_float, // ev_int do_op_float, // ev_uint @@ -1117,7 +1117,7 @@ static operation_t op_vector[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_invalid, // ev_quaternion do_op_vector, // ev_int do_op_vector, // ev_uint @@ -1136,7 +1136,7 @@ static operation_t op_entity[ev_type_count] = { do_op_entity, // ev_entity do_op_entity, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_invalid, // ev_quaternion do_op_invalid, // ev_int do_op_invalid, // ev_uint @@ -1155,7 +1155,7 @@ static operation_t op_field[ev_type_count] = { do_op_invalid, // ev_entity do_op_field, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_invalid, // ev_quaternion do_op_invalid, // ev_int do_op_invalid, // ev_uint @@ -1174,7 +1174,7 @@ static operation_t op_func[ev_type_count] = { do_op_func, // ev_entity do_op_func, // ev_field do_op_func, // ev_func - do_op_func, // ev_pointer + do_op_func, // ev_ptr do_op_func, // ev_quaternion do_op_func, // ev_int do_op_func, // ev_uint @@ -1193,7 +1193,7 @@ static operation_t op_pointer[ev_type_count] = { do_op_pointer, // ev_entity do_op_pointer, // ev_field do_op_pointer, // ev_func - do_op_pointer, // ev_pointer + do_op_pointer, // ev_ptr do_op_pointer, // ev_quaternion do_op_pointer, // ev_int do_op_pointer, // ev_uint @@ -1212,7 +1212,7 @@ static operation_t op_quaternion[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_quaternion, // ev_quaternion do_op_quaternion, // ev_int do_op_quaternion, // ev_uint @@ -1231,7 +1231,7 @@ static operation_t op_int[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_quaternion, // ev_quaternion do_op_int, // ev_int do_op_uint, // ev_uint @@ -1250,7 +1250,7 @@ static operation_t op_uint[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_quaternion, // ev_quaternion do_op_uint, // ev_int do_op_uint, // ev_uint @@ -1269,7 +1269,7 @@ static operation_t op_short[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_quaternion, // ev_quaternion do_op_int, // ev_int do_op_uint, // ev_uint @@ -1288,7 +1288,7 @@ static operation_t op_double[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_quaternion, // ev_quaternion do_op_int, // ev_int do_op_uint, // ev_uint @@ -1307,7 +1307,7 @@ static operation_t op_compound[ev_type_count] = { do_op_invalid, // ev_entity do_op_invalid, // ev_field do_op_invalid, // ev_func - do_op_invalid, // ev_pointer + do_op_invalid, // ev_ptr do_op_invalid, // ev_quaternion do_op_compound, // ev_int do_op_compound, // ev_uint @@ -1326,7 +1326,7 @@ static operation_t *do_op[ev_type_count] = { op_entity, // ev_entity op_field, // ev_field op_func, // ev_func - op_pointer, // ev_pointer + op_pointer, // ev_ptr op_quaternion, // ev_quaternion op_int, // ev_int op_uint, // ev_uint @@ -1658,7 +1658,7 @@ static unaryop_t do_unary_op[ev_type_count] = { uop_entity, // ev_entity uop_field, // ev_field uop_func, // ev_func - uop_pointer, // ev_pointer + uop_pointer, // ev_ptr uop_quaternion, // ev_quaternion uop_int, // ev_int uop_uint, // ev_uint diff --git a/tools/qfcc/source/dags.c b/tools/qfcc/source/dags.c index 9e3b1cdab..9c7746bea 100644 --- a/tools/qfcc/source/dags.c +++ b/tools/qfcc/source/dags.c @@ -427,7 +427,7 @@ dagnode_set_edges (dag_t *dag, dagnode_t *n) set_add (node->edges, n->number); } if (op->op_type == op_value - && op->value->lltype == ev_pointer + && op->value->lltype == ev_ptr && op->value->v.pointer.def) { def_visit_all (op->value->v.pointer.def, 1, dagnode_def_set_edges_visit, n); diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index cf854a1b4..449db7320 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -617,7 +617,7 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space, internal_error (0, "initializier not a value"); return; } - if (init->e.value->lltype == ev_pointer + if (init->e.value->lltype == ev_ptr || init->e.value->lltype == ev_field) { // FIXME offset pointers D_INT (sym->s.def) = init->e.value->v.pointer.val; diff --git a/tools/qfcc/source/dot_expr.c b/tools/qfcc/source/dot_expr.c index d1cbfee26..19081fd48 100644 --- a/tools/qfcc/source/dot_expr.c +++ b/tools/qfcc/source/dot_expr.c @@ -547,7 +547,7 @@ print_value (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next) e->e.value->v.quaternion_val[2], e->e.value->v.quaternion_val[3]); break; - case ev_pointer: + case ev_ptr: type = e->e.value->v.pointer.type; dstring_clearstr(type_str); if (type) { diff --git a/tools/qfcc/source/dot_type.c b/tools/qfcc/source/dot_type.c index fa77bbf3d..5f743dae7 100644 --- a/tools/qfcc/source/dot_type.c +++ b/tools/qfcc/source/dot_type.c @@ -61,7 +61,7 @@ print_pointer (dstring_t *dstr, type_t *t, int level, int id) dot_print_type (dstr, aux, level, id); dasprintf (dstr, "%*st_%p -> \"t_%p\";\n", indent, "", t, aux); dasprintf (dstr, "%*st_%p [label=\"%c\"];\n", indent, "", t, - t->type == ev_pointer ? '*' : '.'); + t->type == ev_ptr ? '*' : '.'); } static void @@ -118,7 +118,7 @@ print_function (dstring_t *dstr, type_t *t, int level, int id) static void print_basic (dstring_t *dstr, type_t *t, int level, int id) { - if (t->type == ev_pointer || t->type == ev_field) { + if (t->type == ev_ptr || t->type == ev_field) { print_pointer (dstr, t, level, id); } else if (t->type == ev_func) { print_function (dstr, t, level, id); diff --git a/tools/qfcc/source/dump_globals.c b/tools/qfcc/source/dump_globals.c index e55c10104..5bff7e2a0 100644 --- a/tools/qfcc/source/dump_globals.c +++ b/tools/qfcc/source/dump_globals.c @@ -131,7 +131,7 @@ dump_def (progs_t *pr, pr_def_t *def, int indent) } } break; - case ev_pointer: + case ev_ptr: comment = va (0, " %x", G_INT (pr, offset)); break; case ev_quat: @@ -559,7 +559,7 @@ dump_qfo_types (qfo_t *qfo, int base_address) count = ~count; //ones complement for (i = 0; i < count; i++) printf (" %x", type->func.param_types[i]); - } else if (type->type == ev_pointer + } else if (type->type == ev_ptr || type->type == ev_field) { printf (" %4x", type->fldptr.aux_type); } diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 47daa1348..61e42c552 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -222,6 +222,7 @@ get_type (expr_t *e) case ex_memset: return e->e.memset.type; case ex_error: + return 0; case ex_return: internal_error (e, "unexpected expression type"); case ex_label: @@ -1263,7 +1264,7 @@ expr_integral (expr_t *e) int is_pointer_val (expr_t *e) { - if (e->type == ex_value && e->e.value->lltype == ev_pointer) { + if (e->type == ex_value && e->e.value->lltype == ev_ptr) { return 1; } return 0; @@ -1432,7 +1433,7 @@ field_expr (expr_t *e1, expr_t *e2) return e; } } - } else if (t1->type == ev_pointer) { + } else if (t1->type == ev_ptr) { if (is_struct (t1->t.fldptr.type)) { symbol_t *field; @@ -1695,7 +1696,7 @@ unary_expr (int op, expr_t *e) case ev_entity: case ev_field: case ev_func: - case ev_pointer: + case ev_ptr: internal_error (e, "type check failed!"); case ev_double: new = new_double_expr (-expr_double (e)); @@ -1797,7 +1798,7 @@ unary_expr (int op, expr_t *e) case ev_entity: case ev_field: case ev_func: - case ev_pointer: + case ev_ptr: internal_error (e, 0); case ev_string: s = expr_string (e); @@ -1875,7 +1876,7 @@ unary_expr (int op, expr_t *e) case ev_entity: case ev_field: case ev_func: - case ev_pointer: + case ev_ptr: case ev_vector: case ev_double: return error (e, "invalid type for unary ~"); @@ -1956,7 +1957,7 @@ bitnot_expr: } break; case '.': - if (extract_type (e) != ev_pointer) + if (extract_type (e) != ev_ptr) return error (e, "invalid type for unary ."); e = new_unary_expr ('.', e); e->e.expr.type = get_type (e->e.expr.e1)->t.fldptr.type; @@ -2392,7 +2393,7 @@ array_expr (expr_t *array, expr_t *index) if (index->type == ex_error) return index; - if (array_type->type != ev_pointer && !is_array (array_type)) + if (array_type->type != ev_ptr && !is_array (array_type)) return error (array, "not an array"); if (!is_integral (index_type)) return error (index, "invalid array index type"); @@ -2436,7 +2437,7 @@ pointer_expr (expr_t *pointer) if (pointer->type == ex_error) return pointer; - if (pointer_type->type != ev_pointer) + if (pointer_type->type != ev_ptr) return error (pointer, "not a pointer"); return array_expr (pointer, new_int_expr (0)); } @@ -2889,7 +2890,9 @@ sizeof_expr (expr_t *expr, struct type_s *type) internal_error (0, 0); if (!type) type = get_type (expr); - expr = new_int_expr (type_size (type)); + if (type) { + expr = new_int_expr (type_size (type)); + } return expr; } diff --git a/tools/qfcc/source/expr_binary.c b/tools/qfcc/source/expr_binary.c index 885f87ef1..7610b4542 100644 --- a/tools/qfcc/source/expr_binary.c +++ b/tools/qfcc/source/expr_binary.c @@ -533,7 +533,7 @@ static expr_type_t *string_x[ev_type_count] = { 0, // ev_entity 0, // ev_field 0, // ev_func - 0, // ev_pointer + 0, // ev_ptr 0, // ev_quat 0, // ev_int 0, // ev_uint @@ -549,7 +549,7 @@ static expr_type_t *float_x[ev_type_count] = { 0, // ev_entity 0, // ev_field 0, // ev_func - 0, // ev_pointer + 0, // ev_ptr float_quat, float_int, float_uint, @@ -565,7 +565,7 @@ static expr_type_t *vector_x[ev_type_count] = { 0, // ev_entity 0, // ev_field 0, // ev_func - 0, // ev_pointer + 0, // ev_ptr 0, // ev_quaternion vector_int, vector_uint, @@ -581,7 +581,7 @@ static expr_type_t *entity_x[ev_type_count] = { entity_entity, // ev_entity 0, // ev_field 0, // ev_func - 0, // ev_pointer + 0, // ev_ptr 0, // ev_quaternion 0, // ev_int 0, // ev_uint @@ -597,7 +597,7 @@ static expr_type_t *field_x[ev_type_count] = { 0, // ev_entity field_field, // ev_field 0, // ev_func - 0, // ev_pointer + 0, // ev_ptr 0, // ev_quaternion 0, // ev_int 0, // ev_uint @@ -613,7 +613,7 @@ static expr_type_t *func_x[ev_type_count] = { 0, // ev_entity 0, // ev_field func_func, // ev_func - 0, // ev_pointer + 0, // ev_ptr 0, // ev_quaternion 0, // ev_int 0, // ev_uint @@ -645,7 +645,7 @@ static expr_type_t *quat_x[ev_type_count] = { 0, // ev_entity 0, // ev_field 0, // ev_func - 0, // ev_pointer + 0, // ev_ptr quat_quat, quat_int, quat_uint, @@ -709,7 +709,7 @@ static expr_type_t *double_x[ev_type_count] = { 0, // ev_entity 0, // ev_field 0, // ev_func - 0, // ev_pointer + 0, // ev_ptr double_quat, double_int, double_uint, diff --git a/tools/qfcc/source/expr_bool.c b/tools/qfcc/source/expr_bool.c index df8e25180..52b4de683 100644 --- a/tools/qfcc/source/expr_bool.c +++ b/tools/qfcc/source/expr_bool.c @@ -132,7 +132,7 @@ test_expr (expr_t *e) return new_alias_expr (type_default, e); case ev_func: return new_alias_expr (type_default, e); - case ev_pointer: + case ev_ptr: return new_alias_expr (type_default, e); case ev_quat: new = new_quaternion_expr (zero); diff --git a/tools/qfcc/source/flow.c b/tools/qfcc/source/flow.c index 37d0c1814..8edc44ad1 100644 --- a/tools/qfcc/source/flow.c +++ b/tools/qfcc/source/flow.c @@ -1127,7 +1127,7 @@ flow_analyze_pointer_operand (operand_t *ptrop, set_t *def) { operand_t *op = 0; - if (ptrop->op_type == op_value && ptrop->value->lltype == ev_pointer) { + if (ptrop->op_type == op_value && ptrop->value->lltype == ev_ptr) { ex_pointer_t *ptr = &ptrop->value->v.pointer; if (ptrop->value->v.pointer.def) { def_t *alias; diff --git a/tools/qfcc/source/obj_type.c b/tools/qfcc/source/obj_type.c index d806e6c9b..8d1f5cacf 100644 --- a/tools/qfcc/source/obj_type.c +++ b/tools/qfcc/source/obj_type.c @@ -149,7 +149,7 @@ qfo_encode_basic (type_t *type, defspace_t *space) if (type->type == ev_func) return qfo_encode_func (type, space); - else if (type->type == ev_pointer || type->type == ev_field) + else if (type->type == ev_ptr || type->type == ev_field) return qfo_encode_fldptr (type, space); def = qfo_new_encoding (type, sizeof (enc->type), space); diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index 0d52f7c4e..a0aa7997f 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -140,7 +140,7 @@ operand_string (operand_t *op) op->value->v.quaternion_val[1], op->value->v.quaternion_val[2], op->value->v.quaternion_val[3]); - case ev_pointer: + case ev_ptr: if (op->value->v.pointer.def) { return va (0, "ptr %s+%d", op->value->v.pointer.def->name, @@ -227,7 +227,7 @@ _print_operand (operand_t *op) printf (" %g", op->value->v.quaternion_val[2]); printf (" %g'", op->value->v.quaternion_val[3]); break; - case ev_pointer: + case ev_ptr: printf ("(%s)[%d]", pr_type_name[op->value->v.pointer.type->type], op->value->v.pointer.val); @@ -761,7 +761,7 @@ operand_address (operand_t *reference, expr_t *e) static __attribute__((pure)) int is_const_ptr (expr_t *e) { - if ((e->type != ex_value || e->e.value->lltype != ev_pointer) + if ((e->type != ex_value || e->e.value->lltype != ev_ptr) || !(POINTER_VAL (e->e.value->v.pointer) >= 0 && POINTER_VAL (e->e.value->v.pointer) < 65536)) { return 0; @@ -1170,7 +1170,7 @@ expr_deref (sblock_t *sblock, expr_t *deref, operand_t **op) s->opc = *op; sblock_add_statement (sblock, s); } - } else if (e->type == ex_value && e->e.value->lltype == ev_pointer) { + } else if (e->type == ex_value && e->e.value->lltype == ev_ptr) { ex_pointer_t *ptr = &e->e.value->v.pointer; *op = def_operand (alias_def (ptr->def, ptr->type, ptr->val), ptr->type, e); diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index 81583de9c..de6709c9d 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -72,7 +72,7 @@ type_t type_field = {ev_field, "field", 1, ty_basic, {{&type_void}} }; // type_function is a void() function used for state defs type_t type_function = { ev_func, "function", 1, ty_basic, {{&type_void}} }; -type_t type_pointer = { ev_pointer, "pointer", 1, ty_basic, +type_t type_pointer = { ev_ptr, "pointer", 1, ty_basic, {{&type_void}} }; type_t type_quaternion = { ev_quat, "quaternion", 4 }; type_t type_int = { ev_int, "int", 1 }; @@ -90,7 +90,7 @@ type_t type_zero = { ev_invalid, 0, 0, ty_struct }; type_t type_type_encodings = { ev_invalid, "@type_encodings", 0, ty_struct }; type_t type_xdef = { ev_invalid, "@xdef", 0, ty_struct }; -type_t type_xdef_pointer = { ev_pointer, 0, 1, ty_basic, {{&type_xdef}} }; +type_t type_xdef_pointer = { ev_ptr, 0, 1, ty_basic, {{&type_xdef}} }; type_t type_xdefs = { ev_invalid, "@xdefs", 0, ty_struct }; type_t type_floatfield = { ev_field, ".float", 1, ty_basic, @@ -194,7 +194,7 @@ free_type (type_t *type) case ev_double: break; case ev_field: - case ev_pointer: + case ev_ptr: free_type (type->t.fldptr.type); break; case ev_func: @@ -236,7 +236,7 @@ copy_chain (type_t *type, type_t *append) case ev_double: internal_error (0, "copy basic type"); case ev_field: - case ev_pointer: + case ev_ptr: n = &(*n)->t.fldptr.type; type = type->t.fldptr.type; break; @@ -289,7 +289,7 @@ append_type (type_t *type, type_t *new) case ev_double: internal_error (0, "append to basic type"); case ev_field: - case ev_pointer: + case ev_ptr: t = &(*t)->t.fldptr.type; type->alignment = 1; break; @@ -335,7 +335,7 @@ types_same (type_t *a, type_t *b) case ty_basic: switch (a->type) { case ev_field: - case ev_pointer: + case ev_ptr: if (a->t.fldptr.type != b->t.fldptr.type) return 0; case ev_func: @@ -401,7 +401,7 @@ find_type (type_t *type) case ty_basic: switch (type->type) { case ev_field: - case ev_pointer: + case ev_ptr: type->t.fldptr.type = find_type (type->t.fldptr.type); break; case ev_func: @@ -475,7 +475,7 @@ pointer_type (type_t *aux) memset (&_new, 0, sizeof (_new)); else new = new_type (); - new->type = ev_pointer; + new->type = ev_ptr; new->alignment = 1; if (aux) { new = find_type (append_type (new, aux)); @@ -639,7 +639,7 @@ print_type_str (dstring_t *str, const type_t *type) dasprintf (str, ")"); } return; - case ev_pointer: + case ev_ptr: if (is_id (type)) { dasprintf (str, "id"); if (type->t.fldptr.type->protos) @@ -802,7 +802,7 @@ encode_type (dstring_t *encoding, const type_t *type) encode_type (encoding, type->t.func.type); dasprintf (encoding, "%s)", encode_params (type)); return; - case ev_pointer: + case ev_ptr: if (is_id(type)) { dasprintf (encoding, "@"); return; @@ -962,7 +962,7 @@ int is_pointer (const type_t *type) { type = unalias_type (type); - if (type->type == ev_pointer) + if (type->type == ev_ptr) return 1; return 0; } diff --git a/tools/qfcc/source/value.c b/tools/qfcc/source/value.c index 786a3d2fb..73b3b47ab 100644 --- a/tools/qfcc/source/value.c +++ b/tools/qfcc/source/value.c @@ -262,7 +262,7 @@ new_nil_val (type_t *type) if (val.lltype == ev_void) { val.lltype = type_nil->type; } - if (val.lltype == ev_pointer || val.lltype == ev_field ) + if (val.lltype == ev_ptr || val.lltype == ev_field ) val.v.pointer.type = type->t.fldptr.type; if (val.lltype == ev_func) val.v.func_val.type = type; @@ -507,7 +507,7 @@ emit_value (ex_value_t *value, def_t *def) tab = func_imm_defs; type = &type_function; break; - case ev_pointer: + case ev_ptr: tab = pointer_imm_defs; type = &type_pointer; break; @@ -604,7 +604,7 @@ emit_value (ex_value_t *value, def_t *def) if (val.v.pointer.def) reloc_def_field_ofs (val.v.pointer.def, cn); break; - case ev_pointer: + case ev_ptr: if (val.v.pointer.def) { EMIT_DEF_OFS (pr.near_data, D_INT (cn), val.v.pointer.def); diff --git a/tools/qfcc/test/typedef.r b/tools/qfcc/test/typedef.r index 3755f63eb..61df8f9b6 100644 --- a/tools/qfcc/test/typedef.r +++ b/tools/qfcc/test/typedef.r @@ -24,7 +24,7 @@ next_type (qfot_type_t *type) int check_alias (string name, qfot_type_t *alias) { - if (alias.meta != ty_basic || alias.type != ev_pointer + if (alias.meta != ty_basic || alias.type != ev_ptr || alias.fldptr.aux_type.meta != ty_basic || alias.fldptr.aux_type.type != ev_int) { printf ("%s is not a *int alias\n", name);