[qfcc] Shorten type_function and type_pointer names

To type_func and type_ptr to match the ev type names.
This commit is contained in:
Bill Currie 2022-01-18 22:34:52 +09:00
parent 068c04ece6
commit 57fe669099
8 changed files with 50 additions and 53 deletions

View file

@ -123,9 +123,9 @@ static struct_def_t method_desc_struct[] = {
static struct_def_t category_struct[] = {
{"category_name", &type_string},
{"class_name", &type_string},
{"instance_methods", &type_pointer},
{"class_methods", &type_pointer},
{"protocols", &type_pointer},
{"instance_methods", &type_ptr},
{"class_methods", &type_ptr},
{"protocols", &type_ptr},
{0, 0}
};
@ -146,7 +146,7 @@ static struct_def_t module_struct[] = {
{"version", &type_int},
{"size", &type_int},
{"name", &type_string},
{"symtab", &type_pointer},
{"symtab", &type_ptr},
{0, 0}
};
@ -157,22 +157,22 @@ static struct_def_t class_struct[] = {
{"version", &type_int},
{"info", &type_int},
{"instance_size", &type_int},
{"ivars", &type_pointer},
{"methods", &type_pointer},
{"dtable", &type_pointer},
{"subclass_list", &type_pointer},
{"sibling_class", &type_pointer},
{"protocols", &type_pointer},
{"gc_object_type", &type_pointer},
{"ivars", &type_ptr},
{"methods", &type_ptr},
{"dtable", &type_ptr},
{"subclass_list", &type_ptr},
{"sibling_class", &type_ptr},
{"protocols", &type_ptr},
{"gc_object_type", &type_ptr},
{0, 0}
};
static struct_def_t protocol_struct[] = {
{"class_pointer", &type_Class},
{"protocol_name", &type_string},
{"protocol_list", &type_pointer},
{"instance_methods", &type_pointer},
{"class_methods", &type_pointer},
{"protocol_list", &type_ptr},
{"instance_methods", &type_ptr},
{"class_methods", &type_ptr},
{0, 0}
};
@ -257,8 +257,7 @@ emit_static_instances (const char *classname)
for (static_instance_t **inst = data.instances; *inst; inst++) {
data.num_instances++;
}
instances_struct[1].type = array_type (&type_pointer,
data.num_instances + 1);
instances_struct[1].type = array_type (&type_ptr, data.num_instances + 1);
instances_def = emit_structure (va (0, "_OBJ_STATIC_INSTANCES_%s",
classname),
's', instances_struct, 0, &data,
@ -298,7 +297,7 @@ emit_static_instances_list (void)
free (classes);
// +1 for terminating null
instance_lists_type = array_type (&type_pointer, num_classes + 1);
instance_lists_type = array_type (&type_ptr, num_classes + 1);
instance_lists_sym = make_symbol ("_OBJ_STATIC_INSTANCES",
instance_lists_type,
pr.far_data, sc_static);
@ -878,7 +877,7 @@ emit_class_ref (const char *class_name)
def_t *name_def;
ref_sym = make_symbol (va (0, ".obj_class_ref_%s", class_name),
&type_pointer, pr.far_data, sc_static);
&type_ptr, pr.far_data, sc_static);
if (!ref_sym->table)
symtab_addsymbol (pr.symtab, ref_sym);
ref_def = ref_sym->s.def;
@ -886,7 +885,7 @@ emit_class_ref (const char *class_name)
return;
ref_def->initialized = ref_def->constant = ref_def->nosave = 1;
name_sym = make_symbol (va (0, ".obj_class_name_%s", class_name),
&type_pointer, pr.far_data, sc_extern);
&type_ptr, pr.far_data, sc_extern);
if (!name_sym->table)
symtab_addsymbol (pr.symtab, name_sym);
name_def = name_sym->s.def;
@ -902,7 +901,7 @@ emit_class_name (const char *class_name)
def_t *name_def;
name_sym = make_symbol (va (0, ".obj_class_name_%s", class_name),
&type_pointer, pr.far_data, sc_global);
&type_ptr, pr.far_data, sc_global);
if (!name_sym->table)
symtab_addsymbol (pr.symtab, name_sym);
name_def = name_sym->s.def;
@ -923,7 +922,7 @@ emit_category_ref (const char *class_name, const char *category_name)
ref_sym = make_symbol (va (0, ".obj_category_ref_%s_%s",
class_name, category_name),
&type_pointer, pr.far_data, sc_static);
&type_ptr, pr.far_data, sc_static);
if (!ref_sym->table)
symtab_addsymbol (pr.symtab, ref_sym);
ref_def = ref_sym->s.def;
@ -933,7 +932,7 @@ emit_category_ref (const char *class_name, const char *category_name)
ref_def->nosave = 1;
name_sym = make_symbol (va (0, ".obj_category_name_%s_%s",
class_name, category_name),
&type_pointer, pr.far_data, sc_extern);
&type_ptr, pr.far_data, sc_extern);
if (!name_sym->table)
symtab_addsymbol (pr.symtab, name_sym);
name_def = name_sym->s.def;
@ -950,7 +949,7 @@ emit_category_name (const char *class_name, const char *category_name)
name_sym = make_symbol (va (0, ".obj_category_name_%s_%s",
class_name, category_name),
&type_pointer, pr.far_data, sc_global);
&type_ptr, pr.far_data, sc_global);
if (!name_sym->table)
symtab_addsymbol (pr.symtab, name_sym);
name_def = name_sym->s.def;
@ -1526,7 +1525,7 @@ class_finish_module (void)
if (!data.refs && !data.cls_def_cnt && !data.cat_def_cnt
&& !data.instances_list)
return;
symtab_struct[4].type = array_type (&type_pointer,
symtab_struct[4].type = array_type (&type_ptr,
data.cls_def_cnt
+ data.cat_def_cnt
+ 1);
@ -1553,7 +1552,7 @@ class_finish_module (void)
sc_extern);
}
init_sym = new_symbol_type (".ctor", &type_function);
init_sym = new_symbol_type (".ctor", &type_func);
init_sym = function_symbol (init_sym, 0, 1);
module_expr = address_expr (new_symbol_expr (module_sym), 0, 0);
@ -1776,15 +1775,15 @@ def_t *
emit_protocol_list (protocollist_t *protocols, const char *name)
{
static struct_def_t proto_list_struct[] = {
{"next", &type_pointer, emit_protocol_next},
{"count", &type_int, emit_protocol_count},
{"list", 0, emit_protocol_list_item},
{"next", &type_ptr, emit_protocol_next},
{"count", &type_int, emit_protocol_count},
{"list", 0, emit_protocol_list_item},
{0, 0},
};
if (!protocols)
return 0;
proto_list_struct[2].type = array_type (&type_pointer, protocols->count);
proto_list_struct[2].type = array_type (&type_ptr, protocols->count);
return emit_structure (va (0, "_OBJ_PROTOCOLS_%s", name), 's',
proto_list_struct, 0, protocols, 0, sc_static);
}

