mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
ffc61e1357
commit
11559f1704
1 changed files with 3 additions and 3 deletions
|
@ -500,11 +500,11 @@ void DivePlannerGraphics::drawProfile()
|
||||||
// Re-position the user generated dive handlers
|
// Re-position the user generated dive handlers
|
||||||
int last = 0;
|
int last = 0;
|
||||||
for (int i = 0; i < plannerModel->rowCount(); i++) {
|
for (int i = 0; i < plannerModel->rowCount(); i++) {
|
||||||
divedatapoint dp = plannerModel->at(i);
|
struct divedatapoint datapoint = plannerModel->at(i);
|
||||||
if (dp.time == 0) // those are the magic entries for tanks
|
if (datapoint.time == 0) // those are the magic entries for tanks
|
||||||
continue;
|
continue;
|
||||||
DiveHandler *h = handles.at(i);
|
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 p1 = (last == i) ? QPointF(timeLine->posAtValue(0), depthLine->posAtValue(0)) : handles[last]->pos();
|
||||||
QPointF p2 = handles[i]->pos();
|
QPointF p2 = handles[i]->pos();
|
||||||
QLineF line(p1, p2);
|
QLineF line(p1, p2);
|
||||||
|
|
Loading…
Add table
Reference in a new issue