aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-02 07:23:45 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-02 07:35:58 -0700
commitf61ee20ba356ecfc4c5b247f548f52d588179c94 (patch)
tree4ec481a4368ab55e2ddfdda550bb1cd4316ee32f
parente0b60167f2366092f2e38436d443f0e2bcfe417d (diff)
downloadsubsurface-f61ee20ba356ecfc4c5b247f548f52d588179c94.tar.gz
Don't use switch with just one case
This should be an if statement. Gets rid of build warning. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--configuredivecomputerthreads.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index 0e32f5475..7958d04ff 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -57,9 +57,8 @@ void ReadSettingsThread::run()
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
if (rc == DC_STATUS_SUCCESS) {
DeviceDetails *m_deviceDetails = new DeviceDetails(0);
- switch (dc_device_get_type(m_data->device)) {
#if DC_VERSION_CHECK(0, 5, 0)
- case DC_FAMILY_HW_OSTC3:
+ if (dc_device_get_type(m_data->device) == DC_FAMILY_HW_OSTC3) {
supported = true;
m_deviceDetails->setBrightness(0);
m_deviceDetails->setCustomText("");
@@ -295,9 +294,8 @@ void ReadSettingsThread::run()
}
emit devicedetails(m_deviceDetails);
- break;
-#endif // divecomputer 0.5.0
}
+#endif // divecomputer 0.5.0
dc_device_close(m_data->device);
if (!supported) {
@@ -327,9 +325,8 @@ void WriteSettingsThread::run()
dc_status_t rc;
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
if (rc == DC_STATUS_SUCCESS) {
- switch (dc_device_get_type(m_data->device)) {
#if DC_VERSION_CHECK(0,5,0)
- case DC_FAMILY_HW_OSTC3:
+ if (dc_device_get_type(m_data->device) == DC_FAMILY_HW_OSTC3) {
supported = true;
//write gas values
unsigned char gas1Data[4] = {m_deviceDetails->gas1().oxygen,
@@ -492,10 +489,8 @@ void WriteSettingsThread::run()
time.second = timeToSet.time().second();
hw_ostc3_device_clock(m_data->device, &time);
}
-
- break;
-#endif // divecomputer 0.5.0
}
+#endif // divecomputer 0.5.0
dc_device_close(m_data->device);
if (!supported) {
@@ -522,14 +517,12 @@ void FirmwareUpdateThread::run()
dc_status_t rc;
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
if (rc == DC_STATUS_SUCCESS) {
- switch (dc_device_get_type(m_data->device)) {
#if DC_VERSION_CHECK(0, 5, 0)
- case DC_FAMILY_HW_OSTC3:
+ if (dc_device_get_type(m_data->device) == DC_FAMILY_HW_OSTC3) {
supported = true;
//hw_ostc3_device_fwupdate(m_data->device, m_fileName.toUtf8().data());
- break;
-#endif // divecomputer 0.5.0
}
+#endif // divecomputer 0.5.0
dc_device_close(m_data->device);
if (!supported) {