mesa,glsl: rename `interface` to `programInterface`.

`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.
This commit is contained in:
Jose Fonseca 2015-04-16 10:19:57 +01:00
parent f78b2c432f
commit 037e0e78ab
3 changed files with 25 additions and 25 deletions

View File

@ -2552,7 +2552,7 @@ build_stageref(struct gl_shader_program *shProg, const char *name)
static bool static bool
add_interface_variables(struct gl_shader_program *shProg, 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) { foreach_in_list(ir_instruction, node, sh->ir) {
ir_variable *var = node->as_variable(); 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) var->data.location != SYSTEM_VALUE_INSTANCE_ID)
continue; continue;
case ir_var_shader_in: case ir_var_shader_in:
if (interface != GL_PROGRAM_INPUT) if (programInterface != GL_PROGRAM_INPUT)
continue; continue;
break; break;
case ir_var_shader_out: case ir_var_shader_out:
if (interface != GL_PROGRAM_OUTPUT) if (programInterface != GL_PROGRAM_OUTPUT)
continue; continue;
break; break;
default: default:
continue; continue;
}; };
if (!add_program_resource(shProg, interface, var, if (!add_program_resource(shProg, programInterface, var,
build_stageref(shProg, var->name))) build_stageref(shProg, var->name)))
return false; return false;
} }

View File

@ -544,18 +544,18 @@ array_index_of_resource(struct gl_program_resource *res,
*/ */
struct gl_program_resource * struct gl_program_resource *
_mesa_program_resource_find_name(struct gl_shader_program *shProg, _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; struct gl_program_resource *res = shProg->ProgramResourceList;
for (unsigned i = 0; i < shProg->NumProgramResourceList; i++, res++) { for (unsigned i = 0; i < shProg->NumProgramResourceList; i++, res++) {
if (res->Type != interface) if (res->Type != programInterface)
continue; continue;
/* Resource basename. */ /* Resource basename. */
const char *rname = _mesa_program_resource_name(res); const char *rname = _mesa_program_resource_name(res);
unsigned baselen = strlen(rname); unsigned baselen = strlen(rname);
switch (interface) { switch (programInterface) {
case GL_TRANSFORM_FEEDBACK_VARYING: case GL_TRANSFORM_FEEDBACK_VARYING:
case GL_UNIFORM_BLOCK: case GL_UNIFORM_BLOCK:
case GL_UNIFORM: case GL_UNIFORM:
@ -620,13 +620,13 @@ _mesa_program_resource_index(struct gl_shader_program *shProg,
*/ */
struct gl_program_resource * struct gl_program_resource *
_mesa_program_resource_find_index(struct gl_shader_program *shProg, _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; struct gl_program_resource *res = shProg->ProgramResourceList;
int idx = -1; int idx = -1;
for (unsigned i = 0; i < shProg->NumProgramResourceList; i++, res++) { for (unsigned i = 0; i < shProg->NumProgramResourceList; i++, res++) {
if (res->Type != interface) if (res->Type != programInterface)
continue; continue;
switch (res->Type) { switch (res->Type) {
@ -653,7 +653,7 @@ _mesa_program_resource_find_index(struct gl_shader_program *shProg,
*/ */
bool bool
_mesa_get_program_resource_name(struct gl_shader_program *shProg, _mesa_get_program_resource_name(struct gl_shader_program *shProg,
GLenum interface, GLuint index, GLenum programInterface, GLuint index,
GLsizei bufSize, GLsizei *length, GLsizei bufSize, GLsizei *length,
GLchar *name, const char *caller) 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. */ /* Find resource with given interface and index. */
struct gl_program_resource *res = 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 /* The error INVALID_VALUE is generated if <index> is greater than
* or equal to the number of entries in the active resource list for * 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 * Note, that TCS outputs and TES inputs should not have index appended
* either. * either.
*/ */
bool add_index = !(((interface == GL_PROGRAM_INPUT) && bool add_index = !(((programInterface == GL_PROGRAM_INPUT) &&
res->StageReferences & (1 << MESA_SHADER_GEOMETRY))); res->StageReferences & (1 << MESA_SHADER_GEOMETRY)));
if (add_index && _mesa_program_resource_array_size(res)) { if (add_index && _mesa_program_resource_array_size(res)) {
@ -777,10 +777,10 @@ program_resource_location(struct gl_shader_program *shProg,
*/ */
GLint GLint
_mesa_program_resource_location(struct gl_shader_program *shProg, _mesa_program_resource_location(struct gl_shader_program *shProg,
GLenum interface, const char *name) GLenum programInterface, const char *name)
{ {
struct gl_program_resource *res = struct gl_program_resource *res =
_mesa_program_resource_find_name(shProg, interface, name); _mesa_program_resource_find_name(shProg, programInterface, name);
/* Resource not found. */ /* Resource not found. */
if (!res) if (!res)
@ -795,10 +795,10 @@ _mesa_program_resource_location(struct gl_shader_program *shProg,
*/ */
GLint GLint
_mesa_program_resource_location_index(struct gl_shader_program *shProg, _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 = 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. */ /* Non-existent variable or resource is not referenced by fragment stage. */
if (!res || !(res->StageReferences & (1 << MESA_SHADER_FRAGMENT))) if (!res || !(res->StageReferences & (1 << MESA_SHADER_FRAGMENT)))
@ -1033,7 +1033,7 @@ invalid_operation:
extern void extern void
_mesa_get_program_resourceiv(struct gl_shader_program *shProg, _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, const GLenum *props, GLsizei bufSize,
GLsizei *length, GLint *params) GLsizei *length, GLint *params)
{ {
@ -1043,13 +1043,13 @@ _mesa_get_program_resourceiv(struct gl_shader_program *shProg,
GLsizei amount = 0; GLsizei amount = 0;
struct gl_program_resource *res = 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. */ /* No such resource found or bufSize negative. */
if (!res || bufSize < 0) { if (!res || bufSize < 0) {
_mesa_error(ctx, GL_INVALID_VALUE, _mesa_error(ctx, GL_INVALID_VALUE,
"glGetProgramResourceiv(%s index %d bufSize %d)", "glGetProgramResourceiv(%s index %d bufSize %d)",
_mesa_lookup_enum_by_nr(interface), index, bufSize); _mesa_lookup_enum_by_nr(programInterface), index, bufSize);
return; return;
} }

View File

@ -232,25 +232,25 @@ _mesa_program_resource_index(struct gl_shader_program *shProg,
extern struct gl_program_resource * extern struct gl_program_resource *
_mesa_program_resource_find_name(struct gl_shader_program *shProg, _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 * extern struct gl_program_resource *
_mesa_program_resource_find_index(struct gl_shader_program *shProg, _mesa_program_resource_find_index(struct gl_shader_program *shProg,
GLenum interface, GLuint index); GLenum programInterface, GLuint index);
extern bool extern bool
_mesa_get_program_resource_name(struct gl_shader_program *shProg, _mesa_get_program_resource_name(struct gl_shader_program *shProg,
GLenum interface, GLuint index, GLenum programInterface, GLuint index,
GLsizei bufSize, GLsizei *length, GLsizei bufSize, GLsizei *length,
GLchar *name, const char *caller); GLchar *name, const char *caller);
extern GLint extern GLint
_mesa_program_resource_location(struct gl_shader_program *shProg, _mesa_program_resource_location(struct gl_shader_program *shProg,
GLenum interface, const char *name); GLenum programInterface, const char *name);
extern GLint extern GLint
_mesa_program_resource_location_index(struct gl_shader_program *shProg, _mesa_program_resource_location_index(struct gl_shader_program *shProg,
GLenum interface, const char *name); GLenum programInterface, const char *name);
extern unsigned extern unsigned
_mesa_program_resource_prop(struct gl_shader_program *shProg, _mesa_program_resource_prop(struct gl_shader_program *shProg,
@ -259,7 +259,7 @@ _mesa_program_resource_prop(struct gl_shader_program *shProg,
extern void extern void
_mesa_get_program_resourceiv(struct gl_shader_program *shProg, _mesa_get_program_resourceiv(struct gl_shader_program *shProg,
GLenum interface, GLuint index, GLenum programInterface, GLuint index,
GLsizei propCount, const GLenum *props, GLsizei propCount, const GLenum *props,
GLsizei bufSize, GLsizei *length, GLsizei bufSize, GLsizei *length,
GLint *params); GLint *params);