mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-12-18 08:22:13 +00:00
It's the same TYPE enum...
This commit is contained in:
parent
5ca6f4abca
commit
f5cbd73768
1 changed files with 1 additions and 10 deletions
11
ir.c
11
ir.c
|
@ -1816,30 +1816,25 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
|
||||||
int32_t *iptr;
|
int32_t *iptr;
|
||||||
prog_section_def def;
|
prog_section_def def;
|
||||||
|
|
||||||
def.type = 0;
|
def.type = global->vtype;
|
||||||
def.offset = code_globals_elements;
|
def.offset = code_globals_elements;
|
||||||
def.name = global->code.name = code_genstring(global->name);
|
def.name = global->code.name = code_genstring(global->name);
|
||||||
|
|
||||||
switch (global->vtype)
|
switch (global->vtype)
|
||||||
{
|
{
|
||||||
case TYPE_POINTER:
|
case TYPE_POINTER:
|
||||||
def.type = 7;
|
|
||||||
if (code_defs_add(def) < 0)
|
if (code_defs_add(def) < 0)
|
||||||
return false;
|
return false;
|
||||||
return gen_global_pointer(global);
|
return gen_global_pointer(global);
|
||||||
case TYPE_FIELD:
|
case TYPE_FIELD:
|
||||||
def.type = 5;
|
|
||||||
if (code_defs_add(def) < 0)
|
if (code_defs_add(def) < 0)
|
||||||
return false;
|
return false;
|
||||||
return gen_global_field(global);
|
return gen_global_field(global);
|
||||||
case TYPE_ENTITY:
|
case TYPE_ENTITY:
|
||||||
def.type = 4;
|
|
||||||
if (code_defs_add(def) < 0)
|
if (code_defs_add(def) < 0)
|
||||||
return false;
|
return false;
|
||||||
case TYPE_FLOAT:
|
case TYPE_FLOAT:
|
||||||
{
|
{
|
||||||
def.type = 2;
|
|
||||||
|
|
||||||
if (code_defs_add(def) < 0)
|
if (code_defs_add(def) < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1853,7 +1848,6 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
|
||||||
}
|
}
|
||||||
case TYPE_STRING:
|
case TYPE_STRING:
|
||||||
{
|
{
|
||||||
def.type = 1;
|
|
||||||
if (code_defs_add(def) < 0)
|
if (code_defs_add(def) < 0)
|
||||||
return false;
|
return false;
|
||||||
if (global->isconst)
|
if (global->isconst)
|
||||||
|
@ -1864,8 +1858,6 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
|
||||||
}
|
}
|
||||||
case TYPE_VECTOR:
|
case TYPE_VECTOR:
|
||||||
{
|
{
|
||||||
def.type = 3;
|
|
||||||
|
|
||||||
if (code_defs_add(def) < 0)
|
if (code_defs_add(def) < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1882,7 +1874,6 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
|
||||||
return global->code.globaladdr >= 0;
|
return global->code.globaladdr >= 0;
|
||||||
}
|
}
|
||||||
case TYPE_FUNCTION:
|
case TYPE_FUNCTION:
|
||||||
def.type = 6;
|
|
||||||
if (code_defs_add(def) < 0)
|
if (code_defs_add(def) < 0)
|
||||||
return false;
|
return false;
|
||||||
return gen_global_function(self, global);
|
return gen_global_function(self, global);
|
||||||
|
|
Loading…
Reference in a new issue