st/mesa: add casts to silence MSVC warnings

This commit is contained in:
Brian Paul
2013-06-26 09:34:02 -06:00
parent 202299d16e
commit bc6eb8068f
5 changed files with 8 additions and 8 deletions

View File

@@ -205,7 +205,7 @@ static void st_bind_ubos(struct st_context *st,
* Take the minimum just to be sure. * Take the minimum just to be sure.
*/ */
if (!binding->AutomaticSize) if (!binding->AutomaticSize)
cb.buffer_size = MIN2(cb.buffer_size, binding->Size); cb.buffer_size = MIN2(cb.buffer_size, (unsigned) binding->Size);
} }
else { else {
cb.buffer_offset = 0; cb.buffer_offset = 0;

View File

@@ -346,8 +346,8 @@ is_scissor_enabled(struct gl_context *ctx, struct gl_renderbuffer *rb)
return ctx->Scissor.Enabled && return ctx->Scissor.Enabled &&
(ctx->Scissor.X > 0 || (ctx->Scissor.X > 0 ||
ctx->Scissor.Y > 0 || ctx->Scissor.Y > 0 ||
ctx->Scissor.Width < rb->Width || (unsigned) ctx->Scissor.Width < rb->Width ||
ctx->Scissor.Height < rb->Height); (unsigned) ctx->Scissor.Height < rb->Height);
} }

View File

@@ -208,7 +208,7 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y,
const uint bytesPerRow = width * util_format_get_blocksize(dst_format); const uint bytesPerRow = width * util_format_get_blocksize(dst_format);
GLuint row; GLuint row;
for (row = 0; row < height; row++) { for (row = 0; row < (unsigned) height; row++) {
GLvoid *dest = _mesa_image_address3d(pack, pixels, GLvoid *dest = _mesa_image_address3d(pack, pixels,
width, height, format, width, height, format,
type, 0, row, 0); type, 0, row, 0);

View File

@@ -734,7 +734,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
const uint bytesPerRow = width * util_format_get_blocksize(src_format); const uint bytesPerRow = width * util_format_get_blocksize(src_format);
GLuint row, slice; GLuint row, slice;
for (slice = 0; slice < depth; slice++) { for (slice = 0; slice < (unsigned) depth; slice++) {
if (gl_target == GL_TEXTURE_1D_ARRAY) { if (gl_target == GL_TEXTURE_1D_ARRAY) {
/* 1D array textures. /* 1D array textures.
* We need to convert gallium coords to GL coords. * We need to convert gallium coords to GL coords.
@@ -747,7 +747,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
else { else {
ubyte *slice_map = map; ubyte *slice_map = map;
for (row = 0; row < height; row++) { for (row = 0; row < (unsigned) height; row++) {
GLvoid *src = _mesa_image_address3d(unpack, pixels, GLvoid *src = _mesa_image_address3d(unpack, pixels,
width, height, format, width, height, format,
type, slice, row, 0); type, slice, row, 0);
@@ -1625,7 +1625,7 @@ st_AllocTextureStorage(struct gl_context *ctx,
GLuint ptWidth, ptHeight, ptDepth, ptLayers, bindings; GLuint ptWidth, ptHeight, ptDepth, ptLayers, bindings;
enum pipe_format fmt; enum pipe_format fmt;
GLint level; GLint level;
int num_samples = texImage->NumSamples; GLuint num_samples = texImage->NumSamples;
assert(levels > 0); assert(levels > 0);

View File

@@ -118,7 +118,7 @@ compute_num_levels(struct gl_context *ctx,
baseImage = _mesa_get_tex_image(ctx, texObj, target, texObj->BaseLevel); baseImage = _mesa_get_tex_image(ctx, texObj, target, texObj->BaseLevel);
numLevels = texObj->BaseLevel + baseImage->MaxNumLevels; numLevels = texObj->BaseLevel + baseImage->MaxNumLevels;
numLevels = MIN2(numLevels, texObj->MaxLevel + 1); numLevels = MIN2(numLevels, (GLuint) texObj->MaxLevel + 1);
assert(numLevels >= 1); assert(numLevels >= 1);
return numLevels; return numLevels;