View file

@ -2789,7 +2789,7 @@ think_expr (symbol_t *think_sym)
&& sym->type->t.fldptr.type->type == ev_func) {
think_sym->type = sym->type->t.fldptr.type;
} else {
think_sym->type = &type_function;
think_sym->type = &type_func;
}
think_sym = function_symbol (think_sym, 0, 1);
make_function (think_sym, 0, current_symtab->space, current_storage);

View file

@ -590,7 +590,7 @@ begin_function (symbol_t *sym, const char *nicename, symtab_t *parent,
if (sym->sy_type != sy_func) {
error (0, "%s is not a function", sym->name);
sym = new_symbol_type (sym->name, &type_function);
sym = new_symbol_type (sym->name, &type_func);
sym = function_symbol (sym, 1, 1);
}
if (sym->s.func && sym->s.func->def && sym->s.func->def->initialized) {

View file

@ -585,9 +585,9 @@ def_t *
emit_methods (methodlist_t *methods, const char *name, int instance)
{
static struct_def_t methods_struct[] = {
{"method_next", &type_pointer, emit_methods_next},
{"method_count", &type_int, emit_methods_count},
{"method_list", 0, emit_methods_list_item},
{"method_next", &type_ptr, emit_methods_next},
{"method_count", &type_int, emit_methods_count},
{"method_list", 0, emit_methods_list_item},
{0, 0}
};
const char *type = instance ? "INSTANCE" : "CLASS";

View file

@ -379,7 +379,7 @@ static keyword_t qf_keywords[] = {
{"int", TYPE, &type_int },
{"unsigned", TYPE, &type_int },//FIXME
{"@function", TYPE, &type_function },
{"@function", TYPE, &type_func },
{"@args", ARGS, 0 },
{"@va_list", TYPE, &type_va_list },
{"@param", TYPE, &type_param },

View file

@ -955,7 +955,7 @@ dereference_dst:
s = new_statement (st_expr, "&", dst_expr);
s->opa = dst;
s->opb = ofs;
s->opc = temp_operand (&type_pointer, dst_expr);
s->opc = temp_operand (&type_ptr, dst_expr);
sblock_add_statement (sblock, s);
dst = s->opc;
ofs = 0;
@ -1128,7 +1128,7 @@ lea_statement (operand_t *pointer, operand_t *offset, expr_t *e)
statement_t *s = new_statement (st_expr, "&", e);
s->opa = pointer;
s->opb = offset;
s->opc = temp_operand (&type_pointer, e);
s->opc = temp_operand (&type_ptr, e);
return s;
}

View file

@ -69,11 +69,9 @@ type_t type_vector = { ev_vector, "vector", 1 };
type_t type_entity = { ev_entity, "entity", 1 };
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_ptr, "pointer", 1, ty_basic,
{{&type_void}} };
// type_func is a void() function used for state defs
type_t type_func = { ev_func, "func", 1, ty_basic, {{&type_void}} };
type_t type_ptr = { ev_ptr, "pointer", 1, ty_basic, {{&type_void}} };
type_t type_quaternion = { ev_quaternion, "quaternion", 4 };
type_t type_int = { ev_int, "int", 1 };
type_t type_uint = { ev_uint, "uint", 1 };
@ -1141,8 +1139,8 @@ chain_basic_types (void)
type_entity.t.symtab = pr.entity_fields;
chain_type (&type_entity);
chain_type (&type_field);
chain_type (&type_function);
chain_type (&type_pointer);
chain_type (&type_func);
chain_type (&type_ptr);
chain_type (&type_floatfield);
if (!options.traditional) {
chain_type (&type_quaternion);
@ -1180,8 +1178,8 @@ init_types (void)
{"float_val", &type_float},
{"entity_val", &type_entity},
{"field_val", &type_field},
{"func_val", &type_function},
{"pointer_val", &type_pointer},
{"func_val", &type_func},
{"pointer_val", &type_ptr},
{"vector_val", &type_vector},
{"int_val", &type_int},
{"uint_val", &type_uint},
@ -1197,8 +1195,8 @@ init_types (void)
{"vector_val", &type_vector},
{"entity_val", &type_entity},
{"field_val", &type_field},
{"func_val", &type_function},
{"pointer_val", &type_pointer},
{"func_val", &type_func},
{"pointer_val", &type_ptr},
{"int_val", &type_int},
{"uint_val", &type_uint},
{"quaternion_val", &type_quaternion},
@ -1217,13 +1215,13 @@ init_types (void)
{0, 0}
};
static struct_def_t type_encoding_struct[] = {
{"types", &type_pointer},
{"types", &type_ptr},
{"size", &type_uint},
{0, 0}
};
static struct_def_t xdef_struct[] = {
{"types", &type_pointer},
{"offset", &type_pointer},
{"types", &type_ptr},
{"offset", &type_ptr},
{0, 0}
};
static struct_def_t xdefs_struct[] = {

View file

@ -505,11 +505,11 @@ emit_value (ex_value_t *value, def_t *def)
break;
case ev_func:
tab = func_imm_defs;
type = &type_function;
type = &type_func;
break;
case ev_ptr:
tab = pointer_imm_defs;
type = &type_pointer;
type = &type_ptr;
break;
case ev_int:
case ev_uint: