[Mesa-dev] [PATCH 10/18] mesa: fix signed/unsigned MSVC warnings in fbobject.c

Brian Paul brianp at vmware.com
Tue Nov 6 11:51:33 PST 2012


On 11/06/2012 12:25 PM, Ian Romanick wrote:
> On 11/04/2012 03:43 PM, Brian Paul wrote:
>> ---
>> src/mesa/main/fbobject.c | 5 +++--
>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
>> index fc5681c..d54f6a9 100644
>> --- a/src/mesa/main/fbobject.c
>> +++ b/src/mesa/main/fbobject.c
>> @@ -2059,7 +2059,8 @@ framebuffer_texture(struct gl_context *ctx,
>> const char *caller, GLenum target,
>> }
>> else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) ||
>> (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) {
>> - if (zoffset < 0 || zoffset >= ctx->Const.MaxArrayTextureLayers) {
>> + if (zoffset < 0 ||
>> + zoffset >= (GLint) ctx->Const.MaxArrayTextureLayers) {
>> _mesa_error(ctx, GL_INVALID_VALUE,
>> "glFramebufferTexture%sEXT(layer)", caller);
>> return;
>> @@ -3142,7 +3143,7 @@ invalidate_framebuffer_storage(GLenum target,
>> GLsizei numAttachments,
>> case GL_COLOR_ATTACHMENT13:
>> case GL_COLOR_ATTACHMENT14:
>> case GL_COLOR_ATTACHMENT15: {
>> - const int k = attachments[i] - GL_COLOR_ATTACHMENT0;
>> + unsigned k = attachments[i] - GL_COLOR_ATTACHMENT0;
>
> Why drop const? No other assignments to k were added...
>
>> if (k >= ctx->Const.MaxColorAttachments) {
>> _mesa_error(ctx, GL_INVALID_OPERATION,
>> "%s(attachment >= max. color attachments)", name);

The use of 'k' there is trivial so the const qualifier didn't seem 
worthwhile.  And I know how Eric hates them. :)

-Brian



More information about the mesa-dev mailing list