Some changed for non-C99 compilers

This commit is contained in:
Alan Hourihane
2008-05-02 10:08:03 +00:00
parent a1cb0c2b91
commit 54507125e7
17 changed files with 94 additions and 118 deletions

15
src/mesa/state_tracker/st_atom_blend.c Normal file → Executable file
View File

@@ -223,15 +223,10 @@ update_blend( struct st_context *st )
const struct st_tracked_state st_update_blend = { const struct st_tracked_state st_update_blend = {
.name = "st_update_blend", "st_update_blend", /* name */
.dirty = { { /* dirty */
.mesa = (_NEW_COLOR), /* XXX _NEW_BLEND someday? */ (_NEW_COLOR), /* XXX _NEW_BLEND someday? */ /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_blend update_blend, /* update */
}; };

15
src/mesa/state_tracker/st_atom_clip.c Normal file → Executable file
View File

@@ -62,15 +62,10 @@ static void update_clip( struct st_context *st )
const struct st_tracked_state st_update_clip = { const struct st_tracked_state st_update_clip = {
.name = "st_update_clip", "st_update_clip", /* name */
.dirty = { { /* dirty */
.mesa = (_NEW_TRANSFORM), (_NEW_TRANSFORM), /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_clip update_clip /* update */
}; };

20
src/mesa/state_tracker/st_atom_constbuf.c Normal file → Executable file
View File

@@ -113,12 +113,12 @@ static void update_vs_constants(struct st_context *st )
} }
const struct st_tracked_state st_update_vs_constants = { const struct st_tracked_state st_update_vs_constants = {
.name = "st_update_vs_constants", "st_update_vs_constants", /* name */
.dirty = { { /* dirty */
.mesa = 0, /* set dynamically above */ 0, /* set dynamically above */ /* mesa */
.st = ST_NEW_VERTEX_PROGRAM, ST_NEW_VERTEX_PROGRAM, /* st */
}, },
.update = update_vs_constants update_vs_constants /* update */
}; };
/* Fragment shader: /* Fragment shader:
@@ -132,11 +132,11 @@ static void update_fs_constants(struct st_context *st )
} }
const struct st_tracked_state st_update_fs_constants = { const struct st_tracked_state st_update_fs_constants = {
.name = "st_update_fs_constants", "st_update_fs_constants", /* name */
.dirty = { { /* dirty */
.mesa = 0, /* set dynamically above */ 0, /* set dynamically above */ /* mesa */
.st = ST_NEW_FRAGMENT_PROGRAM, ST_NEW_FRAGMENT_PROGRAM, /* st */
}, },
.update = update_fs_constants update_fs_constants /* update */
}; };

View File

