mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-06-01 09:02:08 +00:00
[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:
parent
068c04ece6
commit
57fe669099
8 changed files with 50 additions and 53 deletions
|
@ -123,9 +123,9 @@ static struct_def_t method_desc_struct[] = {
|
||||||
static struct_def_t category_struct[] = {
|
static struct_def_t category_struct[] = {
|
||||||
{"category_name", &type_string},
|
{"category_name", &type_string},
|
||||||
{"class_name", &type_string},
|
{"class_name", &type_string},
|
||||||
{"instance_methods", &type_pointer},
|
{"instance_methods", &type_ptr},
|
||||||
{"class_methods", &type_pointer},
|
{"class_methods", &type_ptr},
|
||||||
{"protocols", &type_pointer},
|
{"protocols", &type_ptr},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ static struct_def_t module_struct[] = {
|
||||||
{"version", &type_int},
|
{"version", &type_int},
|
||||||
{"size", &type_int},
|
{"size", &type_int},
|
||||||
{"name", &type_string},
|
{"name", &type_string},
|
||||||
{"symtab", &type_pointer},
|
{"symtab", &type_ptr},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -157,22 +157,22 @@ static struct_def_t class_struct[] = {
|
||||||
{"version", &type_int},
|
{"version", &type_int},
|
||||||
{"info", &type_int},
|
{"info", &type_int},
|
||||||
{"instance_size", &type_int},
|
{"instance_size", &type_int},
|
||||||
{"ivars", &type_pointer},
|
{"ivars", &type_ptr},
|
||||||
{"methods", &type_pointer},
|
{"methods", &type_ptr},
|
||||||
{"dtable", &type_pointer},
|
{"dtable", &type_ptr},
|
||||||
{"subclass_list", &type_pointer},
|
{"subclass_list", &type_ptr},
|
||||||
{"sibling_class", &type_pointer},
|
{"sibling_class", &type_ptr},
|
||||||
{"protocols", &type_pointer},
|
{"protocols", &type_ptr},
|
||||||
{"gc_object_type", &type_pointer},
|
{"gc_object_type", &type_ptr},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct_def_t protocol_struct[] = {
|
static struct_def_t protocol_struct[] = {
|
||||||
{"class_pointer", &type_Class},
|
{"class_pointer", &type_Class},
|
||||||
{"protocol_name", &type_string},
|
{"protocol_name", &type_string},
|
||||||
{"protocol_list", &type_pointer},
|
{"protocol_list", &type_ptr},
|
||||||
{"instance_methods", &type_pointer},
|
{"instance_methods", &type_ptr},
|
||||||
{"class_methods", &type_pointer},
|
{"class_methods", &type_ptr},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -257,8 +257,7 @@ emit_static_instances (const char *classname)
|
||||||
for (static_instance_t **inst = data.instances; *inst; inst++) {
|
for (static_instance_t **inst = data.instances; *inst; inst++) {
|
||||||
data.num_instances++;
|
data.num_instances++;
|
||||||
}
|
}
|
||||||
instances_struct[1].type = array_type (&type_pointer,
|
instances_struct[1].type = array_type (&type_ptr, data.num_instances + 1);
|
||||||
data.num_instances + 1);
|
|
||||||
instances_def = emit_structure (va (0, "_OBJ_STATIC_INSTANCES_%s",
|
instances_def = emit_structure (va (0, "_OBJ_STATIC_INSTANCES_%s",
|
||||||
classname),
|
classname),
|
||||||
's', instances_struct, 0, &data,
|
's', instances_struct, 0, &data,
|
||||||
|
@ -298,7 +297,7 @@ emit_static_instances_list (void)
|
||||||
free (classes);
|
free (classes);
|
||||||
|
|
||||||
// +1 for terminating null
|
// +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_sym = make_symbol ("_OBJ_STATIC_INSTANCES",
|
||||||
instance_lists_type,
|
instance_lists_type,
|
||||||
pr.far_data, sc_static);
|
pr.far_data, sc_static);
|
||||||
|
@ -878,7 +877,7 @@ emit_class_ref (const char *class_name)
|
||||||
def_t *name_def;
|
def_t *name_def;
|
||||||
|
|
||||||
ref_sym = make_symbol (va (0, ".obj_class_ref_%s", class_name),
|
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)
|
if (!ref_sym->table)
|
||||||
symtab_addsymbol (pr.symtab, ref_sym);
|
symtab_addsymbol (pr.symtab, ref_sym);
|
||||||
ref_def = ref_sym->s.def;
|
ref_def = ref_sym->s.def;
|
||||||
|
@ -886,7 +885,7 @@ emit_class_ref (const char *class_name)
|
||||||
return;
|
return;
|
||||||
ref_def->initialized = ref_def->constant = ref_def->nosave = 1;
|
ref_def->initialized = ref_def->constant = ref_def->nosave = 1;
|
||||||
name_sym = make_symbol (va (0, ".obj_class_name_%s", class_name),
|
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)
|
if (!name_sym->table)
|
||||||
symtab_addsymbol (pr.symtab, name_sym);
|
symtab_addsymbol (pr.symtab, name_sym);
|
||||||
name_def = name_sym->s.def;
|
name_def = name_sym->s.def;
|
||||||
|
@ -902,7 +901,7 @@ emit_class_name (const char *class_name)
|
||||||
def_t *name_def;
|
def_t *name_def;
|
||||||
|
|
||||||
name_sym = make_symbol (va (0, ".obj_class_name_%s", class_name),
|
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)
|
if (!name_sym->table)
|
||||||
symtab_addsymbol (pr.symtab, name_sym);
|
symtab_addsymbol (pr.symtab, name_sym);
|
||||||
name_def = name_sym->s.def;
|
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",
|
ref_sym = make_symbol (va (0, ".obj_category_ref_%s_%s",
|
||||||
class_name, category_name),
|
class_name, category_name),
|
||||||
&type_pointer, pr.far_data, sc_static);
|
&type_ptr, pr.far_data, sc_static);
|
||||||
if (!ref_sym->table)
|
if (!ref_sym->table)
|
||||||
symtab_addsymbol (pr.symtab, ref_sym);
|
symtab_addsymbol (pr.symtab, ref_sym);
|
||||||
ref_def = ref_sym->s.def;
|
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;
|
ref_def->nosave = 1;
|
||||||
name_sym = make_symbol (va (0, ".obj_category_name_%s_%s",
|
name_sym = make_symbol (va (0, ".obj_category_name_%s_%s",
|
||||||
class_name, category_name),
|
class_name, category_name),
|
||||||
&type_pointer, pr.far_data, sc_extern);
|
&type_ptr, pr.far_data, sc_extern);
|
||||||
if (!name_sym->table)
|
if (!name_sym->table)
|
||||||
symtab_addsymbol (pr.symtab, name_sym);
|
symtab_addsymbol (pr.symtab, name_sym);
|
||||||
name_def = name_sym->s.def;
|
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",
|
name_sym = make_symbol (va (0, ".obj_category_name_%s_%s",
|
||||||
class_name, category_name),
|
class_name, category_name),
|
||||||
&type_pointer, pr.far_data, sc_global);
|
&type_ptr, pr.far_data, sc_global);
|
||||||
if (!name_sym->table)
|
if (!name_sym->table)
|
||||||
symtab_addsymbol (pr.symtab, name_sym);
|
symtab_addsymbol (pr.symtab, name_sym);
|
||||||
name_def = name_sym->s.def;
|
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
|
if (!data.refs && !data.cls_def_cnt && !data.cat_def_cnt
|
||||||
&& !data.instances_list)
|
&& !data.instances_list)
|
||||||
return;
|
return;
|
||||||
symtab_struct[4].type = array_type (&type_pointer,
|
symtab_struct[4].type = array_type (&type_ptr,
|
||||||
data.cls_def_cnt
|
data.cls_def_cnt
|
||||||
+ data.cat_def_cnt
|
+ data.cat_def_cnt
|
||||||
+ 1);
|
+ 1);
|
||||||
|
@ -1553,7 +1552,7 @@ class_finish_module (void)
|
||||||
sc_extern);
|
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);
|
init_sym = function_symbol (init_sym, 0, 1);
|
||||||
|
|
||||||
module_expr = address_expr (new_symbol_expr (module_sym), 0, 0);
|
module_expr = address_expr (new_symbol_expr (module_sym), 0, 0);
|
||||||
|
@ -1776,7 +1775,7 @@ def_t *
|
||||||
emit_protocol_list (protocollist_t *protocols, const char *name)
|
emit_protocol_list (protocollist_t *protocols, const char *name)
|
||||||
{
|
{
|
||||||
static struct_def_t proto_list_struct[] = {
|
static struct_def_t proto_list_struct[] = {
|
||||||
{"next", &type_pointer, emit_protocol_next},
|
{"next", &type_ptr, emit_protocol_next},
|
||||||
{"count", &type_int, emit_protocol_count},
|
{"count", &type_int, emit_protocol_count},
|
||||||
{"list", 0, emit_protocol_list_item},
|
{"list", 0, emit_protocol_list_item},
|
||||||
{0, 0},
|
{0, 0},
|
||||||
|
@ -1784,7 +1783,7 @@ emit_protocol_list (protocollist_t *protocols, const char *name)
|
||||||
|
|
||||||
if (!protocols)
|
if (!protocols)
|
||||||
return 0;
|
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',
|
return emit_structure (va (0, "_OBJ_PROTOCOLS_%s", name), 's',
|
||||||
proto_list_struct, 0, protocols, 0, sc_static);
|
proto_list_struct, 0, protocols, 0, sc_static);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2789,7 +2789,7 @@ think_expr (symbol_t *think_sym)
|
||||||
&& sym->type->t.fldptr.type->type == ev_func) {
|
&& sym->type->t.fldptr.type->type == ev_func) {
|
||||||
think_sym->type = sym->type->t.fldptr.type;
|
think_sym->type = sym->type->t.fldptr.type;
|
||||||
} else {
|
} else {
|
||||||
think_sym->type = &type_function;
|
think_sym->type = &type_func;
|
||||||
}
|
}
|
||||||
think_sym = function_symbol (think_sym, 0, 1);
|
think_sym = function_symbol (think_sym, 0, 1);
|
||||||
make_function (think_sym, 0, current_symtab->space, current_storage);
|
make_function (think_sym, 0, current_symtab->space, current_storage);
|
||||||
|
|
|
@ -590,7 +590,7 @@ begin_function (symbol_t *sym, const char *nicename, symtab_t *parent,
|
||||||
|
|
||||||
if (sym->sy_type != sy_func) {
|
if (sym->sy_type != sy_func) {
|
||||||
error (0, "%s is not a function", sym->name);
|
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);
|
sym = function_symbol (sym, 1, 1);
|
||||||
}
|
}
|
||||||
if (sym->s.func && sym->s.func->def && sym->s.func->def->initialized) {
|
if (sym->s.func && sym->s.func->def && sym->s.func->def->initialized) {
|
||||||
|
|
|
@ -585,7 +585,7 @@ def_t *
|
||||||
emit_methods (methodlist_t *methods, const char *name, int instance)
|
emit_methods (methodlist_t *methods, const char *name, int instance)
|
||||||
{
|
{
|
||||||
static struct_def_t methods_struct[] = {
|
static struct_def_t methods_struct[] = {
|
||||||
{"method_next", &type_pointer, emit_methods_next},
|
{"method_next", &type_ptr, emit_methods_next},
|
||||||
{"method_count", &type_int, emit_methods_count},
|
{"method_count", &type_int, emit_methods_count},
|
||||||
{"method_list", 0, emit_methods_list_item},
|
{"method_list", 0, emit_methods_list_item},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
|
|
|
@ -379,7 +379,7 @@ static keyword_t qf_keywords[] = {
|
||||||
{"int", TYPE, &type_int },
|
{"int", TYPE, &type_int },
|
||||||
{"unsigned", TYPE, &type_int },//FIXME
|
{"unsigned", TYPE, &type_int },//FIXME
|
||||||
|
|
||||||
{"@function", TYPE, &type_function },
|
{"@function", TYPE, &type_func },
|
||||||
{"@args", ARGS, 0 },
|
{"@args", ARGS, 0 },
|
||||||
{"@va_list", TYPE, &type_va_list },
|
{"@va_list", TYPE, &type_va_list },
|
||||||
{"@param", TYPE, &type_param },
|
{"@param", TYPE, &type_param },
|
||||||
|
|
|
@ -955,7 +955,7 @@ dereference_dst:
|
||||||
s = new_statement (st_expr, "&", dst_expr);
|
s = new_statement (st_expr, "&", dst_expr);
|
||||||
s->opa = dst;
|
s->opa = dst;
|
||||||
s->opb = ofs;
|
s->opb = ofs;
|
||||||
s->opc = temp_operand (&type_pointer, dst_expr);
|
s->opc = temp_operand (&type_ptr, dst_expr);
|
||||||
sblock_add_statement (sblock, s);
|
sblock_add_statement (sblock, s);
|
||||||
dst = s->opc;
|
dst = s->opc;
|
||||||
ofs = 0;
|
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);
|
statement_t *s = new_statement (st_expr, "&", e);
|
||||||
s->opa = pointer;
|
s->opa = pointer;
|
||||||
s->opb = offset;
|
s->opb = offset;
|
||||||
s->opc = temp_operand (&type_pointer, e);
|
s->opc = temp_operand (&type_ptr, e);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,11 +69,9 @@ type_t type_vector = { ev_vector, "vector", 1 };
|
||||||
type_t type_entity = { ev_entity, "entity", 1 };
|
type_t type_entity = { ev_entity, "entity", 1 };
|
||||||
type_t type_field = {ev_field, "field", 1, ty_basic, {{&type_void}} };
|
type_t type_field = {ev_field, "field", 1, ty_basic, {{&type_void}} };
|
||||||
|
|
||||||
// type_function is a void() function used for state defs
|
// type_func is a void() function used for state defs
|
||||||
type_t type_function = { ev_func, "function", 1, ty_basic,
|
type_t type_func = { ev_func, "func", 1, ty_basic, {{&type_void}} };
|
||||||
{{&type_void}} };
|
type_t type_ptr = { ev_ptr, "pointer", 1, ty_basic, {{&type_void}} };
|
||||||
type_t type_pointer = { ev_ptr, "pointer", 1, ty_basic,
|
|
||||||
{{&type_void}} };
|
|
||||||
type_t type_quaternion = { ev_quaternion, "quaternion", 4 };
|
type_t type_quaternion = { ev_quaternion, "quaternion", 4 };
|
||||||
type_t type_int = { ev_int, "int", 1 };
|
type_t type_int = { ev_int, "int", 1 };
|
||||||
type_t type_uint = { ev_uint, "uint", 1 };
|
type_t type_uint = { ev_uint, "uint", 1 };
|
||||||
|
@ -1141,8 +1139,8 @@ chain_basic_types (void)
|
||||||
type_entity.t.symtab = pr.entity_fields;
|
type_entity.t.symtab = pr.entity_fields;
|
||||||
chain_type (&type_entity);
|
chain_type (&type_entity);
|
||||||
chain_type (&type_field);
|
chain_type (&type_field);
|
||||||
chain_type (&type_function);
|
chain_type (&type_func);
|
||||||
chain_type (&type_pointer);
|
chain_type (&type_ptr);
|
||||||
chain_type (&type_floatfield);
|
chain_type (&type_floatfield);
|
||||||
if (!options.traditional) {
|
if (!options.traditional) {
|
||||||
chain_type (&type_quaternion);
|
chain_type (&type_quaternion);
|
||||||
|
@ -1180,8 +1178,8 @@ init_types (void)
|
||||||
{"float_val", &type_float},
|
{"float_val", &type_float},
|
||||||
{"entity_val", &type_entity},
|
{"entity_val", &type_entity},
|
||||||
{"field_val", &type_field},
|
{"field_val", &type_field},
|
||||||
{"func_val", &type_function},
|
{"func_val", &type_func},
|
||||||
{"pointer_val", &type_pointer},
|
{"pointer_val", &type_ptr},
|
||||||
{"vector_val", &type_vector},
|
{"vector_val", &type_vector},
|
||||||
{"int_val", &type_int},
|
{"int_val", &type_int},
|
||||||
{"uint_val", &type_uint},
|
{"uint_val", &type_uint},
|
||||||
|
@ -1197,8 +1195,8 @@ init_types (void)
|
||||||
{"vector_val", &type_vector},
|
{"vector_val", &type_vector},
|
||||||
{"entity_val", &type_entity},
|
{"entity_val", &type_entity},
|
||||||
{"field_val", &type_field},
|
{"field_val", &type_field},
|
||||||
{"func_val", &type_function},
|
{"func_val", &type_func},
|
||||||
{"pointer_val", &type_pointer},
|
{"pointer_val", &type_ptr},
|
||||||
{"int_val", &type_int},
|
{"int_val", &type_int},
|
||||||
{"uint_val", &type_uint},
|
{"uint_val", &type_uint},
|
||||||
{"quaternion_val", &type_quaternion},
|
{"quaternion_val", &type_quaternion},
|
||||||
|
@ -1217,13 +1215,13 @@ init_types (void)
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct_def_t type_encoding_struct[] = {
|
static struct_def_t type_encoding_struct[] = {
|
||||||
{"types", &type_pointer},
|
{"types", &type_ptr},
|
||||||
{"size", &type_uint},
|
{"size", &type_uint},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct_def_t xdef_struct[] = {
|
static struct_def_t xdef_struct[] = {
|
||||||
{"types", &type_pointer},
|
{"types", &type_ptr},
|
||||||
{"offset", &type_pointer},
|
{"offset", &type_ptr},
|
||||||
{0, 0}
|
{0, 0}
|
||||||
};
|
};
|
||||||
static struct_def_t xdefs_struct[] = {
|
static struct_def_t xdefs_struct[] = {
|
||||||
|
|
|
@ -505,11 +505,11 @@ emit_value (ex_value_t *value, def_t *def)
|
||||||
break;
|
break;
|
||||||
case ev_func:
|
case ev_func:
|
||||||
tab = func_imm_defs;
|
tab = func_imm_defs;
|
||||||
type = &type_function;
|
type = &type_func;
|
||||||
break;
|
break;
|
||||||
case ev_ptr:
|
case ev_ptr:
|
||||||
tab = pointer_imm_defs;
|
tab = pointer_imm_defs;
|
||||||
type = &type_pointer;
|
type = &type_ptr;
|
||||||
break;
|
break;
|
||||||
case ev_int:
|
case ev_int:
|
||||||
case ev_uint:
|
case ev_uint:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue