Skip to content

Commit

Permalink
RP2040: Fixed compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-bs committed May 8, 2024
1 parent 8fa80e2 commit 2523730
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions examples/BresserWeatherSensorMQTTCustom/src/WeatherSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ bool WeatherSensor::getData(uint32_t timeout, uint8_t flags, uint8_t type, void
bool all_slots_valid = true;
bool all_slots_complete = true;

for (int i = 0; i < sensor.size(); i++)
for (size_t i = 0; i < sensor.size(); i++)
{
if (!sensor[i].valid)
{
Expand Down Expand Up @@ -291,7 +291,7 @@ bool WeatherSensor::getData(uint32_t timeout, uint8_t flags, uint8_t type, void
radio.standby();
return true;
}
} // for (int i=0; i<sensor.size(); i++)
} // for (size_t i=0; i<sensor.size(); i++)

// All slots required (valid AND complete)
if ((flags & DATA_ALL_SLOTS) && all_slots_valid && all_slots_complete)
Expand Down Expand Up @@ -509,7 +509,7 @@ int WeatherSensor::findSlot(uint32_t id, DecodeStatus *status)
// Search all slots
int free_slot = -1;
int update_slot = -1;
for (int i = 0; i < sensor.size(); i++)
for (size_t i = 0; i < sensor.size(); i++)
{
log_d("sensor[%d]: v=%d id=0x%08X t=%d c=%d", i, sensor[i].valid, (unsigned int)sensor[i].sensor_id, sensor[i].s_type, sensor[i].complete);

Expand Down Expand Up @@ -554,7 +554,7 @@ int WeatherSensor::findSlot(uint32_t id, DecodeStatus *status)
//
int WeatherSensor::findId(uint32_t id)
{
for (int i = 0; i < sensor.size(); i++)
for (size_t i = 0; i < sensor.size(); i++)
{
if (sensor[i].valid && (sensor[i].sensor_id == id))
return i;
Expand All @@ -567,7 +567,7 @@ int WeatherSensor::findId(uint32_t id)
//
int WeatherSensor::findType(uint8_t type, uint8_t ch)
{
for (int i = 0; i < sensor.size(); i++)
for (size_t i = 0; i < sensor.size(); i++)
{
if (sensor[i].valid && (sensor[i].s_type == type) &&
((ch == 0xFF) || (sensor[i].chan = ch)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class WeatherSensor {
*/
void clearSlots(uint8_t type = 0xFF)
{
for (int i=0; i<sensor.size(); i++) {
for (size_t i=0; i<sensor.size(); i++) {
if ((type == 0xFF) || (sensor[i].s_type == type)) {
sensor[i].valid = false;
sensor[i].complete = false;
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=BresserWeatherSensorReceiver
version=0.28.0
version=0.28.1
author=Matthias Prinke <matthias-bs@web.de>
maintainer=Matthias Prinke <matthias-bs@web.de>
sentence=Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver for Arduino based on CC1101, SX1276/RFM95W or SX1262.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BresserWeatherSensorReceiver",
"version": "0.28.0",
"version": "0.28.1",
"description": "Bresser 5-in-1/6-in-1/7-in-1 868 MHz Weather Sensor Radio Receiver for Arduino based on CC1101, SX1276/RFM95W or SX1262",
"main": "WeatherSensor.cpp",
"frameworks": "arduino",
Expand Down
10 changes: 5 additions & 5 deletions src/WeatherSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ bool WeatherSensor::getData(uint32_t timeout, uint8_t flags, uint8_t type, void
bool all_slots_valid = true;
bool all_slots_complete = true;

for (int i = 0; i < sensor.size(); i++)
for (size_t i = 0; i < sensor.size(); i++)
{
if (!sensor[i].valid)
{
Expand Down Expand Up @@ -291,7 +291,7 @@ bool WeatherSensor::getData(uint32_t timeout, uint8_t flags, uint8_t type, void
radio.standby();
return true;
}
} // for (int i=0; i<sensor.size(); i++)
} // for (size_t i=0; i<sensor.size(); i++)

// All slots required (valid AND complete)
if ((flags & DATA_ALL_SLOTS) && all_slots_valid && all_slots_complete)
Expand Down Expand Up @@ -509,7 +509,7 @@ int WeatherSensor::findSlot(uint32_t id, DecodeStatus *status)
// Search all slots
int free_slot = -1;
int update_slot = -1;
for (int i = 0; i < sensor.size(); i++)
for (size_t i = 0; i < sensor.size(); i++)
{
log_d("sensor[%d]: v=%d id=0x%08X t=%d c=%d", i, sensor[i].valid, (unsigned int)sensor[i].sensor_id, sensor[i].s_type, sensor[i].complete);

Expand Down Expand Up @@ -554,7 +554,7 @@ int WeatherSensor::findSlot(uint32_t id, DecodeStatus *status)
//
int WeatherSensor::findId(uint32_t id)
{
for (int i = 0; i < sensor.size(); i++)
for (size_t i = 0; i < sensor.size(); i++)
{
if (sensor[i].valid && (sensor[i].sensor_id == id))
return i;
Expand All @@ -567,7 +567,7 @@ int WeatherSensor::findId(uint32_t id)
//
int WeatherSensor::findType(uint8_t type, uint8_t ch)
{
for (int i = 0; i < sensor.size(); i++)
for (size_t i = 0; i < sensor.size(); i++)
{
if (sensor[i].valid && (sensor[i].s_type == type) &&
((ch == 0xFF) || (sensor[i].chan = ch)))
Expand Down
2 changes: 1 addition & 1 deletion src/WeatherSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ class WeatherSensor {
*/
void clearSlots(uint8_t type = 0xFF)
{
for (int i=0; i<sensor.size(); i++) {
for (size_t i=0; i<sensor.size(); i++) {
if ((type == 0xFF) || (sensor[i].s_type == type)) {
sensor[i].valid = false;
sensor[i].complete = false;
Expand Down

0 comments on commit 2523730

Please sign in to comment.