From: Karl Schultz Date: Thu, 18 Sep 2003 15:14:10 +0000 (+0000) Subject: Add casts to prevent signed/unsigned compare compiler warnings. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df8d337eec9b9f6f1d6ed0b4a7044b4f4420c52b;p=mesa.git Add casts to prevent signed/unsigned compare compiler warnings. --- diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 57e6b8df23c..3ae35d5b4d5 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -110,7 +110,7 @@ buffer_object_subdata_range_good( GLcontext * ctx, GLenum target, return NULL; } - if ( (offset + size) > bufObj->Size ) { + if ( (GLuint)(offset + size) > bufObj->Size ) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(size + offset > buffer size)", str); return NULL; @@ -261,7 +261,7 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, struct gl_buffer_object * bufObj ) { if ( (bufObj->Data != NULL) - && ((size + offset) <= bufObj->Size) ) { + && ((GLuint)(size + offset) <= bufObj->Size) ) { _mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size ); } } @@ -291,7 +291,7 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset, struct gl_buffer_object * bufObj ) { if ( (bufObj->Data != NULL) - && ((size + offset) <= bufObj->Size) ) { + && ((GLuint)(size + offset) <= bufObj->Size) ) { _mesa_memcpy( data, (GLubyte *) bufObj->Data + offset, size ); } } @@ -428,7 +428,7 @@ void _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) { GET_CURRENT_CONTEXT(ctx); - unsigned i; + GLsizei i; ASSERT_OUTSIDE_BEGIN_END(ctx); if (n < 0) { diff --git a/src/mesa/main/program.c b/src/mesa/main/program.c index 0d1a53c7616..8cc5f6885a4 100644 --- a/src/mesa/main/program.c +++ b/src/mesa/main/program.c @@ -363,7 +363,7 @@ _mesa_lookup_parameter_value(struct program_parameter_list *paramList, /* name is not null-terminated, use nameLen */ for (i = 0; i < paramList->NumParameters; i++) { if (_mesa_strncmp(paramList->Parameters[i].Name, name, nameLen) == 0 - && _mesa_strlen(paramList->Parameters[i].Name) == nameLen) + && _mesa_strlen(paramList->Parameters[i].Name) == (size_t)nameLen) return paramList->Parameters[i].Values; } } @@ -392,7 +392,7 @@ _mesa_lookup_parameter_index(struct program_parameter_list *paramList, /* name is not null-terminated, use nameLen */ for (i = 0; i < (GLint) paramList->NumParameters; i++) { if (_mesa_strncmp(paramList->Parameters[i].Name, name, nameLen) == 0 - && _mesa_strlen(paramList->Parameters[i].Name) == nameLen) + && _mesa_strlen(paramList->Parameters[i].Name) == (size_t)nameLen) return i; } }