nir/print: Factor variable name lookup into a helper
[mesa.git] / src / glsl / s_expression.h
index 795f3fccea78a4f0b7b416add8061a5fc0dbc3d6..f0dffb1b2f86d35422238c386e4cf46272a38a4a 100644 (file)
@@ -27,7 +27,7 @@
 #define S_EXPRESSION_H
 
 #include "main/core.h" /* for Elements */
-#include "strtod.h"
+#include "util/strtod.h"
 #include "list.h"
 
 /* Type-safe downcasting macros (also safe to pass NULL) */
@@ -39,8 +39,8 @@
 #define SX_AS_INT(x)    SX_AS_(int, x)
 
 /* Pattern matching macros */
-#define MATCH(list, pat) s_match(list, Elements(pat), pat, false)
-#define PARTIAL_MATCH(list, pat) s_match(list, Elements(pat), pat, true)
+#define MATCH(list, pat) s_match(list, ARRAY_SIZE(pat), pat, false)
+#define PARTIAL_MATCH(list, pat) s_match(list, ARRAY_SIZE(pat), pat, true)
 
 /* For our purposes, S-Expressions are:
  * - <int>
@@ -57,7 +57,7 @@ public:
     * Read an S-Expression from the given string.
     * Advances the supplied pointer to just after the expression read.
     *
-    * Any allocation will be performed with 'ctx' as the talloc owner.
+    * Any allocation will be performed with 'ctx' as the ralloc owner.
     */
    static s_expression *read_expression(void *ctx, const char *&src);
 
@@ -129,7 +129,7 @@ public:
    void print();
 
 private:
-   char *str;
+   const char *str;
 };
 
 /* Lists of expressions: (expr1 ... exprN) */