]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
It's the same TYPE enum...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 9 May 2012 12:18:01 +0000 (14:18 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 9 May 2012 13:03:19 +0000 (15:03 +0200)
ir.c

diff --git a/ir.c b/ir.c
index 850f070d5e2e1ac3f767584b1868ef5a43763ae7..181f3fc753a9836cb0ce771b78552b2fbdcb2305 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -1816,30 +1816,25 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
     int32_t         *iptr;
     prog_section_def def;
 
-    def.type = 0;
+    def.type = global->vtype;
     def.offset = code_globals_elements;
     def.name   = global->code.name       = code_genstring(global->name);
 
     switch (global->vtype)
     {
     case TYPE_POINTER:
-        def.type = 7;
         if (code_defs_add(def) < 0)
             return false;
         return gen_global_pointer(global);
     case TYPE_FIELD:
-        def.type = 5;
         if (code_defs_add(def) < 0)
             return false;
         return gen_global_field(global);
     case TYPE_ENTITY:
-        def.type = 4;
         if (code_defs_add(def) < 0)
             return false;
     case TYPE_FLOAT:
     {
-        def.type = 2;
-
         if (code_defs_add(def) < 0)
             return false;
 
@@ -1853,7 +1848,6 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
     }
     case TYPE_STRING:
     {
-        def.type = 1;
         if (code_defs_add(def) < 0)
             return false;
         if (global->isconst)
@@ -1864,8 +1858,6 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
     }
     case TYPE_VECTOR:
     {
-        def.type = 3;
-
         if (code_defs_add(def) < 0)
             return false;
 
@@ -1882,7 +1874,6 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global)
         return global->code.globaladdr >= 0;
     }
     case TYPE_FUNCTION:
-        def.type = 6;
         if (code_defs_add(def) < 0)
             return false;
         return gen_global_function(self, global);