mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 07:20:50 +00:00
Encode the basic type for functions, fields and pointers.
Very important for distinguishing them from other types.
This commit is contained in:
parent
55043310fc
commit
4f6d18a328
2 changed files with 6 additions and 2 deletions
|
@ -44,10 +44,12 @@
|
|||
#include "type.h"
|
||||
|
||||
typedef struct qfot_ptrfld_s {
|
||||
pointer_t type; ///< referenced type
|
||||
pr_int_t type; ///< ev_field or ev_pointer
|
||||
pointer_t aux_type; ///< referenced type
|
||||
} qfot_ptrfld_t;
|
||||
|
||||
typedef struct qfot_func_s {
|
||||
pr_int_t type; ///< always ev_func
|
||||
pointer_t return_type; ///< return type of the function
|
||||
pr_int_t num_params; ///< ones compliment count of the
|
||||
///< parameters. -ve values indicate the
|
||||
|
|
|
@ -119,6 +119,7 @@ qfo_encode_func (type_t *type)
|
|||
def = qfo_new_encoding (type, size);
|
||||
enc = D_POINTER (qfot_type_t, def);
|
||||
func = &enc->t.func;
|
||||
func->type = ev_func;
|
||||
ENC_DEF (func->return_type, return_type_def);
|
||||
func->num_params = type->t.func.num_params;
|
||||
for (i = 0; i < param_count; i++)
|
||||
|
@ -136,7 +137,8 @@ qfo_encode_ptrfld (type_t *type)
|
|||
type_def = qfo_encode_type (type->t.fldptr.type);
|
||||
def = qfo_new_encoding (type, sizeof (enc->t.ptrfld));
|
||||
enc = D_POINTER (qfot_type_t, def);
|
||||
ENC_DEF (enc->t.ptrfld.type, type_def);
|
||||
enc->t.ptrfld.type = type->type;
|
||||
ENC_DEF (enc->t.ptrfld.aux_type, type_def);
|
||||
return def;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue