COMMON: Use override

Using clang-tidy modernize-use-override
This commit is contained in:
Orgad Shaneh 2021-11-13 22:30:12 +02:00 committed by Filippos Karapetis
parent 2e2a613e23
commit 7adcd48a41
13 changed files with 72 additions and 72 deletions

View File

@ -252,17 +252,17 @@ public:
*/
void setPriority(const String& name, int priority);
virtual bool hasFile(const Path &path) const;
virtual int listMatchingMembers(ArchiveMemberList &list, const Path &pattern) const;
virtual int listMembers(ArchiveMemberList &list) const;
bool hasFile(const Path &path) const override;
int listMatchingMembers(ArchiveMemberList &list, const Path &pattern) const override;
int listMembers(ArchiveMemberList &list) const override;
virtual const ArchiveMemberPtr getMember(const Path &path) const;
const ArchiveMemberPtr getMember(const Path &path) const override;
/**
* Implement createReadStreamForMember from the Archive base class. The current policy is
* opening the first file encountered that matches the name.
*/
virtual SeekableReadStream *createReadStreamForMember(const Path &path) const;
SeekableReadStream *createReadStreamForMember(const Path &path) const override;
/**
* Ignore clashes when adding directories. For more details, see the corresponding parameter

View File

@ -167,14 +167,14 @@ public:
bool err() const override;
void clearErr() override;
virtual uint32 write(const void *dataPtr, uint32 dataSize) override;
uint32 write(const void *dataPtr, uint32 dataSize) override;
virtual bool flush() override;
bool flush() override;
virtual int64 pos() const override;
int64 pos() const override;
virtual bool seek(int64 offset, int whence = SEEK_SET) override;
virtual int64 size() const override;
bool seek(int64 offset, int whence = SEEK_SET) override;
int64 size() const override;
};
/** @} */

View File

@ -371,29 +371,29 @@ public:
* Check for the existence of a file in the cache. A full match of relative path and file name
* is needed for success.
*/
virtual bool hasFile(const Path &path) const;
bool hasFile(const Path &path) const override;
/**
* Return a list of matching file names. Pattern can use GLOB wildcards.
*/
virtual int listMatchingMembers(ArchiveMemberList &list, const Path &pattern) const;
int listMatchingMembers(ArchiveMemberList &list, const Path &pattern) const override;
/**
* Return a list of all the files in the cache.
*/
virtual int listMembers(ArchiveMemberList &list) const;
int listMembers(ArchiveMemberList &list) const override;
/**
* Get an ArchiveMember representation of the specified file. A full match of relative
* path and file name is needed for success.
*/
virtual const ArchiveMemberPtr getMember(const Path &path) const;
const ArchiveMemberPtr getMember(const Path &path) const override;
/**
* Open the specified file. A full match of relative path and file name is needed
* for success.
*/
virtual SeekableReadStream *createReadStreamForMember(const Path &path) const;
SeekableReadStream *createReadStreamForMember(const Path &path) const override;
};
/** @} */

View File

@ -64,10 +64,10 @@ public:
void close();
// Archive API implementation
virtual bool hasFile(const Path &path) const;
virtual int listMembers(ArchiveMemberList &list) const;
virtual const ArchiveMemberPtr getMember(const Path &path) const;
virtual SeekableReadStream *createReadStreamForMember(const Path &path) const;
bool hasFile(const Path &path) const override;
int listMembers(ArchiveMemberList &list) const override;
const ArchiveMemberPtr getMember(const Path &path) const override;
SeekableReadStream *createReadStreamForMember(const Path &path) const override;
private:
struct FileEntry {

View File

@ -60,9 +60,9 @@ private:
public:
virtual ~LuaFileConfig();
virtual bool eof() const override { return _readPos >= _readData.size(); }
virtual size_t read(void *ptr, size_t size, size_t count) override;
virtual size_t write(const char *ptr, size_t count) override;
bool eof() const override { return _readPos >= _readData.size(); }
size_t read(void *ptr, size_t size, size_t count) override;
size_t write(const char *ptr, size_t count) override;
};
class LuaFileRead : public LuaFileProxy {
@ -74,9 +74,9 @@ public:
public:
virtual ~LuaFileRead() {}
virtual bool eof() const override;
virtual size_t read(void *ptr, size_t size, size_t count) override;
virtual size_t write(const char *ptr, size_t count) override;
bool eof() const override;
size_t read(void *ptr, size_t size, size_t count) override;
size_t write(const char *ptr, size_t count) override;
};
} // End of namespace Lua

