Merge pull request #644 from hrydgard/override-warning-fixes

Fix a large number of Clang warnings about inconsistent usage of 'override'
This commit is contained in:
John Kessenich 2016-12-21 10:50:33 -07:00 committed by GitHub
commit 906b0a3e60
2 changed files with 27 additions and 27 deletions

View File

@ -245,9 +245,9 @@ protected:
delete expandedArgs[i]; delete expandedArgs[i];
} }
virtual int scan(TPpToken*); virtual int scan(TPpToken*) override;
virtual int getch() { assert(0); return EndOfInput; } virtual int getch() override { assert(0); return EndOfInput; }
virtual void ungetch() { assert(0); } virtual void ungetch() override { assert(0); }
bool peekPasting() override { return prepaste; } bool peekPasting() override { return prepaste; }
bool endOfReplacementList() override { return mac->body.current >= mac->body.data.size(); } bool endOfReplacementList() override { return mac->body.current >= mac->body.data.size(); }
@ -264,7 +264,7 @@ protected:
class tMarkerInput : public tInput { class tMarkerInput : public tInput {
public: public:
tMarkerInput(TPpContext* pp) : tInput(pp) { } tMarkerInput(TPpContext* pp) : tInput(pp) { }
virtual int scan(TPpToken*) virtual int scan(TPpToken*) override
{ {
if (done) if (done)
return EndOfInput; return EndOfInput;
@ -272,17 +272,17 @@ protected:
return marker; return marker;
} }
virtual int getch() { assert(0); return EndOfInput; } virtual int getch() override { assert(0); return EndOfInput; }
virtual void ungetch() { assert(0); } virtual void ungetch() override { assert(0); }
static const int marker = -3; static const int marker = -3;
}; };
class tZeroInput : public tInput { class tZeroInput : public tInput {
public: public:
tZeroInput(TPpContext* pp) : tInput(pp) { } tZeroInput(TPpContext* pp) : tInput(pp) { }
virtual int scan(TPpToken*); virtual int scan(TPpToken*) override;
virtual int getch() { assert(0); return EndOfInput; } virtual int getch() override { assert(0); return EndOfInput; }
virtual void ungetch() { assert(0); } virtual void ungetch() override { assert(0); }
}; };
std::vector<tInput*> inputStack; std::vector<tInput*> inputStack;
@ -329,9 +329,9 @@ protected:
class tTokenInput : public tInput { class tTokenInput : public tInput {
public: public:
tTokenInput(TPpContext* pp, TokenStream* t, bool prepasting) : tInput(pp), tokens(t), lastTokenPastes(prepasting) { } tTokenInput(TPpContext* pp, TokenStream* t, bool prepasting) : tInput(pp), tokens(t), lastTokenPastes(prepasting) { }
virtual int scan(TPpToken *); virtual int scan(TPpToken *) override;
virtual int getch() { assert(0); return EndOfInput; } virtual int getch() override { assert(0); return EndOfInput; }
virtual void ungetch() { assert(0); } virtual void ungetch() override { assert(0); }
virtual bool peekPasting() override; virtual bool peekPasting() override;
protected: protected:
TokenStream* tokens; TokenStream* tokens;
@ -341,9 +341,9 @@ protected:
class tUngotTokenInput : public tInput { class tUngotTokenInput : public tInput {
public: public:
tUngotTokenInput(TPpContext* pp, int t, TPpToken* p) : tInput(pp), token(t), lval(*p) { } tUngotTokenInput(TPpContext* pp, int t, TPpToken* p) : tInput(pp), token(t), lval(*p) { }
virtual int scan(TPpToken *); virtual int scan(TPpToken *) override;
virtual int getch() { assert(0); return EndOfInput; } virtual int getch() override { assert(0); return EndOfInput; }
virtual void ungetch() { assert(0); } virtual void ungetch() override { assert(0); }
protected: protected:
int token; int token;
TPpToken lval; TPpToken lval;
@ -355,12 +355,12 @@ protected:
class tStringInput : public tInput { class tStringInput : public tInput {
public: public:
tStringInput(TPpContext* pp, TInputScanner& i) : tInput(pp), input(&i) { } tStringInput(TPpContext* pp, TInputScanner& i) : tInput(pp), input(&i) { }
virtual int scan(TPpToken*); virtual int scan(TPpToken*) override;
// Scanner used to get source stream characters. // Scanner used to get source stream characters.
// - Escaped newlines are handled here, invisibly to the caller. // - Escaped newlines are handled here, invisibly to the caller.
// - All forms of newline are handled, and turned into just a '\n'. // - All forms of newline are handled, and turned into just a '\n'.
int getch() int getch() override
{ {
int ch = input->get(); int ch = input->get();
@ -398,7 +398,7 @@ protected:
// handled here, invisibly to the caller, meaning have to undo exactly // handled here, invisibly to the caller, meaning have to undo exactly
// what getch() above does (e.g., don't leave things in the middle of a // what getch() above does (e.g., don't leave things in the middle of a
// sequence of escaped newlines). // sequence of escaped newlines).
void ungetch() void ungetch() override
{ {
input->unget(); input->unget();

View File

@ -50,18 +50,18 @@ public:
const TString sourceEntryPointName, const TString sourceEntryPointName,
bool forwardCompatible = false, EShMessages messages = EShMsgDefault); bool forwardCompatible = false, EShMessages messages = EShMsgDefault);
virtual ~HlslParseContext(); virtual ~HlslParseContext();
void initializeExtensionBehavior(); void initializeExtensionBehavior() override;
void setLimits(const TBuiltInResource&); void setLimits(const TBuiltInResource&) override;
bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false); bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false) override;
virtual const char* getGlobalUniformBlockName() { return "$Global"; } virtual const char* getGlobalUniformBlockName() override { return "$Global"; }
void reservedPpErrorCheck(const TSourceLoc&, const char* /*name*/, const char* /*op*/) { } void reservedPpErrorCheck(const TSourceLoc&, const char* /*name*/, const char* /*op*/) override { }
bool lineContinuationCheck(const TSourceLoc&, bool /*endOfComment*/) { return true; } bool lineContinuationCheck(const TSourceLoc&, bool /*endOfComment*/) override { return true; }
bool lineDirectiveShouldSetNextLine() const { return true; } bool lineDirectiveShouldSetNextLine() const override { return true; }
bool builtInName(const TString&); bool builtInName(const TString&);
void handlePragma(const TSourceLoc&, const TVector<TString>&); void handlePragma(const TSourceLoc&, const TVector<TString>&) override;
TIntermTyped* handleVariable(const TSourceLoc&, TSymbol* symbol, const TString* string); TIntermTyped* handleVariable(const TSourceLoc&, TSymbol* symbol, const TString* string);
TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
TIntermTyped* handleBracketOperator(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); TIntermTyped* handleBracketOperator(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
@ -134,7 +134,7 @@ public:
TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&);
TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0, TArraySizes* arraySizes = 0); void declareBlock(const TSourceLoc&, TType&, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
void finalizeGlobalUniformBlockLayout(TVariable& block); void finalizeGlobalUniformBlockLayout(TVariable& block) override;
void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation);
void fixBlockXfbOffsets(TQualifier&, TTypeList&); void fixBlockXfbOffsets(TQualifier&, TTypeList&);
void fixBlockUniformOffsets(const TQualifier&, TTypeList&); void fixBlockUniformOffsets(const TQualifier&, TTypeList&);