mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:23:24 +00:00
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>
This commit is contained in:
parent
e0b60167f2
commit
f61ee20ba3
1 changed files with 6 additions and 13 deletions
|
@ -57,9 +57,8 @@ void ReadSettingsThread::run()
|
||||||
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
|
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
|
||||||
if (rc == DC_STATUS_SUCCESS) {
|
if (rc == DC_STATUS_SUCCESS) {
|
||||||
DeviceDetails *m_deviceDetails = new DeviceDetails(0);
|
DeviceDetails *m_deviceDetails = new DeviceDetails(0);
|
||||||
switch (dc_device_get_type(m_data->device)) {
|
|
||||||
#if DC_VERSION_CHECK(0, 5, 0)
|
#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;
|
supported = true;
|
||||||
m_deviceDetails->setBrightness(0);
|
m_deviceDetails->setBrightness(0);
|
||||||
m_deviceDetails->setCustomText("");
|
m_deviceDetails->setCustomText("");
|
||||||
|
@ -295,9 +294,8 @@ void ReadSettingsThread::run()
|
||||||
}
|
}
|
||||||
|
|
||||||
emit devicedetails(m_deviceDetails);
|
emit devicedetails(m_deviceDetails);
|
||||||
break;
|
|
||||||
#endif // divecomputer 0.5.0
|
|
||||||
}
|
}
|
||||||
|
#endif // divecomputer 0.5.0
|
||||||
dc_device_close(m_data->device);
|
dc_device_close(m_data->device);
|
||||||
|
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
|
@ -327,9 +325,8 @@ void WriteSettingsThread::run()
|
||||||
dc_status_t rc;
|
dc_status_t rc;
|
||||||
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
|
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
|
||||||
if (rc == DC_STATUS_SUCCESS) {
|
if (rc == DC_STATUS_SUCCESS) {
|
||||||
switch (dc_device_get_type(m_data->device)) {
|
|
||||||
#if DC_VERSION_CHECK(0,5,0)
|
#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;
|
supported = true;
|
||||||
//write gas values
|
//write gas values
|
||||||
unsigned char gas1Data[4] = {m_deviceDetails->gas1().oxygen,
|
unsigned char gas1Data[4] = {m_deviceDetails->gas1().oxygen,
|
||||||
|
@ -492,10 +489,8 @@ void WriteSettingsThread::run()
|
||||||
time.second = timeToSet.time().second();
|
time.second = timeToSet.time().second();
|
||||||
hw_ostc3_device_clock(m_data->device, &time);
|
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);
|
dc_device_close(m_data->device);
|
||||||
|
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
|
@ -522,14 +517,12 @@ void FirmwareUpdateThread::run()
|
||||||
dc_status_t rc;
|
dc_status_t rc;
|
||||||
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
|
rc = rc = dc_device_open(&m_data->device, m_data->context, m_data->descriptor, m_data->devname);
|
||||||
if (rc == DC_STATUS_SUCCESS) {
|
if (rc == DC_STATUS_SUCCESS) {
|
||||||
switch (dc_device_get_type(m_data->device)) {
|
|
||||||
#if DC_VERSION_CHECK(0, 5, 0)
|
#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;
|
supported = true;
|
||||||
//hw_ostc3_device_fwupdate(m_data->device, m_fileName.toUtf8().data());
|
//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);
|
dc_device_close(m_data->device);
|
||||||
|
|
||||||
if (!supported) {
|
if (!supported) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue