Revision: 71866 http://sourceforge.net/p/brlcad/code/71866 Author: starseeker Date: 2018-09-26 22:47:18 +0000 (Wed, 26 Sep 2018) Log Message: ----------- Per Sean's recommendation, just use time to seed srand here.
Modified Paths: -------------- brlcad/trunk/src/other/libnetpbm/libpm.cxx Modified: brlcad/trunk/src/other/libnetpbm/libpm.cxx =================================================================== --- brlcad/trunk/src/other/libnetpbm/libpm.cxx 2018-09-26 22:07:10 UTC (rev 71865) +++ brlcad/trunk/src/other/libnetpbm/libpm.cxx 2018-09-26 22:47:18 UTC (rev 71866) @@ -67,7 +67,6 @@ #ifdef WIN32 # include <io.h> -# include <Windows.h> #endif extern "C" { @@ -775,31 +774,7 @@ } #ifndef HAVE_MKSTEMP -/* Pull in the mkstemp logic from BRL-CAD's libbu */ -int64_t mkstemp_gettime() { -#ifdef WIN32 - LARGE_INTEGER count; - static LARGE_INTEGER freq = {0}; - if (freq.QuadPart == 0) - if (QueryPerformanceFrequency(&freq) == 0) { - return -1; - } - - if (QueryPerformanceCounter(&count) == 0) { - return -1; - } - - return 1e6*count.QuadPart/freq.QuadPart; -#else - struct timeval nowTime; - - gettimeofday(&nowTime, NULL); - return ((int64_t)nowTime.tv_sec * (int64_t)1000000 - + (int64_t)nowTime.tv_usec); -#endif -} - static int mkstemp(char *file_template) { @@ -825,7 +800,7 @@ do { /* replace the template with random chars */ - srand((unsigned)(mkstemp_gettime() % UINT_MAX)); + srand(time(NULL)); for (i=start; i>=end; i--) { file_template[i] = replace[(int)(replacelen * ((double)rand() / (double)RAND_MAX))]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits