From 61a85582d53e4a35ebe6a7978f24ad2416d286ea Mon Sep 17 00:00:00 2001 From: evomarc Date: Mon, 8 Jan 2001 10:07:27 +0000 Subject: [PATCH] Added the namespace eo for the global variable rng in eoRNG.cpp Also added "using eo::rng" in eoRNG.h so nothing has to be modified. We should gradually move to write eo::rng everywhere, and remove that using directive to be almost full-proofed against possible name collision. --- eo/src/utils/eoRNG.cpp | 3 +++ eo/src/utils/eoRNG.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/eo/src/utils/eoRNG.cpp b/eo/src/utils/eoRNG.cpp index fadc1aa2..36f6a489 100644 --- a/eo/src/utils/eoRNG.cpp +++ b/eo/src/utils/eoRNG.cpp @@ -3,5 +3,8 @@ /// The global object, should probably be initialized with an xor /// between time and process_id. +namespace eo +{ eoRng rng((uint32) time(0)); +} diff --git a/eo/src/utils/eoRNG.h b/eo/src/utils/eoRNG.h index 849de003..027da5d5 100644 --- a/eo/src/utils/eoRNG.h +++ b/eo/src/utils/eoRNG.h @@ -279,7 +279,13 @@ private : /** The one and only global eoRng object */ +namespace eo +{ extern eoRng rng; +} + +using eo::rng; + // Implementation of some eoRng members.... Don't mind the mess, it does work.