mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 08:17:40 +00:00
COMMON: Use override
Using clang-tidy modernize-use-override
This commit is contained in:
parent
2e2a613e23
commit
7adcd48a41
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
/** @} */
|
||||
|
10
common/fs.h
10
common/fs.h
@ -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;
|
||||
};
|
||||
|
||||
/** @} */
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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; }
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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); }
|
||||
};
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -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; \
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user