Skip to content

Commit 978fe28

Browse files
committed
First pass at addressing linter issues.
It seems we have a new linter that is picking up lots of issues. Attempt to address them.
1 parent 21ba403 commit 978fe28

38 files changed

+1921
-1881
lines changed

examples/IRMQTTServer/IRMQTTServer.ino

+10-8
Original file line numberDiff line numberDiff line change
@@ -1659,11 +1659,12 @@ bool parseStringAndSendAirCon(IRsend *irsend, const decode_type_t irType,
16591659
stateSize = inputLength / 2; // Every two hex chars is a byte.
16601660
// Use at least the minimum size.
16611661
stateSize = std::max(stateSize,
1662-
(uint16_t) (kFujitsuAcStateLengthShort - 1));
1662+
static_cast<uint16_t>(kFujitsuAcStateLengthShort - 1));
16631663
// If we think it isn't a "short" message.
16641664
if (stateSize > kFujitsuAcStateLengthShort)
16651665
// Then it has to be at least the smaller version of the "normal" size.
1666-
stateSize = std::max(stateSize, (uint16_t) (kFujitsuAcStateLength - 1));
1666+
stateSize = std::max(stateSize,
1667+
static_cast<uint16_t>(kFujitsuAcStateLength - 1));
16671668
// Lastly, it should never exceed the maximum "normal" size.
16681669
stateSize = std::min(stateSize, kFujitsuAcStateLength);
16691670
break;
@@ -1675,12 +1676,12 @@ bool parseStringAndSendAirCon(IRsend *irsend, const decode_type_t irType,
16751676
stateSize = inputLength / 2; // Every two hex chars is a byte.
16761677
// Use at least the minimum size.
16771678
stateSize = std::max(stateSize,
1678-
(uint16_t) (kHitachiAc3MinStateLength));
1679+
static_cast<uint16_t>(kHitachiAc3MinStateLength));
16791680
// If we think it isn't a "short" message.
16801681
if (stateSize > kHitachiAc3MinStateLength)
16811682
// Then it probably the "normal" size.
16821683
stateSize = std::max(stateSize,
1683-
(uint16_t) (kHitachiAc3StateLength));
1684+
static_cast<uint16_t>(kHitachiAc3StateLength));
16841685
// Lastly, it should never exceed the maximum "normal" size.
16851686
stateSize = std::min(stateSize, kHitachiAc3StateLength);
16861687
break;
@@ -1691,7 +1692,7 @@ bool parseStringAndSendAirCon(IRsend *irsend, const decode_type_t irType,
16911692
// the correct length/byte size.
16921693
stateSize = inputLength / 2; // Every two hex chars is a byte.
16931694
// Use at least the minimum size.
1694-
stateSize = std::max(stateSize, (uint16_t) 3);
1695+
stateSize = std::max(stateSize, static_cast<uint16_t>(3));
16951696
// Cap the maximum size.
16961697
stateSize = std::min(stateSize, kStateSizeMax);
16971698
break;
@@ -1702,12 +1703,12 @@ bool parseStringAndSendAirCon(IRsend *irsend, const decode_type_t irType,
17021703
// the correct length/byte size.
17031704
stateSize = inputLength / 2; // Every two hex chars is a byte.
17041705
// Use at least the minimum size.
1705-
stateSize = std::max(stateSize, (uint16_t) (kSamsungAcStateLength));
1706+
stateSize = std::max(stateSize, static_cast<uint16_t>(kSamsungAcStateLength));
17061707
// If we think it isn't a "normal" message.
17071708
if (stateSize > kSamsungAcStateLength)
17081709
// Then it probably the extended size.
17091710
stateSize = std::max(stateSize,
1710-
(uint16_t) (kSamsungAcExtendedStateLength));
1711+
static_cast<uint16_t>(kSamsungAcExtendedStateLength));
17111712
// Lastly, it should never exceed the maximum "extended" size.
17121713
stateSize = std::min(stateSize, kSamsungAcExtendedStateLength);
17131714
break;
@@ -2671,7 +2672,8 @@ void receivingMQTT(String const topic_name, String const callback_str) {
26712672
switch (ircommand[0]) {
26722673
case kPauseChar:
26732674
{ // It's a pause. Everything after the 'P' should be a number.
2674-
int32_t msecs = std::min((int32_t) strtoul(ircommand + 1, NULL, 10),
2675+
int32_t msecs = std::min(static_cast<int32_t>(strtoul(ircommand + 1,
2676+
NULL, 10)),
26752677
kMaxPauseMs);
26762678
delay(msecs);
26772679
mqtt_client.publish(MqttAck.c_str(),

examples/IRrecvDump/IRrecvDump.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void dump(decode_results *results) {
8787
Serial.print(results->rawbuf[i] * kRawTick, DEC);
8888
} else {
8989
Serial.print(", ");
90-
Serial.print((uint32_t) results->rawbuf[i] * kRawTick, DEC);
90+
Serial.print(static_cast<uint32_t>(results->rawbuf[i] * kRawTick), DEC);
9191
}
9292
}
9393
Serial.println("};");

0 commit comments

Comments
 (0)