ir_value_set_field

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-11 15:41:10 +02:00
parent 48d330a1e9
commit 1559dedfd9
2 changed files with 10 additions and 0 deletions

9
ir.c
View file

@ -646,6 +646,15 @@ bool ir_value_set_vector(ir_value *self, vector v)
return true;
}
bool ir_value_set_field(ir_value *self, ir_value *fld)
{
if (self->vtype != TYPE_FIELD)
return false;
self->constval.vpointer = fld;
self->isconst = true;
return true;
}
bool ir_value_set_string(ir_value *self, const char *str)
{
if (self->vtype != TYPE_STRING)

1
ir.h
View file

@ -95,6 +95,7 @@ bool GMQCC_WARN ir_value_set_int(ir_value*, int i);
#endif
bool GMQCC_WARN ir_value_set_string(ir_value*, const char *s);
bool GMQCC_WARN ir_value_set_vector(ir_value*, vector v);
bool GMQCC_WARN ir_value_set_field(ir_value*, ir_value *fld);
/*bool ir_value_set_pointer_v(ir_value*, ir_value* p); */
/*bool ir_value_set_pointer_i(ir_value*, int i); */