[Scummvm-cvs-logs] SF.net SVN: scummvm:[45482] scummvm/trunk/tools/create_msvc/create_msvc.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Wed Oct 28 21:24:55 CET 2009


Revision: 45482
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45482&view=rev
Author:   lordhoto
Date:     2009-10-28 20:24:55 +0000 (Wed, 28 Oct 2009)

Log Message:
-----------
Fix bug createUUID, which caused our custom createUUID implementation to fail to convert some UUIDs to a string correctly.

Modified Paths:
--------------
    scummvm/trunk/tools/create_msvc/create_msvc.cpp

Modified: scummvm/trunk/tools/create_msvc/create_msvc.cpp
===================================================================
--- scummvm/trunk/tools/create_msvc/create_msvc.cpp	2009-10-28 19:28:43 UTC (rev 45481)
+++ scummvm/trunk/tools/create_msvc/create_msvc.cpp	2009-10-28 20:24:55 UTC (rev 45482)
@@ -727,17 +727,17 @@
 	unsigned char uuid[16];
 
 	for (int i = 0; i < 16; ++i)
-		uuid[i] = (std::rand() / (double)(RAND_MAX)) * 0xFF;
+		uuid[i] = (unsigned char)((std::rand() / (double)(RAND_MAX)) * 0xFF);
 
 	uuid[8] &= 0xBF; uuid[8] |= 0x80;
 	uuid[6] &= 0x4F; uuid[6] |= 0x40;
 
 	std::stringstream uuidString;
-	uuidString << std::hex << std::uppercase << std::setw(2) << std::setfill('0');
+	uuidString << std::hex << std::uppercase << std::setfill('0');
 	for (int i = 0; i < 16; ++i) {
-		uuidString << (int)uuid[i];
+		uuidString << std::setw(2) << (int)uuid[i];
 		if (i == 3 || i == 5 || i == 7 || i == 9) {
-			uuidString << std::setw(0) << '-' << std::setw(2);
+			uuidString << std::setw(0) << '-';
 		}
 	}
 


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