cleanup: Supress missing return warnings

Rewrite the function with a temporary to avoid the spourious no-return
warning.

The generated code is *unchanged*.
This commit is contained in:
Yuri D'Elia 2022-09-30 12:31:07 +02:00
parent 9f6d3e2c10
commit d6af13dfc1
1 changed files with 6 additions and 2 deletions

View File

@ -278,7 +278,9 @@ void IR_sensor_analog::voltUpdate(uint16_t raw) { // to be called from the ADC I
} }
uint16_t IR_sensor_analog::getVoltRaw() { uint16_t IR_sensor_analog::getVoltRaw() {
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { return voltRaw; } uint16_t ret;
ATOMIC_BLOCK(ATOMIC_RESTORESTATE) { ret = voltRaw; }
return ret;
} }
const char *IR_sensor_analog::getIRVersionText() { const char *IR_sensor_analog::getIRVersionText() {
@ -339,7 +341,9 @@ bool IR_sensor_analog::checkVoltage(uint16_t raw) {
} }
bool IR_sensor_analog::getVoltReady() const { bool IR_sensor_analog::getVoltReady() const {
ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ return voltReady; } bool ret;
ATOMIC_BLOCK(ATOMIC_RESTORESTATE){ ret = voltReady; }
return ret;
} }
void IR_sensor_analog::clearVoltReady(){ void IR_sensor_analog::clearVoltReady(){