Silence a few warnings

None of these are actual bugs. But none of the fixes are harmful, either.
And much as I hate adding the 'default' clauses, I'd rather not have the
build output cluttered by invalid warnings.

The exception is the fix in divelistview.cpp - while I don't think it is
possible for this function to be called with no dive selected,
initializing pd to NULL is cheap insurance in case that does happen for
some weird reason.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-20 09:37:56 -08:00
parent 4ab58d6b47
commit 0421a161b4
3 changed files with 7 additions and 4 deletions

View file

@ -581,7 +581,7 @@ void DiveListView::addToTripAbove()
{
int idx, delta = (currentOrder == Qt::AscendingOrder) ? -1 : +1;
dive_trip_t *trip = NULL;
struct dive *pd;
struct dive *pd = NULL;
struct dive *d = (struct dive *) contextMenuIndex.data(DiveTripModel::DIVE_ROLE).value<void*>();
if (!d) // shouldn't happen as we only are setting up this action if this is a dive
return;