Remove typedefs from enums.

typedefs are rather evil, remove them and use the enum
keyword explicitely.
This commit is contained in:
Zack Rusin
2007-10-29 08:35:08 -04:00
committed by Keith Whitwell
parent 25b17b213b
commit a70c5e37f1
8 changed files with 18 additions and 18 deletions

View File

@@ -56,7 +56,7 @@ static INLINE void copy_colors( struct draw_stage *stage,
const struct vertex_header *src ) const struct vertex_header *src )
{ {
const uint num_attribs = stage->draw->vertex_info.num_attribs; const uint num_attribs = stage->draw->vertex_info.num_attribs;
const interp_mode *interp = stage->draw->vertex_info.interp_mode; const enum interp_mode *interp = stage->draw->vertex_info.interp_mode;
uint i; uint i;
/* Look for constant/flat attribs and duplicate from src to dst vertex */ /* Look for constant/flat attribs and duplicate from src to dst vertex */

View File

@@ -44,7 +44,7 @@
static INLINE void static INLINE void
emit_vertex_attr(struct vertex_info *vinfo, emit_vertex_attr(struct vertex_info *vinfo,
attrib_format format, interp_mode interp) enum attrib_format format, enum interp_mode interp)
{ {
const uint n = vinfo->num_attribs; const uint n = vinfo->num_attribs;
vinfo->interp_mode[n] = interp; vinfo->interp_mode[n] = interp;
@@ -95,7 +95,7 @@ draw_compute_vertex_size(struct vertex_info *vinfo)
void void
draw_set_vertex_attributes( struct draw_context *draw, draw_set_vertex_attributes( struct draw_context *draw,
const uint *slot_to_vf_attr, const uint *slot_to_vf_attr,
const interp_mode *interps, const enum interp_mode *interps,
unsigned nr_attrs ) unsigned nr_attrs )
{ {
struct vertex_info *vinfo = &draw->vertex_info; struct vertex_info *vinfo = &draw->vertex_info;

View File

@@ -40,7 +40,7 @@ struct draw_context;
/** /**
* Vertex attribute format * Vertex attribute format
*/ */
typedef enum { enum attrib_format {
FORMAT_OMIT, FORMAT_OMIT,
FORMAT_1F, FORMAT_1F,
FORMAT_2F, FORMAT_2F,
@@ -48,18 +48,18 @@ typedef enum {
FORMAT_4F, FORMAT_4F,
FORMAT_4F_VIEWPORT, FORMAT_4F_VIEWPORT,
FORMAT_4UB FORMAT_4UB
} attrib_format; };
/** /**
* Attribute interpolation mode * Attribute interpolation mode
*/ */
typedef enum { enum interp_mode {
INTERP_NONE, /**< never interpolate vertex header info */ INTERP_NONE, /**< never interpolate vertex header info */
INTERP_CONSTANT, INTERP_CONSTANT,
INTERP_LINEAR, INTERP_LINEAR,
INTERP_PERSPECTIVE INTERP_PERSPECTIVE
} interp_mode; };
/** /**
@@ -69,8 +69,8 @@ struct vertex_info
{ {
uint num_attribs; uint num_attribs;
uint hwfmt[4]; /**< hardware format info for this format */ uint hwfmt[4]; /**< hardware format info for this format */
interp_mode interp_mode[PIPE_MAX_SHADER_OUTPUTS]; enum interp_mode interp_mode[PIPE_MAX_SHADER_OUTPUTS];
attrib_format format[PIPE_MAX_SHADER_OUTPUTS]; /**< FORMAT_x */ enum attrib_format format[PIPE_MAX_SHADER_OUTPUTS]; /**< FORMAT_x */
uint size; /**< total vertex size in dwords */ uint size; /**< total vertex size in dwords */
}; };
@@ -82,7 +82,7 @@ struct vertex_info
*/ */
static INLINE uint static INLINE uint
draw_emit_vertex_attr(struct vertex_info *vinfo, draw_emit_vertex_attr(struct vertex_info *vinfo,
attrib_format format, interp_mode interp) enum attrib_format format, enum interp_mode interp)
{ {
const uint n = vinfo->num_attribs; const uint n = vinfo->num_attribs;
assert(n < PIPE_MAX_SHADER_OUTPUTS); assert(n < PIPE_MAX_SHADER_OUTPUTS);
@@ -95,7 +95,7 @@ draw_emit_vertex_attr(struct vertex_info *vinfo,
extern void draw_set_vertex_attributes( struct draw_context *draw, extern void draw_set_vertex_attributes( struct draw_context *draw,
const uint *attrs, const uint *attrs,
const interp_mode *interps, const enum interp_mode *interps,
unsigned nr_attrs ); unsigned nr_attrs );
extern void draw_set_twoside_attributes(struct draw_context *draw, extern void draw_set_twoside_attributes(struct draw_context *draw,

View File

@@ -130,7 +130,7 @@ struct i915_depth_stencil_state {
struct i915_rasterizer_state { struct i915_rasterizer_state {
int light_twoside : 1; int light_twoside : 1;
unsigned st; unsigned st;
interp_mode color_interp; enum interp_mode color_interp;
unsigned LIS4; unsigned LIS4;
unsigned LIS7; unsigned LIS7;

View File

@@ -44,7 +44,7 @@
static void calculate_vertex_layout( struct i915_context *i915 ) static void calculate_vertex_layout( struct i915_context *i915 )
{ {
const struct pipe_shader_state *fs = i915->fs; const struct pipe_shader_state *fs = i915->fs;
const interp_mode colorInterp = i915->rasterizer->color_interp; const enum interp_mode colorInterp = i915->rasterizer->color_interp;
struct vertex_info vinfo; struct vertex_info vinfo;
uint front0 = 0, back0 = 0, front1 = 0, back1 = 0; uint front0 = 0, back0 = 0, front1 = 0, back1 = 0;
boolean needW = 0; boolean needW = 0;

View File

@@ -471,7 +471,7 @@ static void tri_persp_coeff( struct setup_stage *setup,
*/ */
static void setup_tri_coefficients( struct setup_stage *setup ) static void setup_tri_coefficients( struct setup_stage *setup )
{ {
const interp_mode *interp = setup->softpipe->vertex_info.interp_mode; const enum interp_mode *interp = setup->softpipe->vertex_info.interp_mode;
unsigned slot, j; unsigned slot, j;
/* z and w are done by linear interpolation: /* z and w are done by linear interpolation:
@@ -701,7 +701,7 @@ line_persp_coeff(struct setup_stage *setup, unsigned slot, unsigned i)
static INLINE void static INLINE void
setup_line_coefficients(struct setup_stage *setup, struct prim_header *prim) setup_line_coefficients(struct setup_stage *setup, struct prim_header *prim)
{ {
const interp_mode *interp = setup->softpipe->vertex_info.interp_mode; const enum interp_mode *interp = setup->softpipe->vertex_info.interp_mode;
unsigned slot, j; unsigned slot, j;
/* use setup->vmin, vmax to point to vertices */ /* use setup->vmin, vmax to point to vertices */
@@ -927,7 +927,7 @@ static void
setup_point(struct draw_stage *stage, struct prim_header *prim) setup_point(struct draw_stage *stage, struct prim_header *prim)
{ {
struct setup_stage *setup = setup_stage( stage ); struct setup_stage *setup = setup_stage( stage );
const interp_mode *interp = setup->softpipe->vertex_info.interp_mode; const enum interp_mode *interp = setup->softpipe->vertex_info.interp_mode;
const struct vertex_header *v0 = prim->v[0]; const struct vertex_header *v0 = prim->v[0];
const int sizeAttr = setup->softpipe->psize_slot; const int sizeAttr = setup->softpipe->psize_slot;
const float size const float size

View File

@@ -45,7 +45,7 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
{ {
const struct pipe_shader_state *vs = softpipe->vs->state; const struct pipe_shader_state *vs = softpipe->vs->state;
const struct pipe_shader_state *fs = softpipe->fs; const struct pipe_shader_state *fs = softpipe->fs;
const interp_mode colorInterp const enum interp_mode colorInterp
= softpipe->rasterizer->flatshade ? INTERP_CONSTANT : INTERP_LINEAR; = softpipe->rasterizer->flatshade ? INTERP_CONSTANT : INTERP_LINEAR;
struct vertex_info *vinfo = &softpipe->vertex_info; struct vertex_info *vinfo = &softpipe->vertex_info;
boolean emitBack0 = FALSE, emitBack1 = FALSE, emitPsize = FALSE; boolean emitBack0 = FALSE, emitBack1 = FALSE, emitPsize = FALSE;

View File

@@ -325,7 +325,7 @@ set_feedback_vertex_format(GLcontext *ctx)
{ {
struct st_context *st = ctx->st; struct st_context *st = ctx->st;
uint attrs[PIPE_MAX_SHADER_OUTPUTS]; uint attrs[PIPE_MAX_SHADER_OUTPUTS];
interp_mode interp[PIPE_MAX_SHADER_OUTPUTS]; enum interp_mode interp[PIPE_MAX_SHADER_OUTPUTS];
GLuint n, i; GLuint n, i;
if (ctx->RenderMode == GL_FEEDBACK) { if (ctx->RenderMode == GL_FEEDBACK) {