Skip to content

Commit

Permalink
Fix CDT warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
uweseimet committed Jan 28, 2025
1 parent 0b99b73 commit ed9c3c1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions cpp/base/primary_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ class PrimaryDevice : public Device

protected:

PrimaryDevice(PbDeviceType type, int lun, int delay = SEND_NO_DELAY)
: Device(type, lun), delay_after_bytes(delay)
PrimaryDevice(PbDeviceType t, int l, int delay = SEND_NO_DELAY) : Device(t, l), delay_after_bytes(delay)
{
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/buses/in_process_bus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ bool InProcessBus::WaitForSelection()
return true;
}

DelegatingInProcessBus::DelegatingInProcessBus(InProcessBus &bus, const string &name, bool log_signals) : bus(
bus), in_process_logger(CreateLogger(name)), log_signals(log_signals)
DelegatingInProcessBus::DelegatingInProcessBus(InProcessBus &b, const string &name, bool l) : bus(b), in_process_logger(
CreateLogger(name)), log_signals(l)
{
// Log without timestamps
in_process_logger->set_pattern("[%^%l%$] [%n] %v");
Expand Down
4 changes: 2 additions & 2 deletions cpp/buses/in_process_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ class DelegatingInProcessBus : public InProcessBus
{
return bus.GetDAT();
}
void SetDAT(uint8_t dat) override
void SetDAT(uint8_t d) override
{
bus.SetDAT(dat);
bus.SetDAT(d);
}

bool GetSignal(int) const override;
Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/storage_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class StorageDevice : public PrimaryDevice

protected:

StorageDevice(PbDeviceType type, int lun, bool s, bool p, const set<uint32_t> &sizes)
: PrimaryDevice(type, lun), supported_block_sizes(sizes), supports_mode_select(s), supports_save_parameters(p)
StorageDevice(PbDeviceType t, int l, bool s, bool p, const set<uint32_t> &sizes)
: PrimaryDevice(t, l), supported_block_sizes(sizes), supports_mode_select(s), supports_save_parameters(p)
{
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/devices/tap_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pair<string, string> TapDriver::ExtractAddressAndMask(logger &logger) const
}

// long long is required for compatibility with 32 bit platforms
const auto mask = (long long)(pow(2, 32) - (1 << (32 - m)));
const auto mask = static_cast<long long>(pow(2, 32) - (1 << (32 - m)));
netmask = to_string((mask >> 24) & 0xff) + '.' + to_string((mask >> 16) & 0xff) + '.' +
to_string((mask >> 8) & 0xff) + '.' + to_string(mask & 0xff);
}
Expand Down Expand Up @@ -323,7 +323,7 @@ void TapDriver::Flush(logger &logger) const
{
while (HasPendingPackets()) {
array<uint8_t, ETH_FRAME_LEN> m_garbage_buffer;
(void)Receive(m_garbage_buffer, logger);
static_cast<void>(Receive(m_garbage_buffer, logger));
}
}

Expand Down

0 comments on commit ed9c3c1

Please sign in to comment.