summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_program.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2011-10-07 12:26:50 -0700
committerKenneth Graunke <kenneth@whitecape.org>2011-10-18 11:38:39 -0700
commit2e5a1a254ed81b1d3efa6064f48183eefac784d0 (patch)
tree0aba873855392f49ad3123c91f97ac2b3789a8eb /src/mesa/drivers/dri/i965/brw_program.c
parent1b45d68c117d716adb488dcaac16e0834e2471ba (diff)
downloadexternal_mesa3d-2e5a1a254ed81b1d3efa6064f48183eefac784d0.zip
external_mesa3d-2e5a1a254ed81b1d3efa6064f48183eefac784d0.tar.gz
external_mesa3d-2e5a1a254ed81b1d3efa6064f48183eefac784d0.tar.bz2
intel: Convert from GLboolean to 'bool' from stdbool.h.
I initially produced the patch using this bash command: for file in {intel,i915,i965}/*.{c,cpp,h}; do [ ! -h $file ] && sed -i 's/GLboolean/bool/g' $file && sed -i 's/GL_TRUE/true/g' $file && sed -i 's/GL_FALSE/false/g' $file; done Then I manually added #include <stdbool.h> to fix compilation errors, and converted a few functions back to GLboolean that were used in core Mesa's function pointer table to avoid "incompatible pointer" warnings. Finally, I cleaned up some whitespace issues introduced by the change. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Chad Versace <chad@chad-versace.us> Acked-by: Paul Berry <stereotype441@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_program.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 97bd222..0bf72d9 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -100,11 +100,12 @@ static void brwDeleteProgram( struct gl_context *ctx,
}
-static GLboolean brwIsProgramNative( struct gl_context *ctx,
- GLenum target,
- struct gl_program *prog )
+static GLboolean
+brwIsProgramNative(struct gl_context *ctx,
+ GLenum target,
+ struct gl_program *prog)
{
- return GL_TRUE;
+ return true;
}
static void
@@ -116,13 +117,14 @@ shader_error(struct gl_context *ctx, struct gl_program *prog, const char *msg)
if (shader) {
ralloc_strcat(&shader->InfoLog, msg);
- shader->LinkStatus = GL_FALSE;
+ shader->LinkStatus = false;
}
}
-static GLboolean brwProgramStringNotify( struct gl_context *ctx,
- GLenum target,
- struct gl_program *prog )
+static GLboolean
+brwProgramStringNotify(struct gl_context *ctx,
+ GLenum target,
+ struct gl_program *prog)
{
struct brw_context *brw = brw_context(ctx);
int i;
@@ -144,7 +146,7 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx,
shader_program = _mesa_lookup_shader_program(ctx, prog->Id);
if (shader_program
&& shader_program->_LinkedShaders[MESA_SHADER_FRAGMENT]) {
- return GL_TRUE;
+ return true;
}
}
else if (target == GL_VERTEX_PROGRAM_ARB) {
@@ -180,14 +182,14 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx,
"i965 driver doesn't yet support uninlined function "
"calls. Move to using a single return statement at "
"the end of the function to work around it.\n");
- return GL_FALSE;
+ return false;
}
if (prog->Instructions[i].Opcode == OPCODE_RET) {
shader_error(ctx, prog,
"i965 driver doesn't yet support \"return\" "
"from main().\n");
- return GL_FALSE;
+ return false;
}
for (r = 0; r < _mesa_num_inst_src_regs(inst->Opcode); r++) {
@@ -195,7 +197,7 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx,
prog->Instructions[i].SrcReg[r].File == PROGRAM_INPUT) {
shader_error(ctx, prog,
"Variable indexing of shader inputs unsupported\n");
- return GL_FALSE;
+ return false;
}
}
@@ -204,7 +206,7 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx,
prog->Instructions[i].DstReg.File == PROGRAM_OUTPUT) {
shader_error(ctx, prog,
"Variable indexing of FS outputs unsupported\n");
- return GL_FALSE;
+ return false;
}
if (target == GL_FRAGMENT_PROGRAM_ARB) {
if ((prog->Instructions[i].DstReg.RelAddr &&
@@ -218,12 +220,12 @@ static GLboolean brwProgramStringNotify( struct gl_context *ctx,
shader_error(ctx, prog,
"Variable indexing of variable arrays in the FS "
"unsupported\n");
- return GL_FALSE;
+ return false;
}
}
}
- return GL_TRUE;
+ return true;
}
/* Per-thread scratch space is a power-of-two multiple of 1KB. */