Fix some warnings

At least the warnings about size potentially being uninitialized seem correct
and valid.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2016-09-04 10:27:56 -07:00
parent 3affaedb38
commit 80eafb8db7
2 changed files with 5 additions and 4 deletions

View file

@ -67,7 +67,7 @@ DiveObjectHelper::DiveObjectHelper(struct dive *d) :
DiveObjectHelper::~DiveObjectHelper()
{
while (!m_cyls.isEmpty())
delete m_cyls.takeFirst();
delete m_cyls.takeFirst();
}
int DiveObjectHelper::number() const
@ -267,8 +267,8 @@ QStringList DiveObjectHelper::cylinderList() const
}
}
for (i = 0; i < sizeof(tank_info) && tank_info[i].name != NULL; i++) {
QString cyl = tank_info[i].name;
for (unsigned long ti = 0; ti < sizeof(tank_info) && tank_info[ti].name != NULL; ti++) {
QString cyl = tank_info[ti].name;
if (cyl == EMPTY_DIVE_STRING)
continue;
cylinders << cyl;

View file

@ -844,7 +844,8 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q
// info for first cylinder
if (myDive->getCylinder() != cylinder) {
diveChanged = true;
int i, size, wp;
unsigned long i;
int size = 0, wp = 0;
for (i = 0; i < sizeof(tank_info) && tank_info[i].name != NULL; i++) {
if (tank_info[i].name == cylinder ) {
if (tank_info[i].ml > 0){