[Scummvm-cvs-logs] SF.net SVN: scummvm:[54258] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Nov 16 09:23:14 CET 2010


Revision: 54258
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54258&view=rev
Author:   fingolfin
Date:     2010-11-16 08:23:13 +0000 (Tue, 16 Nov 2010)

Log Message:
-----------
COMMON: Simplify DECLARE_SINGLETON macro

This makes it possible to write
  DECLARE_SINGLETON(foo);
instead of
  DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.

Modified Paths:
--------------
    scummvm/trunk/backends/fs/ds/ds-fs-factory.cpp
    scummvm/trunk/backends/fs/ps2/ps2-fs-factory.cpp
    scummvm/trunk/backends/fs/psp/psp-fs-factory.cpp
    scummvm/trunk/backends/fs/wii/wii-fs-factory.cpp
    scummvm/trunk/backends/platform/psp/display_manager.cpp
    scummvm/trunk/backends/platform/psp/powerman.cpp
    scummvm/trunk/backends/platform/psp/rtc.cpp
    scummvm/trunk/base/plugins.cpp
    scummvm/trunk/common/EventRecorder.cpp
    scummvm/trunk/common/archive.cpp
    scummvm/trunk/common/config-manager.cpp
    scummvm/trunk/common/debug.cpp
    scummvm/trunk/common/singleton.h
    scummvm/trunk/common/translation.cpp
    scummvm/trunk/engines/lure/sound.cpp
    scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp
    scummvm/trunk/engines/sword25/gfx/renderobjectregistry.cpp
    scummvm/trunk/engines/sword25/math/regionregistry.cpp
    scummvm/trunk/engines/testbed/config-params.cpp
    scummvm/trunk/graphics/cursorman.cpp
    scummvm/trunk/graphics/font.h
    scummvm/trunk/graphics/fontman.cpp
    scummvm/trunk/gui/GuiManager.cpp

Modified: scummvm/trunk/backends/fs/ds/ds-fs-factory.cpp
===================================================================
--- scummvm/trunk/backends/fs/ds/ds-fs-factory.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/backends/fs/ds/ds-fs-factory.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -27,7 +27,7 @@
 #include "backends/fs/ds/ds-fs.h"
 #include "dsmain.h" //for the isGBAMPAvailable() function
 
