glsl: rename _restrict to restrict_flag
authorBrian Paul <brianp@vmware.com>
Wed, 12 Feb 2014 20:22:27 +0000 (13:22 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 12 Feb 2014 20:37:09 +0000 (13:37 -0700)
To fix MSVC compile breakage.  Evidently, _restrict is an MSVC keyword,
though the docs only mention __restrict (with two underscores).

Note: we may want to also rename _volatile to volatile_flag to be
consistent.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74900
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/ast.h
src/glsl/ast_function.cpp
src/glsl/ast_to_hir.cpp
src/glsl/builtin_functions.cpp
src/glsl/glsl_parser.yy
src/glsl/ir.cpp
src/glsl/ir.h

index cd913ab34ebc36b073cfa7021191c2582459e280..9140ca13cdae5e07e1b52200542c462620ed1a13 100644 (file)
@@ -473,7 +473,7 @@ struct ast_type_qualifier {
         unsigned explicit_image_format:1;
         unsigned coherent:1;
         unsigned _volatile:1;
-        unsigned _restrict:1;
+        unsigned restrict_flag:1;
         unsigned read_only:1; /**< "readonly" qualifier. */
         unsigned write_only:1; /**< "writeonly" qualifier. */
         /** \} */
index 8fa03dc2d4c2b955459c59914c834c5352d58257..4b84470679e3c4d9dad5b000c21a9de59b638dcb 100644 (file)
@@ -120,7 +120,7 @@ verify_image_parameter(YYLTYPE *loc, _mesa_glsl_parse_state *state,
       return false;
    }
 
-   if (actual->data.image._restrict && !formal->data.image._restrict) {
+   if (actual->data.image.restrict_flag && !formal->data.image.restrict_flag) {
       _mesa_glsl_error(loc, state,
                        "function call parameter `%s' drops "
                        "`restrict' qualifier", formal->name);
index 39317685befc8510d18b6aea954c65dd41fd551a..6de73f4764b1dd902c07a23e4fc3d617c330cb2d 100644 (file)
@@ -2232,7 +2232,7 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
       var->data.image.write_only |= qual->flags.q.write_only;
       var->data.image.coherent |= qual->flags.q.coherent;
       var->data.image._volatile |= qual->flags.q._volatile;
-      var->data.image._restrict |= qual->flags.q._restrict;
+      var->data.image.restrict_flag |= qual->flags.q.restrict_flag;
       var->data.read_only = true;
 
       if (qual->flags.q.explicit_image_format) {
index 2905a3560490d66cf51ec59ac20cb05783fe8430..b9dc95902beb847d2b9c2875b77362b619c1bd54 100644 (file)
@@ -4293,7 +4293,7 @@ builtin_builder::_image_prototype(const glsl_type *image_type,
    image->data.image.write_only = flags & IMAGE_FUNCTION_WRITE_ONLY;
    image->data.image.coherent = true;
    image->data.image._volatile = true;
-   image->data.image._restrict = true;
+   image->data.image.restrict_flag = true;
 
    return sig;
 }
index 6aed25464b1c6851a1387bed35834e34b5aa30cd..369da5034d6bc23077b57cbee67787089fbac003 100644 (file)
@@ -1655,7 +1655,7 @@ storage_qualifier:
    {
       STATIC_ASSERT(sizeof($$.flags.q) <= sizeof($$.flags.i));
       memset(& $$, 0, sizeof($$));
-      $$.flags.q._restrict = 1;
+      $$.flags.q.restrict_flag = 1;
    }
    | READONLY
    {
index 338f61b0daa2428701b845de2585b72732ad60d0..a41eddfcb73cdf351617e8d3337075bf13fa70c4 100644 (file)
@@ -1558,7 +1558,7 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
    this->data.image.write_only = false;
    this->data.image.coherent = false;
    this->data.image._volatile = false;
-   this->data.image._restrict = false;
+   this->data.image.restrict_flag = false;
 
    if (type != NULL) {
       if (type->base_type == GLSL_TYPE_SAMPLER)
@@ -1668,7 +1668,7 @@ ir_function_signature::qualifiers_match(exec_list *params)
           a->data.image.write_only != b->data.image.write_only ||
           a->data.image.coherent != b->data.image.coherent ||
           a->data.image._volatile != b->data.image._volatile ||
-          a->data.image._restrict != b->data.image._restrict) {
+          a->data.image.restrict_flag != b->data.image.restrict_flag) {
 
         /* parameter a's qualifiers don't match */
         return a->name;
index 39585731898bc106a2f0b8e49a58cd3d8c5e4737..e27e30adc80ae20b24fac253abc1855b7b93bd67 100644 (file)
@@ -698,7 +698,7 @@ public:
          bool write_only; /**< "writeonly" qualifier. */
          bool coherent;
          bool _volatile;
-         bool _restrict;
+         bool restrict_flag;
 
          /** Image internal format if specified explicitly, otherwise GL_NONE. */
          GLenum format;