aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-12 05:41:45 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-12 05:43:31 -0800
commit11559f1704921aa384bde66667d33c34731efa7d (patch)
tree1049b98728c87666cdfa785257fad5fb42474341 /qt-ui/diveplanner.cpp
parentffc61e135743a1c7a2f81c1f96d0767fd3560e4f (diff)
downloadsubsurface-11559f1704921aa384bde66667d33c34731efa7d.tar.gz
Don't reuse a variable name with a different type inside the same function
Since the variable was inside of an inner scope this was technically legal, but it's just too annoying for words. (The diff in the commit doesn't make this obvious, but outside the for loop in the same function there is a divedatapoint *dp, so we had a pointer to divedatapoint and a divedatapoint with the same name...) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 435f2bebc..2a70b8d93 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -500,11 +500,11 @@ void DivePlannerGraphics::drawProfile()
// Re-position the user generated dive handlers
int last = 0;
for (int i = 0; i < plannerModel->rowCount(); i++) {
- divedatapoint dp = plannerModel->at(i);
- if (dp.time == 0) // those are the magic entries for tanks
+ struct divedatapoint datapoint = plannerModel->at(i);
+ if (datapoint.time == 0) // those are the magic entries for tanks
continue;
DiveHandler *h = handles.at(i);
- h->setPos(timeLine->posAtValue(dp.time / 60), depthLine->posAtValue(dp.depth));
+ h->setPos(timeLine->posAtValue(datapoint.time / 60), depthLine->posAtValue(datapoint.depth));
QPointF p1 = (last == i) ? QPointF(timeLine->posAtValue(0), depthLine->posAtValue(0)) : handles[last]->pos();
QPointF p2 = handles[i]->pos();
QLineF line(p1, p2);