From bda3674578f667e96df06c785580abd1650f53d2 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 20 Jul 2013 16:07:25 -0400 Subject: [PATCH] Code Cleanup - Removed the rand/random/srand/srandom calls that are no longer used. --- CMakeLists.txt | 2 -- cmake.h.in | 6 ------ src/commands/CmdDiagnostics.cpp | 12 ------------ src/main.cpp | 13 ------------- src/shell/main.cpp | 13 ------------- 5 files changed, 46 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1ab3b5e8..882dcbb45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -83,8 +83,6 @@ if (READLINE_FOUND) set (TASK_LIBRARIES ${TASK_LIBRARIES} ${READLINE_LIBRARIES}) endif (READLINE_FOUND) -check_function_exists (random HAVE_RANDOM) -check_function_exists (srandom HAVE_SRANDOM) check_function_exists (timegm HAVE_TIMEGM) check_function_exists (get_current_dir_name HAVE_GET_CURRENT_DIR_NAME) diff --git a/cmake.h.in b/cmake.h.in index 2d6dc7d8e..3a0b2ac4d 100644 --- a/cmake.h.in +++ b/cmake.h.in @@ -52,12 +52,6 @@ /* Found the pthread library */ #cmakedefine HAVE_LIBPTHREAD -/* Found random */ -#cmakedefine HAVE_RANDOM - -/* Found srandom */ -#cmakedefine HAVE_SRANDOM - /* Found tm_gmtoff */ #cmakedefine HAVE_TM_GMTOFF diff --git a/src/commands/CmdDiagnostics.cpp b/src/commands/CmdDiagnostics.cpp index 68a04b6c0..a76cb81ac 100644 --- a/src/commands/CmdDiagnostics.cpp +++ b/src/commands/CmdDiagnostics.cpp @@ -149,18 +149,6 @@ int CmdDiagnostics::execute (std::string& output) << " -pthreads" #endif -#ifdef HAVE_SRANDOM - << " +srandom" -#else - << " -srandom" -#endif - -#ifdef HAVE_RANDOM - << " +random" -#else - << " -random" -#endif - #ifdef HAVE_LIBGNUTLS << " +tls" #else diff --git a/src/main.cpp b/src/main.cpp index 7440024fd..4aa9972b7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,22 +41,9 @@ Context context; -#ifdef HAVE_SRANDOM -#define srand(x) srandom(x) -#endif - //////////////////////////////////////////////////////////////////////////////// int main (int argc, const char** argv) { - // Set up randomness. -#ifdef CYGWIN - srand (time (NULL)); -#else - struct timeval tv; - gettimeofday (&tv, NULL); - srand (tv.tv_usec); -#endif - int status = 0; if (argc == 2 && !strcmp (argv[1], "--version")) diff --git a/src/shell/main.cpp b/src/shell/main.cpp index af74fdacf..699abfd7f 100644 --- a/src/shell/main.cpp +++ b/src/shell/main.cpp @@ -45,22 +45,9 @@ Context context; -#ifdef HAVE_SRANDOM -#define srand(x) srandom(x) -#endif - //////////////////////////////////////////////////////////////////////////////// int main (int argc, const char** argv) { - // Set up randomness. -#ifdef CYGWIN - srand (time (NULL)); -#else - struct timeval tv; - gettimeofday (&tv, NULL); - srand (tv.tv_usec); -#endif - bool read_from_file = false; if (argc > 2)