[ExtractStream] More Re: its in the 3s.....
Dale Reed
daler at n...
Mon, 19 Nov 2001 11:35:57 -0800
Ken Hancock wrote:
> The code you quoted above doesn't match what I see in ExtractStream.
> Did you just transcribe things differently?
Well, I think I got mislead on a quote by another user. I was looking
at line 139, which isn't actually the working code (#if 0 section).
Looking down at the correct lines (which you quote below) they are right.
> From ExtractStream 0.3 CVS tree, lines 326 & 355:
>
> TyStream[j].size = buf[p] << 12 | buf[p+1] << 4 | buf[p+2] >> 4;
>
> This is equivalent to
>
> Tystream[j].size = (buf[p] << 12) | (buf[p+1] << 4) | (buf[p+2] >> 4);
>
> SHIFT operators have higher precedence than | operators. That's why
> I prefer added parentheses because I don't necessarily remember that
> AND is higher precedence than OR, let alone all the other operators.
Yeah, those I follow. Its also equiv to:
Tystream[j].size = ((buf[p] << 8) | (buf[p+1]) << 4) | (buf[p+2] >> 4);
which is what I've been using in tyc.
--
Dale E. Reed Jr. Emerald and RadiusNT/X
__________________________________________
IEA Software, Inc. www.iea-software.com