Use const reference for TSourceLoc in interfaces.

This commit is contained in:
Lei Zhang 2015-07-28 12:45:41 -04:00
parent 780a2f4426
commit 54e47cc275
9 changed files with 272 additions and 272 deletions

View file

@ -95,7 +95,7 @@ public:
default: append("UNKOWN ERROR: "); break;
}
}
void location(TSourceLoc loc) {
void location(const TSourceLoc& loc) {
const int maxSize = 24;
char locText[maxSize];
if (loc.name != nullptr) {
@ -112,7 +112,7 @@ public:
append(s);
append("\n");
}
void message(TPrefixType message, const char* s, TSourceLoc loc) {
void message(TPrefixType message, const char* s, const TSourceLoc& loc) {
prefix(message);
location(loc);
append(s);

View file

@ -798,7 +798,7 @@ public:
const TType* userDef;
TSourceLoc loc;
void initType(TSourceLoc l)
void initType(const TSourceLoc& l)
{
basicType = EbtVoid;
vectorSize = 1;
@ -816,7 +816,7 @@ public:
qualifier.storage = EvqGlobal;
}
void init(TSourceLoc loc, bool global = false)
void init(const TSourceLoc& loc, bool global = false)
{
initType(loc);
sampler.clear();

View file

@ -407,8 +407,8 @@ public:
POOL_ALLOCATOR_NEW_DELETE(glslang::GetThreadPoolAllocator())
TIntermNode() { loc.init(); }
virtual glslang::TSourceLoc getLoc() const { return loc; }
virtual void setLoc(glslang::TSourceLoc l) { loc = l; }
virtual const glslang::TSourceLoc& getLoc() const { return loc; }
virtual void setLoc(const glslang::TSourceLoc& l) { loc = l; }
virtual void traverse(glslang::TIntermTraverser*) = 0;
virtual glslang::TIntermTyped* getAsTyped() { return 0; }
virtual glslang::TIntermOperator* getAsOperator() { return 0; }