J
James Dean
I am recoding a project in C#.....i just wanted to know if these are
equivalent and give the same result....
old C++ code
for ( long loop = 0; loop < ( longWidth_bytes - 1); loop++)
{
*lpbLine = ( *lpbLine >> charShift) |
( *( lpbLine - 1) << charShift_inv) ;
lpbLine-- ;
}
for ( long loop = 0; loop <= (long_WidthValue - 1); loop++)
{
LineBytes[pointerPos] =
Convert.ToByte(LineBytes[pointerPos] >> charShift);
byte prevbyte =
Convert.ToByte(LineBytes[prevPos] << charShift_inv);
LineBytes[pointerPos] =
Convert.ToByte(LineBytes[pointerPos] | prevbyte);
pointerPos--;
prevPos--;
}
I have to shift the data in the amount of this charshift so i have to do
it for every byte. As you see i had use this "Convert To Byte" function
alot to make it work. I don't think this is right. Could anybody suggest
a better way?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
equivalent and give the same result....
old C++ code
for ( long loop = 0; loop < ( longWidth_bytes - 1); loop++)
{
*lpbLine = ( *lpbLine >> charShift) |
( *( lpbLine - 1) << charShift_inv) ;
lpbLine-- ;
}
for ( long loop = 0; loop <= (long_WidthValue - 1); loop++)
{
LineBytes[pointerPos] =
Convert.ToByte(LineBytes[pointerPos] >> charShift);
byte prevbyte =
Convert.ToByte(LineBytes[prevPos] << charShift_inv);
LineBytes[pointerPos] =
Convert.ToByte(LineBytes[pointerPos] | prevbyte);
pointerPos--;
prevPos--;
}
I have to shift the data in the amount of this charshift so i have to do
it for every byte. As you see i had use this "Convert To Byte" function
alot to make it work. I don't think this is right. Could anybody suggest
a better way?
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!