summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2014-11-05 18:33:07 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2014-11-08 14:26:00 +0100
commit9dd940ed722e8235c615e79b7eb688eb427e9a23 (patch)
treed5d4b1f57e2e739ef116d40f4136c1f3e5f2351c
parentce105e87404c53c09b8f9af4f76736b50458f0c7 (diff)
Assert statement calls a function which may have desired side effects: 'pos_is_okay'
It does not have any desired sideeffect, so we just mark it as const to properly advertise this fact to developer, compiler and linter alike. Reported-By: cppcheck Git-Dch: Ignore
-rw-r--r--methods/rred.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/methods/rred.cc b/methods/rred.cc
index cabb3c456..774b58a40 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -150,11 +150,11 @@ class FileChanges {
std::list<struct Change>::iterator where;
size_t pos; // line number is as far left of iterator as possible
- bool pos_is_okay(void)
+ bool pos_is_okay(void) const
{
#ifdef POSDEBUG
size_t cpos = 0;
- std::list<struct Change>::iterator x;
+ std::list<struct Change>::const_iterator x;
for (x = changes.begin(); x != where; ++x) {
assert(x != changes.end());
cpos += x->offset + x->add_cnt;