From ec090fbadc8abae0fcf2cd3075dea0dc8d47ece2 Mon Sep 17 00:00:00 2001 From: "craig.p.drummond" Date: Mon, 24 Mar 2014 20:40:16 +0000 Subject: [PATCH] Use qrand for random numbers --- support/utils.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/support/utils.h b/support/utils.h index f0e20cb7d..cb5a1d8e1 100644 --- a/support/utils.h +++ b/support/utils.h @@ -54,14 +54,7 @@ namespace Utils { return (fabs(d1 - d2) < precision); } - inline int random(int max) - { - #ifdef Q_OS_WIN32 - return ::rand()%max; - #else - return ::random()%max; - #endif - } + inline int random(int max=0) { return max ? (qrand()%max) : qrand(); } extern QString strippedText(QString s); extern QString stripAcceleratorMarkers(QString label);