]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.h
Result of shift operation on signed integers is bad.
[xonotic/gmqcc.git] / ast.h
diff --git a/ast.h b/ast.h
index 14d38d886458efb76207fe878b2a2d46aacee1f0..f18c73ebe0d5e7ecb94f7012a3dcd15e4a7a9a6c 100644 (file)
--- a/ast.h
+++ b/ast.h
@@ -161,6 +161,15 @@ typedef struct
  * typedef float foo;
  * is like creating a 'float foo', foo serving as the type's name.
  */
+typedef union {
+    double        vfloat;
+    int           vint;
+    vector        vvec;
+    const char   *vstring;
+    int           ventity;
+    ast_function *vfunc;
+    ast_value    *vfield;
+} basic_value_t;
 struct ast_value_s
 {
     ast_expression_common expression;
@@ -177,16 +186,14 @@ struct ast_value_s
 
     int  cvq;     /* const/var qualifier */
     bool isfield; /* this declares a field */
+    bool isimm;   /* an immediate, not just const */
     bool hasvalue;
-    union {
-        double        vfloat;
-        int           vint;
-        vector        vvec;
-        const char   *vstring;
-        int           ventity;
-        ast_function *vfunc;
-        ast_value    *vfield;
-    } constval;
+    basic_value_t constval;
+    /* for TYPE_ARRAY we have an optional vector
+     * of constants when an initializer list
+     * was provided.
+     */
+    basic_value_t *initlist;
 
     /* usecount for the parser */
     size_t uses;
@@ -676,14 +683,6 @@ bool ast_generate_accessors(ast_value *asvalue, ir_builder *ir);
 union ast_expression_u
 {
     ast_expression_common expression;
-
-    ast_value    value;
-    ast_binary   binary;
-    ast_block    block;
-    ast_ternary  ternary;
-    ast_ifthen   ifthen;
-    ast_store    store;
-    ast_entfield entfield;
 };
 
 /* Node union
@@ -691,7 +690,6 @@ union ast_expression_u
 union ast_node_u
 {
     ast_node_common node;
-    ast_expression  expression;
 };
 
 #endif