rest of virtuals removed

virtuals removed and replaced with override where necessary on the rest of the code base, clang-tidy to the rescue.
This commit is contained in:
marauder2k7 2024-03-18 18:40:22 +00:00
parent efbe5e90f5
commit 2b295fb7f0
454 changed files with 4162 additions and 4156 deletions

View file

@ -31,7 +31,7 @@ class DXT5nmSwizzle : public Swizzle<U8, 4>
public:
DXT5nmSwizzle() : Swizzle<U8, 4>( NULL ) {};
virtual void InPlace( void *memory, const dsize_t size ) const
void InPlace( void *memory, const dsize_t size ) const override
{
AssertFatal( size % 4 == 0, "Bad buffer size for DXT5nm Swizzle" );
@ -50,7 +50,7 @@ public:
}
}
virtual void ToBuffer( void *destination, const void *source, const dsize_t size ) const
void ToBuffer( void *destination, const void *source, const dsize_t size ) const override
{
AssertFatal( size % 4 == 0, "Bad buffer size for DXT5nm Swizzle" );
@ -77,12 +77,12 @@ class DXT5nmSwizzleUp24t32 : public Swizzle<U8, 3>
public:
DXT5nmSwizzleUp24t32() : Swizzle<U8, 3>( NULL ) {};
virtual void InPlace( void *memory, const dsize_t size ) const
void InPlace( void *memory, const dsize_t size ) const override
{
AssertISV( false, "Cannot swizzle in place a 24->32 bit swizzle." );
}
virtual void ToBuffer( void *destination, const void *source, const dsize_t size ) const
void ToBuffer( void *destination, const void *source, const dsize_t size ) const override
{
AssertFatal( size % 3 == 0, "Bad buffer size for DXT5nm Swizzle" );
const S32 pixels = size / 3;

View file

@ -81,9 +81,9 @@ class NullSwizzle : public Swizzle<T, mapLength>
public:
NullSwizzle( const dsize_t *map = NULL ) : Swizzle<T, mapLength>( map ) {};
virtual void InPlace( void *memory, const dsize_t size ) const {}
void InPlace( void *memory, const dsize_t size ) const override {}
virtual void ToBuffer( void *destination, const void *source, const dsize_t size ) const
void ToBuffer( void *destination, const void *source, const dsize_t size ) const override
{
dMemcpy( destination, source, size );
}

View file

@ -65,8 +65,8 @@ public:
CentralDir(FileHeader &fh);
virtual ~CentralDir();
virtual bool read(Stream *stream);
virtual bool write(Stream *stream);
bool read(Stream *stream) override;
bool write(Stream *stream) override;
void setFileComment(const char *comment);
};

View file

@ -51,15 +51,15 @@ public:
inline void setFileEndPos(S32 pos) { mFileEndPos = pos; }
// Overrides of FilterStream
bool attachStream(Stream* io_pSlaveStream);
void detachStream();
Stream *getStream() { return mStream; }
bool attachStream(Stream* io_pSlaveStream) override;
void detachStream() override;
Stream *getStream() override { return mStream; }
U32 getPosition() const;
bool setPosition(const U32 in_newPosition);
U32 getPosition() const override;
bool setPosition(const U32 in_newPosition) override;
protected:
bool _read(const U32 in_numBytes, void* out_pBuffer);
bool _read(const U32 in_numBytes, void* out_pBuffer) override;
void updateKeys(const U8 c);
U8 decryptByte();

View file

@ -109,7 +109,7 @@ protected:
CentralDir *mCD;
virtual bool _write(const U32 numBytes, const void *buffer)
bool _write(const U32 numBytes, const void *buffer) override
{
if(! mStream->write(numBytes, buffer))
return false;
@ -120,7 +120,7 @@ protected:
return true;
}
virtual bool _read(const U32 numBytes, void *buffer)
bool _read(const U32 numBytes, void *buffer) override
{
if(! mStream->read(numBytes, buffer))
return false;
@ -139,7 +139,7 @@ public:
detachStream();
}
virtual bool attachStream(Stream *stream)
bool attachStream(Stream *stream) override
{
if(mCD == NULL)
return false;
@ -150,7 +150,7 @@ public:
return true;
}
virtual void detachStream()
void detachStream() override
{
if(mStream == NULL)
return;
@ -160,7 +160,7 @@ public:
mStream = NULL;
}
virtual Stream *getStream() { return mStream; }
Stream *getStream() override { return mStream; }
void setCentralDir(CentralDir *cd) { mCD = cd; }
CentralDir *getCentralDir() { return mCD; }

View file

@ -47,8 +47,8 @@ class ZipSubRStream : public FilterStream, public IStreamByteCount
U32 fillBuffer(const U32 in_attemptSize);
public:
virtual U32 getLastBytesRead() { return m_lastBytesRead; }
virtual U32 getLastBytesWritten() { return 0; }
U32 getLastBytesRead() override { return m_lastBytesRead; }
U32 getLastBytesWritten() override { return 0; }
public:
@ -57,23 +57,23 @@ public:
// Overrides of NFilterStream
public:
bool attachStream(Stream* io_pSlaveStream);
void detachStream();
Stream* getStream();
bool attachStream(Stream* io_pSlaveStream) override;
void detachStream() override;
Stream* getStream() override;
void setUncompressedSize(const U32);
// Mandatory overrides. By default, these are simply passed to
// whatever is returned from getStream();
protected:
bool _read(const U32 in_numBytes, void* out_pBuffer);
bool _read(const U32 in_numBytes, void* out_pBuffer) override;
public:
bool hasCapability(const Capability) const;
bool hasCapability(const Capability) const override;
U32 getPosition() const;
bool setPosition(const U32 in_newPosition);
U32 getPosition() const override;
bool setPosition(const U32 in_newPosition) override;
U32 getStreamSize();
U32 getStreamSize() override;
};
class ZipSubWStream : public FilterStream, public IStreamByteCount
@ -91,8 +91,8 @@ class ZipSubWStream : public FilterStream, public IStreamByteCount
U32 m_lastBytesWritten;
public:
virtual U32 getLastBytesRead() { return m_lastBytesRead; }
virtual U32 getLastBytesWritten() { return m_lastBytesWritten; }
U32 getLastBytesRead() override { return m_lastBytesRead; }
U32 getLastBytesWritten() override { return m_lastBytesWritten; }
public:
ZipSubWStream();
@ -100,22 +100,22 @@ public:
// Overrides of NFilterStream
public:
bool attachStream(Stream* io_pSlaveStream);
void detachStream();
Stream* getStream();
bool attachStream(Stream* io_pSlaveStream) override;
void detachStream() override;
Stream* getStream() override;
// Mandatory overrides. By default, these are simply passed to
// whatever is returned from getStream();
protected:
bool _read(const U32 in_numBytes, void* out_pBuffer);
bool _write(const U32 in_numBytes, const void* in_pBuffer);
bool _read(const U32 in_numBytes, void* out_pBuffer) override;
bool _write(const U32 in_numBytes, const void* in_pBuffer) override;
public:
bool hasCapability(const Capability) const;
bool hasCapability(const Capability) const override;
U32 getPosition() const;
bool setPosition(const U32 in_newPosition);
U32 getPosition() const override;
bool setPosition(const U32 in_newPosition) override;
U32 getStreamSize();
U32 getStreamSize() override;
};
#endif //_ZIPSUBSTREAM_H_

