[Scummvm-cvs-logs] CVS: scummvm/common system.cpp,1.14,1.15 system.h,1.76,1.77
Max Horn
fingolfin at users.sourceforge.net
Sat Jan 1 10:56:06 CET 2005
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31532/common
Modified Files:
system.cpp system.h
Log Message:
Changed OSystem::instance() to return a reference, not a pointer (it now matches the Singleton interface)
Index: system.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- system.cpp 1 Jan 2005 16:08:50 -0000 1.14
+++ system.cpp 1 Jan 2005 18:53:47 -0000 1.15
@@ -58,10 +58,10 @@
#endif
}
-OSystem *OSystem::instance() {
+OSystem &OSystem::instance() {
if (!s_system)
s_system = createSystem();
- return s_system;
+ return *s_system;
}
Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- system.h 1 Jan 2005 16:08:50 -0000 1.76
+++ system.h 1 Jan 2005 18:53:47 -0000 1.77
@@ -47,7 +47,7 @@
* 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 @@
};
/** The global OSystem instance. Inited in main(). */
-#define g_system (OSystem::instance())
+#define g_system (&OSystem::instance())
namespace Common {
More information about the Scummvm-git-logs
mailing list