mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 07:11:41 +00:00
[gamecode] Add ev_ushort and partial support
Really, only just enough to get everything compiling (which does include vkgen running correctly).
This commit is contained in:
parent
6df79b2b06
commit
068c04ece6
11 changed files with 41 additions and 1 deletions
|
@ -1737,6 +1737,7 @@ typedef struct type_view_s {
|
|||
type_view_func double_view;
|
||||
type_view_func long_view;
|
||||
type_view_func ulong_view;
|
||||
type_view_func ushort_view;
|
||||
|
||||
type_view_func struct_view;
|
||||
type_view_func union_view;
|
||||
|
|
|
@ -45,5 +45,6 @@ EV_TYPE(short) // value is embedded in the opcode
|
|||
EV_TYPE(double)
|
||||
EV_TYPE(long)
|
||||
EV_TYPE(ulong)
|
||||
EV_TYPE(ushort)
|
||||
|
||||
#undef EV_TYPE
|
||||
|
|
|
@ -149,6 +149,8 @@ static void pr_debug_long_view (qfot_type_t *type, pr_type_t *value,
|
|||
void *_data);
|
||||
static void pr_debug_ulong_view (qfot_type_t *type, pr_type_t *value,
|
||||
void *_data);
|
||||
static void pr_debug_ushort_view (qfot_type_t *type, pr_type_t *value,
|
||||
void *_data);
|
||||
static void pr_debug_struct_view (qfot_type_t *type, pr_type_t *value,
|
||||
void *_data);
|
||||
static void pr_debug_union_view (qfot_type_t *type, pr_type_t *value,
|
||||
|
@ -176,6 +178,7 @@ static type_view_t raw_type_view = {
|
|||
pr_debug_double_view,
|
||||
pr_debug_long_view,
|
||||
pr_debug_ulong_view,
|
||||
pr_debug_ushort_view,
|
||||
pr_debug_struct_view,
|
||||
pr_debug_union_view,
|
||||
pr_debug_enum_view,
|
||||
|
@ -1074,6 +1077,9 @@ value_string (pr_debug_data_t *data, qfot_type_t *type, pr_type_t *value)
|
|||
case ev_ulong:
|
||||
raw_type_view.ulong_view (type, value, data);
|
||||
break;
|
||||
case ev_ushort:
|
||||
raw_type_view.ushort_view (type, value, data);
|
||||
break;
|
||||
case ev_invalid:
|
||||
case ev_type_count:
|
||||
dstring_appendstr (data->dstr, "<?""?>");
|
||||
|
@ -1395,6 +1401,15 @@ pr_debug_ulong_view (qfot_type_t *type, pr_type_t *value, void *_data)
|
|||
dasprintf (dstr, "%" PRIu64, *(uint64_t *)value);
|
||||
}
|
||||
|
||||
static void
|
||||
pr_debug_ushort_view (qfot_type_t *type, pr_type_t *value, void *_data)
|
||||
{
|
||||
__auto_type data = (pr_debug_data_t *) _data;
|
||||
dstring_t *dstr = data->dstr;
|
||||
|
||||
dasprintf (dstr, "%04x", (pr_ushort_t)value->int_var);
|
||||
}
|
||||
|
||||
static void
|
||||
pr_dump_struct (qfot_type_t *type, pr_type_t *value, void *_data,
|
||||
const char *struct_type)
|
||||
|
|
|
@ -339,6 +339,7 @@ set_address (sv_def_t *def, void *address)
|
|||
switch (def->type) {
|
||||
case ev_void:
|
||||
case ev_short:
|
||||
case ev_ushort:
|
||||
case ev_invalid:
|
||||
case ev_type_count:
|
||||
break;
|
||||
|
|
|
@ -372,6 +372,7 @@ set_address (sv_def_t *def, void *address)
|
|||
switch (def->type) {
|
||||
case ev_void:
|
||||
case ev_short:
|
||||
case ev_ushort:
|
||||
case ev_invalid:
|
||||
case ev_type_count:
|
||||
break;
|
||||
|
|
|
@ -203,7 +203,8 @@ typedef struct ex_value_s {
|
|||
float quaternion_val[4]; ///< quaternion constant
|
||||
int int_val; ///< int constant
|
||||
unsigned uint_val; ///< unsigned int constant
|
||||
short short_val; ///< short constant
|
||||
int16_t short_val; ///< short constant
|
||||
uint16_t ushort_val; ///< unsigned short constant
|
||||
} v;
|
||||
} ex_value_t;
|
||||
|
||||
|
|
|
@ -593,6 +593,9 @@ print_value (dstring_t *dstr, expr_t *e, int level, int id, expr_t *next)
|
|||
case ev_short:
|
||||
label = va (0, "s %d", e->e.value->v.short_val);
|
||||
break;
|
||||
case ev_ushort:
|
||||
label = va (0, "us %d", e->e.value->v.ushort_val);
|
||||
break;
|
||||
case ev_void:
|
||||
label = "<void>";
|
||||
break;
|
||||
|
|
|
@ -1712,6 +1712,7 @@ unary_expr (int op, expr_t *e)
|
|||
return new_vector_expr (q);
|
||||
case ev_long:
|
||||
case ev_ulong:
|
||||
case ev_ushort:
|
||||
internal_error (e, "long not implemented");
|
||||
case ev_int:
|
||||
return new_int_expr (-expr_int (e));
|
||||
|
@ -1813,6 +1814,7 @@ unary_expr (int op, expr_t *e)
|
|||
return new_int_expr (!QuatIsZero (expr_quaternion (e)));
|
||||
case ev_long:
|
||||
case ev_ulong:
|
||||
case ev_ushort:
|
||||
internal_error (e, "long not implemented");
|
||||
case ev_int:
|
||||
return new_int_expr (!expr_int (e));
|
||||
|
@ -1887,6 +1889,7 @@ unary_expr (int op, expr_t *e)
|
|||
return new_vector_expr (q);
|
||||
case ev_long:
|
||||
case ev_ulong:
|
||||
case ev_ushort:
|
||||
internal_error (e, "long not implemented");
|
||||
case ev_int:
|
||||
return new_int_expr (~expr_int (e));
|
||||
|
|
|
@ -96,6 +96,7 @@ test_expr (expr_t *e)
|
|||
break;
|
||||
case ev_long:
|
||||
case ev_ulong:
|
||||
case ev_ushort:
|
||||
internal_error (e, "long not implemented");
|
||||
case ev_uint:
|
||||
case ev_int:
|
||||
|
|
|
@ -168,6 +168,8 @@ operand_string (operand_t *op)
|
|||
return va (0, "ulong %"PRIu64, op->value->v.ulong_val);
|
||||
case ev_short:
|
||||
return va (0, "short %d", op->value->v.short_val);
|
||||
case ev_ushort:
|
||||
return va (0, "ushort %d", op->value->v.ushort_val);
|
||||
case ev_void:
|
||||
return "(void)";
|
||||
case ev_invalid:
|
||||
|
@ -252,6 +254,9 @@ _print_operand (operand_t *op)
|
|||
case ev_short:
|
||||
printf ("%d", op->value->v.short_val);
|
||||
break;
|
||||
case ev_ushort:
|
||||
printf ("%d", op->value->v.ushort_val);
|
||||
break;
|
||||
case ev_void:
|
||||
case ev_invalid:
|
||||
case ev_type_count:
|
||||
|
|
|
@ -110,6 +110,7 @@ type_t *ev_types[ev_type_count] = {
|
|||
&type_uint,
|
||||
&type_short,
|
||||
&type_double,
|
||||
0, 0, 0,
|
||||
&type_invalid,
|
||||
};
|
||||
|
||||
|
@ -191,6 +192,7 @@ free_type (type_t *type)
|
|||
case ev_long:
|
||||
case ev_ulong:
|
||||
case ev_short:
|
||||
case ev_ushort:
|
||||
case ev_double:
|
||||
break;
|
||||
case ev_field:
|
||||
|
@ -233,6 +235,7 @@ copy_chain (type_t *type, type_t *append)
|
|||
case ev_long:
|
||||
case ev_ulong:
|
||||
case ev_short:
|
||||
case ev_ushort:
|
||||
case ev_double:
|
||||
internal_error (0, "copy basic type");
|
||||
case ev_field:
|
||||
|
@ -286,6 +289,7 @@ append_type (type_t *type, type_t *new)
|
|||
case ev_long:
|
||||
case ev_ulong:
|
||||
case ev_short:
|
||||
case ev_ushort:
|
||||
case ev_double:
|
||||
internal_error (0, "append to basic type");
|
||||
case ev_field:
|
||||
|
@ -665,6 +669,7 @@ print_type_str (dstring_t *str, const type_t *type)
|
|||
case ev_long:
|
||||
case ev_ulong:
|
||||
case ev_short:
|
||||
case ev_ushort:
|
||||
case ev_double:
|
||||
dasprintf (str, " %s", pr_type_name[type->type]);
|
||||
return;
|
||||
|
@ -837,6 +842,9 @@ encode_type (dstring_t *encoding, const type_t *type)
|
|||
case ev_short:
|
||||
dasprintf (encoding, "s");
|
||||
return;
|
||||
case ev_ushort:
|
||||
dasprintf (encoding, "S");
|
||||
return;
|
||||
case ev_invalid:
|
||||
case ev_type_count:
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue