Skip to content

Commit

Permalink
Hopefully fixed all the non-namespace linter errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
crankyoldgit committed Jan 7, 2025
1 parent 3cae482 commit 447f945
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/IRrecv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,8 @@ uint32_t IRrecv::ticksLow(const uint32_t usecs, const uint8_t tolerance,
const uint16_t delta) {
// max() used to ensure the result can't drop below 0 before the cast.
return (static_cast<uint32_t>(std::max(
static_cast<int32_t>(usecs * (1.0 - _validTolerance(tolerance) / 100.0) - delta),
static_cast<int32_t>(usecs * (1.0 - _validTolerance(tolerance) / 100.0) -
delta),
static_cast<int32_t>(0))));
}

Expand Down
2 changes: 1 addition & 1 deletion src/ir_Haier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ void IRHaierAC176::setTemp(const uint8_t degree, const bool fahrenheit) {
/// The unit of temperature is specified by UseFahrenheit value.
/// @return The current setting for temperature.
uint8_t IRHaierAC176::getTemp(void) const {
if (!_.UseFahrenheit)
if (!_.UseFahrenheit)
return _.Temp + kHaierAcYrw02MinTempC;
uint8_t degree = _.Temp*2 + kHaierAcYrw02MinTempF + _.ExtraDegreeF;
// The way of coding the temperature in degree Fahrenheit is
Expand Down
3 changes: 1 addition & 2 deletions src/ir_Panasonic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ void IRsend::sendPanasonic64(const uint64_t data, const uint16_t nbits,
void IRsend::sendPanasonic(const uint16_t address, const uint32_t data,
const uint16_t nbits, const uint16_t repeat) {
sendPanasonic64(static_cast<uint64_t>(address) << 32 |
static_cast<uint64_t>(data),
nbits, repeat);
static_cast<uint64_t>(data), nbits, repeat);
}

/// Calculate the raw Panasonic data based on device, subdevice, & function.
Expand Down
7 changes: 4 additions & 3 deletions src/ir_RC5_RC6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ uint16_t IRsend::encodeRC5X(const uint8_t address, const uint8_t command,
// The 2nd start/field bit (MSB of the return value) is the value of the 7th
// command bit.
bool s2 = (command >> 6) & 1;
return ((uint16_t)s2 << (kRC5XBits - 1)) |
return (static_cast<uint16_t>(s2) << (kRC5XBits - 1)) |
encodeRC5(address, command, key_released);
}

Expand Down Expand Up @@ -174,7 +174,8 @@ uint64_t IRsend::encodeRC6(const uint32_t address, const uint8_t command,
case kRC6Mode0Bits:
return ((address & 0xFFF) << 8) | (command & 0xFF);
case kRC6_36Bits:
return ((uint64_t)(address & 0xFFFFFFF) << 8) | (command & 0xFF);
return (static_cast<uint64_t>(address & 0xFFFFFFF) << 8) |
(command & 0xFF);
default:
return 0;
}
Expand Down Expand Up @@ -360,7 +361,7 @@ bool IRrecv::decodeRC5(decode_results *results, uint16_t offset,
results->repeat = false;
if (is_rc5x) {
results->decode_type = RC5X;
results->command |= ((uint32_t)is_rc5x) << 6;
results->command |= (static_cast<uint32_t>(is_rc5x)) << 6;
} else {
results->decode_type = RC5;
actual_bits--; // RC5 doesn't count the field bit as data.
Expand Down
3 changes: 2 additions & 1 deletion src/ir_Sanyo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,8 @@ uint16_t IRSanyoAc88::getClock(void) const {
/// Set the current clock time.
/// @param[in] mins_since_midnight The time as nr. of minutes past midnight.
void IRSanyoAc88::setClock(const uint16_t mins_since_midnight) {
uint16_t mins = std::min(mins_since_midnight, (uint16_t)(23 * 60 + 59));
uint16_t mins = std::min(mins_since_midnight,
static_cast<uint16_t>(23 * 60 + 59));
_.ClockMins = mins % 60;
_.ClockHrs = mins / 60;
_.ClockSecs = 0;
Expand Down
8 changes: 5 additions & 3 deletions src/ir_Sharp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ const uint16_t kSharpGapTicks = 1677;
const uint16_t kSharpGap = kSharpGapTicks * kSharpTick;
// Address(5) + Command(8) + Expansion(1) + Check(1)
const uint64_t kSharpToggleMask =
((uint64_t)1 << (kSharpBits - kSharpAddressBits)) - 1;
const uint64_t kSharpAddressMask = ((uint64_t)1 << kSharpAddressBits) - 1;
const uint64_t kSharpCommandMask = ((uint64_t)1 << kSharpCommandBits) - 1;
(static_cast<uint64_t>(1) << (kSharpBits - kSharpAddressBits)) - 1;
const uint64_t kSharpAddressMask = (static_cast<uint64_t>(1) <<
kSharpAddressBits) - 1;
const uint64_t kSharpCommandMask = (static_cast<uint64_t>(1) <<
kSharpCommandBits) - 1;

using irutils::addBoolToString;
using irutils::addFanToString;
Expand Down
4 changes: 2 additions & 2 deletions src/ir_Xmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ void IRsend::sendXmp(const uint64_t data, const uint16_t nbits,
uint64_t send_data = data;
for (uint16_t r = 0; r <= repeat; r++) {
uint16_t bits_so_far = kXmpWordSize;
for (uint64_t mask = static_cast<uint64_t>(kXmpMaxWordValue) << (nbits -
kXmpWordSize);
for (uint64_t mask = static_cast<uint64_t>(kXmpMaxWordValue) <<
(nbits - kXmpWordSize);
mask;
mask >>= kXmpWordSize) {
uint8_t word = (send_data & mask) >> (nbits - bits_so_far);
Expand Down
2 changes: 2 additions & 0 deletions test/ir_Argo_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include <gmock/gmock.h>
#include <algorithm>
#include <memory>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#include "ir_Argo.h"
Expand Down
1 change: 1 addition & 0 deletions test/ir_Gorenje_test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2022 Mateusz Bronk (mbronk)

#include <tuple>
#include <vector>
#include "IRac.h"
#include "IRsend.h"
Expand Down

0 comments on commit 447f945

Please sign in to comment.