[FFmpeg-cvslog] r14469 - trunk/libavcodec/ra288.c

Vitor Sessak vitor1001
Tue Jul 29 20:36:19 CEST 2008


M?ns Rullg?rd wrote:
> vitor <subversion at mplayerhq.hu> writes:
> 
>> Author: vitor
>> Date: Tue Jul 29 20:22:31 2008
>> New Revision: 14469
>>
>> Log:
>> Do not declare a counter as unsigned when it is not needed
>>
>> Modified:
>>    trunk/libavcodec/ra288.c
>>
>> Modified: trunk/libavcodec/ra288.c
>> ==============================================================================
>> --- trunk/libavcodec/ra288.c	(original)
>> +++ trunk/libavcodec/ra288.c	Tue Jul 29 20:22:31 2008
>> @@ -171,7 +171,7 @@ static void do_hybrid_window(int order, 
>>                               float *out, float *hist, float *out2,
>>                               const float *window)
>>  {
>> -    unsigned int i;
>> +    int i;
>>      float buffer1[order + 1];
>>      float buffer2[order + 1];
>>      float work[order + n + non_rec];
> 
> IMO, it is better to declare things as unsigned, when a negative value
> is meaningless.  It makes range checking simpler, if nothing else.

I agree, but I consider loop counters an exception. At least for me, 
every time I saw it I expected something more complex than a loop 
counter (something that needed some range checking).

-Vitor




More information about the ffmpeg-cvslog mailing list