From de4dedb918d910b869e7a24e967f106b96dbc441 Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Sun, 21 Apr 2013 13:21:11 +0300 Subject: [PATCH] const --- hlslang/GLSLCodeGen/glslFunction.cpp | 5 +---- hlslang/GLSLCodeGen/glslFunction.h | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hlslang/GLSLCodeGen/glslFunction.cpp b/hlslang/GLSLCodeGen/glslFunction.cpp index 3310a95..7820bd9 100644 --- a/hlslang/GLSLCodeGen/glslFunction.cpp +++ b/hlslang/GLSLCodeGen/glslFunction.cpp @@ -43,13 +43,10 @@ GlslFunction::~GlslFunction() void GlslFunction::pushDepth(int d) { this->depth.push_back(d); } void GlslFunction::popDepth() { depth.pop_back(); } -bool GlslFunction::hasSymbol( int id ) +bool GlslFunction::hasSymbol( int id ) const { if (symbolIdMap.find(id) != symbolIdMap.end()) - { return true; - } - return false; } diff --git a/hlslang/GLSLCodeGen/glslFunction.h b/hlslang/GLSLCodeGen/glslFunction.h index 945fbf8..6565626 100644 --- a/hlslang/GLSLCodeGen/glslFunction.h +++ b/hlslang/GLSLCodeGen/glslFunction.h @@ -25,7 +25,7 @@ public: bool isGlobalScopeFunction() const { return name == "__global__"; } - bool hasSymbol( int id ); + bool hasSymbol( int id ) const; GlslSymbol& getSymbol( int id ); std::string getPrototype() const; @@ -42,7 +42,7 @@ public: void addLibFunction( TOperator op ) { libFunctions.insert( op); } const std::set& getLibFunctions() const { return libFunctions; } - const std::vector& getSymbols() { return symbols; } + const std::vector& getSymbols() const { return symbols; } void increaseDepth() { depth.back()++; } void decreaseDepth() { depth.back() = depth.back() ? depth.back()-1 : depth.back(); } @@ -59,10 +59,10 @@ public: void beginStatement() { if (!inStatement) { indent(); inStatement = true;}} void endStatement() { if (inStatement) { *active << ";\n"; inStatement = false;}} - const std::string &getName() { return name; } - const std::string &getMangledName() { return mangledName; } + const std::string& getName() const { return name; } + const std::string& getMangledName() const { return mangledName; } - EGlslSymbolType getReturnType() { return returnType; } + EGlslSymbolType getReturnType() const { return returnType; } TPrecision getPrecision() const { return precision; } const std::string& getSemantic() const { return semantic; } GlslStruct* getStruct() { return structPtr; }