[Scummvm-cvs-logs] SF.net SVN: scummvm:[33709] scummvm/branches/branch-0-12-0/engines/cine/ part.cpp

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Sat Aug 9 12:46:40 CEST 2008


Revision: 33709
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33709&view=rev
Author:   buddha_
Date:     2008-08-09 10:46:40 +0000 (Sat, 09 Aug 2008)

Log Message:
-----------
Backport of r33708: Small cleanup: Renamed rol to rolByte and made it handle all cases.

Modified Paths:
--------------
    scummvm/branches/branch-0-12-0/engines/cine/part.cpp

Modified: scummvm/branches/branch-0-12-0/engines/cine/part.cpp
===================================================================
--- scummvm/branches/branch-0-12-0/engines/cine/part.cpp	2008-08-09 10:44:12 UTC (rev 33708)
+++ scummvm/branches/branch-0-12-0/engines/cine/part.cpp	2008-08-09 10:46:40 UTC (rev 33709)
@@ -259,8 +259,9 @@
 	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 @@
 	// 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);
 		}
 	}
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list