summaryrefslogtreecommitdiffstats
path: root/profile-widget/tankitem.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-17 00:58:30 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-23 05:16:38 -0700
commit605e1e19ed0c52a16580c95e36ae79e71b539351 (patch)
tree50895b0e390a1b446d220cefaad531880c13259b /profile-widget/tankitem.cpp
parent44f34d8cd72568a313e9a39907b65ed44bdbdeba (diff)
downloadsubsurface-605e1e19ed0c52a16580c95e36ae79e71b539351.tar.gz
Cleanup: const-ify functions taking pointers to events
This is another entry in the series to make more things "const-clean" with the ultimate goal of merge_dive() take const pointers. This concerns functions taking pointers to events and the fallout from making these const. The somewhat debatable part of this commit might be that get_next_event() is split in a two distinct (const and non-const) versions with different names, since C doesn't allow overloading. The linker should recognize that these functions are identical and remove one of them. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/tankitem.cpp')
-rw-r--r--profile-widget/tankitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp
index 5a8b8ca48..2bbcdc1a7 100644
--- a/profile-widget/tankitem.cpp
+++ b/profile-widget/tankitem.cpp
@@ -108,7 +108,7 @@ void TankItem::modelDataChanged(const QModelIndex&, const QModelIndex&)
int startTime = 0;
// work through all the gas changes and add the rectangle for each gas while it was used
- struct event *ev = get_next_event(dc->events, "gaschange");
+ const struct event *ev = get_next_event(dc->events, "gaschange");
while (ev && (int)ev->time.seconds < last_entry->sec) {
width = hAxis->posAtValue(ev->time.seconds) - hAxis->posAtValue(startTime);
left = hAxis->posAtValue(startTime);