Skip to content

Commit 3390e72

Browse files
authored
Fix linter issues (#2173)
It seems we have a new linter that is picking up lots of issues. Attempt to address them. Set cpplint to ignore whitespace/namespace issues
1 parent 21ba403 commit 3390e72

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1987
-1908
lines changed

CPPLINT.cfg

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
set noparent
22
root=src
33
linelength=80
4+
filter=-whitespace/indent_namespace

examples/IRMQTTServer/IRMQTTServer.ino

+13-9
Original file line numberDiff line numberDiff line change
@@ -1659,11 +1659,13 @@ 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 -
1663+
1));
16631664
// If we think it isn't a "short" message.
16641665
if (stateSize > kFujitsuAcStateLengthShort)
16651666
// Then it has to be at least the smaller version of the "normal" size.
1666-
stateSize = std::max(stateSize, (uint16_t) (kFujitsuAcStateLength - 1));
1667+
stateSize = std::max(stateSize,
1668+
static_cast<uint16_t>(kFujitsuAcStateLength - 1));
16671669
// Lastly, it should never exceed the maximum "normal" size.
16681670
stateSize = std::min(stateSize, kFujitsuAcStateLength);
16691671
break;
@@ -1675,12 +1677,12 @@ bool parseStringAndSendAirCon(IRsend *irsend, const decode_type_t irType,
16751677
stateSize = inputLength / 2; // Every two hex chars is a byte.
16761678
// Use at least the minimum size.
16771679
stateSize = std::max(stateSize,
1678-
(uint16_t) (kHitachiAc3MinStateLength));
1680+
static_cast<uint16_t>(kHitachiAc3MinStateLength));
16791681
// If we think it isn't a "short" message.
16801682
if (stateSize > kHitachiAc3MinStateLength)
16811683
// Then it probably the "normal" size.
16821684
stateSize = std::max(stateSize,
1683-
(uint16_t) (kHitachiAc3StateLength));
1685+
static_cast<uint16_t>(kHitachiAc3StateLength));
16841686
// Lastly, it should never exceed the maximum "normal" size.
16851687
stateSize = std::min(stateSize, kHitachiAc3StateLength);
16861688
break;
@@ -1691,7 +1693,7 @@ bool parseStringAndSendAirCon(IRsend *irsend, const decode_type_t irType,
16911693
// the correct length/byte size.
16921694
stateSize = inputLength / 2; // Every two hex chars is a byte.
16931695
// Use at least the minimum size.
1694-
stateSize = std::max(stateSize, (uint16_t) 3);
1696+
stateSize = std::max(stateSize, static_cast<uint16_t>(3));
16951697
// Cap the maximum size.
16961698
stateSize = std::min(stateSize, kStateSizeMax);
16971699
break;
@@ -1702,12 +1704,13 @@ bool parseStringAndSendAirCon(IRsend *irsend, const decode_type_t irType,
17021704
// the correct length/byte size.
17031705
stateSize = inputLength / 2; // Every two hex chars is a byte.
17041706
// Use at least the minimum size.
1705-
stateSize = std::max(stateSize, (uint16_t) (kSamsungAcStateLength));
1707+
stateSize = std::max(stateSize,
1708+
static_cast<uint16_t>(kSamsungAcStateLength));
17061709
// If we think it isn't a "normal" message.
17071710
if (stateSize > kSamsungAcStateLength)
17081711
// Then it probably the extended size.
1709-
stateSize = std::max(stateSize,
1710-
(uint16_t) (kSamsungAcExtendedStateLength));
1712+
stateSize = std::max(
1713+
stateSize, static_cast<uint16_t>(kSamsungAcExtendedStateLength));
17111714
// Lastly, it should never exceed the maximum "extended" size.
17121715
stateSize = std::min(stateSize, kSamsungAcExtendedStateLength);
17131716
break;
@@ -2671,7 +2674,8 @@ void receivingMQTT(String const topic_name, String const callback_str) {
26712674
switch (ircommand[0]) {
26722675
case kPauseChar:
26732676
{ // 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),
2677+
int32_t msecs = std::min(static_cast<int32_t>(strtoul(ircommand + 1,
2678+
NULL, 10)),
26752679
kMaxPauseMs);
26762680
delay(msecs);
26772681
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)