From d242f74de618e92bb7baaca59aa224685783c5a8 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Fri, 23 Jan 2015 15:31:43 +0100 Subject: Made more stuff const --- src/core/common/Location.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core/common/Location.hpp b/src/core/common/Location.hpp index 57892cc..808abbd 100644 --- a/src/core/common/Location.hpp +++ b/src/core/common/Location.hpp @@ -115,7 +115,7 @@ public: * * @return true if the SourcePosition instance is value, false otherwise. */ - bool isValid() { return pos != InvalidSourceOffset; } + bool isValid() const { return pos != InvalidSourceOffset; } }; /** @@ -252,7 +252,7 @@ public: * * @return true if the Range is valid. */ - bool isValid() + bool isValid() const { return start.isValid() && end.isValid() && start.getPosition() <= end.getPosition(); @@ -333,7 +333,7 @@ public: * * @return the id of the source file this instance is bound to. */ - SourceId getSourceId() { return sourceId; } + SourceId getSourceId() const { return sourceId; } /** * Returns true if this location is actually valid. This is the case if @@ -341,7 +341,7 @@ public: * * @return true if the Range is valid. */ - bool isValid() + bool isValid() const { return SourceRange::isValid() && sourceId != InvalidSourceId; } @@ -469,7 +469,7 @@ struct SourceContext { * @return the corresponding SourceContext. */ using SourceContextCallback = - std::function; + std::function; /** * Function to be used as default value for the SourceContextCallback. Returns @@ -478,7 +478,7 @@ using SourceContextCallback = * @param location is the location for which the context should be looked up. * @return an empty, invalid SourceContext. */ -void SourceContext NullSourceContextCallback(const SourceLocation &location); +SourceContext NullSourceContextCallback(const SourceLocation &location); } -- cgit v1.2.3