summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-11-19 22:36:03 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-11-19 17:51:38 -0800
commitd3ca1df76572bed691ba04a8607e0ac33f7d0622 (patch)
tree12e14456735564a17f81449d5c04db7c15795ab2
parent36b604546009ea172b051b8a150d67dd6487e12b (diff)
downloadsubsurface-d3ca1df76572bed691ba04a8607e0ac33f7d0622.tar.gz
Change the OSTC3 macros to have a ; in the end
This changes the OSTC3 READ_SETTING/WRITE_SETTING macros into something that can have a ; in the end which makes some editors auto-indent it better. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--configuredivecomputerthreads.cpp121
1 files changed, 62 insertions, 59 deletions
diff --git a/configuredivecomputerthreads.cpp b/configuredivecomputerthreads.cpp
index f89aa8d79..6d6e08990 100644
--- a/configuredivecomputerthreads.cpp
+++ b/configuredivecomputerthreads.cpp
@@ -433,36 +433,38 @@ void ReadSettingsThread::run()
unsigned char uData[1] = {0};
#define READ_SETTING(_OSTC3_SETTING, _DEVICE_DETAIL) \
- rc = hw_ostc3_device_config_read(m_data->device, _OSTC3_SETTING, uData, sizeof(uData)); \
- if (rc == DC_STATUS_SUCCESS) \
- m_deviceDetails->_DEVICE_DETAIL(uData[0]);
-
- READ_SETTING(OSTC3_DIVE_MODE, setDiveMode)
- READ_SETTING(OSTC3_SATURATION, setSaturation)
- READ_SETTING(OSTC3_DESATURATION, setDesaturation)
- READ_SETTING(OSTC3_LAST_DECO, setLastDeco)
- READ_SETTING(OSTC3_BRIGHTNESS, setBrightness)
- READ_SETTING(OSTC3_UNITS, setUnits)
- READ_SETTING(OSTC3_SAMPLING_RATE,setSamplingRate)
- READ_SETTING(OSTC3_SALINITY, setSalinity)
- READ_SETTING(OSTC3_DIVEMODE_COLOR,setDiveModeColor)
- READ_SETTING(OSTC3_LANGUAGE, setLanguage)
- READ_SETTING(OSTC3_DATE_FORMAT, setDateFormat)
- READ_SETTING(OSTC3_COMPASS_GAIN, setCompassGain)
- READ_SETTING(OSTC3_SAFETY_STOP, setSafetyStop)
- READ_SETTING(OSTC3_GF_HIGH, setGfHigh)
- READ_SETTING(OSTC3_GF_LOW, setGfLow)
- READ_SETTING(OSTC3_PPO2_MIN, setPpO2Min)
- READ_SETTING(OSTC3_PPO2_MAX, setPpO2Max)
- READ_SETTING(OSTC3_FUTURE_TTS, setFutureTTS)
- READ_SETTING(OSTC3_CCR_MODE, setCcrMode)
- READ_SETTING(OSTC3_DECO_TYPE, setDecoType)
- READ_SETTING(OSTC3_AGF_SELECTABLE, setAGFSelectable)
- READ_SETTING(OSTC3_AGF_HIGH, setAGFHigh)
- READ_SETTING(OSTC3_AGF_LOW, setAGFLow)
- READ_SETTING(OSTC3_CALIBRATION_GAS_O2, setCalibrationGas)
- READ_SETTING(OSTC3_FLIP_SCREEN, setFlipScreen)
- READ_SETTING(OSTC3_SETPOINT_FALLBACK, setSetPointFallback)
+ do { \
+ rc = hw_ostc3_device_config_read(m_data->device, _OSTC3_SETTING, uData, sizeof(uData)); \
+ if (rc == DC_STATUS_SUCCESS) \
+ m_deviceDetails->_DEVICE_DETAIL(uData[0]); \
+ } while (0)
+
+ READ_SETTING(OSTC3_DIVE_MODE, setDiveMode);
+ READ_SETTING(OSTC3_SATURATION, setSaturation);
+ READ_SETTING(OSTC3_DESATURATION, setDesaturation);
+ READ_SETTING(OSTC3_LAST_DECO, setLastDeco);
+ READ_SETTING(OSTC3_BRIGHTNESS, setBrightness);
+ READ_SETTING(OSTC3_UNITS, setUnits);
+ READ_SETTING(OSTC3_SAMPLING_RATE,setSamplingRate);
+ READ_SETTING(OSTC3_SALINITY, setSalinity);
+ READ_SETTING(OSTC3_DIVEMODE_COLOR,setDiveModeColor);
+ READ_SETTING(OSTC3_LANGUAGE, setLanguage);
+ READ_SETTING(OSTC3_DATE_FORMAT, setDateFormat);
+ READ_SETTING(OSTC3_COMPASS_GAIN, setCompassGain);
+ READ_SETTING(OSTC3_SAFETY_STOP, setSafetyStop);
+ READ_SETTING(OSTC3_GF_HIGH, setGfHigh);
+ READ_SETTING(OSTC3_GF_LOW, setGfLow);
+ READ_SETTING(OSTC3_PPO2_MIN, setPpO2Min);
+ READ_SETTING(OSTC3_PPO2_MAX, setPpO2Max);
+ READ_SETTING(OSTC3_FUTURE_TTS, setFutureTTS);
+ READ_SETTING(OSTC3_CCR_MODE, setCcrMode);
+ READ_SETTING(OSTC3_DECO_TYPE, setDecoType);
+ READ_SETTING(OSTC3_AGF_SELECTABLE, setAGFSelectable);
+ READ_SETTING(OSTC3_AGF_HIGH, setAGFHigh);
+ READ_SETTING(OSTC3_AGF_LOW, setAGFLow);
+ READ_SETTING(OSTC3_CALIBRATION_GAS_O2, setCalibrationGas);
+ READ_SETTING(OSTC3_FLIP_SCREEN, setFlipScreen);
+ READ_SETTING(OSTC3_SETPOINT_FALLBACK, setSetPointFallback);
#undef READ_SETTING
@@ -975,35 +977,36 @@ void WriteSettingsThread::run()
unsigned char data[1] = {0};
#define WRITE_SETTING(_OSTC3_SETTING, _DEVICE_DETAIL) \
- data[0] = m_deviceDetails->_DEVICE_DETAIL(); \
- hw_ostc3_device_config_write(m_data->device, _OSTC3_SETTING, data, sizeof(data));
-
- WRITE_SETTING(OSTC3_DIVE_MODE, diveMode)
- WRITE_SETTING(OSTC3_SATURATION, saturation)
- WRITE_SETTING(OSTC3_DESATURATION, desaturation)
- WRITE_SETTING(OSTC3_LAST_DECO, lastDeco)
- WRITE_SETTING(OSTC3_BRIGHTNESS, brightness)
- WRITE_SETTING(OSTC3_UNITS, units)
- WRITE_SETTING(OSTC3_SAMPLING_RATE, samplingRate)
- WRITE_SETTING(OSTC3_SALINITY, salinity)
- WRITE_SETTING(OSTC3_DIVEMODE_COLOR, diveModeColor)
- WRITE_SETTING(OSTC3_LANGUAGE, language)
- WRITE_SETTING(OSTC3_DATE_FORMAT, dateFormat)
- WRITE_SETTING(OSTC3_COMPASS_GAIN, compassGain)
- WRITE_SETTING(OSTC3_SAFETY_STOP, safetyStop)
- WRITE_SETTING(OSTC3_GF_HIGH, gfHigh)
- WRITE_SETTING(OSTC3_GF_LOW, gfLow)
- WRITE_SETTING(OSTC3_PPO2_MIN, ppO2Min)
- WRITE_SETTING(OSTC3_PPO2_MAX, ppO2Max)
- WRITE_SETTING(OSTC3_FUTURE_TTS, futureTTS)
- WRITE_SETTING(OSTC3_CCR_MODE, ccrMode)
- WRITE_SETTING(OSTC3_DECO_TYPE, decoType)
- WRITE_SETTING(OSTC3_AGF_SELECTABLE, aGFSelectable)
- WRITE_SETTING(OSTC3_AGF_HIGH, aGFHigh)
- WRITE_SETTING(OSTC3_AGF_LOW, aGFLow)
- WRITE_SETTING(OSTC3_CALIBRATION_GAS_O2, calibrationGas)
- WRITE_SETTING(OSTC3_FLIP_SCREEN, flipScreen)
- WRITE_SETTING(OSTC3_SETPOINT_FALLBACK, setPointFallback)
+ do { \
+ data[0] = m_deviceDetails->_DEVICE_DETAIL(); \
+ hw_ostc3_device_config_write(m_data->device, _OSTC3_SETTING, data, sizeof(data)); \
+ } while (0)
+
+ WRITE_SETTING(OSTC3_DIVE_MODE, diveMode);
+ WRITE_SETTING(OSTC3_SATURATION, saturation);
+ WRITE_SETTING(OSTC3_DESATURATION, desaturation);
+ WRITE_SETTING(OSTC3_LAST_DECO, lastDeco);
+ WRITE_SETTING(OSTC3_BRIGHTNESS, brightness);
+ WRITE_SETTING(OSTC3_UNITS, units);
+ WRITE_SETTING(OSTC3_SAMPLING_RATE, samplingRate);
+ WRITE_SETTING(OSTC3_SALINITY, salinity);
+ WRITE_SETTING(OSTC3_DIVEMODE_COLOR, diveModeColor);
+ WRITE_SETTING(OSTC3_LANGUAGE, language);
+ WRITE_SETTING(OSTC3_DATE_FORMAT, dateFormat);
+ WRITE_SETTING(OSTC3_COMPASS_GAIN, compassGain);
+ WRITE_SETTING(OSTC3_SAFETY_STOP, safetyStop);
+ WRITE_SETTING(OSTC3_GF_HIGH, gfHigh);
+ WRITE_SETTING(OSTC3_GF_LOW, gfLow);
+ WRITE_SETTING(OSTC3_PPO2_MIN, ppO2Min);
+ WRITE_SETTING(OSTC3_PPO2_MAX, ppO2Max);
+ WRITE_SETTING(OSTC3_FUTURE_TTS, futureTTS);
+ WRITE_SETTING(OSTC3_CCR_MODE, ccrMode);
+ WRITE_SETTING(OSTC3_DECO_TYPE, decoType);
+ WRITE_SETTING(OSTC3_AGF_SELECTABLE, aGFSelectable);
+ WRITE_SETTING(OSTC3_AGF_HIGH, aGFHigh);
+ WRITE_SETTING(OSTC3_AGF_LOW, aGFLow); WRITE_SETTING(OSTC3_CALIBRATION_GAS_O2, calibrationGas);
+ WRITE_SETTING(OSTC3_FLIP_SCREEN, flipScreen);
+ WRITE_SETTING(OSTC3_SETPOINT_FALLBACK, setPointFallback);
#undef WRITE_SETTING