[Scummvm-cvs-logs] SF.net SVN: scummvm:[45449] scummvm/trunk/tools/create_msvc/create_msvc.cpp
lordhoto at users.sourceforge.net
lordhoto at users.sourceforge.net
Tue Oct 27 20:24:50 CET 2009
Revision: 45449
http://scummvm.svn.sourceforge.net/scummvm/?rev=45449&view=rev
Author: lordhoto
Date: 2009-10-27 19:24:49 +0000 (Tue, 27 Oct 2009)
Log Message:
-----------
Only use std::srand once. (Fixes bug that createUUID always creates identical UUIDs, when run only with a short span of time in between).
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-27 19:21:47 UTC (rev 45448)
+++ scummvm/trunk/tools/create_msvc/create_msvc.cpp 2009-10-27 19:24:49 UTC (rev 45449)
@@ -91,6 +91,11 @@
} // End of anonymous namespace
int main(int argc, char *argv[]) {
+#if !(defined(_WIN32) || defined(WIN32))
+ // Initialize random number generator for UUID creation
+ std::srand(std::time(0));
+#endif
+
if (argc < 2) {
displayHelp(argv[0]);
return -1;
@@ -720,7 +725,6 @@
return result;
#else
unsigned char uuid[16];
- std::srand(std::time(0));
for (int i = 0; i < 16; ++i)
uuid[i] = (std::rand() / (double)(RAND_MAX)) * 0xFF;
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