]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - fold.cpp
temp committing major c++ification
[xonotic/gmqcc.git] / fold.cpp
index d8f9de170e7c6dd91577d89eba7f2096b183cb5f..195e8a52d897063feec0fdd97f10217ea5249a00 100644 (file)
--- a/fold.cpp
+++ b/fold.cpp
@@ -878,7 +878,7 @@ lex_ctx_t fold::ctx() {
 }
 
 bool fold::immediate_true(ast_value *v) {
 }
 
 bool fold::immediate_true(ast_value *v) {
-    switch (v->expression.vtype) {
+    switch (v->vtype) {
         case TYPE_FLOAT:
             return !!v->constval.vfloat;
         case TYPE_INTEGER:
         case TYPE_FLOAT:
             return !!v->constval.vfloat;
         case TYPE_INTEGER:
@@ -939,7 +939,7 @@ bool fold::generate(ir_builder *ir) {
     return true;
 err:
     con_out("failed to generate global %s\n", cur->name);
     return true;
 err:
     con_out("failed to generate global %s\n", cur->name);
-    ir_builder_delete(ir);
+    delete ir;
     return false;
 }
 
     return false;
 }
 
@@ -998,7 +998,7 @@ ast_expression *fold::constgen_string(const char *str, bool translate) {
         char name[32];
         util_snprintf(name, sizeof(name), "dotranslate_%zu", m_parser->translated++);
         out = ast_value_new(ctx(), name, TYPE_STRING);
         char name[32];
         util_snprintf(name, sizeof(name), "dotranslate_%zu", m_parser->translated++);
         out = ast_value_new(ctx(), name, TYPE_STRING);
-        out->expression.flags |= AST_FLAG_INCLUDE_DEF; /* def needs to be included for translatables */
+        out->flags |= AST_FLAG_INCLUDE_DEF; /* def needs to be included for translatables */
     } else {
         out = ast_value_new(ctx(), "#IMMEDIATE", TYPE_STRING);
     }
     } else {
         out = ast_value_new(ctx(), "#IMMEDIATE", TYPE_STRING);
     }