-DECLARE_SINGLETON(DSFilesystemFactory)
+DECLARE_SINGLETON(DSFilesystemFactory);
 
 AbstractFSNode *DSFilesystemFactory::makeRootFileNode() const {
 	if (DS::isGBAMPAvailable()) {

Modified: scummvm/trunk/backends/fs/ps2/ps2-fs-factory.cpp
===================================================================
--- scummvm/trunk/backends/fs/ps2/ps2-fs-factory.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/backends/fs/ps2/ps2-fs-factory.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -30,7 +30,7 @@
 #include "backends/fs/ps2/ps2-fs-factory.h"
 #include "backends/fs/ps2/ps2-fs.cpp"
 
-DECLARE_SINGLETON(Ps2FilesystemFactory)
+DECLARE_SINGLETON(Ps2FilesystemFactory);
 
 AbstractFSNode *Ps2FilesystemFactory::makeRootFileNode() const {
 	return new Ps2FilesystemNode();

Modified: scummvm/trunk/backends/fs/psp/psp-fs-factory.cpp
===================================================================
--- scummvm/trunk/backends/fs/psp/psp-fs-factory.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/backends/fs/psp/psp-fs-factory.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -26,7 +26,7 @@
 #include "backends/fs/psp/psp-fs-factory.h"
 #include "backends/fs/psp/psp-fs.cpp"
 
-DECLARE_SINGLETON(PSPFilesystemFactory)
+DECLARE_SINGLETON(PSPFilesystemFactory);
 
 AbstractFSNode *PSPFilesystemFactory::makeRootFileNode() const {
 	return new PSPFilesystemNode();

Modified: scummvm/trunk/backends/fs/wii/wii-fs-factory.cpp
===================================================================
--- scummvm/trunk/backends/fs/wii/wii-fs-factory.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/backends/fs/wii/wii-fs-factory.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -37,7 +37,7 @@
 #include <smb.h>
 #endif
 
-DECLARE_SINGLETON(WiiFilesystemFactory)
+DECLARE_SINGLETON(WiiFilesystemFactory);
 
 WiiFilesystemFactory::WiiFilesystemFactory() :
 	_dvdMounted(false),

Modified: scummvm/trunk/backends/platform/psp/display_manager.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/display_manager.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/backends/platform/psp/display_manager.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -63,7 +63,7 @@
 
 // Class VramAllocator -----------------------------------
 
-DECLARE_SINGLETON(VramAllocator)
+DECLARE_SINGLETON(VramAllocator);
 
 //#define __PSP_DEBUG_FUNCS__	/* For debugging the stack */
 //#define __PSP_DEBUG_PRINT__

Modified: scummvm/trunk/backends/platform/psp/powerman.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/powerman.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/backends/platform/psp/powerman.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -33,7 +33,7 @@
 //#define __PSP_DEBUG_PRINT__
 #include "backends/platform/psp/trace.h"
 
-DECLARE_SINGLETON(PowerManager)
+DECLARE_SINGLETON(PowerManager);
 
 // Function to debug the Power Manager (we have no output to screen)
 inline void PowerManager::debugPM() {

Modified: scummvm/trunk/backends/platform/psp/rtc.cpp
===================================================================
--- scummvm/trunk/backends/platform/psp/rtc.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/backends/platform/psp/rtc.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -37,7 +37,7 @@
 
 
 // Class PspRtc ---------------------------------------------------------------
-DECLARE_SINGLETON(PspRtc)
+DECLARE_SINGLETON(PspRtc);
 
 void PspRtc::init() {						// init our starting ticks
 	uint32 ticks[2];

Modified: scummvm/trunk/base/plugins.cpp
===================================================================
--- scummvm/trunk/base/plugins.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/base/plugins.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -300,7 +300,7 @@
 
 #pragma mark -
 
-DECLARE_SINGLETON(PluginManager)
+DECLARE_SINGLETON(PluginManager);
 
 PluginManager::PluginManager() {
 	// Always add the static plugin provider.
@@ -450,7 +450,7 @@
 
 #include "engines/metaengine.h"
 
-DECLARE_SINGLETON(EngineManager)
+DECLARE_SINGLETON(EngineManager);
 
 GameDescriptor EngineManager::findGameOnePluginAtATime(const Common::String &gameName, const EnginePlugin **plugin) const {
 	GameDescriptor result;
@@ -514,7 +514,7 @@
 
 #include "sound/musicplugin.h"
 
-DECLARE_SINGLETON(MusicManager)
+DECLARE_SINGLETON(MusicManager);
 
 const MusicPlugin::List &MusicManager::getPlugins() const {
 	return (const MusicPlugin::List &)PluginManager::instance().getPlugins(PLUGIN_TYPE_MUSIC);

Modified: scummvm/trunk/common/EventRecorder.cpp
===================================================================
--- scummvm/trunk/common/EventRecorder.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/common/EventRecorder.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -28,7 +28,7 @@
 #include "common/config-manager.h"
 #include "common/random.h"
 
-DECLARE_SINGLETON(Common::EventRecorder)
+DECLARE_SINGLETON(Common::EventRecorder);
 
 namespace Common {
 

Modified: scummvm/trunk/common/archive.cpp
===================================================================
--- scummvm/trunk/common/archive.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/common/archive.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -290,5 +290,5 @@
 
 } // namespace Common
 
-DECLARE_SINGLETON(Common::SearchManager)
+DECLARE_SINGLETON(Common::SearchManager);
 

Modified: scummvm/trunk/common/config-manager.cpp
===================================================================
--- scummvm/trunk/common/config-manager.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/common/config-manager.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -29,7 +29,7 @@
 #include "common/util.h"
 #include "common/system.h"
 
-DECLARE_SINGLETON(Common::ConfigManager)
+DECLARE_SINGLETON(Common::ConfigManager);
 
 static bool isValidDomainName(const Common::String &domName) {
 	const char *p = domName.c_str();

Modified: scummvm/trunk/common/debug.cpp
===================================================================
--- scummvm/trunk/common/debug.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/common/debug.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -51,7 +51,7 @@
 // TODO: Move gDebugLevel into namespace Common.
 int gDebugLevel = -1;
 
-DECLARE_SINGLETON(Common::DebugManager)
+DECLARE_SINGLETON(Common::DebugManager);
 
 namespace Common {
 

Modified: scummvm/trunk/common/singleton.h
===================================================================
--- scummvm/trunk/common/singleton.h	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/common/singleton.h	2010-11-16 08:23:13 UTC (rev 54258)
@@ -101,9 +101,7 @@
  * namespace Common is referenced.
  */
 #define DECLARE_SINGLETON(T) \
-	namespace Common { \
-	template<> T *Singleton<T>::_singleton = 0; \
-	} // End of namespace Common
+	template<> T *Common::Singleton<T>::_singleton = 0
 
 }	// End of namespace Common
 

Modified: scummvm/trunk/common/translation.cpp
===================================================================
--- scummvm/trunk/common/translation.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/common/translation.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -35,7 +35,7 @@
 #include "common/archive.h"
 #include "common/config-manager.h"
 
-DECLARE_SINGLETON(Common::TranslationManager)
+DECLARE_SINGLETON(Common::TranslationManager);
 
 #ifdef USE_DETECTLANG
 #ifndef WIN32

Modified: scummvm/trunk/engines/lure/sound.cpp
===================================================================
--- scummvm/trunk/engines/lure/sound.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/engines/lure/sound.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -34,7 +34,7 @@
 #include "common/endian.h"
 #include "sound/midiparser.h"
 
-DECLARE_SINGLETON(Lure::SoundManager)
+DECLARE_SINGLETON(Lure::SoundManager);
 
 namespace Lure {
 

Modified: scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -39,7 +39,7 @@
 #include "sword25/gfx/animationtemplateregistry.h"
 #include "sword25/gfx/animationtemplate.h"
 
-DECLARE_SINGLETON(Sword25::AnimationTemplateRegistry)
+DECLARE_SINGLETON(Sword25::AnimationTemplateRegistry);
 
 namespace Sword25 {
 

Modified: scummvm/trunk/engines/sword25/gfx/renderobjectregistry.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/renderobjectregistry.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/engines/sword25/gfx/renderobjectregistry.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -34,7 +34,7 @@
 
 #include "sword25/gfx/renderobjectregistry.h"
 
-DECLARE_SINGLETON(Sword25::RenderObjectRegistry)
+DECLARE_SINGLETON(Sword25::RenderObjectRegistry);
 
 namespace Sword25 {
 

Modified: scummvm/trunk/engines/sword25/math/regionregistry.cpp
===================================================================
--- scummvm/trunk/engines/sword25/math/regionregistry.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/engines/sword25/math/regionregistry.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -39,7 +39,7 @@
 #include "sword25/math/regionregistry.h"
 #include "sword25/math/region.h"
 
-DECLARE_SINGLETON(Sword25::RegionRegistry)
+DECLARE_SINGLETON(Sword25::RegionRegistry);
 
 namespace Sword25 {
 

Modified: scummvm/trunk/engines/testbed/config-params.cpp
===================================================================
--- scummvm/trunk/engines/testbed/config-params.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/engines/testbed/config-params.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -27,7 +27,7 @@
 
 #include "testbed/config-params.h"
 
-DECLARE_SINGLETON(Testbed::ConfigParams)
+DECLARE_SINGLETON(Testbed::ConfigParams);
 
 namespace Testbed {
 

Modified: scummvm/trunk/graphics/cursorman.cpp
===================================================================
--- scummvm/trunk/graphics/cursorman.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/graphics/cursorman.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -27,7 +27,7 @@
 #include "common/system.h"
 #include "common/stack.h"
 
-DECLARE_SINGLETON(Graphics::CursorManager)
+DECLARE_SINGLETON(Graphics::CursorManager);
 
 namespace Graphics {
 

Modified: scummvm/trunk/graphics/font.h
===================================================================
--- scummvm/trunk/graphics/font.h	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/graphics/font.h	2010-11-16 08:23:13 UTC (rev 54258)
@@ -149,10 +149,10 @@
 
 #define FORWARD_DECLARE_FONT(n) \
 		extern const NewFont *n; \
-		extern void create_##n();
+		extern void create_##n()
 
 #define INIT_FONT(n) \
-		create_##n();
+		create_##n()
 
 } // End of namespace Graphics
 

Modified: scummvm/trunk/graphics/fontman.cpp
===================================================================
--- scummvm/trunk/graphics/fontman.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/graphics/fontman.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -23,16 +23,15 @@
  */
 
 #include "graphics/fontman.h"
-//#include "gui/consolefont.h"
 
-DECLARE_SINGLETON(Graphics::FontManager)
+DECLARE_SINGLETON(Graphics::FontManager);
 
 namespace Graphics {
 
 const ScummFont *g_scummfont = 0;
-FORWARD_DECLARE_FONT(g_sysfont)
-FORWARD_DECLARE_FONT(g_sysfont_big)
-FORWARD_DECLARE_FONT(g_consolefont)
+FORWARD_DECLARE_FONT(g_sysfont);
+FORWARD_DECLARE_FONT(g_sysfont_big);
+FORWARD_DECLARE_FONT(g_consolefont);
 
 FontManager::FontManager() {
 	// This assert should *never* trigger, because
@@ -41,9 +40,9 @@
 	// reset to 0 in the desctructor of this class).
 	assert(g_scummfont == 0);
 	g_scummfont = new ScummFont;
-	INIT_FONT(g_sysfont)
-	INIT_FONT(g_sysfont_big)
-	INIT_FONT(g_consolefont)
+	INIT_FONT(g_sysfont);
+	INIT_FONT(g_sysfont_big);
+	INIT_FONT(g_consolefont);
 }
 
 FontManager::~FontManager() {

Modified: scummvm/trunk/gui/GuiManager.cpp
===================================================================
--- scummvm/trunk/gui/GuiManager.cpp	2010-11-16 08:21:53 UTC (rev 54257)
+++ scummvm/trunk/gui/GuiManager.cpp	2010-11-16 08:23:13 UTC (rev 54258)
@@ -39,7 +39,7 @@
 
 #include "graphics/cursorman.h"
 
-DECLARE_SINGLETON(GUI::GuiManager)
+DECLARE_SINGLETON(GUI::GuiManager);
 
 namespace GUI {
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list