From 67be0a85c0af66fd296965256de0539199140c66 Mon Sep 17 00:00:00 2001 From: Evghenii Date: Wed, 19 Feb 2014 12:52:12 +0100 Subject: [PATCH] use rand instead of drand48 --- examples_ptx/ptxcc/ptxcc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples_ptx/ptxcc/ptxcc.cpp b/examples_ptx/ptxcc/ptxcc.cpp index b70cb77d..e6a6942c 100644 --- a/examples_ptx/ptxcc/ptxcc.cpp +++ b/examples_ptx/ptxcc/ptxcc.cpp @@ -39,14 +39,14 @@ static char lRandomAlNum() "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz"; const size_t max_index = (sizeof(charset) - 1); - return charset[ int(drand48() * (1ULL<<31)) % max_index ]; + return charset[ rand() % max_index ]; } static std::string lRandomString(const size_t length) { timeval t1; gettimeofday(&t1, NULL); - srand48((long long)t1.tv_usec * t1.tv_sec); + srand(t1.tv_usec * t1.tv_sec); std::string str(length,0); std::generate_n( str.begin(), length, lRandomAlNum); return str;