From 0f2226e177d1bfeb100967131e6022a8c1383c3d Mon Sep 17 00:00:00 2001 From: Maxim Prokhorov Date: Thu, 17 Oct 2019 17:47:04 +0300 Subject: [PATCH] sensor: cast variable as UNUSED and prevent intended assignment warnings --- code/espurna/sensor.ino | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/espurna/sensor.ino b/code/espurna/sensor.ino index 47a18df8..42d87221 100644 --- a/code/espurna/sensor.ino +++ b/code/espurna/sensor.ino @@ -238,6 +238,7 @@ void _sensorWebSocketOnConnected(JsonObject& root) { for (unsigned char i=0; i<_sensors.size(); i++) { BaseSensor * sensor = _sensors[i]; + UNUSED(sensor); #if EMON_ANALOG_SUPPORT if (sensor->getID() == SENSOR_EMON_ANALOG_ID) { @@ -1378,17 +1379,17 @@ void _sensorConfigure() { double value; HLW8012Sensor * sensor = (HLW8012Sensor *) _sensors[i]; - if (value = getSetting("pwrExpectedC", 0).toFloat()) { + if ((value = getSetting("pwrExpectedC", 0).toFloat())) { sensor->expectedCurrent(value); setSetting("pwrRatioC", sensor->getCurrentRatio()); } - if (value = getSetting("pwrExpectedV", 0).toInt()) { + if ((value = getSetting("pwrExpectedV", 0).toInt())) { sensor->expectedVoltage(value); setSetting("pwrRatioV", sensor->getVoltageRatio()); } - if (value = getSetting("pwrExpectedP", 0).toInt()) { + if ((value = getSetting("pwrExpectedP", 0).toInt())) { sensor->expectedPower(value); setSetting("pwrRatioP", sensor->getPowerRatio()); }