JANITORIAL: Use override

Using clang-tidy modernize-use-override
This commit is contained in:
Orgad Shaneh 2021-11-13 23:28:45 +02:00 committed by Filippos Karapetis
parent 94e0595c23
commit 2e68b4ffdc
7 changed files with 50 additions and 50 deletions

View File

@ -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 {

View File

@ -86,7 +86,7 @@ public:
~StaticPluginProvider() {
}
virtual PluginList getPlugins() {
PluginList getPlugins() override {
PluginList pl;
#define LINK_PLUGIN(ID) \

View File

@ -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

View File

@ -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

View File

@ -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));
}
};

View File

@ -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() {

View File

@ -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;