[Scummvm-git-logs] scummvm master -> 2e68b4ffdcb37e03365149c4c3d3772b367f8f28

bluegr bluegr at gmail.com
Sun Nov 14 00:59:25 UTC 2021


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:
2e68b4ffdc JANITORIAL: Use override


Commit: 2e68b4ffdcb37e03365149c4c3d3772b367f8f28
    https://github.com/scummvm/scummvm/commit/2e68b4ffdcb37e03365149c4c3d3772b367f8f28
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2021-11-14T02:59:23+02:00

Commit Message:
JANITORIAL: Use override

Using clang-tidy modernize-use-override

Changed paths:
    backends/midi/windows.cpp
    base/plugins.cpp
    devtools/create_neverhood/create_neverhood.cpp
    devtools/create_titanic/zlib.cpp
    graphics/larryScale.cpp
    graphics/wincursor.cpp
    video/bink_decoder.cpp


diff --git a/backends/midi/windows.cpp b/backends/midi/windows.cpp
index 03793f7e3d..73ebd1e373 100644
--- a/backends/midi/windows.cpp
+++ b/backends/midi/windows.cpp
@@ -165,16 +165,16 @@ void MidiDriver_WIN::check_error(MMRESULT result) {
 
 class WindowsMusicPlugin : public MusicPluginObject {
 public:
-	const char *getName() const {
+	const char *getName() const override {
 		return _s("Windows MIDI");
 	}
 
-	const char *getId() const {
+	const char *getId() const override {
 		return "windows";
 	}
 
-	MusicDevices getDevices() const;
-	Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const;
+	MusicDevices getDevices() const override;
+	Common::Error createInstance(MidiDriver **mididriver, MidiDriver::DeviceHandle = 0) const override;
 };
 
 MusicDevices WindowsMusicPlugin::getDevices() const {
diff --git a/base/plugins.cpp b/base/plugins.cpp
index b0675c6e5a..09b731aab8 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -86,7 +86,7 @@ public:
 	~StaticPluginProvider() {
 	}
 
-	virtual PluginList getPlugins() {
+	PluginList getPlugins() override {
 		PluginList pl;
 
 		#define LINK_PLUGIN(ID) \
diff --git a/devtools/create_neverhood/create_neverhood.cpp b/devtools/create_neverhood/create_neverhood.cpp
index d71911c11c..8940abc6c1 100644
--- a/devtools/create_neverhood/create_neverhood.cpp
+++ b/devtools/create_neverhood/create_neverhood.cpp
@@ -393,7 +393,7 @@ class RectList : public StaticDataList<RectItem> {
 class MessageList : public StaticDataList<MessageItem> {
 public:
 
-	virtual bool specialLoadList(uint32 count, uint32 offset) {
+	bool specialLoadList(uint32 count, uint32 offset) override {
 		// Special code for message lists which are set at runtime (but otherwise constant)
 		switch (offset) {
 		// Scene 1002 rings
diff --git a/devtools/create_titanic/zlib.cpp b/devtools/create_titanic/zlib.cpp
index 06ff38b13a..8cc916e8b0 100644
--- a/devtools/create_titanic/zlib.cpp
+++ b/devtools/create_titanic/zlib.cpp
@@ -219,13 +219,13 @@ public:
 		inflateEnd(&_stream);
 	}
 
-	bool err() const { return (_zlibErr != Z_OK) && (_zlibErr != Z_STREAM_END); }
-	void clearErr() {
+	bool err() const override { return (_zlibErr != Z_OK) && (_zlibErr != Z_STREAM_END); }
+	void clearErr() override {
 		// only reset _eos; I/O errors are not recoverable
 		_eos = false;
 	}
 
-	uint32 read(void *dataPtr, uint32 dataSize) {
+	uint32 read(void *dataPtr, uint32 dataSize) override {
 		_stream.next_out = (byte *)dataPtr;
 		_stream.avail_out = dataSize;
 
@@ -248,16 +248,16 @@ public:
 		return dataSize - _stream.avail_out;
 	}
 
-	bool eos() const {
+	bool eos() const override {
 		return _eos;
 	}
-	int64 pos() const {
+	int64 pos() const override {
 		return _pos;
 	}
-	int64 size() const {
+	int64 size() const override {
 		return _origSize;
 	}
-	bool seek(int64 offset, int whence = SEEK_SET) {
+	bool seek(int64 offset, int whence = SEEK_SET) override {
 		int32 newPos = 0;
 		switch (whence) {
 		default:
@@ -374,18 +374,18 @@ public:
 		deflateEnd(&_stream);
 	}
 
-	bool err() const {
+	bool err() const override {
 		// CHECKME: does Z_STREAM_END make sense here?
 		return (_zlibErr != Z_OK && _zlibErr != Z_STREAM_END) || _wrapped->err();
 	}
 
-	void clearErr() {
+	void clearErr() override {
 		// Note: we don't reset the _zlibErr here, as it is not
 		// clear in general how
 		_wrapped->clearErr();
 	}
 
-	void finalize() {
+	void finalize() override {
 		if (_zlibErr != Z_OK)
 			return;
 
@@ -405,7 +405,7 @@ public:
 		_wrapped->finalize();
 	}
 
-	uint32 write(const void *dataPtr, uint32 dataSize) {
+	uint32 write(const void *dataPtr, uint32 dataSize) override {
 		if (err())
 			return 0;
 
@@ -422,7 +422,7 @@ public:
 		return dataSize - _stream.avail_in;
 	}
 
-	virtual int64 pos() const { return _pos; }
+	int64 pos() const override { return _pos; }
 };
 
 #endif	// USE_ZLIB
diff --git a/graphics/larryScale.cpp b/graphics/larryScale.cpp
index 331baaeb68..c873f1b819 100644
--- a/graphics/larryScale.cpp
+++ b/graphics/larryScale.cpp
@@ -143,7 +143,7 @@ public:
 	explicit MarginedBitmapWriter(MarginedBitmap<Color> &target)
 		: _target(target) {}
 
-	void writeRow(int y, const LarryScaleColor *row) {
+	void writeRow(int y, const LarryScaleColor *row) override {
 		memcpy(_target.getPointerTo(0, y), row, _target.getWidth() * sizeof(Color));
 	}
 };
diff --git a/graphics/wincursor.cpp b/graphics/wincursor.cpp
index 9867e352f4..26b82a84da 100644
--- a/graphics/wincursor.cpp
+++ b/graphics/wincursor.cpp
@@ -35,21 +35,21 @@ public:
 	~WinCursor();
 
 	/** Return the cursor's width. */
-	uint16 getWidth() const;
+	uint16 getWidth() const override;
 	/** Return the cursor's height. */
-	uint16 getHeight() const;
+	uint16 getHeight() const override;
 	/** Return the cursor's hotspot's x coordinate. */
-	uint16 getHotspotX() const;
+	uint16 getHotspotX() const override;
 	/** Return the cursor's hotspot's y coordinate. */
-	uint16 getHotspotY() const;
+	uint16 getHotspotY() const override;
 	/** Return the cursor's transparent key. */
-	byte getKeyColor() const;
+	byte getKeyColor() const override;
 
-	const byte *getSurface() const { return _surface; }
+	const byte *getSurface() const override { return _surface; }
 
-	const byte *getPalette() const { return _palette; }
-	byte getPaletteStartIndex() const { return 0; }
-	uint16 getPaletteCount() const { return 256; }
+	const byte *getPalette() const override { return _palette; }
+	byte getPaletteStartIndex() const override { return 0; }
+	uint16 getPaletteCount() const override { return 256; }
 
 	/** Read the cursor's data out of a stream. */
 	bool readFromStream(Common::SeekableReadStream &stream);
@@ -304,13 +304,13 @@ public:
 	DefaultWinCursor() {}
 	~DefaultWinCursor() {}
 
-	uint16 getWidth() const { return 12; }
-	uint16 getHeight() const { return 20; }
-	uint16 getHotspotX() const { return 0; }
-	uint16 getHotspotY() const { return 0; }
-	byte getKeyColor() const { return 0; }
+	uint16 getWidth() const override { return 12; }
+	uint16 getHeight() const override { return 20; }
+	uint16 getHotspotX() const override { return 0; }
+	uint16 getHotspotY() const override { return 0; }
+	byte getKeyColor() const override { return 0; }
 
-	const byte *getSurface() const {
+	const byte *getSurface() const override {
 		static const byte defaultCursor[] = {
 			1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 			1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -337,7 +337,7 @@ public:
 		return defaultCursor;
 	}
 
-	const byte *getPalette() const {
+	const byte *getPalette() const override {
 		static const byte bwPalette[] = {
 			0x00, 0x00, 0x00,	// Black
 			0xFF, 0xFF, 0xFF	// White
@@ -345,8 +345,8 @@ public:
 
 		return bwPalette;
 	}
-	byte getPaletteStartIndex() const { return 1; }
-	uint16 getPaletteCount() const { return 2; }
+	byte getPaletteStartIndex() const override { return 1; }
+	uint16 getPaletteCount() const override { return 2; }
 };
 
 Cursor *makeDefaultWinCursor() {
@@ -361,13 +361,13 @@ public:
 	BusyWinCursor() {}
 	~BusyWinCursor() {}
 
-	uint16 getWidth() const { return 15; }
-	uint16 getHeight() const { return 27; }
-	uint16 getHotspotX() const { return 7; }
-	uint16 getHotspotY() const { return 13; }
-	byte getKeyColor() const { return 0; }
+	uint16 getWidth() const override { return 15; }
+	uint16 getHeight() const override { return 27; }
+	uint16 getHotspotX() const override { return 7; }
+	uint16 getHotspotY() const override { return 13; }
+	byte getKeyColor() const override { return 0; }
 
-	const byte *getSurface() const {
+	const byte *getSurface() const override {
 		static const byte busyCursor[] = {
 			1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 			1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -401,7 +401,7 @@ public:
 		return busyCursor;
 	}
 
-	const byte *getPalette() const {
+	const byte *getPalette() const override {
 		static const byte bwPalette[] = {
 			0x00, 0x00, 0x00,	// Black
 			0xFF, 0xFF, 0xFF	// White
@@ -409,8 +409,8 @@ public:
 
 		return bwPalette;
 	}
-	byte getPaletteStartIndex() const { return 1; }
-	uint16 getPaletteCount() const { return 2; }
+	byte getPaletteStartIndex() const override { return 1; }
+	uint16 getPaletteCount() const override { return 2; }
 };
 
 Cursor *makeBusyWinCursor() {
diff --git a/video/bink_decoder.cpp b/video/bink_decoder.cpp
index b420e61c7e..d30c7eb5f4 100644
--- a/video/bink_decoder.cpp
+++ b/video/bink_decoder.cpp
@@ -333,14 +333,14 @@ class SilentAudioStream : public Audio::AudioStream {
 public:
 	SilentAudioStream(int rate, bool stereo) : _rate(rate), _isStereo(stereo) {}
 
-	int readBuffer(int16 *buffer, const int numSamples) {
+	int readBuffer(int16 *buffer, const int numSamples) override {
 		memset(buffer, 0, numSamples * 2);
 		return numSamples;
 	}
 
-	bool endOfData() const { return false; } // it never ends!
-	bool isStereo() const { return _isStereo; }
-	int getRate() const { return _rate; }
+	bool endOfData() const override { return false; } // it never ends!
+	bool isStereo() const override { return _isStereo; }
+	int getRate() const override { return _rate; }
 
 private:
 	int _rate;




More information about the Scummvm-git-logs mailing list