|
|
@ -1730,25 +1730,10 @@ void CSaveRestoreBuffer::BufferRewind( int size ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if !XASH_WIN32 && !__WATCOMC__ |
|
|
|
#if !XASH_WIN32 && !__WATCOMC__ |
|
|
|
extern "C" { |
|
|
|
static unsigned _rotr( unsigned val, int shift ) |
|
|
|
unsigned _rotr( unsigned val, int shift ) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
unsigned lobit; /* non-zero means lo bit set */ |
|
|
|
// Any modern compiler will generate one single ror instruction for x86, arm and mips here.
|
|
|
|
unsigned num = val; /* number to rotate */ |
|
|
|
return ( val >> shift ) | ( val << ( 32 - shift )); |
|
|
|
|
|
|
|
|
|
|
|
shift &= 0x1f; /* modulo 32 -- this will also make
|
|
|
|
|
|
|
|
negative shifts work */ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while( shift-- ) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
lobit = num & 1; /* get high bit */ |
|
|
|
|
|
|
|
num >>= 1; /* shift right one bit */ |
|
|
|
|
|
|
|
if( lobit ) |
|
|
|
|
|
|
|
num |= 0x80000000; /* set hi bit if lo bit was set */ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return num; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|