[Scummvm-git-logs] scummvm master -> 5c255b3aa982a2bb2b79f3df72bea1c3472298f6

ccawley2011 ccawley2011 at gmail.com
Fri Oct 16 17:32:27 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5c255b3aa9 WIN32: Add override and final keywords


Commit: 5c255b3aa982a2bb2b79f3df72bea1c3472298f6
    https://github.com/scummvm/scummvm/commit/5c255b3aa982a2bb2b79f3df72bea1c3472298f6
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2020-10-16T18:32:08+01:00

Commit Message:
WIN32: Add override and final keywords

Changed paths:
    backends/audiocd/win32/win32-audiocd.cpp
    backends/dialogs/win32/win32-dialogs.h
    backends/fs/windows/windows-fs-factory.h
    backends/fs/windows/windows-fs.h
    backends/midi/windows.cpp
    backends/platform/sdl/win32/win32-window.h
    backends/platform/sdl/win32/win32.cpp
    backends/platform/sdl/win32/win32.h
    backends/plugins/win32/win32-provider.cpp
    backends/plugins/win32/win32-provider.h
    backends/saves/windows/windows-saves.h
    backends/taskbar/win32/win32-taskbar.h
    backends/text-to-speech/windows/windows-text-to-speech.h
    backends/updates/win32/win32-updates.h


diff --git a/backends/audiocd/win32/win32-audiocd.cpp b/backends/audiocd/win32/win32-audiocd.cpp
index 9ffcc00ec3..5d72daf6d2 100644
--- a/backends/audiocd/win32/win32-audiocd.cpp
+++ b/backends/audiocd/win32/win32-audiocd.cpp
@@ -74,15 +74,15 @@
 #include <ntddcdrm.h>
 #endif
 
