[MPlayer-cvslog] r22958 - trunk/stream/realrtsp/real.c

Roberto Togni rxt at rtogni.it
Mon Apr 9 22:46:08 CEST 2007


On Mon, 09 Apr 2007 23:25:53 +0300
Uoti Urpala <uoti.urpala at pp1.inet.fi> wrote:

> On Mon, 2007-04-09 at 21:30 +0200, rtogni wrote:
> > +#define XOR_TABLE_SIZE 45
> > +
> > +static const unsigned char xor_table[XOR_TABLE_SIZE] = {
> 
> > +    for (i=0; i<XOR_TABLE_SIZE; i++)
> >        ptr[i] = ptr[i] ^ xor_table[i];
> 
> Why the explicit size, and why is it larger than the number of nonzero
> entries when it's only used for xor?
> 
> Why not just
> 
> static const unsigned char xor_table[] = {   ...
> 
> and
> 
> for (i=0; i < sizeof(xor_table); i++)
> 

Explicit size: all that code uses fixed-size buffers, so I prefer to
have explicit sizes to make it clear that if you change anything you
have to check all the sizes manually.

Why bigger than the table? stupid bug, fixed

Ciao,
 Roberto



More information about the MPlayer-cvslog mailing list