--- fpx/buffdesc.cpp Wed Apr 23 21:31:48 2003 +++ fpx/buffdesc.cpp Fri Apr 25 18:41:02 2003 @@ -74,69 +74,31 @@ } } -/* -// Rotate on the left by 8 bits on each 32 bits long and wrap the last one -static void Shift8BitsLeft (unsigned char* buffer, long size) -{ - register unsigned long tmp; - register unsigned long* all = (unsigned long*)(buffer); - while (size--) { - tmp = (*all) >> 24; - (*all) = ((*all) << 8) | tmp; - all++; - } -} */ + //Updated the procedure to work on both architedture --**IM-05/16/97 // Rotate on the left by 8 bits on each 32 bits long and wrap the last one static void Shift8BitsLeft (unsigned char* buffer, long size) { - register unsigned long tmp; - register unsigned long* all = (unsigned long*)(buffer); + unsigned char tmp; while (size--) { - -#ifdef IN_LITTLE_ENDIAN - *all = (unsigned long) SwapBytes( (int32) *all ); -#endif - - tmp = (*all) >> 24; - (*all) = ((*all) << 8) | tmp; - -#ifdef IN_LITTLE_ENDIAN - *all = (unsigned long) SwapBytes( (int32) *all ); -#endif - - all++; + tmp = buffer[0]; + buffer[0] = buffer[1]; + buffer[1] = buffer[2]; + buffer[2] = buffer[3]; + buffer[3] = tmp; + buffer += 4; } } -/* -// Rotate on the right by 8 bits on each 32 bits long and wrap the last one -static void Shift8BitsRight (unsigned char* buffer, long size) -{ - register unsigned long tmp; - register unsigned long* all = (unsigned long*)(buffer); - while (size--) { - tmp = (*all) << 24; - (*all) = ((*all) >> 8) | tmp; - all++; - } -} -*/ // Rotate on the right by 8 bits on each 32 bits long and wrap the last one static void Shift8BitsRight (unsigned char* buffer, long size) { - register unsigned long tmp; - register unsigned long* all = (unsigned long*)(buffer); + unsigned char tmp; while (size--) { - -#ifdef IN_LITTLE_ENDIAN - *all = (unsigned long) SwapBytes( (int32) *all ); -#endif - tmp = (*all) << 24; - (*all) = ((*all) >> 8) | tmp; - -#ifdef IN_LITTLE_ENDIAN - *all = (unsigned long) SwapBytes( (int32) *all ); -#endif - all++; + tmp = buffer[3]; + buffer[3] = buffer[2]; + buffer[2] = buffer[1]; + buffer[1] = buffer[0]; + buffer[0] = tmp; + buffer += 4; } }