View file

@ -60,7 +60,7 @@ public:
return open(String(), Torque::FS::File::ReadWrite);
}
virtual void close()
void close() override
{
Parent::close();
@ -70,7 +70,7 @@ public:
}
/// Disallow setPosition()
virtual bool setPosition(const U32 i_newPosition) { return false; }
bool setPosition(const U32 i_newPosition) override { return false; }
/// Seek back to the start of the file.
/// This is used internally by the zip code and should never be called whilst

View file

@ -54,8 +54,8 @@ public:
close();
}
virtual Path getName() const { return mZipFilename; }
virtual NodeStatus getStatus() const
Path getName() const override { return mZipFilename; }
NodeStatus getStatus() const override
{
if (mZipStream)
{
@ -76,7 +76,7 @@ public:
return FileNode::Closed;
}
virtual bool getAttributes(Attributes* attr)
bool getAttributes(Attributes* attr) override
{
if (!attr)
return false;
@ -92,7 +92,7 @@ public:
return true;
}
virtual U32 getPosition()
U32 getPosition() override
{
if (mZipStream)
return mZipStream->getPosition();
@ -100,7 +100,7 @@ public:
return 0;
}
virtual U32 setPosition(U32 pos, SeekMode mode)
U32 setPosition(U32 pos, SeekMode mode) override
{
if (!mZipStream || mode != Begin)
return 0;
@ -108,7 +108,7 @@ public:
return mZipStream->setPosition(pos);
}
virtual bool open(AccessMode mode)
bool open(AccessMode mode) override
{
// stream is already open so just check to make sure that they are using a valid mode
if (mode == Read)
@ -120,7 +120,7 @@ public:
}
}
virtual bool close()
bool close() override
{
if (mZipStream != NULL && mArchive != NULL)
{
@ -131,7 +131,7 @@ public:
return true;
}
virtual U32 read(void* dst, U32 size)
U32 read(void* dst, U32 size) override
{
if (mZipStream && mZipStream->read(size, dst) && mByteCount)
return mByteCount->getLastBytesRead();
@ -139,7 +139,7 @@ public:
return 0;
}
virtual U32 write(const void* src, U32 size)
U32 write(const void* src, U32 size) override
{
if (mZipStream && mZipStream->write(size, src) && mByteCount)
return mByteCount->getLastBytesWritten();
@ -148,7 +148,7 @@ public:
}
protected:
virtual U32 calculateChecksum()
U32 calculateChecksum() override
{
// JMQ: implement
return 0;
@ -180,15 +180,15 @@ public:
{
}
Torque::Path getName() const { return mPath; }
Torque::Path getName() const override { return mPath; }
// getStatus() doesn't appear to be used for directories
NodeStatus getStatus() const
NodeStatus getStatus() const override
{
return FileNode::Open;
}
bool getAttributes(Attributes* attr)
bool getAttributes(Attributes* attr) override
{
if (!attr)
return false;
@ -204,20 +204,20 @@ public:
return true;
}
bool open()
bool open() override
{
// reset iterator
if (mZipEntry)
mChildIter = mZipEntry->mChildren.begin();
return (mZipEntry != NULL && mArchive.getPointer() != NULL);
}
bool close()
bool close() override
{
if (mZipEntry)
mChildIter = mZipEntry->mChildren.end();
return true;
}
bool read(Attributes* attr)
bool read(Attributes* attr) override
{
if (!attr)
return false;
@ -244,7 +244,7 @@ public:
}
private:
U32 calculateChecksum()
U32 calculateChecksum() override
{
return 0;
}
@ -273,15 +273,15 @@ public:
{
}
Torque::Path getName() const { return mPath; }
Torque::Path getName() const override { return mPath; }
// getStatus() doesn't appear to be used for directories
NodeStatus getStatus() const
NodeStatus getStatus() const override
{
return FileNode::Open;
}
bool getAttributes(Attributes* attr)
bool getAttributes(Attributes* attr) override
{
if (!attr)
return false;
@ -299,17 +299,17 @@ public:
return true;
}
bool open()
bool open() override
{
mRead = false;
return (mArchive.getPointer() != NULL);
}
bool close()
bool close() override
{
mRead = false;
return true;
}
bool read(Attributes* attr)
bool read(Attributes* attr) override
{
if (!attr)
return false;
@ -336,7 +336,7 @@ public:
}
private:
U32 calculateChecksum()
U32 calculateChecksum() override
{
return 0;
}

View file

@ -38,25 +38,25 @@ public:
ZipFileSystem(String& zipFilename, bool zipNameIsDir = false);
virtual ~ZipFileSystem();
String getTypeStr() const { return "Zip"; }
String getTypeStr() const override { return "Zip"; }
// Strict resolve function will reteurn a node if it is mounted *AS* the requested path.
FileNodeRef resolve(const Path& path);
FileNodeRef resolve(const Path& path) override;
// Loose resolve function will return a node if it is mounted as or under the requested path.
// This is needed so mounted subdirectories will be included in recursive FindByPatern searches.
// i.e. If data/ui.zip is mounted as data/ui, a search for data/*.module will only include files
// under data/ui if the loose resolve function is used.
FileNodeRef resolveLoose(const Path& path);
FileNodeRef resolveLoose(const Path& path) override;
// these are unsupported, ZipFileSystem is currently read only access
FileNodeRef create(const Path& path,FileNode::Mode) { return 0; }
bool remove(const Path& path) { return 0; }
bool rename(const Path& a,const Path& b) { return 0; }
FileNodeRef create(const Path& path,FileNode::Mode) override { return 0; }
bool remove(const Path& path) override { return 0; }
bool rename(const Path& a,const Path& b) override { return 0; }
// these are unsupported
Path mapTo(const Path& path) { return path; }
Path mapFrom(const Path& path) { return path; }
Path mapTo(const Path& path) override { return path; }
Path mapFrom(const Path& path) override { return path; }
public:
/// Private interface for use by unit test only.