Build: Remove causes of pedantic warnings. Addresses issue #352 and PR #242.

This commit is contained in:
John Kessenich 2016-07-08 22:09:10 -06:00
parent c45dddae5f
commit 7f349c73db
16 changed files with 88 additions and 46 deletions

View file

@ -579,7 +579,10 @@ public:
virtual const glslang::TIntermSymbol* getAsSymbolNode() const { return 0; }
virtual const glslang::TIntermBranch* getAsBranchNode() const { return 0; }
virtual ~TIntermNode() { }
protected:
TIntermNode(const TIntermNode&);
TIntermNode& operator=(const TIntermNode&);
glslang::TSourceLoc loc;
};
@ -621,6 +624,7 @@ public:
TString getCompleteString() const { return type.getCompleteString(); }
protected:
TIntermTyped& operator=(const TIntermTyped&);
TType type;
};
@ -702,6 +706,7 @@ public:
const TConstUnionArray& getConstArray() const { return constArray; }
void setConstSubtree(TIntermTyped* subtree) { constSubtree = subtree; }
TIntermTyped* getConstSubtree() const { return constSubtree; }
protected:
int id; // the unique id of the symbol this node represents
TString name; // the name of the symbol this node represents
@ -721,7 +726,10 @@ public:
void setLiteral() { literal = true; }
void setExpression() { literal = false; }
bool isLiteral() const { return literal; }
protected:
TIntermConstantUnion& operator=(const TIntermConstantUnion&);
const TConstUnionArray constArray;
bool literal; // true if node represents a literal in the source code
};

View file

@ -173,7 +173,7 @@ public:
loc[getLastValidSourceIndex()].name = filename;
}
void setFile(const char* filename, size_t i)
void setFile(const char* filename, int i)
{
if (i == getLastValidSourceIndex()) {
logicalSourceLoc.name = filename;

View file

@ -783,6 +783,8 @@ public:
void setLineNum(int newLineNum) { lastLine = newLineNum; }
private:
SourceLineSynchronizer& operator=(const SourceLineSynchronizer&);
// A function for getting the index of the last valid source string we've
// read tokens from.
const std::function<int()> getLastSourceIndex;

View file

@ -487,6 +487,8 @@ protected:
}
private:
TokenizableIncludeFile& operator=(const TokenizableIncludeFile&);
// Stores the prologue for this string.
const std::string prologue_;

View file

@ -244,6 +244,8 @@ public:
bool visitBranch(glslang::TVisit, glslang::TIntermBranch*) override;
protected:
TSymbolDefinitionCollectingTraverser& operator=(const TSymbolDefinitionCollectingTraverser&);
// The mapping from symbol node IDs to their defining nodes. This should be
// populated along traversing the AST.
NodeMapping& symbol_definition_mapping_;
@ -548,6 +550,8 @@ public:
}
protected:
TNoContractionAssigneeCheckingTraverser& operator=(const TNoContractionAssigneeCheckingTraverser&);
bool visitBinary(glslang::TVisit, glslang::TIntermBinary* node) override;
void visitSymbol(glslang::TIntermSymbol* node) override;
@ -648,6 +652,8 @@ public:
}
protected:
TNoContractionPropagator& operator=(const TNoContractionPropagator&);
// Visits an aggregate node. The node can be a initializer list, in which
// case we need to find the 'precise' or 'precise' containing object node
// with the access chain record. In other cases, just need to traverse all

View file

@ -307,7 +307,7 @@ public:
// 2. Call parse with an Includer.
//
// When the Glslang parser encounters an #include directive, it calls
// the Includer's include method with the the requested include name
// the Includer's include method with the requested include name
// together with the current string name. The returned IncludeResult
// contains the fully resolved name of the included source, together
// with the source text that should replace the #include directive
@ -323,8 +323,10 @@ public:
// An IncludeResult contains the resolved name and content of a source
// inclusion.
struct IncludeResult {
IncludeResult(const std::string& file_name, const char* const file_data, const size_t file_length, void* user_data) :
file_name(file_name), file_data(file_data), file_length(file_length), user_data(user_data) { }
// For a successful inclusion, the fully resolved name of the requested
// include. For example, in a filesystem-based includer, full resolution
// include. For example, in a file system-based includer, full resolution
// should convert a relative path name into an absolute path name.
// For a failed inclusion, this is an empty string.
const std::string file_name;
@ -337,6 +339,9 @@ public:
const size_t file_length;
// Include resolver's context.
void* user_data;
protected:
IncludeResult& operator=(const IncludeResult&);
IncludeResult();
};
// Resolves an inclusion request by name, type, current source name,
@ -365,11 +370,8 @@ public:
public:
IncludeResult* include(const char*, IncludeType, const char*, size_t) override
{
static const char unexpected_include[] =
"unexpected include directive";
static const IncludeResult unexpectedIncludeResult =
{"", unexpected_include, sizeof(unexpected_include) - 1, nullptr};
return new IncludeResult(unexpectedIncludeResult);
const char* unexpected_include = "unexpected include directive";
return new IncludeResult(std::string(""), unexpected_include, strlen(unexpected_include), nullptr);
}
virtual void releaseInclude(IncludeResult* result) override
{