From f61ee20ba356ecfc4c5b247f548f52d588179c94 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 2 Oct 2014 07:23:45 -0700 Subject: Don't use switch with just one case This should be an if statement. Gets rid of build warning. Signed-off-by: Dirk Hohndel --- configuredivecomputerthreads.cpp | 19 ++++++------------- 1 file 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) { -- cgit v1.2.3-70-g09d2