@@ -142,10 +142,10 @@ update_depth_stencil_alpha(struct st_context *st)
const struct st_tracked_state st_update_depth_stencil_alpha = { const struct st_tracked_state st_update_depth_stencil_alpha = {
.name = "st_update_depth_stencil", "st_update_depth_stencil", /* name */
.dirty = { { /* dirty */
.mesa = (_NEW_DEPTH|_NEW_STENCIL|_NEW_COLOR), (_NEW_DEPTH|_NEW_STENCIL|_NEW_COLOR), /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_depth_stencil_alpha update_depth_stencil_alpha /* update */
}; };

View File

@@ -55,12 +55,12 @@ static void update_tnl( struct st_context *st )
const struct st_tracked_state st_update_tnl = { const struct st_tracked_state st_update_tnl = {
.name = "st_update_tnl", "st_update_tnl", /* name */
.dirty = { { /* dirty */
.mesa = TNL_FIXED_FUNCTION_STATE_FLAGS, TNL_FIXED_FUNCTION_STATE_FLAGS, /* mesa */
.st = 0 0 /* st */
}, },
.update = update_tnl update_tnl /* update */
}; };

View File

@@ -96,11 +96,11 @@ update_framebuffer_state( struct st_context *st )
const struct st_tracked_state st_update_framebuffer = { const struct st_tracked_state st_update_framebuffer = {
.name = "st_update_framebuffer", "st_update_framebuffer", /* name */
.dirty = { { /* dirty */
.mesa = _NEW_BUFFERS, _NEW_BUFFERS, /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_framebuffer_state update_framebuffer_state /* update */
}; };

View File

@@ -463,10 +463,10 @@ update_pixel_transfer(struct st_context *st)
const struct st_tracked_state st_update_pixel_transfer = { const struct st_tracked_state st_update_pixel_transfer = {
.name = "st_update_pixel_transfer", "st_update_pixel_transfer", /* name */
.dirty = { { /* dirty */
.mesa = _NEW_PIXEL | _NEW_COLOR_MATRIX, _NEW_PIXEL | _NEW_COLOR_MATRIX, /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_pixel_transfer update_pixel_transfer /* update */
}; };

View File

@@ -267,11 +267,11 @@ static void update_raster_state( struct st_context *st )
} }
const struct st_tracked_state st_update_rasterizer = { const struct st_tracked_state st_update_rasterizer = {
.name = "st_update_rasterizer", "st_update_rasterizer", /* name */
.dirty = { { /* dirty */
.mesa = (_NEW_LIGHT | _NEW_POLYGON | _NEW_LINE | _NEW_SCISSOR | (_NEW_LIGHT | _NEW_POLYGON | _NEW_LINE | _NEW_SCISSOR | /* mesa */
_NEW_POINT | _NEW_BUFFERS | _NEW_MULTISAMPLE), _NEW_POINT | _NEW_BUFFERS | _NEW_MULTISAMPLE),
.st = 0, 0, /* st */
}, },
.update = update_raster_state update_raster_state /* update */
}; };

View File

@@ -185,15 +185,10 @@ update_samplers(struct st_context *st)
const struct st_tracked_state st_update_sampler = { const struct st_tracked_state st_update_sampler = {
.name = "st_update_sampler", "st_update_sampler", /* name */
.dirty = { { /* dirty */
.mesa = _NEW_TEXTURE, _NEW_TEXTURE, /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_samplers update_samplers /* update */
}; };

View File

@@ -83,15 +83,10 @@ update_scissor( struct st_context *st )
const struct st_tracked_state st_update_scissor = { const struct st_tracked_state st_update_scissor = {
.name = "st_update_scissor", "st_update_scissor", /* name */
.dirty = { { /* dirty */
.mesa = (_NEW_SCISSOR | _NEW_BUFFERS), (_NEW_SCISSOR | _NEW_BUFFERS), /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_scissor update_scissor /* update */
}; };

View File

@@ -281,10 +281,10 @@ update_linkage( struct st_context *st )
const struct st_tracked_state st_update_shader = { const struct st_tracked_state st_update_shader = {
.name = "st_update_shader", "st_update_shader", /* name */
.dirty = { { /* dirty */
.mesa = 0, 0, /* mesa */
.st = ST_NEW_VERTEX_PROGRAM | ST_NEW_FRAGMENT_PROGRAM ST_NEW_VERTEX_PROGRAM | ST_NEW_FRAGMENT_PROGRAM /* st */
}, },
.update = update_linkage update_linkage /* update */
}; };

View File

@@ -54,10 +54,10 @@ update_stipple( struct st_context *st )
const struct st_tracked_state st_update_polygon_stipple = { const struct st_tracked_state st_update_polygon_stipple = {
.name = "st_update_polygon_stipple", "st_update_polygon_stipple", /* name */
.dirty = { { /* dirty */
.mesa = (_NEW_POLYGONSTIPPLE), (_NEW_POLYGONSTIPPLE), /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_stipple update_stipple /* update */
}; };

View File

@@ -111,15 +111,10 @@ update_textures(struct st_context *st)
const struct st_tracked_state st_update_texture = { const struct st_tracked_state st_update_texture = {
.name = "st_update_texture", "st_update_texture", /* name */
.dirty = { { /* dirty */
.mesa = _NEW_TEXTURE, _NEW_TEXTURE, /* mesa */
.st = ST_NEW_FRAGMENT_PROGRAM, ST_NEW_FRAGMENT_PROGRAM, /* st */
}, },
.update = update_textures update_textures /* update */
}; };

View File

@@ -82,10 +82,10 @@ update_viewport( struct st_context *st )
const struct st_tracked_state st_update_viewport = { const struct st_tracked_state st_update_viewport = {
.name = "st_update_viewport", "st_update_viewport", /* name */
.dirty = { { /* dirty */
.mesa = _NEW_BUFFERS | _NEW_VIEWPORT, _NEW_BUFFERS | _NEW_VIEWPORT, /* mesa */
.st = 0, 0, /* st */
}, },
.update = update_viewport update_viewport /* update */
}; };

View File

@@ -34,8 +34,8 @@
#include "main/glheader.h" #include "main/glheader.h"
#include "main/macros.h" #include "main/macros.h"
#include "shader/prog_instruction.h" #include "shader/prog_instruction.h"
#include "st_atom.h"
#include "st_context.h" #include "st_context.h"
#include "st_atom.h"
#include "st_cb_accum.h" #include "st_cb_accum.h"
#include "st_cb_clear.h" #include "st_cb_clear.h"
#include "st_cb_fbo.h" #include "st_cb_fbo.h"

View File

@@ -35,8 +35,8 @@
#include "vbo/vbo.h" #include "vbo/vbo.h"
#include "st_atom.h"
#include "st_context.h" #include "st_context.h"
#include "st_atom.h"
#include "st_cb_bufferobjects.h" #include "st_cb_bufferobjects.h"
#include "st_draw.h" #include "st_draw.h"
#include "st_program.h" #include "st_program.h"
@@ -549,9 +549,10 @@ st_feedback_draw_vbo(GLcontext *ctx,
unsigned indexSize; unsigned indexSize;
struct gl_buffer_object *bufobj = ib->obj; struct gl_buffer_object *bufobj = ib->obj;
struct st_buffer_object *stobj = st_buffer_object(bufobj); struct st_buffer_object *stobj = st_buffer_object(bufobj);
index_buffer_handle = stobj->buffer;
void *map; void *map;
index_buffer_handle = stobj->buffer;
switch (ib->type) { switch (ib->type) {
case GL_UNSIGNED_INT: case GL_UNSIGNED_INT:
indexSize = 4; indexSize = 4;

View File

@@ -38,17 +38,17 @@
#include "st_extensions.h" #include "st_extensions.h"
static int min(int a, int b) static int _min(int a, int b)
{ {
return (a < b) ? a : b; return (a < b) ? a : b;
} }
static int max(int a, int b) static int _max(int a, int b)
{ {
return (a > b) ? a : b; return (a > b) ? a : b;
} }
static int clamp(int a, int min, int max) static int _clamp(int a, int min, int max)
{ {
if (a < min) if (a < min)
return min; return min;
@@ -69,42 +69,42 @@ void st_init_limits(struct st_context *st)
struct gl_constants *c = &st->ctx->Const; struct gl_constants *c = &st->ctx->Const;
c->MaxTextureLevels c->MaxTextureLevels
= min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS), = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
MAX_TEXTURE_LEVELS); MAX_TEXTURE_LEVELS);
c->Max3DTextureLevels c->Max3DTextureLevels
= min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_3D_LEVELS), = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_3D_LEVELS),
MAX_3D_TEXTURE_LEVELS); MAX_3D_TEXTURE_LEVELS);
c->MaxCubeTextureLevels c->MaxCubeTextureLevels
= min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS), = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS),
MAX_CUBE_TEXTURE_LEVELS); MAX_CUBE_TEXTURE_LEVELS);
c->MaxTextureRectSize c->MaxTextureRectSize
= min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE); = _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE);
c->MaxTextureUnits c->MaxTextureUnits
= c->MaxTextureImageUnits = c->MaxTextureImageUnits
= c->MaxTextureCoordUnits = c->MaxTextureCoordUnits
= min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS), = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
MAX_TEXTURE_IMAGE_UNITS); MAX_TEXTURE_IMAGE_UNITS);
c->MaxDrawBuffers c->MaxDrawBuffers
= clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), = _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS),
1, MAX_DRAW_BUFFERS); 1, MAX_DRAW_BUFFERS);
c->MaxLineWidth c->MaxLineWidth
= max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH)); = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH));
c->MaxLineWidthAA c->MaxLineWidthAA
= max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA)); = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA));
c->MaxPointSize c->MaxPointSize
= max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH)); = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH));
c->MaxPointSizeAA c->MaxPointSizeAA
= max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA)); = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA));
c->MaxTextureMaxAnisotropy c->MaxTextureMaxAnisotropy
= max(2.0, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY)); = _max(2.0, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY));
c->MaxTextureLodBias c->MaxTextureLodBias
= screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS); = screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS);