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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user