From f52be9df681358564991e0988bf70160970104ad Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 1 Jan 2005 18:53:47 +0000 Subject: Changed OSystem::instance() to return a reference, not a pointer (it now matches the Singleton interface) svn-id: r16402 --- common/system.cpp | 4 ++-- common/system.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'common') diff --git a/common/system.cpp b/common/system.cpp index fbd9e0a7cd..9c465a14fb 100644 --- a/common/system.cpp +++ b/common/system.cpp @@ -58,10 +58,10 @@ static OSystem *createSystem() { #endif } -OSystem *OSystem::instance() { +OSystem &OSystem::instance() { if (!s_system) s_system = createSystem(); - return s_system; + return *s_system; } diff --git a/common/system.h b/common/system.h index b1d33e34b8..2a3b0fafc1 100644 --- a/common/system.h +++ b/common/system.h @@ -47,7 +47,7 @@ public: * not a real class (and thus it isn't based on our Singleton template). * @return the pointer to the (singleton) OSystem instance */ - static OSystem *instance(); + static OSystem &instance(); public: @@ -687,7 +687,7 @@ public: }; /** The global OSystem instance. Inited in main(). */ -#define g_system (OSystem::instance()) +#define g_system (&OSystem::instance()) namespace Common { -- cgit v1.2.3