summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-20 09:37:56 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-20 09:53:06 -0800
commit0421a161b4e3e319fb57397b5a729a3440a82c80 (patch)
treea8994be0a1de08aea2a362baa0c0e1fb7aed69d2 /dive.c
parent4ab58d6b47e8786d0a10c1308ee487e10af7fa83 (diff)
downloadsubsurface-0421a161b4e3e319fb57397b5a729a3440a82c80.tar.gz
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>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index d0c22734c..540f40eb5 100644
--- a/dive.c
+++ b/dive.c
@@ -57,6 +57,7 @@ int get_pressure_units(unsigned int mb, const char **units)
unit = translate("gettextFromC","pascal");
break;
case BAR:
+ default:
pressure = (mb + 500) / 1000;
unit = translate("gettextFromC","bar");
break;
@@ -97,6 +98,7 @@ double get_volume_units(unsigned int ml, int *frac, const char **units)
switch (units_p->volume) {
case LITER:
+ default:
vol = ml / 1000.0;
unit = translate("gettextFromC","l");
decimals = 1;
@@ -130,6 +132,7 @@ double get_depth_units(unsigned int mm, int *frac, const char **units)
switch (units_p->length) {
case METERS:
+ default:
d = mm / 1000.0;
unit = translate("gettextFromC","m");
decimals = d < 20;
@@ -156,6 +159,7 @@ double get_vertical_speed_units(unsigned int mms, int *frac, const char **units)
switch (units_p->length) {
case METERS:
+ default:
d = mms / 1000.0 * time_factor;
unit = translate("gettextFromC",(units_p->vertical_speed_time == MINUTES) ? "m/min" : "m/s");
break;