]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.c
Cleanups and make compile with clang again with no warnings.
[xonotic/gmqcc.git] / ast.c
diff --git a/ast.c b/ast.c
index 7fcab1538e4b12fe00db1b4dd034736841cffcbc..e544e48a24984edd9e6176bec0afe3297d84a324 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1061,10 +1061,10 @@ const char* ast_function_label(ast_function *self, const char *prefix)
     from = self->labelbuf + sizeof(self->labelbuf)-1;
     *from-- = 0;
     do {
-        unsigned int digit = id % 10;
-        *from = digit + '0';
+        *from-- = (id%10) + '0';
         id /= 10;
     } while (id);
+    ++from;
     memcpy(from - len, prefix, len);
     return from - len;
 }
@@ -1085,7 +1085,6 @@ void _ast_codegen_output_type(ast_expression_common *self, ir_value *out)
 }
 
 #define codegen_output_type(a,o) (_ast_codegen_output_type(&((a)->expression),(o)))
-#define codegen_output_type_expr(a,o) (_ast_codegen_output_type(a,(o)))
 
 bool ast_value_codegen(ast_value *self, ast_function *func, bool lvalue, ir_value **out)
 {
@@ -1505,7 +1504,7 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir)
     }
 
     /* TODO: check return types */
-    if (!self->curblock->is_return)
+    if (!self->curblock->final)
     {
         if (!self->vtype->expression.next ||
             self->vtype->expression.next->expression.vtype == TYPE_VOID)