]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Merge branch 'master' into blub/bc3
authorWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sun, 22 Jul 2012 10:22:33 +0000 (12:22 +0200)
committerWolfgang Bumiller <wolfgang.linux@bumiller.com>
Sun, 22 Jul 2012 10:22:33 +0000 (12:22 +0200)
1  2 
ast.c

diff --combined ast.c
index 66752444f6fb697d014badd08489565292f7831b,e173ed584db854f32ffdd71205ddca5ca26ee1bd..582cda6a7af4dc6805a9dd563360dfd3a2a67cfb
--- 1/ast.c
--- 2/ast.c
+++ b/ast.c
@@@ -170,18 -170,6 +170,18 @@@ ast_binary* ast_binary_new(lex_ctx ctx
      self->left = left;
      self->right = right;
  
 +    if (op >= INSTR_EQ_F && op <= INSTR_GT)
 +        self->expression.vtype = TYPE_FLOAT;
 +    else if (op == INSTR_AND || op == INSTR_OR ||
 +             op == INSTR_BITAND || op == INSTR_BITOR)
 +        self->expression.vtype = TYPE_FLOAT;
 +    else if (op == INSTR_MUL_VF || op == INSTR_MUL_FV)
 +        self->expression.vtype = TYPE_VECTOR;
 +    else if (op == INSTR_MUL_V)
 +        self->expression.vtype = TYPE_FLOAT;
 +    else
 +        self->expression.vtype = left->expression.vtype;
 +
      return self;
  }
  
@@@ -530,10 -518,8 +530,10 @@@ bool ast_global_codegen(ast_value *self
      }
  
      v = ir_builder_create_global(ir, self->name, self->expression.vtype);
 -    if (!v)
 +    if (!v) {
 +        printf("ir_builder_create_global failed\n");
          return false;
 +    }
  
      if (self->isconst) {
          switch (self->expression.vtype)
@@@ -633,7 -619,7 +633,7 @@@ bool ast_function_codegen(ast_function 
  
      if (!self->builtin && self->vtype->params_count != self->params_count) {
          printf("ast_function's parameter variables doesn't match the declared parameter count\n");
-         printf("%i != %i\n", self->vtype->params_count, self->params_count);
+         printf("%i != %i\n", (int)self->vtype->params_count, (int)self->params_count);
          return false;
      }