View File

@ -126,13 +126,13 @@ public:
return dataSize;
}
virtual int64 pos() const override { return _pos; }
virtual int64 size() const override { return _bufSize; }
int64 pos() const override { return _pos; }
int64 size() const override { return _bufSize; }
virtual bool err() const override { return _err; }
virtual void clearErr() override { _err = false; }
bool err() const override { return _err; }
void clearErr() override { _err = false; }
virtual bool seek(int64 offset, int whence = SEEK_SET) override { return false; }
bool seek(int64 offset, int whence = SEEK_SET) override { return false; }
};
/**
@ -144,7 +144,7 @@ private:
public:
SeekableMemoryWriteStream(byte *buf, uint32 len) : MemoryWriteStream(buf, len), _ptrOrig(buf) {}
virtual bool seek(int64 offset, int whence = SEEK_SET) override {
bool seek(int64 offset, int whence = SEEK_SET) override {
switch (whence) {
case SEEK_END:
// SEEK_END works just like SEEK_SET, only 'reversed',
@ -232,12 +232,12 @@ public:
return dataSize;
}
virtual int64 pos() const override { return _pos; }
virtual int64 size() const override { return _size; }
int64 pos() const override { return _pos; }
int64 size() const override { return _size; }
byte *getData() { return _data; }
virtual bool seek(int64 offs, int whence = SEEK_SET) override {
bool seek(int64 offs, int whence = SEEK_SET) override {
// Pre-Condition
assert(_pos <= _size);
switch (whence) {
@ -325,7 +325,7 @@ public:
return dataSize;
}
virtual uint32 read(void *dataPtr, uint32 dataSize) override {
uint32 read(void *dataPtr, uint32 dataSize) override {
if (_length < dataSize) {
dataSize = _length;
_eos = true;
@ -343,11 +343,11 @@ public:
return dataSize;
}
virtual int64 pos() const override { return _pos - _length; }
virtual int64 size() const override { return _size; }
virtual bool seek(int64, int) override { return false; }
virtual bool eos() const override { return _eos; }
virtual void clearErr() override { _eos = false; }
int64 pos() const override { return _pos - _length; }
int64 size() const override { return _size; }
bool seek(int64, int) override { return false; }
bool eos() const override { return _eos; }
void clearErr() override { _eos = false; }
byte *getData() { return _data; }
};

View File

@ -68,7 +68,7 @@ public:
*
* The periodical polling is used to update the OSD messages.
*/
virtual bool pollEvent(Common::Event &event) override;
bool pollEvent(Common::Event &event) override;
private:
Mutex _mutex;

View File

@ -314,11 +314,11 @@ public:
BufferedReadStream(ReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream);
virtual ~BufferedReadStream();
virtual bool eos() const { return _eos; }
virtual bool err() const { return _parentStream->err(); }
virtual void clearErr() { _eos = false; _parentStream->clearErr(); }
bool eos() const override { return _eos; }
bool err() const override { return _parentStream->err(); }
void clearErr() override { _eos = false; _parentStream->clearErr(); }
virtual uint32 read(void *dataPtr, uint32 dataSize);
uint32 read(void *dataPtr, uint32 dataSize) override;
};
BufferedReadStream::BufferedReadStream(ReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream)
@ -416,10 +416,10 @@ protected:
public:
BufferedSeekableReadStream(SeekableReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream = DisposeAfterUse::NO);
virtual int64 pos() const { return _parentStream->pos() - (_bufSize - _pos); }
virtual int64 size() const { return _parentStream->size(); }
int64 pos() const override { return _parentStream->pos() - (_bufSize - _pos); }
int64 size() const override { return _parentStream->size(); }
virtual bool seek(int64 offset, int whence = SEEK_SET);
bool seek(int64 offset, int whence = SEEK_SET) override;
};
BufferedSeekableReadStream::BufferedSeekableReadStream(SeekableReadStream *parentStream, uint32 bufSize, DisposeAfterUse::Flag disposeParentStream)

