summaryrefslogtreecommitdiff
path: root/src/core/common
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-01-23 15:31:43 +0100
committerAndreas Stöckel <andreas@somweyr.de>2015-01-23 15:31:43 +0100
commitd242f74de618e92bb7baaca59aa224685783c5a8 (patch)
treebb0a6b2908339f3f3b67b84438ca6eedab342840 /src/core/common
parentea55274d4d5a6066f73380352274d568caa2d079 (diff)
Made more stuff const
Diffstat (limited to 'src/core/common')
-rw-r--r--src/core/common/Location.hpp12
1 files changed, 6 insertions, 6 deletions
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<SourceContext(const SourceLocation &location)>;
+ std::function<SourceContext(const SourceLocation &)>;
/**
* 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);
}