Menu

#5 jlib: packDimInfo

open
nobody
None
5
2007-07-24
2007-07-24
Cinly Ooi
No

Can someone check this for me please?

I believe the first & (AND) operator every line of packDimInfo() should be replaced by the ! (OR) operator. For example:

i = (i & ((int)(slice)&3)) << 2;
^
replace this
with

i = (i | ((int)(slice)&3)) << 2;

Otherwise the return value will always be 0.

The final results should be as below.

static public byte
packDimInfo(short freq, short phase, short slice) {
int i = 0;

i = (i | ((int)(slice)&3)) << 2;
i = (i | ((int)(phase)&3)) << 2;
i = (i | ((int)(freq)&3));
return ((byte)i);
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB