On Sat, Dec 03, 2011 at 06:21:55PM +0200, Yordan Makariev wrote:
> 
> --- a/libavutil/crc.c
> +++ b/libavutil/crc.c
> -    if(ctx_size >= sizeof(AVCRC)*1024)
> +    if (ctx_size >= sizeof(AVCRC) * 1024)
>          for (i = 0; i < 256; i++)
> -            for(j=0; j<3; j++)
> -                ctx[256*(j+1) + i]= (ctx[256*j + i]>>8) ^ ctx[ ctx[256*j + 
> i]&0xFF ];
> +            for (j = 0; j < 3; j++)
> +                ctx[256 *(j + 1) + i] = (ctx[256 * j + i] >> 8) ^ctx[
> +                ctx[256 * j + i]&0xFF];

The linebreak is bad.

Add spaces around '&', more below.

> @@ -92,15 +94,16 @@ int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t 
> poly, int ctx_size){
>  #if !CONFIG_HARDCODED_TABLES
> -    if (!av_crc_table[crc_id][FF_ARRAY_ELEMS(av_crc_table[crc_id])-1])
> +    if (!av_crc_table[crc_id][FF_ARRAY_ELEMS(av_crc_table[crc_id]) - 1])
>          if (av_crc_init(av_crc_table[crc_id],
>                          av_crc_table_params[crc_id].le,
>                          av_crc_table_params[crc_id].bits,
>                          av_crc_table_params[crc_id].poly,
> -                        sizeof(av_crc_table[crc_id])) < 0)
> -            return NULL;
> +                 sizeof(av_crc_table[crc_id])) < 0)
> +                return NULL;

This was correct before, now it is no longer.

> @@ -112,46 +115,50 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id){
>  #if !CONFIG_SMALL
> -    if(!ctx[256]) {
> -        while(((intptr_t) buffer & 3) && buffer < end)
> -            crc = ctx[((uint8_t)crc) ^ *buffer++] ^ (crc >> 8);
> +    if (!ctx[256]) {
> +        while (((intptr_t) buffer & 3) && buffer < end)
> +            crc = ctx[((uint8_t)crc) ^ *buffer++] ^(crc >> 8);

The spaces around '^' were better before, more below.

> -        while(buffer<end-3){
> -            crc ^= av_le2ne32(*(const uint32_t*)buffer); buffer+=4;
> +        while (buffer < end - 3) {
> +            crc ^= av_le2ne32(* (const uint32_t *) buffer); buffer += 4;

No need to rearrange the stars here.

> --- a/libavutil/lfg.c
> +++ b/libavutil/lfg.c
> @@ -27,19 +27,20 @@
>  
> -    for(i=8; i<64; i+=4){
> -        AV_WL32(tmp, seed); tmp[4]=i;
> -        av_md5_sum(tmp, tmp,  16);
> -        c->state[i  ]= AV_RL32(tmp);
> -        c->state[i+1]= AV_RL32(tmp+4);
> -        c->state[i+2]= AV_RL32(tmp+8);
> -        c->state[i+3]= AV_RL32(tmp+12);
> +    for(i = 8; i < 64; i += 4) {

for (

> @@ -71,8 +72,8 @@ int main(void)
>      for (j = 0; j < 10000; j++) {
>          START_TIMER
>          for (i = 0; i < 624; i++) {
> -//            av_log(NULL,AV_LOG_ERROR, "%X\n", av_lfg_get(&state));
> +//          av_log(NULL,AV_LOG_ERROR, "%X\n", av_lfg_get(&state));

space after comma

> --- a/libavutil/log.c
> +++ b/libavutil/log.c
> @@ -35,129 +35,139 @@ static int flags;
>  
> -const char* av_default_item_name(void* ptr){
> +const char* av_default_item_name(void* ptr)

The stars should be placed with the variable name, not the type name, i.e.

  const char *av_default_item_name(void *ptr)

more instances below

> -    return (*(AVClass**)ptr)->class_name;
> +    return (* (AVClass**) ptr)->class_name;

Leave as-is.

> -    if(level>av_log_level)
> +    if (level>av_log_level)

space around '>'

>  #if HAVE_ISATTY
> -    if(!is_atty) is_atty= isatty(2) ? 1 : -1;
> +    if (!is_atty) is_atty= isatty(2) ? 1 : -1;

Break the line and add spaces around '='.

> -static void (*av_log_callback)(void*, int, const char*, va_list) = 
> av_log_default_callback;
> +static void ( *av_log_callback)(void* , int, const char* , va_list) 
> +             = av_log_default_callback;

This was as it should be before you changed it; don't add spaces
before commas, nor inside '()', more below.

> -    if(avc && avc->version >= (50<<16 | 15<<8 | 2) && 
> avc->log_level_offset_offset && level>=AV_LOG_FATAL)
> +    if (avc && avc->version >= (50 << 16 | 15 << 8 | 2) && 
> +        avc->log_level_offset_offset && level>=AV_LOG_FATAL)

spaces around '>='

> -int av_log_get_level(void)
> +int av_log_get_level(void) 
>  {
>      return av_log_level;
>  }
>  
> -void av_log_set_level(int level)
> +void av_log_set_level(int level) 
>  {
>      av_log_level = level;
>  }
>  
> -void av_log_set_flags(int arg)
> +void av_log_set_flags(int arg) 

You are adding trailing whitespace, which is forbidden; more below.

> --- a/libavutil/random_seed.c
> +++ b/libavutil/random_seed.c
> @@ -25,39 +25,39 @@
>  
> -    for(i=0;bits<64;i++){
> -        clock_t t= clock();
> -        if(last_t && fabs(t-last_t)>s || t==(clock_t)-1){
> -            if(i<10000 && s<(1<<24)){
> -                s+=s;
> -                i=t=0;
> -            }else{
> -                random= 2*random + (i&1);
> +    for (i = 0;bits < 64; i++) {
> +        clock_t t = clock();
> +        if (last_t && fabs(t-last_t)>s || t == (clock_t) - 1) {
> +            if (i < 10000 && s < (1 << 24)) {
> +                s += s;
> +                i = t = 0;
> +            } else {
> +                random = 2 * random + (i&1);

spaces around '&' and '>'

That's all I have time for right now, please check the rest of your
patch for the stuff I mentioned above yourself and resubmit.

Thanks for your contribution.

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to