diff options
author | Kari Salminen | 2008-08-09 10:44:12 +0000 |
---|---|---|
committer | Kari Salminen | 2008-08-09 10:44:12 +0000 |
commit | 8e33f1530c2b61ca49dd62fdcb14c0c6b128c9d4 (patch) | |
tree | 0ce18a4872d8031d3b63aac89440d46967325fe6 | |
parent | c0701bfcb670e43cf4a26bfefb94bf82a76f62b9 (diff) | |
download | scummvm-rg350-8e33f1530c2b61ca49dd62fdcb14c0c6b128c9d4.tar.gz scummvm-rg350-8e33f1530c2b61ca49dd62fdcb14c0c6b128c9d4.tar.bz2 scummvm-rg350-8e33f1530c2b61ca49dd62fdcb14c0c6b128c9d4.zip |
Small cleanup: Renamed rol to rolByte and made it handle all cases.
svn-id: r33708
-rw-r--r-- | engines/cine/part.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp index 46f6bcb272..d605bdd623 100644 --- a/engines/cine/part.cpp +++ b/engines/cine/part.cpp @@ -259,8 +259,9 @@ byte *readBundleSoundFile(const char *entryName, uint32 *size) { return data; } -/*! \brief Rotate value to the left by n bits */ -byte rol(byte value, int n) { +/*! \brief Rotate byte value to the left by n bits */ +byte rolByte(byte value, uint n) { + n %= 8; return (byte) ((value << n) | (value >> (8 - n))); } @@ -283,7 +284,7 @@ byte *readFile(const char *filename, bool crypted) { // the bytes to the left by one. if (crypted) { for (uint index = 0; index < size; index++) { - dataPtr[index] = rol(dataPtr[index], 1); + dataPtr[index] = rolByte(dataPtr[index], 1); } } |