diff options
author | José Fonseca <[email protected]> | 2008-06-24 11:34:46 +0900 |
---|---|---|
committer | José Fonseca <[email protected]> | 2008-06-24 11:34:46 +0900 |
commit | 18ec140ef27b6488bea9d54e21b08b0a3afbcafe (patch) | |
tree | c65033e375e12ed3ceed04fea934b5d8e57f6561 /src/mesa/state_tracker | |
parent | 80b359f574cd8565af46e0900d2da9dd0faf4291 (diff) |
mesa: Use appropriate unsigned/signed, float/integer types.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_drawpixels.c | 18 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_readpixels.c | 9 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_draw.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_extensions.c | 12 |
4 files changed, 21 insertions, 20 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index a486581989c..8fdeb5c3804 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -517,7 +517,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, struct pipe_context *pipe = ctx->st->pipe; struct cso_context *cso = ctx->st->cso_context; GLfloat x0, y0, x1, y1; - GLuint maxSize; + GLsizei maxSize; /* limit checks */ /* XXX if DrawPixels image is larger than max texture size, break @@ -574,14 +574,14 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, const float width = ctx->DrawBuffer->Width; const float height = ctx->DrawBuffer->Height; struct pipe_viewport_state vp; - vp.scale[0] = 0.5 * width; - vp.scale[1] = -0.5 * height; - vp.scale[2] = 1.0; - vp.scale[3] = 1.0; - vp.translate[0] = 0.5 * width; - vp.translate[1] = 0.5 * height; - vp.translate[2] = 0.0; - vp.translate[3] = 0.0; + vp.scale[0] = 0.5f * width; + vp.scale[1] = -0.5f * height; + vp.scale[2] = 1.0f; + vp.scale[3] = 1.0f; + vp.translate[0] = 0.5f * width; + vp.translate[1] = 0.5f * height; + vp.translate[2] = 0.0f; + vp.translate[3] = 0.0f; cso_set_viewport(cso, &vp); } diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 08934af3195..c5193631a75 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -177,7 +177,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, struct pipe_screen *screen = pipe->screen; GLfloat temp[MAX_WIDTH][4]; const GLbitfield transferOps = ctx->_ImageTransferState; - GLint i, yStep, dfStride; + GLsizei i, j; + GLint yStep, dfStride; GLfloat *df; struct st_renderbuffer *strb; struct gl_pixelstore_attrib clippedPacking = *pack; @@ -258,7 +259,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, surf->format == PIPE_FORMAT_X8Z24_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { - GLuint ztemp[MAX_WIDTH], j; + GLuint ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; const double scale = 1.0 / ((1 << 24) - 1); pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0); @@ -283,7 +284,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } else if (surf->format == PIPE_FORMAT_Z16_UNORM) { for (i = 0; i < height; i++) { - GLushort ztemp[MAX_WIDTH], j; + GLushort ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; const double scale = 1.0 / 0xffff; pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0); @@ -298,7 +299,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } else if (surf->format == PIPE_FORMAT_Z32_UNORM) { for (i = 0; i < height; i++) { - GLuint ztemp[MAX_WIDTH], j; + GLuint ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; const double scale = 1.0 / 0xffffffff; pipe_get_tile_raw(pipe, surf, x, y, width, 1, ztemp, 0); diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 6867d50c873..21911774d79 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -216,7 +216,7 @@ setup_edgeflags(GLcontext *ctx, GLenum primMode, GLint start, GLint count, (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL)) { /* need edge flags */ - GLuint i; + GLint i; unsigned *vec; struct st_buffer_object *stobj = st_buffer_object(array->BufferObj); ubyte *map; diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 6f94ba39aeb..d804d2b453d 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -43,7 +43,7 @@ static int _min(int a, int b) return (a < b) ? a : b; } -static int _max(int a, int b) +static float _maxf(float a, float b) { return (a > b) ? a : b; } @@ -94,17 +94,17 @@ void st_init_limits(struct st_context *st) 1, MAX_DRAW_BUFFERS); c->MaxLineWidth - = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH)); + = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH)); c->MaxLineWidthAA - = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA)); + = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA)); c->MaxPointSize - = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH)); + = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH)); c->MaxPointSizeAA - = _max(1.0, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA)); + = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA)); c->MaxTextureMaxAnisotropy - = _max(2.0, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY)); + = _maxf(2.0f, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY)); c->MaxTextureLodBias = screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS); |