Skip to content

Commit

Permalink
clang-tidy: Apply fixes "modernize-redundant-void-arg"
Browse files Browse the repository at this point in the history
  • Loading branch information
mspang committed Sep 24, 2020
1 parent 5d54534 commit 6309acb
Show file tree
Hide file tree
Showing 203 changed files with 1,095 additions and 1,095 deletions.
2 changes: 1 addition & 1 deletion examples/shell/cmd_base64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static const shell_command_t cmds_base64[] = {
{ &cmd_base64_decode, "decode", "Decode a base64 sting as hex. Usage: base64 decode <base64_string>" },
};

void cmd_base64_init(void)
void cmd_base64_init()
{
// Register `base64` subcommands with the local shell dispatcher.
theShellBase64.RegisterCommands(cmds_base64, ArraySize(cmds_base64));
Expand Down
2 changes: 1 addition & 1 deletion examples/shell/cmd_btp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static const shell_command_t cmds_btp[] = {

#endif // CONFIG_NETWORK_LAYER_BLE

void cmd_btp_init(void)
void cmd_btp_init()
{
#if CONFIG_NETWORK_LAYER_BLE
// CHIP_ERROR error = CHIP_NO_ERROR;
Expand Down
2 changes: 1 addition & 1 deletion examples/shell/cmd_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static const shell_command_t cmds_device[] = {

#endif // CONFIG_DEVICE_LAYER

void cmd_device_init(void)
void cmd_device_init()
{
#if CONFIG_DEVICE_LAYER
CHIP_ERROR error = CHIP_NO_ERROR;
Expand Down
2 changes: 1 addition & 1 deletion examples/shell/cmd_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static shell_command_t cmds_misc[] = {
{ &cmd_rand, "rand", "Random number utilities" },
};

void cmd_misc_init(void)
void cmd_misc_init()
{
shell_register(cmds_misc, ArraySize(cmds_misc));
}
2 changes: 1 addition & 1 deletion examples/shell/cmd_otcli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static int OnOtCliOutput(const char * aBuf, uint16_t aBufLength, void * aContext

#endif // CHIP_ENABLE_OPENTHREAD

void cmd_otcli_init(void)
void cmd_otcli_init()
{
#if CHIP_ENABLE_OPENTHREAD
#if CHIP_TARGET_STYLE_EMBEDDED
Expand Down
2 changes: 1 addition & 1 deletion examples/shell/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ CHIP_ERROR soft_device_init()
}
#endif // defined(CHIP_DEVICE_LAYER_TARGET_NRF5)

int main(void)
int main()
{
#if defined(CHIP_DEVICE_LAYER_TARGET_NRF5)
soft_device_init();
Expand Down
66 changes: 33 additions & 33 deletions src/ble/BLEEndPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ class DLL_EXPORT BLEEndPoint : public BleLayerObject
// Public functions:
BLE_ERROR Send(PacketBuffer * data);
BLE_ERROR Receive(PacketBuffer * data);
BLE_ERROR StartConnect(void);
BLE_ERROR StartConnect();

bool IsUnsubscribePending(void) const;
void Close(void);
void Abort(void);
bool IsUnsubscribePending() const;
void Close();
void Abort();

private:
// Private data members:
Expand Down Expand Up @@ -159,50 +159,50 @@ class DLL_EXPORT BLEEndPoint : public BleLayerObject

private:
// Private functions:
BLEEndPoint(void) = delete;
~BLEEndPoint(void) = delete;
BLEEndPoint() = delete;
~BLEEndPoint() = delete;

BLE_ERROR Init(BleLayer * bleLayer, BLE_CONNECTION_OBJECT connObj, BleRole role, bool autoClose);
bool IsConnected(uint8_t state) const;
void DoClose(uint8_t flags, BLE_ERROR err);

// Transmit path:
BLE_ERROR DriveSending(void);
BLE_ERROR DriveStandAloneAck(void);
BLE_ERROR DriveSending();
BLE_ERROR DriveStandAloneAck();
bool PrepareNextFragment(PacketBuffer * data, bool & sentAck);
BLE_ERROR SendNextMessage(void);
BLE_ERROR ContinueMessageSend(void);
BLE_ERROR DoSendStandAloneAck(void);
BLE_ERROR SendNextMessage();
BLE_ERROR ContinueMessageSend();
BLE_ERROR DoSendStandAloneAck();
BLE_ERROR SendCharacteristic(PacketBuffer * buf);
bool SendIndication(PacketBuffer * buf);
bool SendWrite(PacketBuffer * buf);

// Receive path:
BLE_ERROR HandleConnectComplete(void);
BLE_ERROR HandleReceiveConnectionComplete(void);
void HandleSubscribeReceived(void);
void HandleSubscribeComplete(void);
void HandleUnsubscribeComplete(void);
BLE_ERROR HandleGattSendConfirmationReceived(void);
BLE_ERROR HandleHandshakeConfirmationReceived(void);
BLE_ERROR HandleFragmentConfirmationReceived(void);
BLE_ERROR HandleConnectComplete();
BLE_ERROR HandleReceiveConnectionComplete();
void HandleSubscribeReceived();
void HandleSubscribeComplete();
void HandleUnsubscribeComplete();
BLE_ERROR HandleGattSendConfirmationReceived();
BLE_ERROR HandleHandshakeConfirmationReceived();
BLE_ERROR HandleFragmentConfirmationReceived();
BLE_ERROR HandleCapabilitiesRequestReceived(PacketBuffer * data);
BLE_ERROR HandleCapabilitiesResponseReceived(PacketBuffer * data);
SequenceNumber_t AdjustRemoteReceiveWindow(SequenceNumber_t lastReceivedAck, SequenceNumber_t maxRemoteWindowSize,
SequenceNumber_t newestUnackedSentSeqNum);

// Timer control functions:
BLE_ERROR StartConnectTimer(void); // Start connect timer.
BLE_ERROR StartReceiveConnectionTimer(void); // Start receive connection timer.
BLE_ERROR StartAckReceivedTimer(void); // Start ack-received timer if it's not already running.
BLE_ERROR RestartAckReceivedTimer(void); // Restart ack-received timer.
BLE_ERROR StartSendAckTimer(void); // Start send-ack timer if it's not already running.
BLE_ERROR StartUnsubscribeTimer(void);
void StopConnectTimer(void); // Stop connect timer.
void StopReceiveConnectionTimer(void); // Stop receive connection timer.
void StopAckReceivedTimer(void); // Stop ack-received timer.
void StopSendAckTimer(void); // Stop send-ack timer.
void StopUnsubscribeTimer(void); // Stop unsubscribe timer.
BLE_ERROR StartConnectTimer(); // Start connect timer.
BLE_ERROR StartReceiveConnectionTimer(); // Start receive connection timer.
BLE_ERROR StartAckReceivedTimer(); // Start ack-received timer if it's not already running.
BLE_ERROR RestartAckReceivedTimer(); // Restart ack-received timer.
BLE_ERROR StartSendAckTimer(); // Start send-ack timer if it's not already running.
BLE_ERROR StartUnsubscribeTimer();
void StopConnectTimer(); // Stop connect timer.
void StopReceiveConnectionTimer(); // Stop receive connection timer.
void StopAckReceivedTimer(); // Stop ack-received timer.
void StopSendAckTimer(); // Stop send-ack timer.
void StopUnsubscribeTimer(); // Stop unsubscribe timer.

// Timer expired callbacks:
static void HandleConnectTimeout(chip::System::Layer * systemLayer, void * appState, chip::System::Error err);
Expand All @@ -214,9 +214,9 @@ class DLL_EXPORT BLEEndPoint : public BleLayerObject
// Close functions:
void DoCloseCallback(uint8_t state, uint8_t flags, BLE_ERROR err);
void FinalizeClose(uint8_t state, uint8_t flags, BLE_ERROR err);
void ReleaseBleConnection(void);
void Free(void);
void FreeBtpEngine(void);
void ReleaseBleConnection();
void Free();
void FreeBtpEngine();

// Mutex lock on Tx queue. Used only in BtpEngine test build for now.
#if CHIP_ENABLE_CHIPOBLE_TEST
Expand Down
2 changes: 1 addition & 1 deletion src/ble/BleError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace Ble {
/**
* Register a text error formatter for BLE Layer errors.
*/
void RegisterLayerErrorFormatter(void)
void RegisterLayerErrorFormatter()
{
static ErrorFormatter sBleLayerErrorFormatter = { FormatLayerError, nullptr };

Expand Down
2 changes: 1 addition & 1 deletion src/ble/BleError.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ typedef BLE_CONFIG_ERROR_TYPE BLE_ERROR;
namespace chip {
namespace Ble {

extern void RegisterLayerErrorFormatter(void);
extern void RegisterLayerErrorFormatter();
extern bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err);

} /* namespace Ble */
Expand Down
10 changes: 5 additions & 5 deletions src/ble/BleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ class BleLayerObject
protected:
uint32_t mRefCount;

void AddRef(void) { mRefCount++; }
void Release(void);
void AddRef() { mRefCount++; }
void Release();
};

class BleTransportCapabilitiesRequestMessage
Expand Down Expand Up @@ -246,12 +246,12 @@ class DLL_EXPORT BleLayer

public:
// Public functions:
BleLayer(void);
BleLayer();

BLE_ERROR Init(BlePlatformDelegate * platformDelegate, BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer);
BLE_ERROR Init(BlePlatformDelegate * platformDelegate, BleConnectionDelegate * connDelegate,
BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer);
BLE_ERROR Shutdown(void);
BLE_ERROR Shutdown();

BLE_ERROR NewBleConnection(void * appState, const uint16_t connDiscriminator,
BleConnectionDelegate::OnConnectionCompleteFunct onConnectionComplete,
Expand Down Expand Up @@ -348,7 +348,7 @@ class DLL_EXPORT BleLayer
// Private functions:
void HandleDataReceived(BLE_CONNECTION_OBJECT connObj, PacketBuffer * pBuf);
void HandleAckReceived(BLE_CONNECTION_OBJECT connObj);
void DriveSending(void);
void DriveSending();
BLE_ERROR HandleBleTransportConnectionInitiated(BLE_CONNECTION_OBJECT connObj, PacketBuffer * pBuf);

static BleTransportProtocolVersion GetHighestSupportedProtocolVersion(const BleTransportCapabilitiesRequestMessage & reqMsg);
Expand Down
36 changes: 18 additions & 18 deletions src/ble/BtpEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,27 @@ class BtpEngine

public:
// Public functions:
BtpEngine(void) {}
~BtpEngine(void) {}
BtpEngine() {}
~BtpEngine() {}

BLE_ERROR Init(void * an_app_state, bool expect_first_ack);

inline void SetTxFragmentSize(uint8_t size) { mTxFragmentSize = size; }
inline void SetRxFragmentSize(uint8_t size) { mRxFragmentSize = size; }

uint16_t GetRxFragmentSize(void) { return mRxFragmentSize; }
uint16_t GetTxFragmentSize(void) { return mTxFragmentSize; }
uint16_t GetRxFragmentSize() { return mRxFragmentSize; }
uint16_t GetTxFragmentSize() { return mTxFragmentSize; }

SequenceNumber_t GetAndIncrementNextTxSeqNum(void);
SequenceNumber_t GetAndRecordRxAckSeqNum(void);
SequenceNumber_t GetAndIncrementNextTxSeqNum();
SequenceNumber_t GetAndRecordRxAckSeqNum();

inline SequenceNumber_t GetLastReceivedSequenceNumber(void) { return mRxNewestUnackedSeqNum; }
inline SequenceNumber_t GetNewestUnackedSentSequenceNumber(void) { return mTxNewestUnackedSeqNum; }
inline SequenceNumber_t GetLastReceivedSequenceNumber() { return mRxNewestUnackedSeqNum; }
inline SequenceNumber_t GetNewestUnackedSentSequenceNumber() { return mTxNewestUnackedSeqNum; }

inline bool ExpectingAck(void) const { return mExpectingAck; }
inline bool ExpectingAck() const { return mExpectingAck; }

inline State_t RxState(void) { return mRxState; }
inline State_t TxState(void) { return mTxState; }
inline State_t RxState() { return mRxState; }
inline State_t TxState() { return mTxState; }
#if CHIP_ENABLE_CHIPOBLE_TEST
inline PacketType_t SetTxPacketType(PacketType_t type) { return (mTxPacketType = type); }
inline PacketType_t SetRxPacketType(PacketType_t type) { return (mRxPacketType = type); }
Expand All @@ -137,20 +137,20 @@ class BtpEngine
}
#endif // CHIP_ENABLE_CHIPOBLE_TEST

bool HasUnackedData(void) const;
bool HasUnackedData() const;

BLE_ERROR HandleCharacteristicReceived(PacketBuffer * data, SequenceNumber_t & receivedAck, bool & didReceiveAck);
bool HandleCharacteristicSend(PacketBuffer * data, bool send_ack);
BLE_ERROR EncodeStandAloneAck(PacketBuffer * data);

PacketBuffer * RxPacket(void);
PacketBuffer * TxPacket(void);
PacketBuffer * RxPacket();
PacketBuffer * TxPacket();

bool ClearRxPacket(void);
bool ClearTxPacket(void);
bool ClearRxPacket();
bool ClearTxPacket();

void LogState(void) const;
void LogStateDebug(void) const;
void LogState() const;
void LogStateDebug() const;

private:
// Private data members:
Expand Down
6 changes: 3 additions & 3 deletions src/ble/CHIPBleServiceData.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ struct ChipBLEDeviceIdentificationInfo

void Init() { memset(this, 0, sizeof(*this)); }

uint16_t GetVendorId(void) { return chip::Encoding::LittleEndian::Get16(DeviceVendorId); }
uint16_t GetVendorId() { return chip::Encoding::LittleEndian::Get16(DeviceVendorId); }

void SetVendorId(uint16_t vendorId) { chip::Encoding::LittleEndian::Put16(DeviceVendorId, vendorId); }

uint16_t GetProductId(void) { return chip::Encoding::LittleEndian::Get16(DeviceProductId); }
uint16_t GetProductId() { return chip::Encoding::LittleEndian::Get16(DeviceProductId); }

void SetProductId(uint16_t productId) { chip::Encoding::LittleEndian::Put16(DeviceProductId, productId); }

uint16_t GetDeviceDiscriminator(void)
uint16_t GetDeviceDiscriminator()
{
uint16_t discriminator = chip::Encoding::LittleEndian::Get16(DeviceDiscriminator);
constexpr uint16_t kDiscriminatorMask = 0x7f;
Expand Down
6 changes: 3 additions & 3 deletions src/crypto/CHIPCryptoPAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ CHIP_ERROR Spake2p::Init(const uint8_t * context, size_t context_len)
return error;
}

CHIP_ERROR Spake2p::WriteMN(void)
CHIP_ERROR Spake2p::WriteMN()
{
CHIP_ERROR error = CHIP_ERROR_INTERNAL;

Expand Down Expand Up @@ -323,7 +323,7 @@ CHIP_ERROR Spake2p::ComputeRoundTwo(const uint8_t * in, size_t in_len, uint8_t *
return error;
}

CHIP_ERROR Spake2p::GenerateKeys(void)
CHIP_ERROR Spake2p::GenerateKeys()
{
CHIP_ERROR error = CHIP_ERROR_INTERNAL;
static const uint8_t info_keyconfirm[16] = { 'C', 'o', 'n', 'f', 'i', 'r', 'm', 'a', 't', 'i', 'o', 'n', 'K', 'e', 'y', 's' };
Expand Down Expand Up @@ -387,7 +387,7 @@ CHIP_ERROR Spake2p::GetKeys(uint8_t * out, size_t * out_len)
return error;
}

CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitImpl(void)
CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitImpl()
{
CHIP_ERROR error = CHIP_ERROR_INTERNAL;

Expand Down
18 changes: 9 additions & 9 deletions src/crypto/CHIPCryptoPAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ struct HashSHA256OpaqueContext
class Hash_SHA256_stream
{
public:
Hash_SHA256_stream(void);
~Hash_SHA256_stream(void);
Hash_SHA256_stream();
~Hash_SHA256_stream();

CHIP_ERROR Begin(void);
CHIP_ERROR Begin();
CHIP_ERROR AddData(const uint8_t * data, const size_t data_length);
CHIP_ERROR Finish(uint8_t * out_buffer);
void Clear(void);
void Clear();

private:
HashSHA256OpaqueContext mContext;
Expand Down Expand Up @@ -419,7 +419,7 @@ class Spake2p
{
public:
Spake2p(size_t fe_size, size_t point_size, size_t hash_size);
virtual ~Spake2p(void) {}
virtual ~Spake2p() {}

/**
* @brief Initialize Spake2+ with some context specific information.
Expand Down Expand Up @@ -510,8 +510,8 @@ class Spake2p
CHIP_ERROR GetKeys(uint8_t * out, size_t * out_len);

CHIP_ERROR InternalHash(const uint8_t * in, size_t in_len);
CHIP_ERROR WriteMN(void);
CHIP_ERROR GenerateKeys(void);
CHIP_ERROR WriteMN();
CHIP_ERROR GenerateKeys();

/**
* @brief Load a field element.
Expand Down Expand Up @@ -771,12 +771,12 @@ struct Spake2pOpaqueContext
class Spake2p_P256_SHA256_HKDF_HMAC : public Spake2p
{
public:
Spake2p_P256_SHA256_HKDF_HMAC(void) : Spake2p(kP256_FE_Length, kP256_Point_Length, kSHA256_Hash_Length)
Spake2p_P256_SHA256_HKDF_HMAC() : Spake2p(kP256_FE_Length, kP256_Point_Length, kSHA256_Hash_Length)
{
memset(&mSpake2pContext, 0, sizeof(mSpake2pContext));
}

~Spake2p_P256_SHA256_HKDF_HMAC(void) override { FreeImpl(); }
~Spake2p_P256_SHA256_HKDF_HMAC() override { FreeImpl(); }

CHIP_ERROR Mac(const uint8_t * key, size_t key_len, const uint8_t * in, size_t in_len, uint8_t * out) override;
CHIP_ERROR MacVerify(const uint8_t * key, size_t key_len, const uint8_t * mac, size_t mac_len, const uint8_t * in,
Expand Down
Loading

0 comments on commit 6309acb

Please sign in to comment.