View File

@ -103,10 +103,10 @@ public:
ReadStreamEndian(bigEndian) {
}
virtual int64 pos() const override { return SeekableSubReadStream::pos(); }
virtual int64 size() const override { return SeekableSubReadStream::size(); }
int64 pos() const override { return SeekableSubReadStream::pos(); }
int64 size() const override { return SeekableSubReadStream::size(); }
virtual bool seek(int64 offset, int whence = SEEK_SET) override { return SeekableSubReadStream::seek(offset, whence); }
bool seek(int64 offset, int whence = SEEK_SET) override { return SeekableSubReadStream::seek(offset, whence); }
void hexdump(int len, int bytesPerLine = 16, int startOffset = 0) { SeekableSubReadStream::hexdump(len, bytesPerLine, startOffset); }
bool skip(uint32 offset) override { return SeekableSubReadStream::seek(offset, SEEK_CUR); }
};

View File

@ -702,10 +702,10 @@ public:
virtual ~ArjArchive();
// Archive implementation
virtual bool hasFile(const Path &path) const;
virtual int listMembers(ArchiveMemberList &list) const;
virtual const ArchiveMemberPtr getMember(const Path &path) const;
virtual SeekableReadStream *createReadStreamForMember(const Path &path) const;
bool hasFile(const Path &path) const override;
int listMembers(ArchiveMemberList &list) const override;
const ArchiveMemberPtr getMember(const Path &path) const override;
SeekableReadStream *createReadStreamForMember(const Path &path) const override;
};
ArjArchive::ArjArchive(const String &filename) : _arjFilename(filename) {

View File

@ -1429,10 +1429,10 @@ public:
~ZipArchive();
virtual bool hasFile(const Path &path) const;
virtual int listMembers(ArchiveMemberList &list) const;
virtual const ArchiveMemberPtr getMember(const Path &path) const;
virtual SeekableReadStream *createReadStreamForMember(const Path &path) const;
bool hasFile(const Path &path) const override;
int listMembers(ArchiveMemberList &list) const override;
const ArchiveMemberPtr getMember(const Path &path) const override;
SeekableReadStream *createReadStreamForMember(const Path &path) const override;
};
/*

View File

@ -78,7 +78,7 @@ class SeekableReadStream;
typedef bool (parserName::*ParserCallback)(ParserNode *node);\
ParserCallback callback;\
bool doCallback(XMLParser *parent, ParserNode *node) {return ((kLocalParserName *)parent->*callback)(node);} };\
virtual void buildLayout() override { \
void buildLayout() override { \
Common::Stack<XMLKeyLayout *> layout; \
CustomXMLKeyLayout *lay = 0; \
XMLKeyLayout::XMLKeyProperty prop; \

View File

@ -284,13 +284,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;
@ -313,16 +313,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:
@ -439,18 +439,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;
@ -470,7 +470,7 @@ public:
_wrapped->finalize();
}
uint32 write(const void *dataPtr, uint32 dataSize) {
uint32 write(const void *dataPtr, uint32 dataSize) override {
if (err())
return 0;
@ -487,7 +487,7 @@ public:
return dataSize - _stream.avail_in;
}
virtual int64 pos() const { return _pos; }
int64 pos() const override { return _pos; }
};
#endif // USE_ZLIB