diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2011-10-07 12:26:50 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2011-10-18 11:38:39 -0700 |
commit | 2e5a1a254ed81b1d3efa6064f48183eefac784d0 (patch) | |
tree | 0aba873855392f49ad3123c91f97ac2b3789a8eb /src/mesa/drivers/dri/i965/brw_sf_emit.c | |
parent | 1b45d68c117d716adb488dcaac16e0834e2471ba (diff) | |
download | external_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_sf_emit.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_sf_emit.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c index ebcbf94..fe3341c 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_emit.c +++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c @@ -70,8 +70,8 @@ static struct brw_reg get_vert_result(struct brw_sf_compile *c, return brw_vec4_grf(vert.nr + off, sub * 4); } -static GLboolean have_attr(struct brw_sf_compile *c, - GLuint attr) +static bool +have_attr(struct brw_sf_compile *c, GLuint attr) { return (c->key.attrs & BITFIELD64_BIT(attr)) ? 1 : 0; } @@ -323,13 +323,14 @@ static void invert_det( struct brw_sf_compile *c) } -static GLboolean calculate_masks( struct brw_sf_compile *c, - GLuint reg, - GLushort *pc, - GLushort *pc_persp, - GLushort *pc_linear) +static bool +calculate_masks(struct brw_sf_compile *c, + GLuint reg, + GLushort *pc, + GLushort *pc_persp, + GLushort *pc_linear) { - GLboolean is_last_attr = (reg == c->nr_setup_regs - 1); + bool is_last_attr = (reg == c->nr_setup_regs - 1); GLbitfield64 persp_mask; GLbitfield64 linear_mask; @@ -398,7 +399,7 @@ calculate_point_sprite_mask(struct brw_sf_compile *c, GLuint reg) -void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) +void brw_emit_tri_setup(struct brw_sf_compile *c, bool allocate) { struct brw_compile *p = &c->func; GLuint i; @@ -426,7 +427,7 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) struct brw_reg a1 = offset(c->vert[1], i); struct brw_reg a2 = offset(c->vert[2], i); GLushort pc, pc_persp, pc_linear; - GLboolean last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); + bool last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); if (pc_persp) { @@ -486,7 +487,7 @@ void brw_emit_tri_setup( struct brw_sf_compile *c, GLboolean allocate) -void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate) +void brw_emit_line_setup(struct brw_sf_compile *c, bool allocate) { struct brw_compile *p = &c->func; GLuint i; @@ -510,7 +511,7 @@ void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate) struct brw_reg a0 = offset(c->vert[0], i); struct brw_reg a1 = offset(c->vert[1], i); GLushort pc, pc_persp, pc_linear; - GLboolean last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); + bool last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); if (pc_persp) { @@ -558,7 +559,7 @@ void brw_emit_line_setup( struct brw_sf_compile *c, GLboolean allocate) } } -void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) +void brw_emit_point_sprite_setup(struct brw_sf_compile *c, bool allocate) { struct brw_compile *p = &c->func; GLuint i; @@ -573,7 +574,7 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) { struct brw_reg a0 = offset(c->vert[0], i); GLushort pc, pc_persp, pc_linear, pc_coord_replace; - GLboolean last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); + bool last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); pc_coord_replace = calculate_point_sprite_mask(c, i); pc_persp &= ~pc_coord_replace; @@ -651,7 +652,7 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) /* Points setup - several simplifications as all attributes are * constant across the face of the point (point sprites excluded!) */ -void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate) +void brw_emit_point_setup(struct brw_sf_compile *c, bool allocate) { struct brw_compile *p = &c->func; GLuint i; @@ -670,7 +671,7 @@ void brw_emit_point_setup( struct brw_sf_compile *c, GLboolean allocate) { struct brw_reg a0 = offset(c->vert[0], i); GLushort pc, pc_persp, pc_linear; - GLboolean last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); + bool last = calculate_masks(c, i, &pc, &pc_persp, &pc_linear); if (pc_persp) { @@ -741,7 +742,7 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) { saveflag = p->flag_value; brw_push_insn_state(p); - brw_emit_tri_setup( c, GL_FALSE ); + brw_emit_tri_setup( c, false ); brw_pop_insn_state(p); p->flag_value = saveflag; /* note - thread killed in subroutine, so must @@ -762,7 +763,7 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) { saveflag = p->flag_value; brw_push_insn_state(p); - brw_emit_line_setup( c, GL_FALSE ); + brw_emit_line_setup( c, false ); brw_pop_insn_state(p); p->flag_value = saveflag; /* note - thread killed in subroutine */ @@ -775,13 +776,13 @@ void brw_emit_anyprim_setup( struct brw_sf_compile *c ) { saveflag = p->flag_value; brw_push_insn_state(p); - brw_emit_point_sprite_setup( c, GL_FALSE ); + brw_emit_point_sprite_setup( c, false ); brw_pop_insn_state(p); p->flag_value = saveflag; } brw_land_fwd_jump(p, jmp); - brw_emit_point_setup( c, GL_FALSE ); + brw_emit_point_setup( c, false ); } |