# HG changeset patch # User michael # Date 1075910590 0 # Node ID bbb6e766767178e59b624725d47427767d18835b # Parent cc4c1eb18eecef63e477406ceb5602c87ed651fd cleanup ugly code (also appearently works around a bug gcc 3.4 which fails compiling it) by (mru at kth dot se (Mns Rullgrd)) diff -r cc4c1eb18eec -r bbb6e7667671 ra144.c --- a/ra144.c Wed Feb 04 15:49:55 2004 +0000 +++ b/ra144.c Wed Feb 04 16:03:10 2004 +0000 @@ -424,7 +424,7 @@ /* Uncompress one block (20 bytes -> 160*2 bytes) */ static int ra144_decode_frame(AVCodecContext * avctx, - void *data, int *data_size, + void *vdata, int *data_size, uint8_t * buf, int buf_size) { unsigned int a,b,c; @@ -432,7 +432,8 @@ signed short *shptr; unsigned int *lptr,*temp; const short **dptr; - void *datao; + int16_t *datao; + int16_t *data = vdata; Real144_internal *glob=avctx->priv_data; datao = data; @@ -480,10 +481,10 @@ shptr=glob->output_buffer; while (shptroutput_buffer+BLOCKSIZE) { s=*(shptr++)<<2; - *((int16_t *)data)=s; - if (s>32767) *((int16_t *)data)=32767; - if (s<-32767) *((int16_t *)data)=-32768; - ((int16_t *)data)++; + *data=s; + if (s>32767) *data=32767; + if (s<-32767) *data=-32768; + data++; } b+=30; } @@ -495,7 +496,7 @@ temp=glob->swapbuf2alt; glob->swapbuf2alt=glob->swapbuf2; glob->swapbuf2=temp; - *data_size=data-datao; + *data_size=(data-datao)*sizeof(*data); return 20; }