]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - fold.cpp
temp committing major c++ification
[xonotic/gmqcc.git] / fold.cpp
index ee0bbc1d9b501d03aa18f008ac5291c81d999a32..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) {
-    switch (v->expression.vtype) {
+    switch (v->vtype) {
         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);
-    ir_builder_delete(ir);
+    delete ir;
     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);
-        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);
     }
@@ -1070,7 +1070,7 @@ ast_expression *fold::op_mul_vec(vec3_t vec, ast_value *sel, const char *set) {
         ast_expression *out;
         ++opts_optimizationcount[OPTIM_VECTOR_COMPONENTS];
         out = (ast_expression*)ast_member_new(ctx(), (ast_expression*)sel, set[0]-'x', nullptr);
-        out->node.keep_node = false;
+        out->keep_node = false;
         ((ast_member*)out)->rvalue = true;
         if (x != -1.0f)
             return (ast_expression*)ast_binary_new(ctx(), INSTR_MUL_F, constgen_float(x, false), out);