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

Brian Paul brianp at vmware.com
Tue Nov 6 11:50:09 PST 2012


On 11/06/2012 12:26 PM, Ian Romanick wrote:
> On 11/04/2012 03:44 PM, Brian Paul wrote:
>> ---
>> src/mesa/main/transformfeedback.c | 4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/mesa/main/transformfeedback.c
>> b/src/mesa/main/transformfeedback.c
>> index 1afc0dc..1e3a7ea 100644
>> --- a/src/mesa/main/transformfeedback.c
>> +++ b/src/mesa/main/transformfeedback.c
>> @@ -599,7 +599,7 @@ _mesa_TransformFeedbackVaryings(GLuint program,
>> GLsizei count,
>> }
>>
>> /* free existing varyings, if any */
>> - for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {
>> + for (i = 0; i < (GLint) shProg->TransformFeedback.NumVarying; i++) {
>> free(shProg->TransformFeedback.VaryingNames[i]);
>> }
>> free(shProg->TransformFeedback.VaryingNames);
>> @@ -614,7 +614,7 @@ _mesa_TransformFeedbackVaryings(GLuint program,
>> GLsizei count,
>> }
>>
>> /* Save the new names and the count */
>> - for (i = 0; i < (GLuint) count; i++) {
>> + for (i = 0; i < count; i++) {
>> shProg->TransformFeedback.VaryingNames[i] = _mesa_strdup(varyings[i]);
>> }
>> shProg->TransformFeedback.NumVarying = count;
>>
>
> Is i signed or unsigned? There appear to be casts both ways...

I had messed up on my previous change to this code.  The same 'i' var 
is used as a counter for two loops, one with a signed upper limit and 
the other with an unsigned upper limit.  There's no more warnings now.

-Brian



More information about the mesa-dev mailing list