mesa,glsl: rename `interface` to `programInterface`.
authorJose Fonseca <jfonseca@vmware.com>
Thu, 16 Apr 2015 09:19:57 +0000 (10:19 +0100)
committerJose Fonseca <jfonseca@vmware.com>
Thu, 16 Apr 2015 09:23:24 +0000 (10:23 +0100)
`interface` is a define on Windows -- an alias for `struct` keyword,
used when declaring COM interfaces in C or C++.

So use instead `programInterface`, therefore matching the name used
in GL_ARB_program_interface_query spec/headers, which was renamed exactly
for the same reason:

  "Revision 10, May 10, 2012 (pbrown)
     - Rename the formal parameter <interface> used by the functions in this
       extension to <programInterface>.  Certain versions of the Microsoft
       C/C++ compiler and/or its headers cause "interface" to be treated as a
       reserved keyword."

Trivial.

src/glsl/linker.cpp
src/mesa/main/shader_query.cpp
src/mesa/main/shaderapi.h

index 651ecd85a15051db145829adaafffcbf3b2a790c..b6baa5d36f007860fe74ebc7da984c957d6393b9 100644 (file)
@@ -2552,7 +2552,7 @@ build_stageref(struct gl_shader_program *shProg, const char *name)
 
 static bool
 add_interface_variables(struct gl_shader_program *shProg,
-                        struct gl_shader *sh, GLenum interface)
+                        struct gl_shader *sh, GLenum programInterface)
 {
    foreach_in_list(ir_instruction, node, sh->ir) {
       ir_variable *var = node->as_variable();
@@ -2572,18 +2572,18 @@ add_interface_variables(struct gl_shader_program *shProg,
              var->data.location != SYSTEM_VALUE_INSTANCE_ID)
          continue;
       case ir_var_shader_in:
-         if (interface != GL_PROGRAM_INPUT)
+         if (programInterface != GL_PROGRAM_INPUT)
             continue;
          break;
       case ir_var_shader_out:
-         if (interface != GL_PROGRAM_OUTPUT)
+         if (programInterface != GL_PROGRAM_OUTPUT)
             continue;
          break;
       default:
          continue;
       };
 
-      if (!add_program_resource(shProg, interface, var,
+      if (!add_program_resource(shProg, programInterface, var,
                                 build_stageref(shProg, var->name)))
          return false;
    }
index c7062abe7d8760cd5a8988ae296a17e957f6481c..b5f1d082c3e8b9c39eff248e3b248cb494ee09c4 100644 (file)
@@ -544,18 +544,18 @@ array_index_of_resource(struct gl_program_resource *res,
  */
 struct gl_program_resource *
 _mesa_program_resource_find_name(struct gl_shader_program *shProg,
-                                 GLenum interface, const char *name)
+                                 GLenum programInterface, const char *name)
 {
    struct gl_program_resource *res = shProg->ProgramResourceList;
    for (unsigned i = 0; i < shProg->NumProgramResourceList; i++, res++) {
-      if (res->Type != interface)
+      if (res->Type != programInterface)
          continue;
 
       /* Resource basename. */
       const char *rname = _mesa_program_resource_name(res);
       unsigned baselen = strlen(rname);
 
-      switch (interface) {
+      switch (programInterface) {
       case GL_TRANSFORM_FEEDBACK_VARYING:
       case GL_UNIFORM_BLOCK:
       case GL_UNIFORM:
@@ -620,13 +620,13 @@ _mesa_program_resource_index(struct gl_shader_program *shProg,
  */
 struct gl_program_resource *
 _mesa_program_resource_find_index(struct gl_shader_program *shProg,
-                                  GLenum interface, GLuint index)
+                                  GLenum programInterface, GLuint index)
 {
    struct gl_program_resource *res = shProg->ProgramResourceList;
    int idx = -1;
 
    for (unsigned i = 0; i < shProg->NumProgramResourceList; i++, res++) {
-      if (res->Type != interface)
+      if (res->Type != programInterface)
          continue;
 
       switch (res->Type) {
@@ -653,7 +653,7 @@ _mesa_program_resource_find_index(struct gl_shader_program *shProg,
  */
 bool
 _mesa_get_program_resource_name(struct gl_shader_program *shProg,
-                                GLenum interface, GLuint index,
+                                GLenum programInterface, GLuint index,
                                 GLsizei bufSize, GLsizei *length,
                                 GLchar *name, const char *caller)
 {
@@ -661,7 +661,7 @@ _mesa_get_program_resource_name(struct gl_shader_program *shProg,
 
    /* Find resource with given interface and index. */
    struct gl_program_resource *res =
-      _mesa_program_resource_find_index(shProg, interface, index);
+      _mesa_program_resource_find_index(shProg, programInterface, index);
 
    /* The error INVALID_VALUE is generated if <index> is greater than
    * or equal to the number of entries in the active resource list for
@@ -704,7 +704,7 @@ _mesa_get_program_resource_name(struct gl_shader_program *shProg,
     * Note, that TCS outputs and TES inputs should not have index appended
     * either.
     */
-   bool add_index = !(((interface == GL_PROGRAM_INPUT) &&
+   bool add_index = !(((programInterface == GL_PROGRAM_INPUT) &&
                        res->StageReferences & (1 << MESA_SHADER_GEOMETRY)));
 
    if (add_index && _mesa_program_resource_array_size(res)) {
@@ -777,10 +777,10 @@ program_resource_location(struct gl_shader_program *shProg,
  */
 GLint
 _mesa_program_resource_location(struct gl_shader_program *shProg,
-                                GLenum interface, const char *name)
+                                GLenum programInterface, const char *name)
 {
    struct gl_program_resource *res =
-      _mesa_program_resource_find_name(shProg, interface, name);
+      _mesa_program_resource_find_name(shProg, programInterface, name);
 
    /* Resource not found. */
    if (!res)
@@ -795,10 +795,10 @@ _mesa_program_resource_location(struct gl_shader_program *shProg,
  */
 GLint
 _mesa_program_resource_location_index(struct gl_shader_program *shProg,
-                                      GLenum interface, const char *name)
+                                      GLenum programInterface, const char *name)
 {
    struct gl_program_resource *res =
-      _mesa_program_resource_find_name(shProg, interface, name);
+      _mesa_program_resource_find_name(shProg, programInterface, name);
 
    /* Non-existent variable or resource is not referenced by fragment stage. */
    if (!res || !(res->StageReferences & (1 << MESA_SHADER_FRAGMENT)))
@@ -1033,7 +1033,7 @@ invalid_operation:
 
 extern void
 _mesa_get_program_resourceiv(struct gl_shader_program *shProg,
-                             GLenum interface, GLuint index, GLsizei propCount,
+                             GLenum programInterface, GLuint index, GLsizei propCount,
                              const GLenum *props, GLsizei bufSize,
                              GLsizei *length, GLint *params)
 {
@@ -1043,13 +1043,13 @@ _mesa_get_program_resourceiv(struct gl_shader_program *shProg,
    GLsizei amount = 0;
 
    struct gl_program_resource *res =
-      _mesa_program_resource_find_index(shProg, interface, index);
+      _mesa_program_resource_find_index(shProg, programInterface, index);
 
    /* No such resource found or bufSize negative. */
    if (!res || bufSize < 0) {
       _mesa_error(ctx, GL_INVALID_VALUE,
                   "glGetProgramResourceiv(%s index %d bufSize %d)",
-                  _mesa_lookup_enum_by_nr(interface), index, bufSize);
+                  _mesa_lookup_enum_by_nr(programInterface), index, bufSize);
       return;
    }
 
index 0cd2fad5d18ebab2291c055d92029ba2294e8d21..aba6d5d830669298e5d100bf394e8ca0722733e7 100644 (file)
@@ -232,25 +232,25 @@ _mesa_program_resource_index(struct gl_shader_program *shProg,
 
 extern struct gl_program_resource *
 _mesa_program_resource_find_name(struct gl_shader_program *shProg,
-                                 GLenum interface, const char *name);
+                                 GLenum programInterface, const char *name);
 
 extern struct gl_program_resource *
 _mesa_program_resource_find_index(struct gl_shader_program *shProg,
-                                  GLenum interface, GLuint index);
+                                  GLenum programInterface, GLuint index);
 
 extern bool
 _mesa_get_program_resource_name(struct gl_shader_program *shProg,
-                                GLenum interface, GLuint index,
+                                GLenum programInterface, GLuint index,
                                 GLsizei bufSize, GLsizei *length,
                                 GLchar *name, const char *caller);
 
 extern GLint
 _mesa_program_resource_location(struct gl_shader_program *shProg,
-                                GLenum interface, const char *name);
+                                GLenum programInterface, const char *name);
 
 extern GLint
 _mesa_program_resource_location_index(struct gl_shader_program *shProg,
-                                      GLenum interface, const char *name);
+                                      GLenum programInterface, const char *name);
 
 extern unsigned
 _mesa_program_resource_prop(struct gl_shader_program *shProg,
@@ -259,7 +259,7 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg,
 
 extern void
 _mesa_get_program_resourceiv(struct gl_shader_program *shProg,
-                             GLenum interface, GLuint index,
+                             GLenum programInterface, GLuint index,
                              GLsizei propCount, const GLenum *props,
                              GLsizei bufSize, GLsizei *length,
                              GLint *params);