-class Win32AudioCDStream : public AudioCDStream {
+class Win32AudioCDStream final : public AudioCDStream {
 public:
 	Win32AudioCDStream(HANDLE handle, const TRACK_DATA &startEntry, const TRACK_DATA &endEntry);
 	~Win32AudioCDStream();
 
 protected:
-	uint getStartFrame() const;
-	uint getEndFrame() const;
-	bool readFrame(int frame, int16 *buffer);
+	uint getStartFrame() const override;
+	uint getEndFrame() const override;
+	bool readFrame(int frame, int16 *buffer) override;
 
 private:
 	HANDLE _driveHandle;
@@ -143,7 +143,7 @@ bool Win32AudioCDStream::readFrame(int frame, int16 *buffer) {
 }
 
 
-class Win32AudioCDManager : public DefaultAudioCDManager {
+class Win32AudioCDManager final : public DefaultAudioCDManager {
 public:
 	Win32AudioCDManager();
 	~Win32AudioCDManager();
diff --git a/backends/dialogs/win32/win32-dialogs.h b/backends/dialogs/win32/win32-dialogs.h
index 8b527b9e54..ea8326d8df 100644
--- a/backends/dialogs/win32/win32-dialogs.h
+++ b/backends/dialogs/win32/win32-dialogs.h
@@ -31,11 +31,11 @@
 
 class SdlWindow_Win32;
 
-class Win32DialogManager : public Common::DialogManager {
+class Win32DialogManager final : public Common::DialogManager {
 public:
 	Win32DialogManager(SdlWindow_Win32 *window);
 	virtual ~Win32DialogManager();
-	virtual DialogResult showFileBrowser(const Common::U32String &title, Common::FSNode &choice, bool isDirBrowser);
+	virtual DialogResult showFileBrowser(const Common::U32String &title, Common::FSNode &choice, bool isDirBrowser) override;
 
 private:
 	SdlWindow_Win32 *_window;
diff --git a/backends/fs/windows/windows-fs-factory.h b/backends/fs/windows/windows-fs-factory.h
index b5df5406a8..800500a2cd 100644
--- a/backends/fs/windows/windows-fs-factory.h
+++ b/backends/fs/windows/windows-fs-factory.h
@@ -30,11 +30,11 @@
  *
  * Parts of this class are documented in the base interface class, FilesystemFactory.
  */
-class WindowsFilesystemFactory : public FilesystemFactory {
+class WindowsFilesystemFactory final : public FilesystemFactory {
 public:
-	virtual AbstractFSNode *makeRootFileNode() const;
-	virtual AbstractFSNode *makeCurrentDirectoryFileNode() const;
-	virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const;
+	virtual AbstractFSNode *makeRootFileNode() const override;
+	virtual AbstractFSNode *makeCurrentDirectoryFileNode() const override;
+	virtual AbstractFSNode *makeFileNodePath(const Common::String &path) const override;
 };
 
 #endif /*WINDOWS_FILESYSTEM_FACTORY_H*/
diff --git a/backends/fs/windows/windows-fs.h b/backends/fs/windows/windows-fs.h
index 30c2a98845..8a73dd73e4 100644
--- a/backends/fs/windows/windows-fs.h
+++ b/backends/fs/windows/windows-fs.h
@@ -37,7 +37,7 @@
  *
  * Parts of this class are documented in the base interface class, AbstractFSNode.
  */
-class WindowsFilesystemNode : public AbstractFSNode {
+class WindowsFilesystemNode final : public AbstractFSNode {
 protected:
 	Common::String _displayName;
 	Common::String _path;
@@ -66,21 +66,21 @@ public:
 	 */
 	WindowsFilesystemNode(const Common::String &path, const bool currentDir);
 
-	virtual bool exists() const;
-	virtual Common::String getDisplayName() const { return _displayName; }
-	virtual Common::String getName() const { return _displayName; }
-	virtual Common::String getPath() const { return _path; }
-	virtual bool isDirectory() const { return _isDirectory; }
-	virtual bool isReadable() const;
-	virtual bool isWritable() const;
+	virtual bool exists() const override;
+	virtual Common::String getDisplayName() const override { return _displayName; }
+	virtual Common::String getName() const override { return _displayName; }
+	virtual Common::String getPath() const override { return _path; }
+	virtual bool isDirectory() const override { return _isDirectory; }
+	virtual bool isReadable() const override;
+	virtual bool isWritable() const override;
 
-	virtual AbstractFSNode *getChild(const Common::String &n) const;
-	virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const;
-	virtual AbstractFSNode *getParent() const;
+	virtual AbstractFSNode *getChild(const Common::String &n) const override;
+	virtual bool getChildren(AbstractFSList &list, ListMode mode, bool hidden) const override;
+	virtual AbstractFSNode *getParent() const override;
 
-	virtual Common::SeekableReadStream *createReadStream();
-	virtual Common::WriteStream *createWriteStream();
-	virtual bool createDirectory();
+	virtual Common::SeekableReadStream *createReadStream() override;
+	virtual Common::WriteStream *createWriteStream() override;
+	virtual bool createDirectory() override;
 
 private:
 	/**
diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index 36c9f0a94a..41450ae32a 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -44,7 +44,7 @@
 //
 ////////////////////////////////////////
 
-class MidiDriver_WIN : public MidiDriver_MPU401 {
+class MidiDriver_WIN final : public MidiDriver_MPU401 {
 private:
 	MIDIHDR _streamHeader;
 	byte _streamBuffer[266];	// SysEx blocks should be no larger than 266 bytes
@@ -57,11 +57,11 @@ private:
 
 public:
 	MidiDriver_WIN(int deviceIndex) : _isOpen(false), _device(deviceIndex) { }
-	int open();
-	bool isOpen() const { return _isOpen; }
-	void close();
+	int open() override;
+	bool isOpen() const override { return _isOpen; }
+	void close() override;
 	void send(uint32 b) override;
-	void sysEx(const byte *msg, uint16 length);
+	void sysEx(const byte *msg, uint16 length) override;
 };
 
 int MidiDriver_WIN::open() {
diff --git a/backends/platform/sdl/win32/win32-window.h b/backends/platform/sdl/win32/win32-window.h
index 7498e3fc34..0f10f93bd5 100644
--- a/backends/platform/sdl/win32/win32-window.h
+++ b/backends/platform/sdl/win32/win32-window.h
@@ -27,9 +27,9 @@
 
 #include "backends/platform/sdl/sdl-window.h"
 
-class SdlWindow_Win32 : public SdlWindow {
+class SdlWindow_Win32 final : public SdlWindow {
 public:
-	virtual void setupIcon();
+	virtual void setupIcon() override;
 	HWND getHwnd();
 };
 
diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp
index 468d5d15ec..0c9d844a9d 100644
--- a/backends/platform/sdl/win32/win32.cpp
+++ b/backends/platform/sdl/win32/win32.cpp
@@ -312,15 +312,15 @@ Common::String OSystem_Win32::getDefaultLogFileName() {
 
 namespace {
 
-class Win32ResourceArchive : public Common::Archive {
+class Win32ResourceArchive final : public Common::Archive {
 	friend BOOL CALLBACK EnumResNameProc(HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam);
 public:
 	Win32ResourceArchive();
 
-	virtual bool hasFile(const Common::String &name) const;
-	virtual int listMembers(Common::ArchiveMemberList &list) const;
-	virtual const Common::ArchiveMemberPtr getMember(const Common::String &name) const;
-	virtual Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
+	virtual bool hasFile(const Common::String &name) const override;
+	virtual int listMembers(Common::ArchiveMemberList &list) const override;
+	virtual const Common::ArchiveMemberPtr getMember(const Common::String &name) const override;
+	virtual Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const override;
 private:
 	typedef Common::List<Common::String> FilenameList;
 
diff --git a/backends/platform/sdl/win32/win32.h b/backends/platform/sdl/win32/win32.h
index e7c3485526..03cf6036ab 100644
--- a/backends/platform/sdl/win32/win32.h
+++ b/backends/platform/sdl/win32/win32.h
@@ -26,36 +26,36 @@
 #include "backends/platform/sdl/sdl.h"
 #include "backends/platform/sdl/win32/win32-window.h"
 
-class OSystem_Win32 : public OSystem_SDL {
+class OSystem_Win32 final : public OSystem_SDL {
 public:
-	virtual void init();
-	virtual void initBackend();
+	virtual void init() override;
+	virtual void initBackend() override;
 
-	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
+	virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0) override;
 
-	virtual bool hasFeature(Feature f);
+	virtual bool hasFeature(Feature f) override;
 
-	virtual bool displayLogFile();
+	virtual bool displayLogFile() override;
 
-	virtual bool openUrl(const Common::String &url);
+	virtual bool openUrl(const Common::String &url) override;
 
-	virtual void logMessage(LogMessageType::Type type, const char *message);
+	virtual void logMessage(LogMessageType::Type type, const char *message) override;
 
-	virtual Common::String getSystemLanguage() const;
+	virtual Common::String getSystemLanguage() const override;
 
-	virtual Common::String getScreenshotsPath();
+	virtual Common::String getScreenshotsPath() override;
 
 protected:
-	virtual Common::String getDefaultConfigFileName();
-	virtual Common::String getDefaultLogFileName();
+	virtual Common::String getDefaultConfigFileName() override;
+	virtual Common::String getDefaultLogFileName() override;
 
 	// Override createAudioCDManager() to get our Windows-specific
 	// version.
-	virtual AudioCDManager *createAudioCDManager();
+	virtual AudioCDManager *createAudioCDManager() override;
 	
 	HWND getHwnd() { return ((SdlWindow_Win32*)_window)->getHwnd(); }
 
-	virtual char *convertEncoding(const char *to, const char *from, const char *string, size_t length);
+	virtual char *convertEncoding(const char *to, const char *from, const char *string, size_t length) override;
 };
 
 #endif
diff --git a/backends/plugins/win32/win32-provider.cpp b/backends/plugins/win32/win32-provider.cpp
index 85efab4b92..848a3f935c 100644
--- a/backends/plugins/win32/win32-provider.cpp
+++ b/backends/plugins/win32/win32-provider.cpp
@@ -33,7 +33,7 @@
 #include <windows.h>
 
 
-class Win32Plugin : public DynamicPlugin {
+class Win32Plugin final : public DynamicPlugin {
 private:
 	static const TCHAR* toUnicode(const char *x) {
 	#ifndef UNICODE
@@ -49,7 +49,7 @@ private:
 protected:
 	void *_dlHandle;
 
-	virtual VoidFunc findSymbol(const char *symbol) {
+	virtual VoidFunc findSymbol(const char *symbol) override {
 		FARPROC func = GetProcAddress((HMODULE)_dlHandle, toUnicode(symbol));
 		if (!func)
 			debug("Failed loading symbol '%s' from plugin '%s'", symbol, _filename.c_str());
@@ -61,7 +61,7 @@ public:
 	Win32Plugin(const Common::String &filename)
 		: DynamicPlugin(filename), _dlHandle(0) {}
 
-	bool loadPlugin() {
+	virtual bool loadPlugin() override {
 		assert(!_dlHandle);
 		_dlHandle = LoadLibrary(toUnicode(_filename.c_str()));
 
@@ -75,7 +75,7 @@ public:
 		return DynamicPlugin::loadPlugin();
 	}
 
-	void unloadPlugin() {
+	virtual void unloadPlugin() override {
 		DynamicPlugin::unloadPlugin();
 		if (_dlHandle) {
 			if (!FreeLibrary((HMODULE)_dlHandle))
diff --git a/backends/plugins/win32/win32-provider.h b/backends/plugins/win32/win32-provider.h
index 71e6cf098c..e4ad472bd5 100644
--- a/backends/plugins/win32/win32-provider.h
+++ b/backends/plugins/win32/win32-provider.h
@@ -27,11 +27,11 @@
 
 #if defined(DYNAMIC_MODULES) && defined(_WIN32)
 
-class Win32PluginProvider : public FilePluginProvider {
+class Win32PluginProvider final : public FilePluginProvider {
 protected:
-	Plugin* createPlugin(const Common::FSNode &node) const;
+	Plugin* createPlugin(const Common::FSNode &node) const override;
 
-	bool isPluginFilename(const Common::FSNode &node) const;
+	bool isPluginFilename(const Common::FSNode &node) const override;
 };
 
 #endif // defined(DYNAMIC_MODULES) && defined(_WIN32)
diff --git a/backends/saves/windows/windows-saves.h b/backends/saves/windows/windows-saves.h
index d22033273a..66b5b034a8 100644
--- a/backends/saves/windows/windows-saves.h
+++ b/backends/saves/windows/windows-saves.h
@@ -28,7 +28,7 @@
 /**
  * Provides a default savefile manager implementation for common platforms.
  */
-class WindowsSaveFileManager : public DefaultSaveFileManager {
+class WindowsSaveFileManager final : public DefaultSaveFileManager {
 public:
 	WindowsSaveFileManager();
 };
diff --git a/backends/taskbar/win32/win32-taskbar.h b/backends/taskbar/win32/win32-taskbar.h
index 0742e63f4c..18e78b099e 100644
--- a/backends/taskbar/win32/win32-taskbar.h
+++ b/backends/taskbar/win32/win32-taskbar.h
@@ -31,18 +31,18 @@
 class SdlWindow_Win32;
 struct ITaskbarList3;
 
-class Win32TaskbarManager : public Common::TaskbarManager {
+class Win32TaskbarManager final : public Common::TaskbarManager {
 public:
 	Win32TaskbarManager(SdlWindow_Win32 *window);
 	virtual ~Win32TaskbarManager();
 
-	virtual void setOverlayIcon(const Common::String &name, const Common::String &description);
-	virtual void setProgressValue(int completed, int total);
-	virtual void setProgressState(TaskbarProgressState state);
-	virtual void setCount(int count);
-	virtual void addRecent(const Common::String &name, const Common::String &description);
-	virtual void notifyError();
-	virtual void clearError();
+	virtual void setOverlayIcon(const Common::String &name, const Common::String &description) override;
+	virtual void setProgressValue(int completed, int total) override;
+	virtual void setProgressState(TaskbarProgressState state) override;
+	virtual void setCount(int count) override;
+	virtual void addRecent(const Common::String &name, const Common::String &description) override;
+	virtual void notifyError() override;
+	virtual void clearError() override;
 
 private:
 	SdlWindow_Win32 *_window;
diff --git a/backends/text-to-speech/windows/windows-text-to-speech.h b/backends/text-to-speech/windows/windows-text-to-speech.h
index c07f286a9c..8584bc330e 100644
--- a/backends/text-to-speech/windows/windows-text-to-speech.h
+++ b/backends/text-to-speech/windows/windows-text-to-speech.h
@@ -33,7 +33,7 @@
 #include "common/list.h"
 
 
-class WindowsTextToSpeechManager : public Common::TextToSpeechManager {
+class WindowsTextToSpeechManager final : public Common::TextToSpeechManager {
 public:
 	enum SpeechState {
 		READY,
diff --git a/backends/updates/win32/win32-updates.h b/backends/updates/win32/win32-updates.h
index afa2ef99ef..9d04a36e29 100644
--- a/backends/updates/win32/win32-updates.h
+++ b/backends/updates/win32/win32-updates.h
@@ -31,20 +31,20 @@
 
 class SdlWindow_Win32;
 
-class Win32UpdateManager : public Common::UpdateManager {
+class Win32UpdateManager final : public Common::UpdateManager {
 public:
 	Win32UpdateManager(SdlWindow_Win32 *window);
 	virtual ~Win32UpdateManager();
 
-	virtual void checkForUpdates();
+	virtual void checkForUpdates() override;
 
-	virtual void setAutomaticallyChecksForUpdates(UpdateState state);
-	virtual UpdateState getAutomaticallyChecksForUpdates();
+	virtual void setAutomaticallyChecksForUpdates(UpdateState state) override;
+	virtual UpdateState getAutomaticallyChecksForUpdates() override;
 
-	virtual void setUpdateCheckInterval(int interval);
-	virtual int getUpdateCheckInterval();
+	virtual void setUpdateCheckInterval(int interval) override;
+	virtual int getUpdateCheckInterval() override;
 
-	virtual bool getLastUpdateCheckTimeAndDate(TimeDate &t);
+	virtual bool getLastUpdateCheckTimeAndDate(TimeDate &t) override;
 
 private:
 	static int canShutdownCallback();




More information about the Scummvm-git-logs mailing list