1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-01-07 00:27:13 +01:00

Replace virtual with override wherever possible; eliminate needless virtual...

... for functions in final classes.

override is like const -- it's not necessary, but it helps the compiler to
catch mistakes.

There may be some overriding functions not explicitly declared virtual and I did
not identify such cases, in which I might also add override.
This commit is contained in:
Paul Licameli
2016-02-24 01:06:47 -05:00
parent 74121c1494
commit 990080ae7d
169 changed files with 1652 additions and 1639 deletions

View File

@@ -51,13 +51,13 @@ class ODDecodeFlacTask final : public ODDecodeTask
virtual ~ODDecodeFlacTask();
virtual ODTask* Clone();
ODTask* Clone() override;
///Creates an ODFileDecoder that decodes a file of filetype the subclass handles.
virtual ODFileDecoder* CreateFileDecoder(const wxString & fileName);
ODFileDecoder* CreateFileDecoder(const wxString & fileName) override;
///Lets other classes know that this class handles flac
///Subclasses should override to return respective type.
virtual unsigned int GetODType(){return eODFLAC;}
unsigned int GetODType() override { return eODFLAC; }
};
@@ -83,10 +83,10 @@ class ODFLACFile final : public FLAC::Decoder::File
wxArrayString mComments;
protected:
virtual FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *frame,
const FLAC__int32 * const buffer[]);
virtual void metadata_callback(const FLAC__StreamMetadata *metadata);
virtual void error_callback(FLAC__StreamDecoderErrorStatus status);
FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *frame,
const FLAC__int32 * const buffer[]) override;
void metadata_callback(const FLAC__StreamMetadata *metadata) override;
void error_callback(FLAC__StreamDecoderErrorStatus status) override;
};
@@ -106,12 +106,12 @@ public:
///this->ReadData(sampleData, floatSample, 0, mLen);
///This class should call ReadHeader() first, so it knows the length, and can prepare
///the file object if it needs to.
virtual int Decode(SampleBuffer & data, sampleFormat & format, sampleCount start, sampleCount len, unsigned int channel);
int Decode(SampleBuffer & data, sampleFormat & format, sampleCount start, sampleCount len, unsigned int channel) override;
///Read header. Subclasses must override. Probably should save the info somewhere.
///Ideally called once per decoding of a file. This complicates the task because
virtual bool ReadHeader();
bool ReadHeader() override;
///FLAC specific file (inherited from FLAC::Decoder::File)
ODFLACFile* GetFlacFile();