From 6309acbea15f9d99312545affb14d6aae78fe525 Mon Sep 17 00:00:00 2001 From: Michael Spang Date: Thu, 24 Sep 2020 13:51:12 -0400 Subject: [PATCH] clang-tidy: Apply fixes "modernize-redundant-void-arg" --- examples/shell/cmd_base64.cpp | 2 +- examples/shell/cmd_btp.cpp | 2 +- examples/shell/cmd_device.cpp | 2 +- examples/shell/cmd_misc.cpp | 2 +- examples/shell/cmd_otcli.cpp | 2 +- examples/shell/main.cpp | 2 +- src/ble/BLEEndPoint.h | 66 ++++---- src/ble/BleError.cpp | 2 +- src/ble/BleError.h | 2 +- src/ble/BleLayer.h | 10 +- src/ble/BtpEngine.h | 36 ++-- src/ble/CHIPBleServiceData.h | 6 +- src/crypto/CHIPCryptoPAL.cpp | 6 +- src/crypto/CHIPCryptoPAL.h | 18 +- src/crypto/CHIPCryptoPALOpenSSL.cpp | 12 +- src/crypto/tests/CHIPCryptoPALTestDriver.cpp | 2 +- src/include/platform/ConfigurationManager.h | 4 +- src/include/platform/ConnectivityManager.h | 158 +++++++++--------- src/include/platform/GeneralUtils.h | 2 +- src/include/platform/PlatformManager.h | 28 ++-- src/include/platform/SoftwareUpdateManager.h | 28 ++-- .../platform/SoftwareUpdateManagerImpl.h | 10 +- src/include/platform/ThreadStackManager.h | 64 +++---- src/include/platform/TimeSyncManager.h | 4 +- src/include/platform/internal/BLEManager.h | 32 ++-- src/include/platform/internal/EventLogging.h | 2 +- .../internal/GenericConnectivityManagerImpl.h | 8 +- .../GenericConnectivityManagerImpl_BLE.h | 28 ++-- .../GenericConnectivityManagerImpl_Thread.h | 36 ++-- .../GenericConnectivityManagerImpl_Thread.ipp | 4 +- .../GenericConnectivityManagerImpl_WiFi.h | 54 +++--- .../GenericConnectivityManagerImpl_WiFi.ipp | 2 +- .../internal/GenericPlatformManagerImpl.ipp | 2 +- .../GenericPlatformManagerImpl_POSIX.h | 12 +- .../GenericPlatformManagerImpl_POSIX.ipp | 14 +- .../GenericSoftwareUpdateManagerImpl.h | 30 ++-- .../internal/testing/ConfigUnitTest.h | 2 +- src/inet/AsyncDNSResolverSockets.cpp | 6 +- src/inet/AsyncDNSResolverSockets.h | 8 +- src/inet/DNSResolver.cpp | 2 +- src/inet/DNSResolver.h | 4 +- src/inet/EndPointBasis.h | 8 +- src/inet/IPAddress.cpp | 14 +- src/inet/IPAddress.h | 32 ++-- src/inet/IPEndPointBasis.cpp | 2 +- src/inet/IPEndPointBasis.h | 6 +- src/inet/IPPrefix.h | 2 +- src/inet/InetError.cpp | 2 +- src/inet/InetError.h | 2 +- src/inet/InetFaultInjection.cpp | 2 +- src/inet/InetFaultInjection.h | 2 +- src/inet/InetInterface.cpp | 42 ++--- src/inet/InetInterface.h | 52 +++--- src/inet/InetLayer.cpp | 8 +- src/inet/InetLayer.h | 14 +- src/inet/InetLayerBasis.h | 4 +- src/inet/RawEndPoint.cpp | 12 +- src/inet/RawEndPoint.h | 16 +- src/inet/TCPEndPoint.cpp | 6 +- src/inet/TCPEndPoint.h | 58 +++---- src/inet/UDPEndPoint.cpp | 14 +- src/inet/UDPEndPoint.h | 18 +- src/inet/tests/TestInetAddressDriver.cpp | 2 +- src/inet/tests/TestInetCommon.cpp | 8 +- src/inet/tests/TestInetCommon.h | 14 +- src/inet/tests/TestInetEndPoint.cpp | 2 +- src/inet/tests/TestInetEndPointDriver.cpp | 2 +- src/inet/tests/TestInetErrorStrDriver.cpp | 2 +- src/inet/tests/TestInetLayer.cpp | 14 +- src/inet/tests/TestInetLayerCommon.cpp | 4 +- src/inet/tests/TestInetLayerCommon.hpp | 6 +- src/inet/tests/TestInetLayerDNS.cpp | 2 +- src/inet/tests/TestInetLayerDNSDriver.cpp | 2 +- src/inet/tests/TestInetLayerMulticast.cpp | 14 +- src/lib/core/CHIPCircularTLVBuffer.cpp | 2 +- src/lib/core/CHIPCircularTLVBuffer.h | 16 +- src/lib/core/CHIPError.cpp | 2 +- src/lib/core/CHIPError.h | 2 +- src/lib/core/CHIPTLV.h | 78 ++++----- src/lib/core/CHIPTLVReader.cpp | 4 +- src/lib/core/Optional.h | 6 +- src/lib/core/ReferenceCounted.h | 4 +- src/lib/core/tests/TestCHIPCallbackDriver.cpp | 2 +- src/lib/core/tests/TestCHIPErrorStrDriver.cpp | 2 +- src/lib/core/tests/TestCHIPTLVDriver.cpp | 2 +- .../core/tests/TestReferenceCountedDriver.cpp | 2 +- src/lib/message/CHIPBinding.cpp | 14 +- src/lib/message/CHIPBinding.h | 76 ++++----- src/lib/message/CHIPConnection.cpp | 2 +- src/lib/message/CHIPExchangeMgr.cpp | 10 +- src/lib/message/CHIPExchangeMgr.h | 62 +++---- src/lib/message/CHIPFabricState.cpp | 12 +- src/lib/message/CHIPFabricState.h | 32 ++-- src/lib/message/CHIPMessageLayer.cpp | 6 +- src/lib/message/CHIPMessageLayer.h | 84 +++++----- src/lib/message/CHIPSecurityMgr.cpp | 18 +- src/lib/message/CHIPSecurityMgr.h | 18 +- src/lib/message/CHIPServerBase.h | 4 +- src/lib/message/ExchangeContext.cpp | 24 +-- .../message/support/crypto/AESBlockCipher.h | 12 +- src/lib/message/support/crypto/CTRMode.h | 6 +- src/lib/message/support/crypto/HMAC.h | 6 +- src/lib/message/support/crypto/HashAlgos.h | 16 +- src/lib/protocols/common/CHIPMessage.h | 32 ++-- .../fabric-provisioning/FabricProvisioning.h | 18 +- .../protocols/security/CHIPApplicationKeys.h | 10 +- .../security/CHIPDummyGroupKeyStore.h | 8 +- .../status-report/StatusReportProtocol.h | 8 +- src/lib/shell/streamer.h | 2 +- src/lib/shell/streamer_stdio.cpp | 4 +- src/lib/support/CHIPCounter.cpp | 8 +- src/lib/support/CHIPCounter.h | 16 +- src/lib/support/CHIPFaultInjection.cpp | 2 +- src/lib/support/CHIPFaultInjection.h | 2 +- src/lib/support/CHIPMem-Malloc.cpp | 2 +- src/lib/support/CHIPMem.h | 2 +- src/lib/support/PersistedCounter.cpp | 6 +- src/lib/support/PersistedCounter.h | 6 +- src/lib/support/RandUtils.h | 8 +- src/lib/support/TestUtils.h | 2 +- src/lib/support/logging/CHIPLogging.h | 2 +- src/lib/support/tests/TestBufBoundDriver.cpp | 2 +- .../support/tests/TestCHIPArgParserDriver.cpp | 2 +- src/lib/support/tests/TestCHIPMemDriver.cpp | 2 +- src/lib/support/tests/TestErrorStr.cpp | 2 +- src/lib/support/tests/TestErrorStrDriver.cpp | 2 +- src/lib/support/tests/TestTimeUtils.cpp | 6 +- src/lib/support/tests/TestTimeUtilsDriver.cpp | 2 +- src/lib/support/verhoeff/Verhoeff.h | 16 +- src/platform/GeneralUtils.cpp | 2 +- src/platform/Linux/BLEManagerImpl.cpp | 6 +- src/platform/Linux/BLEManagerImpl.h | 34 ++-- src/platform/Linux/CHIPLinuxStorage.cpp | 4 +- src/platform/Linux/CHIPLinuxStorage.h | 4 +- src/platform/Linux/CHIPLinuxStorageIni.cpp | 2 +- src/platform/Linux/CHIPLinuxStorageIni.h | 4 +- src/platform/Linux/ConfigurationManagerImpl.h | 14 +- .../Linux/ConnectivityManagerImpl.cpp | 6 +- src/platform/Linux/ConnectivityManagerImpl.h | 20 +-- src/platform/Linux/Logging.cpp | 2 +- src/platform/Linux/PlatformManagerImpl.cpp | 2 +- src/platform/Linux/PlatformManagerImpl.h | 10 +- src/platform/Linux/PosixConfig.cpp | 2 +- src/platform/Linux/PosixConfig.h | 6 +- src/platform/Linux/SystemTimeSupport.cpp | 6 +- src/platform/Linux/ThreadStackManagerImpl.cpp | 6 +- src/platform/Linux/ThreadStackManagerImpl.h | 2 +- src/platform/tests/TestCHIPoBLEStackMgr.h | 2 +- src/platform/tests/TestConfigurationMgr.cpp | 2 +- src/platform/tests/TestConfigurationMgr.h | 2 +- .../tests/TestConfigurationMgrDriver.cpp | 2 +- src/platform/tests/TestPlatformMgr.cpp | 2 +- src/platform/tests/TestPlatformMgr.h | 2 +- src/platform/tests/TestPlatformMgrDriver.cpp | 2 +- src/platform/tests/TestPlatformTime.cpp | 2 +- src/platform/tests/TestPlatformTime.h | 2 +- src/platform/tests/TestPlatformTimeDriver.cpp | 2 +- src/platform/tests/TestThreadStackMgr.cpp | 2 +- src/setup_payload/SetupPayload.cpp | 2 +- src/setup_payload/SetupPayload.h | 2 +- src/setup_payload/tests/TestManualCode.cpp | 2 +- src/setup_payload/tests/TestManualCode.h | 2 +- .../tests/TestManualCodeDriver.cpp | 2 +- src/setup_payload/tests/TestQRCode.cpp | 2 +- src/setup_payload/tests/TestQRCode.h | 2 +- src/setup_payload/tests/TestQRCodeDriver.cpp | 2 +- src/setup_payload/tests/TestQRCodeTLV.cpp | 2 +- src/setup_payload/tests/TestQRCodeTLV.h | 2 +- .../tests/TestQRCodeTLVDriver.cpp | 2 +- src/system/SystemClock.cpp | 6 +- src/system/SystemClock.h | 6 +- src/system/SystemError.cpp | 4 +- src/system/SystemError.h | 4 +- src/system/SystemFaultInjection.cpp | 8 +- src/system/SystemFaultInjection.h | 6 +- src/system/SystemLayer.cpp | 6 +- src/system/SystemLayer.h | 18 +- src/system/SystemMutex.h | 16 +- src/system/SystemObject.cpp | 2 +- src/system/SystemObject.h | 22 +-- src/system/SystemPacketBuffer.cpp | 4 +- src/system/SystemPacketBuffer.h | 30 ++-- src/system/SystemStats.cpp | 6 +- src/system/SystemStats.h | 6 +- src/system/SystemTimer.cpp | 2 +- src/system/SystemTimer.h | 6 +- src/system/tests/TestSystemErrorStrDriver.cpp | 2 +- src/system/tests/TestSystemObject.cpp | 4 +- .../tests/TestSystemPacketBufferDriver.cpp | 2 +- src/transport/MessageHeader.h | 14 +- src/transport/SecurePairingSession.cpp | 4 +- src/transport/SecurePairingSession.h | 6 +- src/transport/SecureSession.cpp | 2 +- src/transport/SecureSession.h | 6 +- src/transport/SecureSessionMgr.cpp | 4 +- src/transport/SecureSessionMgr.h | 4 +- .../tests/TestMessageHeaderDriver.cpp | 2 +- .../tests/TestPeerConnectionsDriver.cpp | 2 +- .../tests/TestSecurePairingSessionDriver.cpp | 2 +- .../tests/TestSecureSessionDriver.cpp | 2 +- .../tests/TestSecureSessionMgrDriver.cpp | 2 +- src/transport/tests/TestTCPDriver.cpp | 2 +- src/transport/tests/TestUDPDriver.cpp | 2 +- 203 files changed, 1095 insertions(+), 1095 deletions(-) diff --git a/examples/shell/cmd_base64.cpp b/examples/shell/cmd_base64.cpp index 9ccb92bdbbb430..4aabccf16ee272 100644 --- a/examples/shell/cmd_base64.cpp +++ b/examples/shell/cmd_base64.cpp @@ -102,7 +102,7 @@ static const shell_command_t cmds_base64[] = { { &cmd_base64_decode, "decode", "Decode a base64 sting as hex. Usage: base64 decode " }, }; -void cmd_base64_init(void) +void cmd_base64_init() { // Register `base64` subcommands with the local shell dispatcher. theShellBase64.RegisterCommands(cmds_base64, ArraySize(cmds_base64)); diff --git a/examples/shell/cmd_btp.cpp b/examples/shell/cmd_btp.cpp index 7de51cad1256e6..2e7b6b49003141 100644 --- a/examples/shell/cmd_btp.cpp +++ b/examples/shell/cmd_btp.cpp @@ -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; diff --git a/examples/shell/cmd_device.cpp b/examples/shell/cmd_device.cpp index ff8a5f6348c5f7..ef1fd2d2cfd57d 100644 --- a/examples/shell/cmd_device.cpp +++ b/examples/shell/cmd_device.cpp @@ -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; diff --git a/examples/shell/cmd_misc.cpp b/examples/shell/cmd_misc.cpp index 54d3bc63dc382e..c937b2f3114137 100644 --- a/examples/shell/cmd_misc.cpp +++ b/examples/shell/cmd_misc.cpp @@ -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)); } diff --git a/examples/shell/cmd_otcli.cpp b/examples/shell/cmd_otcli.cpp index aabe477bd0719b..ee1f10be72aea3 100644 --- a/examples/shell/cmd_otcli.cpp +++ b/examples/shell/cmd_otcli.cpp @@ -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 diff --git a/examples/shell/main.cpp b/examples/shell/main.cpp index 3b75bd7111151f..d076e3d336bed1 100644 --- a/examples/shell/main.cpp +++ b/examples/shell/main.cpp @@ -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(); diff --git a/src/ble/BLEEndPoint.h b/src/ble/BLEEndPoint.h index c47d45596de062..01ff7bda7785f2 100644 --- a/src/ble/BLEEndPoint.h +++ b/src/ble/BLEEndPoint.h @@ -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: @@ -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); @@ -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 diff --git a/src/ble/BleError.cpp b/src/ble/BleError.cpp index ddb207048bb997..a401c99694a5f5 100644 --- a/src/ble/BleError.cpp +++ b/src/ble/BleError.cpp @@ -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 }; diff --git a/src/ble/BleError.h b/src/ble/BleError.h index 50ed128fa36598..a67364b991aefd 100644 --- a/src/ble/BleError.h +++ b/src/ble/BleError.h @@ -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 */ diff --git a/src/ble/BleLayer.h b/src/ble/BleLayer.h index 69520d71744155..7352b6b480cc18 100644 --- a/src/ble/BleLayer.h +++ b/src/ble/BleLayer.h @@ -113,8 +113,8 @@ class BleLayerObject protected: uint32_t mRefCount; - void AddRef(void) { mRefCount++; } - void Release(void); + void AddRef() { mRefCount++; } + void Release(); }; class BleTransportCapabilitiesRequestMessage @@ -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, @@ -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); diff --git a/src/ble/BtpEngine.h b/src/ble/BtpEngine.h index 83297ca98fbf83..a03bf58b7caee0 100644 --- a/src/ble/BtpEngine.h +++ b/src/ble/BtpEngine.h @@ -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); } @@ -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: diff --git a/src/ble/CHIPBleServiceData.h b/src/ble/CHIPBleServiceData.h index c824ffd01c065f..0bdd15e1773818 100644 --- a/src/ble/CHIPBleServiceData.h +++ b/src/ble/CHIPBleServiceData.h @@ -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; diff --git a/src/crypto/CHIPCryptoPAL.cpp b/src/crypto/CHIPCryptoPAL.cpp index 750fe461f2bf56..e77a35df21ecf6 100644 --- a/src/crypto/CHIPCryptoPAL.cpp +++ b/src/crypto/CHIPCryptoPAL.cpp @@ -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; @@ -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' }; @@ -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; diff --git a/src/crypto/CHIPCryptoPAL.h b/src/crypto/CHIPCryptoPAL.h index cbf49c7582a0e4..5c02cd0d0d3ff9 100644 --- a/src/crypto/CHIPCryptoPAL.h +++ b/src/crypto/CHIPCryptoPAL.h @@ -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; @@ -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. @@ -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. @@ -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, diff --git a/src/crypto/CHIPCryptoPALOpenSSL.cpp b/src/crypto/CHIPCryptoPALOpenSSL.cpp index 597ca2b0b5c783..e6cc31a971423f 100644 --- a/src/crypto/CHIPCryptoPALOpenSSL.cpp +++ b/src/crypto/CHIPCryptoPALOpenSSL.cpp @@ -284,9 +284,9 @@ CHIP_ERROR Hash_SHA256(const uint8_t * data, const size_t data_length, uint8_t * return error; } -Hash_SHA256_stream::Hash_SHA256_stream(void) {} +Hash_SHA256_stream::Hash_SHA256_stream() {} -Hash_SHA256_stream::~Hash_SHA256_stream(void) {} +Hash_SHA256_stream::~Hash_SHA256_stream() {} static inline SHA256_CTX * to_inner_hash_sha256_context(HashSHA256OpaqueContext * context) { @@ -294,7 +294,7 @@ static inline SHA256_CTX * to_inner_hash_sha256_context(HashSHA256OpaqueContext return reinterpret_cast(context->mOpaque); } -CHIP_ERROR Hash_SHA256_stream::Begin(void) +CHIP_ERROR Hash_SHA256_stream::Begin() { CHIP_ERROR error = CHIP_NO_ERROR; int result = 1; @@ -336,7 +336,7 @@ CHIP_ERROR Hash_SHA256_stream::Finish(uint8_t * out_buffer) return error; } -void Hash_SHA256_stream::Clear(void) +void Hash_SHA256_stream::Clear() { memset(this, 0, sizeof(*this)); } @@ -1073,7 +1073,7 @@ static inline Spake2p_Context * to_inner_spake2p_context(Spake2pOpaqueContext * return reinterpret_cast(context->mOpaque); } -CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal(void) +CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal() { CHIP_ERROR error = CHIP_ERROR_INTERNAL; int error_openssl = 0; @@ -1117,7 +1117,7 @@ CHIP_ERROR Spake2p_P256_SHA256_HKDF_HMAC::InitInternal(void) return error; } -void Spake2p_P256_SHA256_HKDF_HMAC::FreeImpl(void) +void Spake2p_P256_SHA256_HKDF_HMAC::FreeImpl() { Spake2p_Context * context = to_inner_spake2p_context(&mSpake2pContext); diff --git a/src/crypto/tests/CHIPCryptoPALTestDriver.cpp b/src/crypto/tests/CHIPCryptoPALTestDriver.cpp index aa1961ffa9184e..ef7b243c50ef1b 100644 --- a/src/crypto/tests/CHIPCryptoPALTestDriver.cpp +++ b/src/crypto/tests/CHIPCryptoPALTestDriver.cpp @@ -27,7 +27,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/include/platform/ConfigurationManager.h b/src/include/platform/ConfigurationManager.h index 1b042cb6533680..53da75e10657e5 100644 --- a/src/include/platform/ConfigurationManager.h +++ b/src/include/platform/ConfigurationManager.h @@ -176,7 +176,7 @@ class ConfigurationManager * chip application should use this to access features of the ConfigurationManager object * that are common to all platforms. */ -extern ConfigurationManager & ConfigurationMgr(void); +extern ConfigurationManager & ConfigurationMgr(); /** * Returns the platform-specific implementation of the ConfigurationManager singleton object. @@ -184,7 +184,7 @@ extern ConfigurationManager & ConfigurationMgr(void); * chip applications can use this to gain access to features of the ConfigurationManager * that are specific to the selected platform. */ -extern ConfigurationManagerImpl & ConfigurationMgrImpl(void); +extern ConfigurationManagerImpl & ConfigurationMgrImpl(); } // namespace DeviceLayer } // namespace chip diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index a13801e8bf6d1c..299ff2edd5205e 100644 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -104,69 +104,69 @@ class ConnectivityManager struct ThreadPollingConfig; // WiFi station methods - WiFiStationMode GetWiFiStationMode(void); + WiFiStationMode GetWiFiStationMode(); CHIP_ERROR SetWiFiStationMode(WiFiStationMode val); - bool IsWiFiStationEnabled(void); - bool IsWiFiStationApplicationControlled(void); - bool IsWiFiStationConnected(void); - uint32_t GetWiFiStationReconnectIntervalMS(void); + bool IsWiFiStationEnabled(); + bool IsWiFiStationApplicationControlled(); + bool IsWiFiStationConnected(); + uint32_t GetWiFiStationReconnectIntervalMS(); CHIP_ERROR SetWiFiStationReconnectIntervalMS(uint32_t val); - bool IsWiFiStationProvisioned(void); - void ClearWiFiStationProvision(void); - CHIP_ERROR GetAndLogWifiStatsCounters(void); + bool IsWiFiStationProvisioned(); + void ClearWiFiStationProvision(); + CHIP_ERROR GetAndLogWifiStatsCounters(); // WiFi AP methods - WiFiAPMode GetWiFiAPMode(void); + WiFiAPMode GetWiFiAPMode(); CHIP_ERROR SetWiFiAPMode(WiFiAPMode val); - bool IsWiFiAPActive(void); - bool IsWiFiAPApplicationControlled(void); - void DemandStartWiFiAP(void); - void StopOnDemandWiFiAP(void); - void MaintainOnDemandWiFiAP(void); - uint32_t GetWiFiAPIdleTimeoutMS(void); + bool IsWiFiAPActive(); + bool IsWiFiAPApplicationControlled(); + void DemandStartWiFiAP(); + void StopOnDemandWiFiAP(); + void MaintainOnDemandWiFiAP(); + uint32_t GetWiFiAPIdleTimeoutMS(); void SetWiFiAPIdleTimeoutMS(uint32_t val); // Thread Methods - ThreadMode GetThreadMode(void); + ThreadMode GetThreadMode(); CHIP_ERROR SetThreadMode(ThreadMode val); - bool IsThreadEnabled(void); - bool IsThreadApplicationControlled(void); - ThreadDeviceType GetThreadDeviceType(void); + bool IsThreadEnabled(); + bool IsThreadApplicationControlled(); + ThreadDeviceType GetThreadDeviceType(); CHIP_ERROR SetThreadDeviceType(ThreadDeviceType deviceType); void GetThreadPollingConfig(ThreadPollingConfig & pollingConfig); CHIP_ERROR SetThreadPollingConfig(const ThreadPollingConfig & pollingConfig); - bool IsThreadAttached(void); - bool IsThreadProvisioned(void); - void ErasePersistentInfo(void); - bool HaveServiceConnectivityViaThread(void); + bool IsThreadAttached(); + bool IsThreadProvisioned(); + void ErasePersistentInfo(); + bool HaveServiceConnectivityViaThread(); // Internet connectivity methods - bool HaveIPv4InternetConnectivity(void); - bool HaveIPv6InternetConnectivity(void); + bool HaveIPv4InternetConnectivity(); + bool HaveIPv6InternetConnectivity(); // Service connectivity methods - bool HaveServiceConnectivity(void); + bool HaveServiceConnectivity(); // CHIPoBLE service methods Ble::BleLayer * GetBleLayer(); typedef void (*BleConnectionReceivedFunct)(Ble::BLEEndPoint * endpoint); void AddCHIPoBLEConnectionHandler(BleConnectionReceivedFunct handler); - void RemoveCHIPoBLEConnectionHandler(void); - CHIPoBLEServiceMode GetCHIPoBLEServiceMode(void); + void RemoveCHIPoBLEConnectionHandler(); + CHIPoBLEServiceMode GetCHIPoBLEServiceMode(); CHIP_ERROR SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); - bool IsBLEAdvertisingEnabled(void); + bool IsBLEAdvertisingEnabled(); CHIP_ERROR SetBLEAdvertisingEnabled(bool val); - bool IsBLEFastAdvertisingEnabled(void); + bool IsBLEFastAdvertisingEnabled(); CHIP_ERROR SetBLEFastAdvertisingEnabled(bool val); - bool IsBLEAdvertising(void); + bool IsBLEAdvertising(); CHIP_ERROR GetBLEDeviceName(char * buf, size_t bufSize); CHIP_ERROR SetBLEDeviceName(const char * deviceName); - uint16_t NumBLEConnections(void); + uint16_t NumBLEConnections(); // User selected mode methods - bool IsUserSelectedModeActive(void); + bool IsUserSelectedModeActive(); void SetUserSelectedMode(bool val); - uint16_t GetUserSelectedModeTimeout(void); + uint16_t GetUserSelectedModeTimeout(); void SetUserSelectedModeTimeout(uint16_t val); // Support methods @@ -188,11 +188,11 @@ class ConnectivityManager template friend class Internal::GenericNetworkProvisioningServerImpl; - CHIP_ERROR Init(void); + CHIP_ERROR Init(); void OnPlatformEvent(const ChipDeviceEvent * event); - bool CanStartWiFiScan(void); - void OnWiFiScanDone(void); - void OnWiFiStationProvisionChange(void); + bool CanStartWiFiScan(); + void OnWiFiScanDone(); + void OnWiFiStationProvisionChange(); protected: // Construction/destruction limited to subclasses. @@ -227,7 +227,7 @@ struct ConnectivityManager::ThreadPollingConfig * chip applications should use this to access features of the ConnectivityManager object * that are common to all platforms. */ -extern ConnectivityManager & ConnectivityMgr(void); +extern ConnectivityManager & ConnectivityMgr(); /** * Returns the platform-specific implementation of the ConnectivityManager singleton object. @@ -235,7 +235,7 @@ extern ConnectivityManager & ConnectivityMgr(void); * chip applications can use this to gain access to features of the ConnectivityManager * that are specific to the selected platform. */ -extern ConnectivityManagerImpl & ConnectivityMgrImpl(void); +extern ConnectivityManagerImpl & ConnectivityMgrImpl(); } // namespace DeviceLayer } // namespace chip @@ -252,7 +252,7 @@ extern ConnectivityManagerImpl & ConnectivityMgrImpl(void); namespace chip { namespace DeviceLayer { -inline ConnectivityManager::WiFiStationMode ConnectivityManager::GetWiFiStationMode(void) +inline ConnectivityManager::WiFiStationMode ConnectivityManager::GetWiFiStationMode() { return static_cast(this)->_GetWiFiStationMode(); } @@ -262,22 +262,22 @@ inline CHIP_ERROR ConnectivityManager::SetWiFiStationMode(WiFiStationMode val) return static_cast(this)->_SetWiFiStationMode(val); } -inline bool ConnectivityManager::IsWiFiStationEnabled(void) +inline bool ConnectivityManager::IsWiFiStationEnabled() { return static_cast(this)->_IsWiFiStationEnabled(); } -inline bool ConnectivityManager::IsWiFiStationApplicationControlled(void) +inline bool ConnectivityManager::IsWiFiStationApplicationControlled() { return static_cast(this)->_IsWiFiStationApplicationControlled(); } -inline bool ConnectivityManager::IsWiFiStationConnected(void) +inline bool ConnectivityManager::IsWiFiStationConnected() { return static_cast(this)->_IsWiFiStationConnected(); } -inline uint32_t ConnectivityManager::GetWiFiStationReconnectIntervalMS(void) +inline uint32_t ConnectivityManager::GetWiFiStationReconnectIntervalMS() { return static_cast(this)->_GetWiFiStationReconnectIntervalMS(); } @@ -287,17 +287,17 @@ inline CHIP_ERROR ConnectivityManager::SetWiFiStationReconnectIntervalMS(uint32_ return static_cast(this)->_SetWiFiStationReconnectIntervalMS(val); } -inline bool ConnectivityManager::IsWiFiStationProvisioned(void) +inline bool ConnectivityManager::IsWiFiStationProvisioned() { return static_cast(this)->_IsWiFiStationProvisioned(); } -inline void ConnectivityManager::ClearWiFiStationProvision(void) +inline void ConnectivityManager::ClearWiFiStationProvision() { static_cast(this)->_ClearWiFiStationProvision(); } -inline ConnectivityManager::WiFiAPMode ConnectivityManager::GetWiFiAPMode(void) +inline ConnectivityManager::WiFiAPMode ConnectivityManager::GetWiFiAPMode() { return static_cast(this)->_GetWiFiAPMode(); } @@ -307,32 +307,32 @@ inline CHIP_ERROR ConnectivityManager::SetWiFiAPMode(WiFiAPMode val) return static_cast(this)->_SetWiFiAPMode(val); } -inline bool ConnectivityManager::IsWiFiAPActive(void) +inline bool ConnectivityManager::IsWiFiAPActive() { return static_cast(this)->_IsWiFiAPActive(); } -inline bool ConnectivityManager::IsWiFiAPApplicationControlled(void) +inline bool ConnectivityManager::IsWiFiAPApplicationControlled() { return static_cast(this)->_IsWiFiAPApplicationControlled(); } -inline void ConnectivityManager::DemandStartWiFiAP(void) +inline void ConnectivityManager::DemandStartWiFiAP() { static_cast(this)->_DemandStartWiFiAP(); } -inline void ConnectivityManager::StopOnDemandWiFiAP(void) +inline void ConnectivityManager::StopOnDemandWiFiAP() { static_cast(this)->_StopOnDemandWiFiAP(); } -inline void ConnectivityManager::MaintainOnDemandWiFiAP(void) +inline void ConnectivityManager::MaintainOnDemandWiFiAP() { static_cast(this)->_MaintainOnDemandWiFiAP(); } -inline uint32_t ConnectivityManager::GetWiFiAPIdleTimeoutMS(void) +inline uint32_t ConnectivityManager::GetWiFiAPIdleTimeoutMS() { return static_cast(this)->_GetWiFiAPIdleTimeoutMS(); } @@ -342,27 +342,27 @@ inline void ConnectivityManager::SetWiFiAPIdleTimeoutMS(uint32_t val) static_cast(this)->_SetWiFiAPIdleTimeoutMS(val); } -inline CHIP_ERROR ConnectivityManager::GetAndLogWifiStatsCounters(void) +inline CHIP_ERROR ConnectivityManager::GetAndLogWifiStatsCounters() { return static_cast(this)->_GetAndLogWifiStatsCounters(); } -inline bool ConnectivityManager::HaveIPv4InternetConnectivity(void) +inline bool ConnectivityManager::HaveIPv4InternetConnectivity() { return static_cast(this)->_HaveIPv4InternetConnectivity(); } -inline bool ConnectivityManager::HaveIPv6InternetConnectivity(void) +inline bool ConnectivityManager::HaveIPv6InternetConnectivity() { return static_cast(this)->_HaveIPv6InternetConnectivity(); } -inline bool ConnectivityManager::HaveServiceConnectivity(void) +inline bool ConnectivityManager::HaveServiceConnectivity() { return static_cast(this)->_HaveServiceConnectivity(); } -inline ConnectivityManager::ThreadMode ConnectivityManager::GetThreadMode(void) +inline ConnectivityManager::ThreadMode ConnectivityManager::GetThreadMode() { return static_cast(this)->_GetThreadMode(); } @@ -372,17 +372,17 @@ inline CHIP_ERROR ConnectivityManager::SetThreadMode(ThreadMode val) return static_cast(this)->_SetThreadMode(val); } -inline bool ConnectivityManager::IsThreadEnabled(void) +inline bool ConnectivityManager::IsThreadEnabled() { return static_cast(this)->_IsThreadEnabled(); } -inline bool ConnectivityManager::IsThreadApplicationControlled(void) +inline bool ConnectivityManager::IsThreadApplicationControlled() { return static_cast(this)->_IsThreadApplicationControlled(); } -inline ConnectivityManager::ThreadDeviceType ConnectivityManager::GetThreadDeviceType(void) +inline ConnectivityManager::ThreadDeviceType ConnectivityManager::GetThreadDeviceType() { return static_cast(this)->_GetThreadDeviceType(); } @@ -402,27 +402,27 @@ inline CHIP_ERROR ConnectivityManager::SetThreadPollingConfig(const ThreadPollin return static_cast(this)->_SetThreadPollingConfig(pollingConfig); } -inline bool ConnectivityManager::IsThreadAttached(void) +inline bool ConnectivityManager::IsThreadAttached() { return static_cast(this)->_IsThreadAttached(); } -inline bool ConnectivityManager::IsThreadProvisioned(void) +inline bool ConnectivityManager::IsThreadProvisioned() { return static_cast(this)->_IsThreadProvisioned(); } -inline void ConnectivityManager::ErasePersistentInfo(void) +inline void ConnectivityManager::ErasePersistentInfo() { static_cast(this)->_ErasePersistentInfo(); } -inline bool ConnectivityManager::HaveServiceConnectivityViaThread(void) +inline bool ConnectivityManager::HaveServiceConnectivityViaThread() { return static_cast(this)->_HaveServiceConnectivityViaThread(); } -inline Ble::BleLayer * ConnectivityManager::GetBleLayer(void) +inline Ble::BleLayer * ConnectivityManager::GetBleLayer() { return static_cast(this)->_GetBleLayer(); } @@ -432,12 +432,12 @@ inline void ConnectivityManager::AddCHIPoBLEConnectionHandler(BleConnectionRecei return static_cast(this)->_AddCHIPoBLEConnectionHandler(handler); } -inline void ConnectivityManager::RemoveCHIPoBLEConnectionHandler(void) +inline void ConnectivityManager::RemoveCHIPoBLEConnectionHandler() { return static_cast(this)->_RemoveCHIPoBLEConnectionHandler(); } -inline ConnectivityManager::CHIPoBLEServiceMode ConnectivityManager::GetCHIPoBLEServiceMode(void) +inline ConnectivityManager::CHIPoBLEServiceMode ConnectivityManager::GetCHIPoBLEServiceMode() { return static_cast(this)->_GetCHIPoBLEServiceMode(); } @@ -447,7 +447,7 @@ inline CHIP_ERROR ConnectivityManager::SetCHIPoBLEServiceMode(CHIPoBLEServiceMod return static_cast(this)->_SetCHIPoBLEServiceMode(val); } -inline bool ConnectivityManager::IsBLEAdvertisingEnabled(void) +inline bool ConnectivityManager::IsBLEAdvertisingEnabled() { return static_cast(this)->_IsBLEAdvertisingEnabled(); } @@ -457,7 +457,7 @@ inline CHIP_ERROR ConnectivityManager::SetBLEAdvertisingEnabled(bool val) return static_cast(this)->_SetBLEAdvertisingEnabled(val); } -inline bool ConnectivityManager::IsBLEFastAdvertisingEnabled(void) +inline bool ConnectivityManager::IsBLEFastAdvertisingEnabled() { return static_cast(this)->_IsBLEFastAdvertisingEnabled(); } @@ -467,7 +467,7 @@ inline CHIP_ERROR ConnectivityManager::SetBLEFastAdvertisingEnabled(bool val) return static_cast(this)->_SetBLEFastAdvertisingEnabled(val); } -inline bool ConnectivityManager::IsBLEAdvertising(void) +inline bool ConnectivityManager::IsBLEAdvertising() { return static_cast(this)->_IsBLEAdvertising(); } @@ -482,12 +482,12 @@ inline CHIP_ERROR ConnectivityManager::SetBLEDeviceName(const char * deviceName) return static_cast(this)->_SetBLEDeviceName(deviceName); } -inline uint16_t ConnectivityManager::NumBLEConnections(void) +inline uint16_t ConnectivityManager::NumBLEConnections() { return static_cast(this)->_NumBLEConnections(); } -inline bool ConnectivityManager::IsUserSelectedModeActive(void) +inline bool ConnectivityManager::IsUserSelectedModeActive() { return static_cast(this)->_IsUserSelectedModeActive(); } @@ -497,7 +497,7 @@ inline void ConnectivityManager::SetUserSelectedMode(bool val) static_cast(this)->_SetUserSelectedMode(val); } -inline uint16_t ConnectivityManager::GetUserSelectedModeTimeout(void) +inline uint16_t ConnectivityManager::GetUserSelectedModeTimeout() { return static_cast(this)->_GetUserSelectedModeTimeout(); } @@ -522,7 +522,7 @@ inline const char * ConnectivityManager::CHIPoBLEServiceModeToStr(CHIPoBLEServic return ImplClass::_CHIPoBLEServiceModeToStr(mode); } -inline CHIP_ERROR ConnectivityManager::Init(void) +inline CHIP_ERROR ConnectivityManager::Init() { return static_cast(this)->_Init(); } @@ -532,17 +532,17 @@ inline void ConnectivityManager::OnPlatformEvent(const ChipDeviceEvent * event) static_cast(this)->_OnPlatformEvent(event); } -inline bool ConnectivityManager::CanStartWiFiScan(void) +inline bool ConnectivityManager::CanStartWiFiScan() { return static_cast(this)->_CanStartWiFiScan(); } -inline void ConnectivityManager::OnWiFiScanDone(void) +inline void ConnectivityManager::OnWiFiScanDone() { static_cast(this)->_OnWiFiScanDone(); } -inline void ConnectivityManager::OnWiFiStationProvisionChange(void) +inline void ConnectivityManager::OnWiFiStationProvisionChange() { static_cast(this)->_OnWiFiStationProvisionChange(); } diff --git a/src/include/platform/GeneralUtils.h b/src/include/platform/GeneralUtils.h index 01691997990074..99883f0f3d1ba1 100644 --- a/src/include/platform/GeneralUtils.h +++ b/src/include/platform/GeneralUtils.h @@ -30,7 +30,7 @@ extern CHIP_ERROR ParseCompilerDateStr(const char * dateStr, uint16_t & year, ui extern CHIP_ERROR Parse24HourTimeStr(const char * timeStr, uint8_t & hour, uint8_t & minute, uint8_t & second); extern const char * CharacterizeIPv6Address(const chip::Inet::IPAddress & ipAddr); extern const char * CharacterizeIPv6Prefix(const chip::Inet::IPPrefix & inPrefix); -extern void RegisterDeviceLayerErrorFormatter(void); +extern void RegisterDeviceLayerErrorFormatter(); extern bool FormatDeviceLayerError(char * buf, uint16_t bufSize, int32_t err); } // namespace DeviceLayer diff --git a/src/include/platform/PlatformManager.h b/src/include/platform/PlatformManager.h index 87fc5928ccc9c9..7742e3de170f5f 100644 --- a/src/include/platform/PlatformManager.h +++ b/src/include/platform/PlatformManager.h @@ -90,12 +90,12 @@ class PlatformManager CHIP_ERROR AddEventHandler(EventHandlerFunct handler, intptr_t arg = 0); void RemoveEventHandler(EventHandlerFunct handler, intptr_t arg = 0); void ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg = 0); - void RunEventLoop(void); - CHIP_ERROR StartEventLoopTask(void); - void LockChipStack(void); - bool TryLockChipStack(void); - void UnlockChipStack(void); - CHIP_ERROR Shutdown(void); + void RunEventLoop(); + CHIP_ERROR StartEventLoopTask(); + void LockChipStack(); + bool TryLockChipStack(); + void UnlockChipStack(); + CHIP_ERROR Shutdown(); private: // ===== Members for internal use by the following friends. @@ -158,7 +158,7 @@ class PlatformManager * chip applications should use this to access features of the PlatformManager object * that are common to all platforms. */ -extern PlatformManager & PlatformMgr(void); +extern PlatformManager & PlatformMgr(); /** * Returns the platform-specific implementation of the PlatformManager singleton object. @@ -166,7 +166,7 @@ extern PlatformManager & PlatformMgr(void); * chip applications can use this to gain access to features of the PlatformManager * that are specific to the selected platform. */ -extern PlatformManagerImpl & PlatformMgrImpl(void); +extern PlatformManagerImpl & PlatformMgrImpl(); } // namespace DeviceLayer } // namespace chip @@ -203,27 +203,27 @@ inline void PlatformManager::ScheduleWork(AsyncWorkFunct workFunct, intptr_t arg static_cast(this)->_ScheduleWork(workFunct, arg); } -inline void PlatformManager::RunEventLoop(void) +inline void PlatformManager::RunEventLoop() { static_cast(this)->_RunEventLoop(); } -inline CHIP_ERROR PlatformManager::StartEventLoopTask(void) +inline CHIP_ERROR PlatformManager::StartEventLoopTask() { return static_cast(this)->_StartEventLoopTask(); } -inline void PlatformManager::LockChipStack(void) +inline void PlatformManager::LockChipStack() { static_cast(this)->_LockChipStack(); } -inline bool PlatformManager::TryLockChipStack(void) +inline bool PlatformManager::TryLockChipStack() { return static_cast(this)->_TryLockChipStack(); } -inline void PlatformManager::UnlockChipStack(void) +inline void PlatformManager::UnlockChipStack() { static_cast(this)->_UnlockChipStack(); } @@ -243,7 +243,7 @@ inline CHIP_ERROR PlatformManager::StartChipTimer(uint32_t durationMS) return static_cast(this)->_StartChipTimer(durationMS); } -inline CHIP_ERROR PlatformManager::Shutdown(void) +inline CHIP_ERROR PlatformManager::Shutdown() { return static_cast(this)->_Shutdown(); } diff --git a/src/include/platform/SoftwareUpdateManager.h b/src/include/platform/SoftwareUpdateManager.h index 09b9070b24b931..38b8548cab70a5 100644 --- a/src/include/platform/SoftwareUpdateManager.h +++ b/src/include/platform/SoftwareUpdateManager.h @@ -291,18 +291,18 @@ class SoftwareUpdateManager typedef void (*EventCallback)(void * apAppState, EventType aEvent, const InEventParam & aInParam, OutEventParam & aOutParam); typedef void (*RetryPolicyCallback)(void * aAppState, RetryParam & aRetryParam, uint32_t & aOutIntervalMsec); - CHIP_ERROR Abort(void); - CHIP_ERROR CheckNow(void); + CHIP_ERROR Abort(); + CHIP_ERROR CheckNow(); CHIP_ERROR ImageInstallComplete(CHIP_ERROR aError); CHIP_ERROR PrepareImageStorageComplete(CHIP_ERROR aError); CHIP_ERROR SetEventCallback(void * const aAppState, const EventCallback aEventCallback); CHIP_ERROR SetQueryIntervalWindow(uint32_t aMinWaitTimeMs, uint32_t aMaxWaitTimeMs); - bool IsInProgress(void); + bool IsInProgress(); void SetRetryPolicyCallback(const RetryPolicyCallback aRetryPolicyCallback); - State GetState(void); + State GetState(); static void DefaultEventHandler(void * apAppState, EventType aEvent, const InEventParam & aInParam, OutEventParam & aOutParam); @@ -313,7 +313,7 @@ class SoftwareUpdateManager template friend class Internal::GenericPlatformManagerImpl; - CHIP_ERROR Init(void); + CHIP_ERROR Init(); protected: // Construction/destruction limited to subclasses. @@ -332,7 +332,7 @@ class SoftwareUpdateManager * chip application should use this to access features of the SoftwareUpdateManager object * that are common to all platforms. */ -extern SoftwareUpdateManager & SoftwareUpdateMgr(void); +extern SoftwareUpdateManager & SoftwareUpdateMgr(); /** * Returns the platform-specific implementation of the SoftwareUpdateManager singleton object. @@ -340,7 +340,7 @@ extern SoftwareUpdateManager & SoftwareUpdateMgr(void); * chip applications can use this to gain access to features of the SoftwareUpdateManager * that are specific to the selected platform. */ -extern SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(void); +extern SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(); } // namespace DeviceLayer } // namespace chip @@ -362,7 +362,7 @@ using namespace chip::TLV; union SoftwareUpdateManager::InEventParam { - void Clear(void) { memset(this, 0, sizeof(*this)); } + void Clear() { memset(this, 0, sizeof(*this)); } SoftwareUpdateManager * Source; struct @@ -414,7 +414,7 @@ union SoftwareUpdateManager::InEventParam union SoftwareUpdateManager::OutEventParam { - void Clear(void) { memset(this, 0, sizeof(*this)); } + void Clear() { memset(this, 0, sizeof(*this)); } bool DefaultHandlerCalled; struct @@ -450,12 +450,12 @@ union SoftwareUpdateManager::OutEventParam } ComputeImageIntegrity; }; -inline CHIP_ERROR SoftwareUpdateManager::Init(void) +inline CHIP_ERROR SoftwareUpdateManager::Init() { return static_cast(this)->_Init(); } -inline CHIP_ERROR SoftwareUpdateManager::CheckNow(void) +inline CHIP_ERROR SoftwareUpdateManager::CheckNow() { return static_cast(this)->_CheckNow(); } @@ -470,17 +470,17 @@ inline CHIP_ERROR SoftwareUpdateManager::PrepareImageStorageComplete(CHIP_ERROR return static_cast(this)->_PrepareImageStorageComplete(aError); } -inline SoftwareUpdateManager::State SoftwareUpdateManager::GetState(void) +inline SoftwareUpdateManager::State SoftwareUpdateManager::GetState() { return static_cast(this)->_GetState(); } -inline CHIP_ERROR SoftwareUpdateManager::Abort(void) +inline CHIP_ERROR SoftwareUpdateManager::Abort() { return static_cast(this)->_Abort(); } -inline bool SoftwareUpdateManager::IsInProgress(void) +inline bool SoftwareUpdateManager::IsInProgress() { return static_cast(this)->_IsInProgress(); } diff --git a/src/include/platform/SoftwareUpdateManagerImpl.h b/src/include/platform/SoftwareUpdateManagerImpl.h index ae8b17d7634844..cb467281d6bdd0 100644 --- a/src/include/platform/SoftwareUpdateManagerImpl.h +++ b/src/include/platform/SoftwareUpdateManagerImpl.h @@ -44,15 +44,15 @@ class SoftwareUpdateManagerImpl final : public SoftwareUpdateManager, public: // ===== Members for internal use by the following friends. - friend ::chip::DeviceLayer::SoftwareUpdateManager & SoftwareUpdateMgr(void); - friend SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(void); + friend ::chip::DeviceLayer::SoftwareUpdateManager & SoftwareUpdateMgr(); + friend SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(); static SoftwareUpdateManagerImpl sInstance; private: // ===== Members that implement the SoftwareUpdateManager abstract interface. - CHIP_ERROR _Init(void); + CHIP_ERROR _Init(); }; /** @@ -61,7 +61,7 @@ class SoftwareUpdateManagerImpl final : public SoftwareUpdateManager, * Internal components should use this to access features of the SoftwareUpdateManager object * that are common to all platforms. */ -inline SoftwareUpdateManager & SoftwareUpdateMgr(void) +inline SoftwareUpdateManager & SoftwareUpdateMgr() { return SoftwareUpdateManagerImpl::sInstance; } @@ -72,7 +72,7 @@ inline SoftwareUpdateManager & SoftwareUpdateMgr(void) * Internal components can use this to gain access to features of the SoftwareUpdateManager * that are specific to the nRF5 platform. */ -inline SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl(void) +inline SoftwareUpdateManagerImpl & SoftwareUpdateMgrImpl() { return SoftwareUpdateManagerImpl::sInstance; } diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index d7717ea6584a85..a3bf14b48edbec 100644 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -68,19 +68,19 @@ class ThreadStackManager public: // ===== Members that define the public interface of the ThreadStackManager - CHIP_ERROR InitThreadStack(void); - void ProcessThreadActivity(void); - CHIP_ERROR StartThreadTask(void); - void LockThreadStack(void); - bool TryLockThreadStack(void); - void UnlockThreadStack(void); + CHIP_ERROR InitThreadStack(); + void ProcessThreadActivity(); + CHIP_ERROR StartThreadTask(); + void LockThreadStack(); + bool TryLockThreadStack(); + void UnlockThreadStack(); bool HaveRouteToAddress(const Inet::IPAddress & destAddr); - CHIP_ERROR GetAndLogThreadStatsCounters(void); - CHIP_ERROR GetAndLogThreadTopologyMinimal(void); - CHIP_ERROR GetAndLogThreadTopologyFull(void); + CHIP_ERROR GetAndLogThreadStatsCounters(); + CHIP_ERROR GetAndLogThreadTopologyMinimal(); + CHIP_ERROR GetAndLogThreadTopologyFull(); CHIP_ERROR GetPrimary802154MACAddress(uint8_t * buf); - CHIP_ERROR JoinerStart(void); + CHIP_ERROR JoinerStart(); CHIP_ERROR SetThreadProvision(const Internal::DeviceNetworkInfo & netInfo); CHIP_ERROR SetThreadEnabled(bool val); @@ -113,19 +113,19 @@ class ThreadStackManager friend class Internal::GenericNetworkProvisioningServerImpl; void OnPlatformEvent(const ChipDeviceEvent * event); - bool IsThreadEnabled(void); - bool IsThreadProvisioned(void); - bool IsThreadAttached(void); + bool IsThreadEnabled(); + bool IsThreadProvisioned(); + bool IsThreadAttached(); CHIP_ERROR GetThreadProvision(Internal::DeviceNetworkInfo & netInfo, bool includeCredentials); - void ErasePersistentInfo(void); - ConnectivityManager::ThreadDeviceType GetThreadDeviceType(void); + void ErasePersistentInfo(); + ConnectivityManager::ThreadDeviceType GetThreadDeviceType(); CHIP_ERROR SetThreadDeviceType(ConnectivityManager::ThreadDeviceType threadRole); void GetThreadPollingConfig(ConnectivityManager::ThreadPollingConfig & pollingConfig); CHIP_ERROR SetThreadPollingConfig(const ConnectivityManager::ThreadPollingConfig & pollingConfig); - bool HaveMeshConnectivity(void); + bool HaveMeshConnectivity(); void OnMessageLayerActivityChanged(bool messageLayerIsActive); - void OnCHIPoBLEAdvertisingStart(void); - void OnCHIPoBLEAdvertisingStop(void); + void OnCHIPoBLEAdvertisingStart(); + void OnCHIPoBLEAdvertisingStop(); protected: // Construction/destruction limited to subclasses. @@ -144,7 +144,7 @@ class ThreadStackManager * chip applications should use this to access features of the ThreadStackManager object * that are common to all platforms. */ -extern ThreadStackManager & ThreadStackMgr(void); +extern ThreadStackManager & ThreadStackMgr(); /** * Returns the platform-specific implementation of the ThreadStackManager singleton object. @@ -152,7 +152,7 @@ extern ThreadStackManager & ThreadStackMgr(void); * chip applications can use this to gain access to features of the ThreadStackManager * that are specific to the selected platform. */ -extern ThreadStackManagerImpl & ThreadStackMgrImpl(void); +extern ThreadStackManagerImpl & ThreadStackMgrImpl(); } // namespace DeviceLayer } // namespace chip @@ -212,7 +212,7 @@ inline void ThreadStackManager::OnPlatformEvent(const ChipDeviceEvent * event) static_cast(this)->_OnPlatformEvent(event); } -inline bool ThreadStackManager::IsThreadEnabled(void) +inline bool ThreadStackManager::IsThreadEnabled() { return static_cast(this)->_IsThreadEnabled(); } @@ -222,12 +222,12 @@ inline CHIP_ERROR ThreadStackManager::SetThreadEnabled(bool val) return static_cast(this)->_SetThreadEnabled(val); } -inline bool ThreadStackManager::IsThreadProvisioned(void) +inline bool ThreadStackManager::IsThreadProvisioned() { return static_cast(this)->_IsThreadProvisioned(); } -inline bool ThreadStackManager::IsThreadAttached(void) +inline bool ThreadStackManager::IsThreadAttached() { return static_cast(this)->_IsThreadAttached(); } @@ -242,12 +242,12 @@ inline CHIP_ERROR ThreadStackManager::SetThreadProvision(const Internal::DeviceN return static_cast(this)->_SetThreadProvision(netInfo); } -inline void ThreadStackManager::ErasePersistentInfo(void) +inline void ThreadStackManager::ErasePersistentInfo() { static_cast(this)->_ErasePersistentInfo(); } -inline ConnectivityManager::ThreadDeviceType ThreadStackManager::GetThreadDeviceType(void) +inline ConnectivityManager::ThreadDeviceType ThreadStackManager::GetThreadDeviceType() { return static_cast(this)->_GetThreadDeviceType(); } @@ -267,7 +267,7 @@ inline CHIP_ERROR ThreadStackManager::SetThreadPollingConfig(const ConnectivityM return static_cast(this)->_SetThreadPollingConfig(pollingConfig); } -inline bool ThreadStackManager::HaveMeshConnectivity(void) +inline bool ThreadStackManager::HaveMeshConnectivity() { return static_cast(this)->_HaveMeshConnectivity(); } @@ -277,27 +277,27 @@ inline void ThreadStackManager::OnMessageLayerActivityChanged(bool messageLayerI return static_cast(this)->_OnMessageLayerActivityChanged(messageLayerIsActive); } -inline void ThreadStackManager::OnCHIPoBLEAdvertisingStart(void) +inline void ThreadStackManager::OnCHIPoBLEAdvertisingStart() { static_cast(this)->_OnCHIPoBLEAdvertisingStart(); } -inline void ThreadStackManager::OnCHIPoBLEAdvertisingStop(void) +inline void ThreadStackManager::OnCHIPoBLEAdvertisingStop() { static_cast(this)->_OnCHIPoBLEAdvertisingStop(); } -inline CHIP_ERROR ThreadStackManager::GetAndLogThreadStatsCounters(void) +inline CHIP_ERROR ThreadStackManager::GetAndLogThreadStatsCounters() { return static_cast(this)->_GetAndLogThreadStatsCounters(); } -inline CHIP_ERROR ThreadStackManager::GetAndLogThreadTopologyMinimal(void) +inline CHIP_ERROR ThreadStackManager::GetAndLogThreadTopologyMinimal() { return static_cast(this)->_GetAndLogThreadTopologyMinimal(); } -inline CHIP_ERROR ThreadStackManager::GetAndLogThreadTopologyFull(void) +inline CHIP_ERROR ThreadStackManager::GetAndLogThreadTopologyFull() { return static_cast(this)->_GetAndLogThreadTopologyFull(); } @@ -307,7 +307,7 @@ inline CHIP_ERROR ThreadStackManager::GetPrimary802154MACAddress(uint8_t * buf) return static_cast(this)->_GetPrimary802154MACAddress(buf); } -inline CHIP_ERROR ThreadStackManager::JoinerStart(void) +inline CHIP_ERROR ThreadStackManager::JoinerStart() { return static_cast(this)->_JoinerStart(); } diff --git a/src/include/platform/TimeSyncManager.h b/src/include/platform/TimeSyncManager.h index 0d8feea6f804b9..09f7acd75b811f 100644 --- a/src/include/platform/TimeSyncManager.h +++ b/src/include/platform/TimeSyncManager.h @@ -77,7 +77,7 @@ class TimeSyncManager final friend class Internal::GenericPlatformManagerImpl; template friend class Internal::GenericPlatformManagerImpl_FreeRTOS; - friend TimeSyncManager & TimeSyncMgr(void); + friend TimeSyncManager & TimeSyncMgr(); static TimeSyncManager sInstance; @@ -131,7 +131,7 @@ inline uint32_t TimeSyncManager::GetSyncInterval() /** * Returns a reference to the TimeSyncManager singleton object. */ -inline TimeSyncManager & TimeSyncMgr(void) +inline TimeSyncManager & TimeSyncMgr() { return TimeSyncManager::sInstance; } diff --git a/src/include/platform/internal/BLEManager.h b/src/include/platform/internal/BLEManager.h index fb1a2f76391e5c..47bcd894193ac9 100644 --- a/src/include/platform/internal/BLEManager.h +++ b/src/include/platform/internal/BLEManager.h @@ -53,19 +53,19 @@ class BLEManager using CHIPoBLEServiceMode = ConnectivityManager::CHIPoBLEServiceMode; - CHIP_ERROR Init(void); - CHIPoBLEServiceMode GetCHIPoBLEServiceMode(void); + CHIP_ERROR Init(); + CHIPoBLEServiceMode GetCHIPoBLEServiceMode(); CHIP_ERROR SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); - bool IsAdvertisingEnabled(void); + bool IsAdvertisingEnabled(); CHIP_ERROR SetAdvertisingEnabled(bool val); - bool IsFastAdvertisingEnabled(void); + bool IsFastAdvertisingEnabled(); CHIP_ERROR SetFastAdvertisingEnabled(bool val); - bool IsAdvertising(void); + bool IsAdvertising(); CHIP_ERROR GetDeviceName(char * buf, size_t bufSize); CHIP_ERROR SetDeviceName(const char * deviceName); - uint16_t NumConnections(void); + uint16_t NumConnections(); void OnPlatformEvent(const ChipDeviceEvent * event); - chip::Ble::BleLayer * GetBleLayer(void) const; + chip::Ble::BleLayer * GetBleLayer() const; protected: // Construction/destruction limited to subclasses. @@ -84,7 +84,7 @@ class BLEManager * Internal components should use this to access features of the BLEManager object * that are common to all platforms. */ -extern BLEManager & BLEMgr(void); +extern BLEManager & BLEMgr(); /** * Returns the platform-specific implementation of the BLEManager singleton object. @@ -92,7 +92,7 @@ extern BLEManager & BLEMgr(void); * chip applications can use this to gain access to features of the BLEManager * that are specific to the selected platform. */ -extern BLEManagerImpl & BLEMgrImpl(void); +extern BLEManagerImpl & BLEMgrImpl(); } // namespace Internal } // namespace DeviceLayer @@ -111,12 +111,12 @@ namespace chip { namespace DeviceLayer { namespace Internal { -inline CHIP_ERROR BLEManager::Init(void) +inline CHIP_ERROR BLEManager::Init() { return static_cast(this)->_Init(); } -inline BLEManager::CHIPoBLEServiceMode BLEManager::GetCHIPoBLEServiceMode(void) +inline BLEManager::CHIPoBLEServiceMode BLEManager::GetCHIPoBLEServiceMode() { return static_cast(this)->_GetCHIPoBLEServiceMode(); } @@ -126,7 +126,7 @@ inline CHIP_ERROR BLEManager::SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val) return static_cast(this)->_SetCHIPoBLEServiceMode(val); } -inline bool BLEManager::IsAdvertisingEnabled(void) +inline bool BLEManager::IsAdvertisingEnabled() { return static_cast(this)->_IsAdvertisingEnabled(); } @@ -136,7 +136,7 @@ inline CHIP_ERROR BLEManager::SetAdvertisingEnabled(bool val) return static_cast(this)->_SetAdvertisingEnabled(val); } -inline bool BLEManager::IsFastAdvertisingEnabled(void) +inline bool BLEManager::IsFastAdvertisingEnabled() { return static_cast(this)->_IsFastAdvertisingEnabled(); } @@ -146,7 +146,7 @@ inline CHIP_ERROR BLEManager::SetFastAdvertisingEnabled(bool val) return static_cast(this)->_SetFastAdvertisingEnabled(val); } -inline bool BLEManager::IsAdvertising(void) +inline bool BLEManager::IsAdvertising() { return static_cast(this)->_IsAdvertising(); } @@ -161,7 +161,7 @@ inline CHIP_ERROR BLEManager::SetDeviceName(const char * deviceName) return static_cast(this)->_SetDeviceName(deviceName); } -inline uint16_t BLEManager::NumConnections(void) +inline uint16_t BLEManager::NumConnections() { return static_cast(this)->_NumConnections(); } @@ -171,7 +171,7 @@ inline void BLEManager::OnPlatformEvent(const ChipDeviceEvent * event) return static_cast(this)->_OnPlatformEvent(event); } -inline chip::Ble::BleLayer * BLEManager::GetBleLayer(void) const +inline chip::Ble::BleLayer * BLEManager::GetBleLayer() const { return static_cast(this)->_GetBleLayer(); } diff --git a/src/include/platform/internal/EventLogging.h b/src/include/platform/internal/EventLogging.h index d6485f33750cc9..f0be9c73391892 100644 --- a/src/include/platform/internal/EventLogging.h +++ b/src/include/platform/internal/EventLogging.h @@ -32,7 +32,7 @@ namespace Internal { /** * Defines the event logging resources and initializes event logging management subsystem. */ -extern CHIP_ERROR InitChipEventLogging(void); +extern CHIP_ERROR InitChipEventLogging(); } // namespace Internal } // namespace DeviceLayer diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl.h b/src/include/platform/internal/GenericConnectivityManagerImpl.h index b2f7d755fe795f..bfae4630630805 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl.h @@ -43,9 +43,9 @@ class GenericConnectivityManagerImpl public: // ===== Methods that implement the ConnectivityManager abstract interface. - bool _IsUserSelectedModeActive(void); + bool _IsUserSelectedModeActive(); void _SetUserSelectedMode(bool val); - uint16_t _GetUserSelectedModeTimeout(void); + uint16_t _GetUserSelectedModeTimeout(); void _SetUserSelectedModeTimeout(uint16_t val); private: @@ -53,7 +53,7 @@ class GenericConnectivityManagerImpl }; template -inline bool GenericConnectivityManagerImpl::_IsUserSelectedModeActive(void) +inline bool GenericConnectivityManagerImpl::_IsUserSelectedModeActive() { return false; } @@ -63,7 +63,7 @@ inline void GenericConnectivityManagerImpl::_SetUserSelectedMode(bool {} template -inline uint16_t GenericConnectivityManagerImpl::_GetUserSelectedModeTimeout(void) +inline uint16_t GenericConnectivityManagerImpl::_GetUserSelectedModeTimeout() { return 0; } diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h b/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h index b6f65e4c4ef83e..e63cbd95c5a1ac 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_BLE.h @@ -52,19 +52,19 @@ class GenericConnectivityManagerImpl_BLE public: // ===== Methods that implement the ConnectivityManager abstract interface. - Ble::BleLayer * _GetBleLayer(void); + Ble::BleLayer * _GetBleLayer(); void _AddCHIPoBLEConnectionHandler(ConnectivityManager::BleConnectionReceivedFunct handler); - void _RemoveCHIPoBLEConnectionHandler(void); - ConnectivityManager::CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); + void _RemoveCHIPoBLEConnectionHandler(); + ConnectivityManager::CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(); CHIP_ERROR _SetCHIPoBLEServiceMode(ConnectivityManager::CHIPoBLEServiceMode val); - bool _IsBLEAdvertisingEnabled(void); + bool _IsBLEAdvertisingEnabled(); CHIP_ERROR _SetBLEAdvertisingEnabled(bool val); - bool _IsBLEFastAdvertisingEnabled(void); + bool _IsBLEFastAdvertisingEnabled(); CHIP_ERROR _SetBLEFastAdvertisingEnabled(bool val); - bool _IsBLEAdvertising(void); + bool _IsBLEAdvertising(); CHIP_ERROR _GetBLEDeviceName(char * buf, size_t bufSize); CHIP_ERROR _SetBLEDeviceName(const char * deviceName); - uint16_t _NumBLEConnections(void); + uint16_t _NumBLEConnections(); static const char * _CHIPoBLEServiceModeToStr(ConnectivityManager::CHIPoBLEServiceMode mode); private: @@ -75,7 +75,7 @@ class GenericConnectivityManagerImpl_BLE extern template class GenericConnectivityManagerImpl_BLE; template -inline Ble::BleLayer * GenericConnectivityManagerImpl_BLE::_GetBleLayer(void) +inline Ble::BleLayer * GenericConnectivityManagerImpl_BLE::_GetBleLayer() { return BLEMgr().GetBleLayer(); } @@ -89,14 +89,14 @@ inline void GenericConnectivityManagerImpl_BLE::_AddCHIPoBLEConnectio } template -inline void GenericConnectivityManagerImpl_BLE::_RemoveCHIPoBLEConnectionHandler(void) +inline void GenericConnectivityManagerImpl_BLE::_RemoveCHIPoBLEConnectionHandler() { BleLayer * bleLayer = BLEMgr().GetBleLayer(); bleLayer->OnChipBleConnectReceived = nullptr; } template -inline ConnectivityManager::CHIPoBLEServiceMode GenericConnectivityManagerImpl_BLE::_GetCHIPoBLEServiceMode(void) +inline ConnectivityManager::CHIPoBLEServiceMode GenericConnectivityManagerImpl_BLE::_GetCHIPoBLEServiceMode() { return BLEMgr().GetCHIPoBLEServiceMode(); } @@ -109,7 +109,7 @@ GenericConnectivityManagerImpl_BLE::_SetCHIPoBLEServiceMode(Connectiv } template -inline bool GenericConnectivityManagerImpl_BLE::_IsBLEAdvertisingEnabled(void) +inline bool GenericConnectivityManagerImpl_BLE::_IsBLEAdvertisingEnabled() { return BLEMgr().IsAdvertisingEnabled(); } @@ -121,7 +121,7 @@ inline CHIP_ERROR GenericConnectivityManagerImpl_BLE::_SetBLEAdvertis } template -inline bool GenericConnectivityManagerImpl_BLE::_IsBLEFastAdvertisingEnabled(void) +inline bool GenericConnectivityManagerImpl_BLE::_IsBLEFastAdvertisingEnabled() { return BLEMgr().IsFastAdvertisingEnabled(); } @@ -133,7 +133,7 @@ inline CHIP_ERROR GenericConnectivityManagerImpl_BLE::_SetBLEFastAdve } template -inline bool GenericConnectivityManagerImpl_BLE::_IsBLEAdvertising(void) +inline bool GenericConnectivityManagerImpl_BLE::_IsBLEAdvertising() { return BLEMgr().IsAdvertising(); } @@ -151,7 +151,7 @@ inline CHIP_ERROR GenericConnectivityManagerImpl_BLE::_SetBLEDeviceNa } template -inline uint16_t GenericConnectivityManagerImpl_BLE::_NumBLEConnections(void) +inline uint16_t GenericConnectivityManagerImpl_BLE::_NumBLEConnections() { return BLEMgr().NumConnections(); } diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h index ab7af872746945..1eeef7705e8577 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h @@ -52,24 +52,24 @@ class GenericConnectivityManagerImpl_Thread protected: // ===== Methods that implement the ConnectivityManager abstract interface. - void _Init(void); + void _Init(); void _OnPlatformEvent(const ChipDeviceEvent * event); - ConnectivityManager::ThreadMode _GetThreadMode(void); + ConnectivityManager::ThreadMode _GetThreadMode(); CHIP_ERROR _SetThreadMode(ConnectivityManager::ThreadMode val); - bool _IsThreadEnabled(void); - bool _IsThreadApplicationControlled(void); - ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(void); + bool _IsThreadEnabled(); + bool _IsThreadApplicationControlled(); + ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(); CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); void _GetThreadPollingConfig(ConnectivityManager::ThreadPollingConfig & pollingConfig); CHIP_ERROR _SetThreadPollingConfig(const ConnectivityManager::ThreadPollingConfig & pollingConfig); - bool _IsThreadAttached(void); - bool _IsThreadProvisioned(void); - void _ErasePersistentInfo(void); - bool _HaveServiceConnectivityViaThread(void); + bool _IsThreadAttached(); + bool _IsThreadProvisioned(); + void _ErasePersistentInfo(); + bool _HaveServiceConnectivityViaThread(); // ===== Members for use by the implementation subclass. - void UpdateServiceConnectivity(void); + void UpdateServiceConnectivity(); private: // ===== Private members reserved for use by this class only. @@ -86,43 +86,43 @@ class GenericConnectivityManagerImpl_Thread }; template -inline void GenericConnectivityManagerImpl_Thread::_Init(void) +inline void GenericConnectivityManagerImpl_Thread::_Init() { mFlags = 0; } template -inline bool GenericConnectivityManagerImpl_Thread::_IsThreadEnabled(void) +inline bool GenericConnectivityManagerImpl_Thread::_IsThreadEnabled() { return ThreadStackMgrImpl().IsThreadEnabled(); } template -inline bool GenericConnectivityManagerImpl_Thread::_IsThreadApplicationControlled(void) +inline bool GenericConnectivityManagerImpl_Thread::_IsThreadApplicationControlled() { return GetFlag(mFlags, kFlag_IsApplicationControlled); } template -inline bool GenericConnectivityManagerImpl_Thread::_IsThreadAttached(void) +inline bool GenericConnectivityManagerImpl_Thread::_IsThreadAttached() { return ThreadStackMgrImpl().IsThreadAttached(); } template -inline bool GenericConnectivityManagerImpl_Thread::_IsThreadProvisioned(void) +inline bool GenericConnectivityManagerImpl_Thread::_IsThreadProvisioned() { return ThreadStackMgrImpl().IsThreadProvisioned(); } template -inline void GenericConnectivityManagerImpl_Thread::_ErasePersistentInfo(void) +inline void GenericConnectivityManagerImpl_Thread::_ErasePersistentInfo() { ThreadStackMgrImpl().ErasePersistentInfo(); } template -inline ConnectivityManager::ThreadDeviceType GenericConnectivityManagerImpl_Thread::_GetThreadDeviceType(void) +inline ConnectivityManager::ThreadDeviceType GenericConnectivityManagerImpl_Thread::_GetThreadDeviceType() { return ThreadStackMgrImpl().GetThreadDeviceType(); } @@ -149,7 +149,7 @@ inline CHIP_ERROR GenericConnectivityManagerImpl_Thread::_SetThreadPo } template -inline bool GenericConnectivityManagerImpl_Thread::_HaveServiceConnectivityViaThread(void) +inline bool GenericConnectivityManagerImpl_Thread::_HaveServiceConnectivityViaThread() { return GetFlag(mFlags, kFlag_HaveServiceConnectivity); } diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.ipp b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.ipp index 481f8f875a81ef..c01ebc24c66e48 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.ipp +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.ipp @@ -53,7 +53,7 @@ void GenericConnectivityManagerImpl_Thread::_OnPlatformEvent(const Ch } template -ConnectivityManager::ThreadMode GenericConnectivityManagerImpl_Thread::_GetThreadMode(void) +ConnectivityManager::ThreadMode GenericConnectivityManagerImpl_Thread::_GetThreadMode() { if (GetFlag(mFlags, kFlag_IsApplicationControlled)) { @@ -90,7 +90,7 @@ exit: } template -void GenericConnectivityManagerImpl_Thread::UpdateServiceConnectivity(void) +void GenericConnectivityManagerImpl_Thread::UpdateServiceConnectivity() { bool haveServiceConnectivity = false; diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h index 575a9366d42f30..5e72d75cdd7474 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.h @@ -56,24 +56,24 @@ class GenericConnectivityManagerImpl_WiFi public: // ===== Methods that implement the ConnectivityManager abstract interface. - ConnectivityManager::WiFiStationMode _GetWiFiStationMode(void); + ConnectivityManager::WiFiStationMode _GetWiFiStationMode(); CHIP_ERROR _SetWiFiStationMode(ConnectivityManager::WiFiStationMode val); - bool _IsWiFiStationEnabled(void); - bool _IsWiFiStationApplicationControlled(void); - uint32_t _GetWiFiStationReconnectIntervalMS(void); + bool _IsWiFiStationEnabled(); + bool _IsWiFiStationApplicationControlled(); + uint32_t _GetWiFiStationReconnectIntervalMS(); CHIP_ERROR _SetWiFiStationReconnectIntervalMS(uint32_t val); - bool _IsWiFiStationProvisioned(void); - void _ClearWiFiStationProvision(void); - ConnectivityManager::WiFiAPMode _GetWiFiAPMode(void); + bool _IsWiFiStationProvisioned(); + void _ClearWiFiStationProvision(); + ConnectivityManager::WiFiAPMode _GetWiFiAPMode(); CHIP_ERROR _SetWiFiAPMode(ConnectivityManager::WiFiAPMode val); - bool _IsWiFiAPActive(void); - bool _IsWiFiAPApplicationControlled(void); - void _DemandStartWiFiAP(void); - void _StopOnDemandWiFiAP(void); - void _MaintainOnDemandWiFiAP(void); - uint32_t _GetWiFiAPIdleTimeoutMS(void); + bool _IsWiFiAPActive(); + bool _IsWiFiAPApplicationControlled(); + void _DemandStartWiFiAP(); + void _StopOnDemandWiFiAP(); + void _MaintainOnDemandWiFiAP(); + uint32_t _GetWiFiAPIdleTimeoutMS(); void _SetWiFiAPIdleTimeoutMS(uint32_t val); - CHIP_ERROR _GetAndLogWifiStatsCounters(void); + CHIP_ERROR _GetAndLogWifiStatsCounters(); bool _CanStartWiFiScan(); void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); @@ -98,19 +98,19 @@ class GenericConnectivityManagerImpl_WiFi }; template -inline ConnectivityManager::WiFiStationMode GenericConnectivityManagerImpl_WiFi::_GetWiFiStationMode(void) +inline ConnectivityManager::WiFiStationMode GenericConnectivityManagerImpl_WiFi::_GetWiFiStationMode() { return mWiFiStationMode; } template -inline bool GenericConnectivityManagerImpl_WiFi::_IsWiFiStationApplicationControlled(void) +inline bool GenericConnectivityManagerImpl_WiFi::_IsWiFiStationApplicationControlled() { return mWiFiStationMode == ConnectivityManager::kWiFiStationMode_ApplicationControlled; } template -inline uint32_t GenericConnectivityManagerImpl_WiFi::_GetWiFiStationReconnectIntervalMS(void) +inline uint32_t GenericConnectivityManagerImpl_WiFi::_GetWiFiStationReconnectIntervalMS() { return 0; } @@ -122,19 +122,19 @@ inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_SetWiFiStatio } template -inline bool GenericConnectivityManagerImpl_WiFi::_IsWiFiStationProvisioned(void) +inline bool GenericConnectivityManagerImpl_WiFi::_IsWiFiStationProvisioned() { return mWiFiProvisioned; } template -inline void GenericConnectivityManagerImpl_WiFi::_ClearWiFiStationProvision(void) +inline void GenericConnectivityManagerImpl_WiFi::_ClearWiFiStationProvision() { mWiFiProvisioned = false; } template -inline ConnectivityManager::WiFiAPMode GenericConnectivityManagerImpl_WiFi::_GetWiFiAPMode(void) +inline ConnectivityManager::WiFiAPMode GenericConnectivityManagerImpl_WiFi::_GetWiFiAPMode() { return ConnectivityManager::kWiFiAPMode_NotSupported; } @@ -146,31 +146,31 @@ inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_SetWiFiAPMode } template -inline bool GenericConnectivityManagerImpl_WiFi::_IsWiFiAPActive(void) +inline bool GenericConnectivityManagerImpl_WiFi::_IsWiFiAPActive() { return false; } template -inline bool GenericConnectivityManagerImpl_WiFi::_IsWiFiAPApplicationControlled(void) +inline bool GenericConnectivityManagerImpl_WiFi::_IsWiFiAPApplicationControlled() { return false; } template -inline void GenericConnectivityManagerImpl_WiFi::_DemandStartWiFiAP(void) +inline void GenericConnectivityManagerImpl_WiFi::_DemandStartWiFiAP() {} template -inline void GenericConnectivityManagerImpl_WiFi::_StopOnDemandWiFiAP(void) +inline void GenericConnectivityManagerImpl_WiFi::_StopOnDemandWiFiAP() {} template -inline void GenericConnectivityManagerImpl_WiFi::_MaintainOnDemandWiFiAP(void) +inline void GenericConnectivityManagerImpl_WiFi::_MaintainOnDemandWiFiAP() {} template -inline uint32_t GenericConnectivityManagerImpl_WiFi::_GetWiFiAPIdleTimeoutMS(void) +inline uint32_t GenericConnectivityManagerImpl_WiFi::_GetWiFiAPIdleTimeoutMS() { return 0; } @@ -180,7 +180,7 @@ inline void GenericConnectivityManagerImpl_WiFi::_SetWiFiAPIdleTimeou {} template -inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetAndLogWifiStatsCounters(void) +inline CHIP_ERROR GenericConnectivityManagerImpl_WiFi::_GetAndLogWifiStatsCounters() { return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp index 47cc0b73b4bc42..5c02a97e563615 100644 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_WiFi.ipp @@ -55,7 +55,7 @@ GenericConnectivityManagerImpl_WiFi::_WiFiStationModeToStr(Connectivi } template -bool GenericConnectivityManagerImpl_WiFi::_IsWiFiStationEnabled(void) +bool GenericConnectivityManagerImpl_WiFi::_IsWiFiStationEnabled() { return Impl()->GetWiFiStationMode() == ConnectivityManager::kWiFiStationMode_Enabled; } diff --git a/src/include/platform/internal/GenericPlatformManagerImpl.ipp b/src/include/platform/internal/GenericPlatformManagerImpl.ipp index 78137b7e0e36e7..e821090c9f0273 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl.ipp @@ -43,7 +43,7 @@ namespace Internal { extern CHIP_ERROR InitEntropy(); template -CHIP_ERROR GenericPlatformManagerImpl::_InitChipStack(void) +CHIP_ERROR GenericPlatformManagerImpl::_InitChipStack() { CHIP_ERROR err; diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.h b/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.h index 8564e2e59e2247..fe41bdb43b4533 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.h +++ b/src/include/platform/internal/GenericPlatformManagerImpl_POSIX.h @@ -72,14 +72,14 @@ class GenericPlatformManagerImpl_POSIX : public GenericPlatformManagerImpl -CHIP_ERROR GenericPlatformManagerImpl_POSIX::_InitChipStack(void) +CHIP_ERROR GenericPlatformManagerImpl_POSIX::_InitChipStack() { CHIP_ERROR err = CHIP_NO_ERROR; @@ -74,19 +74,19 @@ exit: } template -void GenericPlatformManagerImpl_POSIX::_LockChipStack(void) +void GenericPlatformManagerImpl_POSIX::_LockChipStack() { assert(pthread_mutex_lock(&mChipStackLock) == 0); } template -bool GenericPlatformManagerImpl_POSIX::_TryLockChipStack(void) +bool GenericPlatformManagerImpl_POSIX::_TryLockChipStack() { return pthread_mutex_trylock(&mChipStackLock) == 0; } template -void GenericPlatformManagerImpl_POSIX::_UnlockChipStack(void) +void GenericPlatformManagerImpl_POSIX::_UnlockChipStack() { assert(pthread_mutex_unlock(&mChipStackLock) == 0); } @@ -182,7 +182,7 @@ void GenericPlatformManagerImpl_POSIX::SysProcess() } template -void GenericPlatformManagerImpl_POSIX::_RunEventLoop(void) +void GenericPlatformManagerImpl_POSIX::_RunEventLoop() { Impl()->LockChipStack(); @@ -205,7 +205,7 @@ void * GenericPlatformManagerImpl_POSIX::EventLoopTaskMain(void * arg } template -CHIP_ERROR GenericPlatformManagerImpl_POSIX::_StartEventLoopTask(void) +CHIP_ERROR GenericPlatformManagerImpl_POSIX::_StartEventLoopTask() { int err; err = pthread_attr_init(&mChipTaskAttr); @@ -221,7 +221,7 @@ exit: } template -CHIP_ERROR GenericPlatformManagerImpl_POSIX::_Shutdown(void) +CHIP_ERROR GenericPlatformManagerImpl_POSIX::_Shutdown() { int err = 0; mShouldRunEventLoop.store(false, std::memory_order_relaxed); diff --git a/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.h b/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.h index d8135b5f614167..76d025492d1d24 100644 --- a/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.h +++ b/src/include/platform/internal/GenericSoftwareUpdateManagerImpl.h @@ -50,8 +50,8 @@ class GenericSoftwareUpdateManagerImpl protected: // ===== Methods that implement the SoftwareUpdateManager abstract interface. - bool _IsInProgress(void); - SoftwareUpdateManager::State _GetState(void); + bool _IsInProgress(); + SoftwareUpdateManager::State _GetState(); void _SetRetryPolicyCallback(const SoftwareUpdateManager::RetryPolicyCallback aRetryPolicyCallback); @@ -59,8 +59,8 @@ class GenericSoftwareUpdateManagerImpl const SoftwareUpdateManager::InEventParam & aInParam, SoftwareUpdateManager::OutEventParam & aOutParam); - CHIP_ERROR _Abort(void); - CHIP_ERROR _CheckNow(void); + CHIP_ERROR _Abort(); + CHIP_ERROR _CheckNow(); CHIP_ERROR _PrepareImageStorageComplete(CHIP_ERROR aError); CHIP_ERROR _ImageInstallComplete(CHIP_ERROR aError); CHIP_ERROR _SetQueryIntervalWindow(uint32_t aMinWaitTimeMs, uint32_t aMaxWaitTimeMs); @@ -69,29 +69,29 @@ class GenericSoftwareUpdateManagerImpl // ===== Members for use by the implementation subclass. void DoInit(); - void DownloadComplete(void); + void DownloadComplete(); void SoftwareUpdateFinished(CHIP_ERROR aError); - CHIP_ERROR InstallImage(void); + CHIP_ERROR InstallImage(); CHIP_ERROR StoreImageBlock(uint32_t aLength, uint8_t * aData); private: // ===== Private members reserved for use by this class only. - void Cleanup(void); - void CheckImageState(void); - void CheckImageIntegrity(void); + void Cleanup(); + void CheckImageState(); + void CheckImageIntegrity(); void DriveState(SoftwareUpdateManager::State aNextState); void GetEventState(int32_t & aEventState); void HandleImageQueryResponse(PacketBuffer * aPayload); - void SendQuery(void); - void StartImageInstall(void); - void PrepareImageStorage(void); + void SendQuery(); + void StartImageInstall(); + void PrepareImageStorage(); - CHIP_ERROR PrepareQuery(void); + CHIP_ERROR PrepareQuery(); - uint32_t GetNextWaitTimeInterval(void); - uint32_t ComputeNextScheduledWaitTimeInterval(void); + uint32_t GetNextWaitTimeInterval(); + uint32_t ComputeNextScheduledWaitTimeInterval(); static void PrepareBinding(intptr_t arg); static void StartDownload(intptr_t arg); diff --git a/src/include/platform/internal/testing/ConfigUnitTest.h b/src/include/platform/internal/testing/ConfigUnitTest.h index 25a6a53b874f5d..c16cca76cdfb37 100644 --- a/src/include/platform/internal/testing/ConfigUnitTest.h +++ b/src/include/platform/internal/testing/ConfigUnitTest.h @@ -28,7 +28,7 @@ namespace DeviceLayer { namespace Internal { template -void RunConfigUnitTest(void) +void RunConfigUnitTest() { CHIP_ERROR err; diff --git a/src/inet/AsyncDNSResolverSockets.cpp b/src/inet/AsyncDNSResolverSockets.cpp index 53f1fa1cc8cc8d..b5edb4d242ac88 100644 --- a/src/inet/AsyncDNSResolverSockets.cpp +++ b/src/inet/AsyncDNSResolverSockets.cpp @@ -83,7 +83,7 @@ INET_ERROR AsyncDNSResolverSockets::Init(InetLayer * aInet) * @retval #INET_NO_ERROR if shutdown is successful. * @retval other appropriate POSIX network or OS error. */ -INET_ERROR AsyncDNSResolverSockets::Shutdown(void) +INET_ERROR AsyncDNSResolverSockets::Shutdown() { INET_ERROR err = INET_NO_ERROR; int pthreadErr; @@ -349,7 +349,7 @@ void * AsyncDNSResolverSockets::AsyncDNSThreadRun(void * args) return nullptr; } -void AsyncDNSResolverSockets::AsyncMutexLock(void) +void AsyncDNSResolverSockets::AsyncMutexLock() { int pthreadErr; @@ -357,7 +357,7 @@ void AsyncDNSResolverSockets::AsyncMutexLock(void) VerifyOrDie(pthreadErr == 0); } -void AsyncDNSResolverSockets::AsyncMutexUnlock(void) +void AsyncDNSResolverSockets::AsyncMutexUnlock() { int pthreadErr; diff --git a/src/inet/AsyncDNSResolverSockets.h b/src/inet/AsyncDNSResolverSockets.h index 3bc5c22d698431..d16c8440712319 100644 --- a/src/inet/AsyncDNSResolverSockets.h +++ b/src/inet/AsyncDNSResolverSockets.h @@ -62,7 +62,7 @@ class AsyncDNSResolverSockets INET_ERROR Cancel(DNSResolver & resolver); - INET_ERROR Shutdown(void); + INET_ERROR Shutdown(); INET_ERROR PrepareDNSResolver(DNSResolver & resolver, const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs, IPAddress * addrArray, DNSResolver::OnResolveCompleteFunct onComplete, @@ -81,7 +81,7 @@ class AsyncDNSResolverSockets INET_ERROR DequeueRequest(DNSResolver ** outResolver); - bool ShouldThreadShutdown(void); + bool ShouldThreadShutdown(); void Resolve(DNSResolver & resolver); @@ -91,9 +91,9 @@ class AsyncDNSResolverSockets static void NotifyChipThread(DNSResolver * resolver); - void AsyncMutexLock(void); + void AsyncMutexLock(); - void AsyncMutexUnlock(void); + void AsyncMutexUnlock(); }; } // namespace Inet diff --git a/src/inet/DNSResolver.cpp b/src/inet/DNSResolver.cpp index 5bd6ad57f2d5a6..213cb61e2c8244 100644 --- a/src/inet/DNSResolver.cpp +++ b/src/inet/DNSResolver.cpp @@ -521,7 +521,7 @@ uint8_t DNSResolver::CountAddresses(int family, const struct addrinfo * addrs) #if INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS -void DNSResolver::HandleAsyncResolveComplete(void) +void DNSResolver::HandleAsyncResolveComplete() { // Copy the resolved address to the application supplied buffer, but only if the request hasn't been canceled. if (OnComplete && mState != kState_Canceled) diff --git a/src/inet/DNSResolver.h b/src/inet/DNSResolver.h index 4bd505a9b91287..1f487e5cfa2e9d 100644 --- a/src/inet/DNSResolver.h +++ b/src/inet/DNSResolver.h @@ -149,7 +149,7 @@ class DNSResolver : public InetLayerBasis DNSResolverState mState; - void HandleAsyncResolveComplete(void); + void HandleAsyncResolveComplete(); #endif // INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS @@ -157,7 +157,7 @@ class DNSResolver : public InetLayerBasis INET_ERROR Resolve(const char * hostName, uint16_t hostNameLen, uint8_t options, uint8_t maxAddrs, IPAddress * addrArray, OnResolveCompleteFunct onComplete, void * appState); - INET_ERROR Cancel(void); + INET_ERROR Cancel(); #if CHIP_SYSTEM_CONFIG_USE_LWIP void HandleResolveComplete(void); diff --git a/src/inet/EndPointBasis.h b/src/inet/EndPointBasis.h index 4e859e439b8c47..f22f01a25cee35 100644 --- a/src/inet/EndPointBasis.h +++ b/src/inet/EndPointBasis.h @@ -76,7 +76,7 @@ class DLL_EXPORT EndPointBasis : public InetLayerBasis #if CHIP_SYSTEM_CONFIG_USE_SOCKETS /** Test whether endpoint is a POSIX socket */ - bool IsSocketsEndPoint(void) const; + bool IsSocketsEndPoint() const; #endif #if CHIP_SYSTEM_CONFIG_USE_LWIP @@ -85,7 +85,7 @@ class DLL_EXPORT EndPointBasis : public InetLayerBasis #endif /** Test whether endpoint has a valid descriptor. */ - bool IsOpenEndPoint(void) const; + bool IsOpenEndPoint() const; protected: #if CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK @@ -141,7 +141,7 @@ inline bool EndPointBasis::IsNetworkFrameworkEndPoint(void) const #endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK #if CHIP_SYSTEM_CONFIG_USE_SOCKETS -inline bool EndPointBasis::IsSocketsEndPoint(void) const +inline bool EndPointBasis::IsSocketsEndPoint() const { return mSocket >= 0; } @@ -154,7 +154,7 @@ inline bool EndPointBasis::IsLWIPEndPoint(void) const } #endif // CHIP_SYSTEM_CONFIG_USE_LWIP -inline bool EndPointBasis::IsOpenEndPoint(void) const +inline bool EndPointBasis::IsOpenEndPoint() const { bool lResult = false; diff --git a/src/inet/IPAddress.cpp b/src/inet/IPAddress.cpp index 430fe2df9250dc..97d0019f93c1df 100644 --- a/src/inet/IPAddress.cpp +++ b/src/inet/IPAddress.cpp @@ -240,36 +240,36 @@ bool IPAddress::IsIPv4() const } // Is address a IPv4 multicast address? -bool IPAddress::IsIPv4Multicast(void) const +bool IPAddress::IsIPv4Multicast() const { return (IsIPv4() && ((ntohl(Addr[3]) & 0xF0000000U) == 0xE0000000U)); } // Is address the IPv4 broadcast address? -bool IPAddress::IsIPv4Broadcast(void) const +bool IPAddress::IsIPv4Broadcast() const { return (IsIPv4() && (Addr[3] == 0xFFFFFFFFU)); } // Is address an IPv4 or IPv6 multicast address? -bool IPAddress::IsMulticast(void) const +bool IPAddress::IsMulticast() const { return (IsIPv6Multicast() || IsIPv4Multicast()); } -bool IPAddress::IsIPv6(void) const +bool IPAddress::IsIPv6() const { return *this != Any && !IsIPv4(); } // Is address an IPv6 multicast address? -bool IPAddress::IsIPv6Multicast(void) const +bool IPAddress::IsIPv6Multicast() const { return (ntohl(Addr[0]) & 0xFF000000U) == 0xFF000000U; } // Is address an IPv6 Global Unicast Address? -bool IPAddress::IsIPv6GlobalUnicast(void) const +bool IPAddress::IsIPv6GlobalUnicast() const { return (ntohl(Addr[0]) & 0xE0000000U) == 0x20000000U; } @@ -451,7 +451,7 @@ IPAddress IPAddress::MakeIPv6PrefixMulticast(uint8_t aScope, uint8_t aPrefixLeng return (MakeIPv6TransientMulticast(lFlags, aScope, lGroupId)); } -IPAddress IPAddress::MakeIPv4Broadcast(void) +IPAddress IPAddress::MakeIPv4Broadcast() { IPAddress ipAddr; ipAddr.Addr[0] = 0; diff --git a/src/inet/IPAddress.h b/src/inet/IPAddress.h index 9de7bced859a80..6bb26ef6ffe46d 100644 --- a/src/inet/IPAddress.h +++ b/src/inet/IPAddress.h @@ -162,7 +162,7 @@ class DLL_EXPORT IPAddress * @retval true The address is IPv6 and not the unspecified address. * @retval false The address is IPv4 or the unspecified address. */ - bool IsIPv6(void) const; + bool IsIPv6() const; /** * @brief Test whether address is IPv6 global unicast address. @@ -174,7 +174,7 @@ class DLL_EXPORT IPAddress * @retval true Address is IPv6 global unicast * @retval false Otherwise */ - bool IsIPv6GlobalUnicast(void) const; + bool IsIPv6GlobalUnicast() const; /** * @brief Test whether address is IPv6 unique-local address (ULA). @@ -186,7 +186,7 @@ class DLL_EXPORT IPAddress * @retval true Address is IPv6 unique-local * @retval false Otherwise */ - bool IsIPv6ULA(void) const; + bool IsIPv6ULA() const; /** * @brief Test whether address is IPv6 link-local address (LL). @@ -198,7 +198,7 @@ class DLL_EXPORT IPAddress * @retval true Address is IPv6 link-local * @retval false Otherwise */ - bool IsIPv6LinkLocal(void) const; + bool IsIPv6LinkLocal() const; /** * @brief Test whether address is IPv6 multicast. @@ -210,7 +210,7 @@ class DLL_EXPORT IPAddress * @retval true Address is IPv6 multicast * @retval false Otherwise */ - bool IsIPv6Multicast(void) const; + bool IsIPv6Multicast() const; /** * @brief Test whether address is IPv4 or IPv6 multicast. @@ -222,7 +222,7 @@ class DLL_EXPORT IPAddress * @retval true Address is IPv4 or IPv6 multicast * @retval false Otherwise */ - bool IsMulticast(void) const; + bool IsMulticast() const; /** * @brief Extract the IID of an IPv6 ULA address. @@ -235,7 +235,7 @@ class DLL_EXPORT IPAddress * @return 64-bit interface identifier, or zero if the IP address is not * an IPv6 unique-local address. */ - uint64_t InterfaceId(void) const; + uint64_t InterfaceId() const; /** * @brief Extract the 16-bit subnet identifier of an IPv6 ULA address. @@ -250,7 +250,7 @@ class DLL_EXPORT IPAddress * @return 16-bit subnet identifier, or zero if the IP address is not * an IPv6 unique-local address. */ - uint16_t Subnet(void) const; + uint16_t Subnet() const; /** * @brief Extract the 16-bit global network identifier of an IPv6 ULA @@ -266,7 +266,7 @@ class DLL_EXPORT IPAddress * @return 40-bit global network identifier, or zero if the IP address * is not an IPv6 unique-local address. */ - uint64_t GlobalId(void) const; + uint64_t GlobalId() const; /** * @brief Extract the type of the IP address. @@ -279,7 +279,7 @@ class DLL_EXPORT IPAddress * @retval kIPAddressType_IPv6 The address is IPv6. * @retval kIPAddressType_Any The address is the unspecified address. */ - IPAddressType Type(void) const; + IPAddressType Type() const; /** * @brief Compare this IP address with another for equivalence. @@ -397,7 +397,7 @@ class DLL_EXPORT IPAddress * @retval true The address is IPv4 and not the unspecified address. * @retval false The address is IPv6 or the unspecified address. */ - bool IsIPv4(void) const; + bool IsIPv4() const; /** * @brief Test whether address is IPv4 multicast. @@ -409,7 +409,7 @@ class DLL_EXPORT IPAddress * @retval true Address is the IPv4 multicast * @retval false Otherwise */ - bool IsIPv4Multicast(void) const; + bool IsIPv4Multicast() const; /** * @brief Test whether address is IPv4 broadcast. @@ -421,7 +421,7 @@ class DLL_EXPORT IPAddress * @retval true Address is the IPv4 broadcast * @retval false Otherwise */ - bool IsIPv4Broadcast(void) const; + bool IsIPv4Broadcast() const; /** * @fn ToIPv4() const @@ -546,11 +546,11 @@ class DLL_EXPORT IPAddress #if CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK - struct in6_addr ToIPv6(void) const; + struct in6_addr ToIPv6() const; static IPAddress FromIPv6(const struct in6_addr & addr); #if INET_CONFIG_ENABLE_IPV4 - struct in_addr ToIPv4(void) const; + struct in_addr ToIPv4() const; static IPAddress FromIPv4(const struct in_addr & addr); #endif // INET_CONFIG_ENABLE_IPV4 @@ -663,7 +663,7 @@ class DLL_EXPORT IPAddress * * @return The constructed IP address. */ - static IPAddress MakeIPv4Broadcast(void); + static IPAddress MakeIPv4Broadcast(); /** * @brief The distinguished unspecified IP address object. diff --git a/src/inet/IPEndPointBasis.cpp b/src/inet/IPEndPointBasis.cpp index b3d284647322ca..2334a6ccef580d 100644 --- a/src/inet/IPEndPointBasis.cpp +++ b/src/inet/IPEndPointBasis.cpp @@ -1041,7 +1041,7 @@ INET_ERROR IPEndPointBasis::GetSocket(IPAddressType aAddressType, int aType, int return INET_NO_ERROR; } -SocketEvents IPEndPointBasis::PrepareIO(void) +SocketEvents IPEndPointBasis::PrepareIO() { SocketEvents res; diff --git a/src/inet/IPEndPointBasis.h b/src/inet/IPEndPointBasis.h index 20affccd6af241..9ce346a0efc0cc 100644 --- a/src/inet/IPEndPointBasis.h +++ b/src/inet/IPEndPointBasis.h @@ -147,7 +147,7 @@ class DLL_EXPORT IPEndPointBasis : public EndPointBasis INET_ERROR BindInterface(IPAddressType aAddressType, InterfaceId aInterfaceId); INET_ERROR SendMsg(const IPPacketInfo * aPktInfo, chip::System::PacketBuffer * aBuffer, uint16_t aSendFlags); INET_ERROR GetSocket(IPAddressType aAddressType, int aType, int aProtocol); - SocketEvents PrepareIO(void); + SocketEvents PrepareIO(); void HandlePendingIO(uint16_t aPort); #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS @@ -176,9 +176,9 @@ class DLL_EXPORT IPEndPointBasis : public EndPointBasis #endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK private: - IPEndPointBasis(void) = delete; + IPEndPointBasis() = delete; IPEndPointBasis(const IPEndPointBasis &) = delete; - ~IPEndPointBasis(void) = delete; + ~IPEndPointBasis() = delete; }; #if CHIP_SYSTEM_CONFIG_USE_LWIP diff --git a/src/inet/IPPrefix.h b/src/inet/IPPrefix.h index 534dcac159fd40..43372e77678da1 100644 --- a/src/inet/IPPrefix.h +++ b/src/inet/IPPrefix.h @@ -83,7 +83,7 @@ class IPPrefix * * @return \c true if equivalent to \c Zero, else \c false. */ - bool IsZero(void) const; + bool IsZero() const; /** * @brief Compares the prefix with another for equivalence. diff --git a/src/inet/InetError.cpp b/src/inet/InetError.cpp index 363481b4c563b2..128f9829eeeead 100644 --- a/src/inet/InetError.cpp +++ b/src/inet/InetError.cpp @@ -36,7 +36,7 @@ namespace Inet { /** * Register a text error formatter for Inet Layer errors. */ -void RegisterLayerErrorFormatter(void) +void RegisterLayerErrorFormatter() { static chip::ErrorFormatter sInetLayerErrorFormatter = { FormatLayerError, nullptr }; diff --git a/src/inet/InetError.h b/src/inet/InetError.h index 484a0c5fd33b99..f2ae3e14252ba2 100644 --- a/src/inet/InetError.h +++ b/src/inet/InetError.h @@ -372,7 +372,7 @@ typedef INET_CONFIG_ERROR_TYPE INET_ERROR; namespace chip { namespace Inet { -extern void RegisterLayerErrorFormatter(void); +extern void RegisterLayerErrorFormatter(); extern bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err); } // namespace Inet diff --git a/src/inet/InetFaultInjection.cpp b/src/inet/InetFaultInjection.cpp index 9cdda7c664549f..866895daa6247a 100644 --- a/src/inet/InetFaultInjection.cpp +++ b/src/inet/InetFaultInjection.cpp @@ -43,7 +43,7 @@ static const nl::FaultInjection::Name sFaultNames[] = { /** * Get the singleton FaultInjection::Manager for Inet faults */ -nl::FaultInjection::Manager & GetManager(void) +nl::FaultInjection::Manager & GetManager() { if (0 == sInetFaultInMgr.GetNumFaults()) { diff --git a/src/inet/InetFaultInjection.h b/src/inet/InetFaultInjection.h index f8e2efeaa6fbb4..e5fcaf83cdb2da 100644 --- a/src/inet/InetFaultInjection.h +++ b/src/inet/InetFaultInjection.h @@ -53,7 +53,7 @@ typedef enum kFault_NumItems, } InetFaultInjectionID; -DLL_EXPORT nl::FaultInjection::Manager & GetManager(void); +DLL_EXPORT nl::FaultInjection::Manager & GetManager(); } // namespace FaultInjection } // namespace Inet diff --git a/src/inet/InetInterface.cpp b/src/inet/InetInterface.cpp index 1282f1460a55a1..7bb5f997a614fa 100644 --- a/src/inet/InetInterface.cpp +++ b/src/inet/InetInterface.cpp @@ -200,7 +200,7 @@ static int sIOCTLSocket = -1; * * This function is thread-safe on all platforms. */ -int GetIOCTLSocket(void) +int GetIOCTLSocket() { if (sIOCTLSocket == -1) { @@ -231,7 +231,7 @@ int GetIOCTLSocket(void) * * NB: This function is NOT thread-safe with respect to \c GetIOCTLSocket. */ -void CloseIOCTLSocket(void) +void CloseIOCTLSocket() { if (sIOCTLSocket == -1) { @@ -391,7 +391,7 @@ static struct if_nameindex * backport_if_nameindex(void) #endif // __ANDROID__ && __ANDROID_API__ < 24 -InterfaceIterator::InterfaceIterator(void) +InterfaceIterator::InterfaceIterator() { mIntfArray = nullptr; mCurIntf = 0; @@ -416,7 +416,7 @@ InterfaceIterator::InterfaceIterator() : mCurrentInterface(net_if_get_by_index(m #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS -InterfaceIterator::~InterfaceIterator(void) +InterfaceIterator::~InterfaceIterator() { if (mIntfArray != nullptr) { @@ -441,7 +441,7 @@ InterfaceIterator::~InterfaceIterator(void) */ #if CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS -bool InterfaceIterator::HasCurrent(void) +bool InterfaceIterator::HasCurrent() { return (mIntfArray != nullptr) ? mIntfArray[mCurIntf].if_index != 0 : Next(); } @@ -474,7 +474,7 @@ bool InterfaceIterator::HasCurrent(void) * interfaces, *except* in the case of LwIP systems when the currently selected * interface is removed from the list, which causes iteration to end immediately. */ -bool InterfaceIterator::Next(void) +bool InterfaceIterator::Next() { #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS @@ -540,7 +540,7 @@ bool InterfaceIterator::Next(void) */ #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS -InterfaceId InterfaceIterator::GetInterfaceId(void) +InterfaceId InterfaceIterator::GetInterfaceId() { return (HasCurrent()) ? mIntfArray[mCurIntf].if_index : INET_NULL_INTERFACEID; } @@ -600,7 +600,7 @@ INET_ERROR InterfaceIterator::GetInterfaceName(char * nameBuf, size_t nameBufSiz * @return \c true if current network interface is up, \c false if not * or if the iterator is positioned beyond the end of the list. */ -bool InterfaceIterator::IsUp(void) +bool InterfaceIterator::IsUp() { #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS return (GetFlags() & IFF_UP) != 0; @@ -621,7 +621,7 @@ bool InterfaceIterator::IsUp(void) * @return \c true if current network interface supports multicast, \c false * if not, or if the iterator is positioned beyond the end of the list. */ -bool InterfaceIterator::SupportsMulticast(void) +bool InterfaceIterator::SupportsMulticast() { #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS return (GetFlags() & IFF_MULTICAST) != 0; @@ -647,7 +647,7 @@ bool InterfaceIterator::SupportsMulticast(void) * @return \c true if current network interface has a broadcast address, \c false * if not, or if the iterator is positioned beyond the end of the list. */ -bool InterfaceIterator::HasBroadcastAddress(void) +bool InterfaceIterator::HasBroadcastAddress() { #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS return (GetFlags() & IFF_BROADCAST) != 0; @@ -670,7 +670,7 @@ bool InterfaceIterator::HasBroadcastAddress(void) * * @brief Returns the ifr_flags value for the current interface. */ -short InterfaceIterator::GetFlags(void) +short InterfaceIterator::GetFlags() { struct ifreq intfData; @@ -702,7 +702,7 @@ short InterfaceIterator::GetFlags(void) * Starts the iterator at the first network address. On some platforms, * this constructor may allocate resources recycled by the destructor. */ -InterfaceAddressIterator::InterfaceAddressIterator(void) +InterfaceAddressIterator::InterfaceAddressIterator() { mAddrsList = nullptr; mCurAddr = nullptr; @@ -723,7 +723,7 @@ InterfaceAddressIterator::InterfaceAddressIterator() = default; */ #if CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS -InterfaceAddressIterator::~InterfaceAddressIterator(void) +InterfaceAddressIterator::~InterfaceAddressIterator() { if (mAddrsList != nullptr) { @@ -741,7 +741,7 @@ InterfaceAddressIterator::~InterfaceAddressIterator(void) * @return \c true if the iterator is positioned on an interface address; * \c false if positioned beyond the end of the address list. */ -bool InterfaceAddressIterator::HasCurrent(void) +bool InterfaceAddressIterator::HasCurrent() { #if CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS return (mAddrsList != nullptr) ? (mCurAddr != nullptr) : Next(); @@ -772,7 +772,7 @@ bool InterfaceAddressIterator::HasCurrent(void) * themselves are never destroyed. Additionally, iteration on LwIP systems * will terminate early if the current interface is removed from the list. */ -bool InterfaceAddressIterator::Next(void) +bool InterfaceAddressIterator::Next() { #if CHIP_SYSTEM_CONFIG_USE_SOCKETS && CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS while (true) @@ -870,7 +870,7 @@ bool InterfaceAddressIterator::Next(void) * @return the current interface address or \c IPAddress::Any if the iterator * is positioned beyond the end of the address list. */ -IPAddress InterfaceAddressIterator::GetAddress(void) +IPAddress InterfaceAddressIterator::GetAddress() { if (HasCurrent()) { @@ -918,7 +918,7 @@ IPAddress InterfaceAddressIterator::GetAddress(void) * something else. On most platforms, the system's interface address * structure can represent arbitrary prefix lengths between 0 and 128. */ -uint8_t InterfaceAddressIterator::GetPrefixLength(void) +uint8_t InterfaceAddressIterator::GetPrefixLength() { if (HasCurrent()) { @@ -967,7 +967,7 @@ uint8_t InterfaceAddressIterator::GetPrefixLength(void) * @return the interface id or \c INET_NULL_INTERFACEID if the iterator * is positioned beyond the end of the address list. */ -InterfaceId InterfaceAddressIterator::GetInterfaceId(void) +InterfaceId InterfaceAddressIterator::GetInterfaceId() { if (HasCurrent()) { @@ -1031,7 +1031,7 @@ INET_ERROR InterfaceAddressIterator::GetInterfaceName(char * nameBuf, size_t nam * @return \c true if current network interface is up, \c false if not, or * if the iterator is not positioned on an interface address. */ -bool InterfaceAddressIterator::IsUp(void) +bool InterfaceAddressIterator::IsUp() { if (HasCurrent()) { @@ -1055,7 +1055,7 @@ bool InterfaceAddressIterator::IsUp(void) * @return \c true if multicast is supported, \c false if not, or * if the iterator is not positioned on an interface address. */ -bool InterfaceAddressIterator::SupportsMulticast(void) +bool InterfaceAddressIterator::SupportsMulticast() { if (HasCurrent()) { @@ -1079,7 +1079,7 @@ bool InterfaceAddressIterator::SupportsMulticast(void) * @return \c true if the interface has a broadcast address, \c false if not, or * if the iterator is not positioned on an interface address. */ -bool InterfaceAddressIterator::HasBroadcastAddress(void) +bool InterfaceAddressIterator::HasBroadcastAddress() { if (HasCurrent()) { diff --git a/src/inet/InetInterface.h b/src/inet/InetInterface.h index dee996df6d9fc7..532f22d59e1b24 100644 --- a/src/inet/InetInterface.h +++ b/src/inet/InetInterface.h @@ -141,17 +141,17 @@ extern uint8_t NetmaskToPrefixLength(const uint8_t * netmask, uint16_t netmaskLe class InterfaceIterator { public: - InterfaceIterator(void); - ~InterfaceIterator(void); + InterfaceIterator(); + ~InterfaceIterator(); - bool HasCurrent(void); - bool Next(void); - InterfaceId GetInterface(void); - InterfaceId GetInterfaceId(void); + bool HasCurrent(); + bool Next(); + InterfaceId GetInterface(); + InterfaceId GetInterfaceId(); INET_ERROR GetInterfaceName(char * nameBuf, size_t nameBufSize); - bool IsUp(void); - bool SupportsMulticast(void); - bool HasBroadcastAddress(void); + bool IsUp(); + bool SupportsMulticast(); + bool HasBroadcastAddress(); protected: #if CHIP_SYSTEM_CONFIG_USE_LWIP @@ -164,7 +164,7 @@ class InterfaceIterator short mIntfFlags; bool mIntfFlagsCached; - short GetFlags(void); + short GetFlags(); #endif // CHIP_SYSTEM_CONFIG_USE_BSD_IFADDRS #if CHIP_SYSTEM_CONFIG_USE_ZEPHYR_NET_IF @@ -198,21 +198,21 @@ class InterfaceIterator class DLL_EXPORT InterfaceAddressIterator { public: - InterfaceAddressIterator(void); - ~InterfaceAddressIterator(void); - - bool HasCurrent(void); - bool Next(void); - IPAddress GetAddress(void); - uint8_t GetPrefixLength(void); - uint8_t GetIPv6PrefixLength(void); + InterfaceAddressIterator(); + ~InterfaceAddressIterator(); + + bool HasCurrent(); + bool Next(); + IPAddress GetAddress(); + uint8_t GetPrefixLength(); + uint8_t GetIPv6PrefixLength(); void GetAddressWithPrefix(IPPrefix & addrWithPrefix); - InterfaceId GetInterface(void); - InterfaceId GetInterfaceId(void); + InterfaceId GetInterface(); + InterfaceId GetInterfaceId(); INET_ERROR GetInterfaceName(char * nameBuf, size_t nameBufSize); - bool IsUp(void); - bool SupportsMulticast(void); - bool HasBroadcastAddress(void); + bool IsUp(); + bool SupportsMulticast(); + bool HasBroadcastAddress(); private: #if CHIP_SYSTEM_CONFIG_USE_LWIP @@ -273,7 +273,7 @@ inline InterfaceAddressIterator::~InterfaceAddressIterator() = default; /** * @brief Deprecated alias for \c GetInterfaceId(void) */ -inline InterfaceId InterfaceIterator::GetInterface(void) +inline InterfaceId InterfaceIterator::GetInterface() { return GetInterfaceId(); } @@ -281,7 +281,7 @@ inline InterfaceId InterfaceIterator::GetInterface(void) /** * @brief Deprecated alias for \c GetInterfaceId(void) */ -inline InterfaceId InterfaceAddressIterator::GetInterface(void) +inline InterfaceId InterfaceAddressIterator::GetInterface() { return GetInterfaceId(); } @@ -289,7 +289,7 @@ inline InterfaceId InterfaceAddressIterator::GetInterface(void) /** * @brief Deprecated alias for \c GetPrefixLength(void) */ -inline uint8_t InterfaceAddressIterator::GetIPv6PrefixLength(void) +inline uint8_t InterfaceAddressIterator::GetIPv6PrefixLength() { return GetPrefixLength(); } diff --git a/src/inet/InetLayer.cpp b/src/inet/InetLayer.cpp index 84da8cd0931be7..e01d661cd50785 100644 --- a/src/inet/InetLayer.cpp +++ b/src/inet/InetLayer.cpp @@ -107,7 +107,7 @@ void InetLayer::UpdateSnapshot(chip::System::Stats::Snapshot & aSnapshot) * method must be called successfully prior to using the object. * */ -InetLayer::InetLayer(void) +InetLayer::InetLayer() { State = kState_NotInitialized; @@ -308,7 +308,7 @@ INET_ERROR InetLayer::Init(chip::System::Layer & aSystemLayer, void * aContext) * the reason for shutdown failure. * */ -INET_ERROR InetLayer::Shutdown(void) +INET_ERROR InetLayer::Shutdown() { INET_ERROR err; @@ -388,7 +388,7 @@ INET_ERROR InetLayer::Shutdown(void) * otherwise, NULL. * */ -void * InetLayer::GetPlatformData(void) +void * InetLayer::GetPlatformData() { return mPlatformData; } @@ -406,7 +406,7 @@ void InetLayer::SetPlatformData(void * aPlatformData) } #if INET_CONFIG_ENABLE_TCP_ENDPOINT && INET_TCP_IDLE_CHECK_INTERVAL > 0 -bool InetLayer::IsIdleTimerRunning(void) +bool InetLayer::IsIdleTimerRunning() { bool timerRunning = false; diff --git a/src/inet/InetLayer.h b/src/inet/InetLayer.h index 29a1b1eca8be36..d311227cdbaa96 100644 --- a/src/inet/InetLayer.h +++ b/src/inet/InetLayer.h @@ -173,12 +173,12 @@ class DLL_EXPORT InetLayer kState_ShutdownInProgress = 2, /**< State where Shutdown has been triggered. */ } State; /**< [READ-ONLY] Current state. */ - InetLayer(void); + InetLayer(); INET_ERROR Init(chip::System::Layer & aSystemLayer, void * aContext); - INET_ERROR Shutdown(void); + INET_ERROR Shutdown(); - chip::System::Layer * SystemLayer(void) const; + chip::System::Layer * SystemLayer() const; // End Points @@ -222,7 +222,7 @@ class DLL_EXPORT InetLayer static void UpdateSnapshot(chip::System::Stats::Snapshot & aSnapshot); - void * GetPlatformData(void); + void * GetPlatformData(); void SetPlatformData(void * aPlatformData); #if CHIP_SYSTEM_CONFIG_USE_LWIP @@ -305,10 +305,10 @@ class DLL_EXPORT InetLayer friend INET_ERROR Platform::InetLayer::WillShutdown(Inet::InetLayer * aLayer, void * aContext); friend void Platform::InetLayer::DidShutdown(Inet::InetLayer * aLayer, void * aContext, INET_ERROR anError); - bool IsIdleTimerRunning(void); + bool IsIdleTimerRunning(); }; -inline chip::System::Layer * InetLayer::SystemLayer(void) const +inline chip::System::Layer * InetLayer::SystemLayer() const { return mSystemLayer; } @@ -332,7 +332,7 @@ class IPPacketInfo uint16_t SrcPort; /**< The source port in the packet. */ uint16_t DestPort; /**< The destination port in the packet. */ - void Clear(void); + void Clear(); }; extern INET_ERROR ParseHostAndPort(const char * aString, uint16_t aStringLen, const char *& aHost, uint16_t & aHostLen, diff --git a/src/inet/InetLayerBasis.h b/src/inet/InetLayerBasis.h index 5423f312cdb22a..050540b7c323e0 100644 --- a/src/inet/InetLayerBasis.h +++ b/src/inet/InetLayerBasis.h @@ -53,7 +53,7 @@ class InetLayer; class InetLayerBasis : public chip::System::Object { public: - InetLayer & Layer(void) const; + InetLayer & Layer() const; bool IsCreatedByInetLayer(const InetLayer & aInetLayer) const; protected: @@ -66,7 +66,7 @@ class InetLayerBasis : public chip::System::Object /** * Returns a reference to the Inet layer object that owns this basis object. */ -inline InetLayer & InetLayerBasis::Layer(void) const +inline InetLayer & InetLayerBasis::Layer() const { return *mInetLayer; } diff --git a/src/inet/RawEndPoint.cpp b/src/inet/RawEndPoint.cpp index 7bba3723910a8f..7c53c917a247cc 100644 --- a/src/inet/RawEndPoint.cpp +++ b/src/inet/RawEndPoint.cpp @@ -375,7 +375,7 @@ INET_ERROR RawEndPoint::BindIPv6LinkLocal(InterfaceId intfId, IPAddress addr) * On LwIP, this method must not be called with the LwIP stack lock * already acquired */ -INET_ERROR RawEndPoint::Listen(void) +INET_ERROR RawEndPoint::Listen() { INET_ERROR res = INET_NO_ERROR; @@ -440,7 +440,7 @@ INET_ERROR RawEndPoint::Listen(void) * On LwIP systems, this method must not be called with the LwIP stack * lock already acquired. */ -void RawEndPoint::Close(void) +void RawEndPoint::Close() { if (mState != kState_Closed) { @@ -496,7 +496,7 @@ void RawEndPoint::Close(void) * On LwIP systems, this method must not be called with the LwIP stack * lock already acquired. */ -void RawEndPoint::Free(void) +void RawEndPoint::Free() { Close(); @@ -864,7 +864,7 @@ void RawEndPoint::Init(InetLayer * inetLayer, IPVersion ipVer, IPProtocol ipProt * * @return InterfaceId The bound interface id. */ -InterfaceId RawEndPoint::GetBoundInterface(void) +InterfaceId RawEndPoint::GetBoundInterface() { #if CHIP_SYSTEM_CONFIG_USE_LWIP #if HAVE_LWIP_RAW_BIND_NETIF @@ -1102,12 +1102,12 @@ INET_ERROR RawEndPoint::GetSocket(IPAddressType aAddressType) return (lRetval); } -SocketEvents RawEndPoint::PrepareIO(void) +SocketEvents RawEndPoint::PrepareIO() { return (IPEndPointBasis::PrepareIO()); } -void RawEndPoint::HandlePendingIO(void) +void RawEndPoint::HandlePendingIO() { if (mState == kState_Listening && OnMessageReceived != nullptr && mPendingIO.IsReadable()) { diff --git a/src/inet/RawEndPoint.h b/src/inet/RawEndPoint.h index 5b123e0dc2e915..aaf6b64fddcc7d 100644 --- a/src/inet/RawEndPoint.h +++ b/src/inet/RawEndPoint.h @@ -74,19 +74,19 @@ class DLL_EXPORT RawEndPoint : public IPEndPointBasis INET_ERROR Bind(IPAddressType addrType, IPAddress addr, InterfaceId intfId = INET_NULL_INTERFACEID); INET_ERROR BindIPv6LinkLocal(InterfaceId intfId, IPAddress addr); INET_ERROR BindInterface(IPAddressType addrType, InterfaceId intfId); - InterfaceId GetBoundInterface(void); - INET_ERROR Listen(void); + InterfaceId GetBoundInterface(); + INET_ERROR Listen(); INET_ERROR SendTo(IPAddress addr, chip::System::PacketBuffer * msg, uint16_t sendFlags = 0); INET_ERROR SendTo(IPAddress addr, InterfaceId intfId, chip::System::PacketBuffer * msg, uint16_t sendFlags = 0); INET_ERROR SendMsg(const IPPacketInfo * pktInfo, chip::System::PacketBuffer * msg, uint16_t sendFlags = 0); INET_ERROR SetICMPFilter(uint8_t numICMPTypes, const uint8_t * aICMPTypes); - void Close(void); - void Free(void); + void Close(); + void Free(); private: - RawEndPoint(void) = delete; + RawEndPoint() = delete; RawEndPoint(const RawEndPoint &) = delete; - ~RawEndPoint(void) = delete; + ~RawEndPoint() = delete; static chip::System::ObjectPool sPool; @@ -108,8 +108,8 @@ class DLL_EXPORT RawEndPoint : public IPEndPointBasis #if CHIP_SYSTEM_CONFIG_USE_SOCKETS INET_ERROR GetSocket(IPAddressType addrType); - SocketEvents PrepareIO(void); - void HandlePendingIO(void); + SocketEvents PrepareIO(); + void HandlePendingIO(); #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS }; diff --git a/src/inet/TCPEndPoint.cpp b/src/inet/TCPEndPoint.cpp index 14aa7d69a8e459..21a5079d8658ee 100644 --- a/src/inet/TCPEndPoint.cpp +++ b/src/inet/TCPEndPoint.cpp @@ -523,7 +523,7 @@ void TCPEndPoint::SetConnectTimeout(const uint32_t connTimeoutMsecs) mConnectTimeoutMsecs = connTimeoutMsecs; } -void TCPEndPoint::StartConnectTimerIfSet(void) +void TCPEndPoint::StartConnectTimerIfSet() { if (mConnectTimeoutMsecs > 0) { @@ -533,7 +533,7 @@ void TCPEndPoint::StartConnectTimerIfSet(void) } } -void TCPEndPoint::StopConnectTimer(void) +void TCPEndPoint::StopConnectTimer() { chip::System::Layer & lSystemLayer = SystemLayer(); @@ -764,7 +764,7 @@ void TCPEndPoint::EnableReceive() * */ -INET_ERROR TCPEndPoint::EnableNoDelay(void) +INET_ERROR TCPEndPoint::EnableNoDelay() { INET_ERROR res = INET_NO_ERROR; diff --git a/src/inet/TCPEndPoint.h b/src/inet/TCPEndPoint.h index e03327a6a58c23..e93a818a176e06 100644 --- a/src/inet/TCPEndPoint.h +++ b/src/inet/TCPEndPoint.h @@ -207,7 +207,7 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * Disable all event handlers. Data sent to an endpoint that disables * reception will be acknowledged until the receive window is exhausted. */ - void DisableReceive(void); + void DisableReceive(); /** * @brief Enable reception. @@ -216,12 +216,12 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * Enable all event handlers. Data sent to an endpoint that disables * reception will be acknowledged until the receive window is exhausted. */ - void EnableReceive(void); + void EnableReceive(); /** * @brief EnableNoDelay */ - INET_ERROR EnableNoDelay(void); + INET_ERROR EnableNoDelay(); /** * @brief @@ -269,7 +269,7 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * * @retval other another system or platform error */ - INET_ERROR DisableKeepAlive(void); + INET_ERROR DisableKeepAlive(); /** * @brief Set the TCP TCP_USER_TIMEOUT socket option. @@ -331,7 +331,7 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * * @return Number of untransmitted bytes in the transmit queue. */ - uint32_t PendingSendLength(void); + uint32_t PendingSendLength(); /** * @brief Extract the length of the unacknowledged receive data. @@ -339,7 +339,7 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * @return Number of bytes in the receive queue that have not yet been * acknowledged with AckReceive(uint16_t len). */ - uint32_t PendingReceiveLength(void); + uint32_t PendingReceiveLength(); /** * @brief Initiate TCP half close, in other words, finished with sending. @@ -349,7 +349,7 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * * @retval other another system or platform error */ - INET_ERROR Shutdown(void); + INET_ERROR Shutdown(); /** * @brief Initiate TCP full close, in other words, finished with both send and @@ -360,12 +360,12 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * * @retval other another system or platform error */ - INET_ERROR Close(void); + INET_ERROR Close(); /** * @brief Abortively close the endpoint, in other words, send RST packets. */ - void Abort(void); + void Abort(); /** * @brief Initiate (or continue) TCP full close, ignoring errors. @@ -374,12 +374,12 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * The object is returned to the free pool, and all remaining user * references are subsequently invalid. */ - void Free(void); + void Free(); /** * @brief Extract whether TCP connection is established. */ - bool IsConnected(void) const; + bool IsConnected() const; void SetConnectTimeout(const uint32_t connTimeoutMsecs); @@ -402,14 +402,14 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis * @details * Reset the idle timer to zero. */ - void MarkActive(void); + void MarkActive(); /** * @brief Obtain an identifier for the endpoint. * * @return Returns an opaque unique identifier for use logs. */ - uint16_t LogId(void); + uint16_t LogId(); /** * @brief Type of connection establishment event handling function. @@ -594,11 +594,11 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis static void TCPUserTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError); - void StartTCPUserTimeoutTimer(void); + void StartTCPUserTimeoutTimer(); - void StopTCPUserTimeoutTimer(void); + void StopTCPUserTimeoutTimer(); - void RestartTCPUserTimeoutTimer(void); + void RestartTCPUserTimeoutTimer(); void ScheduleNextTCPUserTimeoutPoll(uint32_t aTimeOut); @@ -617,13 +617,13 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis #endif // INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT - TCPEndPoint(void); // not defined + TCPEndPoint(); // not defined TCPEndPoint(const TCPEndPoint &); // not defined - ~TCPEndPoint(void); // not defined + ~TCPEndPoint(); // not defined void Init(InetLayer * inetLayer); - INET_ERROR DriveSending(void); - void DriveReceiving(void); + INET_ERROR DriveSending(); + void DriveReceiving(); void HandleConnectComplete(INET_ERROR err); void HandleAcceptError(INET_ERROR err); INET_ERROR DoClose(INET_ERROR err, bool suppressCallback); @@ -631,8 +631,8 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis static void TCPConnectTimeoutHandler(chip::System::Layer * aSystemLayer, void * aAppState, chip::System::Error aError); - void StartConnectTimerIfSet(void); - void StopConnectTimer(void); + void StartConnectTimerIfSet(); + void StopConnectTimer(); #if CHIP_SYSTEM_CONFIG_USE_LWIP chip::System::PacketBuffer * mUnsentQueue; @@ -654,10 +654,10 @@ class DLL_EXPORT TCPEndPoint : public EndPointBasis #if CHIP_SYSTEM_CONFIG_USE_SOCKETS INET_ERROR GetSocket(IPAddressType addrType); - SocketEvents PrepareIO(void); - void HandlePendingIO(void); - void ReceiveData(void); - void HandleIncomingConnection(void); + SocketEvents PrepareIO(); + void HandlePendingIO(); + void ReceiveData(); + void HandleIncomingConnection(); INET_ERROR BindSrcAddrFromIntf(IPAddressType addrType, InterfaceId intfId); #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS }; @@ -672,17 +672,17 @@ inline uint16_t TCPEndPoint::MaxTCPSendQueuePolls(void) } #endif // INET_CONFIG_ENABLE_TCP_SEND_IDLE_CALLBACKS && INET_CONFIG_OVERRIDE_SYSTEM_TCP_USER_TIMEOUT -inline bool TCPEndPoint::IsConnected(void) const +inline bool TCPEndPoint::IsConnected() const { return IsConnected(State); } -inline uint16_t TCPEndPoint::LogId(void) +inline uint16_t TCPEndPoint::LogId() { return static_cast(reinterpret_cast(this)); } -inline void TCPEndPoint::MarkActive(void) +inline void TCPEndPoint::MarkActive() { #if INET_TCP_IDLE_CHECK_INTERVAL > 0 mRemainingIdleTime = mIdleTimeout; diff --git a/src/inet/UDPEndPoint.cpp b/src/inet/UDPEndPoint.cpp index c250c4487f44e9..e5e81e87efec13 100644 --- a/src/inet/UDPEndPoint.cpp +++ b/src/inet/UDPEndPoint.cpp @@ -305,7 +305,7 @@ INET_ERROR UDPEndPoint::Bind(IPAddressType addrType, IPAddress addr, uint16_t po * On LwIP, this method must not be called with the LwIP stack lock * already acquired */ -INET_ERROR UDPEndPoint::Listen(void) +INET_ERROR UDPEndPoint::Listen() { INET_ERROR res = INET_NO_ERROR; @@ -377,7 +377,7 @@ INET_ERROR UDPEndPoint::Listen(void) * On LwIP systems, this method must not be called with the LwIP stack * lock already acquired. */ -void UDPEndPoint::Close(void) +void UDPEndPoint::Close() { if (mState != kState_Closed) { @@ -437,7 +437,7 @@ void UDPEndPoint::Close(void) * On LwIP systems, this method must not be called with the LwIP stack * lock already acquired. */ -void UDPEndPoint::Free(void) +void UDPEndPoint::Free() { Close(); @@ -793,7 +793,7 @@ void UDPEndPoint::Init(InetLayer * inetLayer) * * @return InterfaceId The bound interface id. */ -InterfaceId UDPEndPoint::GetBoundInterface(void) +InterfaceId UDPEndPoint::GetBoundInterface() { #if CHIP_SYSTEM_CONFIG_USE_LWIP #if HAVE_LWIP_UDP_BIND_NETIF @@ -812,7 +812,7 @@ InterfaceId UDPEndPoint::GetBoundInterface(void) #endif // CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK } -uint16_t UDPEndPoint::GetBoundPort(void) +uint16_t UDPEndPoint::GetBoundPort() { #if CHIP_SYSTEM_CONFIG_USE_LWIP return mUDP->local_port; @@ -972,12 +972,12 @@ INET_ERROR UDPEndPoint::GetSocket(IPAddressType aAddressType) return (lRetval); } -SocketEvents UDPEndPoint::PrepareIO(void) +SocketEvents UDPEndPoint::PrepareIO() { return (IPEndPointBasis::PrepareIO()); } -void UDPEndPoint::HandlePendingIO(void) +void UDPEndPoint::HandlePendingIO() { if (mState == kState_Listening && OnMessageReceived != nullptr && mPendingIO.IsReadable()) { diff --git a/src/inet/UDPEndPoint.h b/src/inet/UDPEndPoint.h index 7b039ef572d797..30231eb1a740c4 100644 --- a/src/inet/UDPEndPoint.h +++ b/src/inet/UDPEndPoint.h @@ -55,19 +55,19 @@ class DLL_EXPORT UDPEndPoint : public IPEndPointBasis public: INET_ERROR Bind(IPAddressType addrType, IPAddress addr, uint16_t port, InterfaceId intfId = INET_NULL_INTERFACEID); INET_ERROR BindInterface(IPAddressType addrType, InterfaceId intfId); - InterfaceId GetBoundInterface(void); - uint16_t GetBoundPort(void); - INET_ERROR Listen(void); + InterfaceId GetBoundInterface(); + uint16_t GetBoundPort(); + INET_ERROR Listen(); INET_ERROR SendTo(IPAddress addr, uint16_t port, chip::System::PacketBuffer * msg, uint16_t sendFlags = 0); INET_ERROR SendTo(IPAddress addr, uint16_t port, InterfaceId intfId, chip::System::PacketBuffer * msg, uint16_t sendFlags = 0); INET_ERROR SendMsg(const IPPacketInfo * pktInfo, chip::System::PacketBuffer * msg, uint16_t sendFlags = 0); - void Close(void); - void Free(void); + void Close(); + void Free(); private: - UDPEndPoint(void) = delete; + UDPEndPoint() = delete; UDPEndPoint(const UDPEndPoint &) = delete; - ~UDPEndPoint(void) = delete; + ~UDPEndPoint() = delete; static chip::System::ObjectPool sPool; @@ -87,8 +87,8 @@ class DLL_EXPORT UDPEndPoint : public IPEndPointBasis uint16_t mBoundPort; INET_ERROR GetSocket(IPAddressType addrType); - SocketEvents PrepareIO(void); - void HandlePendingIO(void); + SocketEvents PrepareIO(); + void HandlePendingIO(); #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS }; diff --git a/src/inet/tests/TestInetAddressDriver.cpp b/src/inet/tests/TestInetAddressDriver.cpp index 20db2579b20f84..5ad4ebbf9db80c 100644 --- a/src/inet/tests/TestInetAddressDriver.cpp +++ b/src/inet/tests/TestInetAddressDriver.cpp @@ -27,7 +27,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/inet/tests/TestInetCommon.cpp b/src/inet/tests/TestInetCommon.cpp index e1eac5f2405523..91ab953a2717ad 100644 --- a/src/inet/tests/TestInetCommon.cpp +++ b/src/inet/tests/TestInetCommon.cpp @@ -106,7 +106,7 @@ struct RestartCallbackContext char ** mArgv; }; -static void RebootCallbackFn(void); +static void RebootCallbackFn(); static void PostInjectionCallbackFn(nl::FaultInjection::Manager * aManager, nl::FaultInjection::Identifier aId, nl::FaultInjection::Record * aFaultRecord); @@ -168,7 +168,7 @@ static void ExitOnSIGUSR1Handler(int signum) } // We set a hook to exit when we receive SIGUSR1, SIGTERM or SIGHUP -void SetSIGUSR1Handler(void) +void SetSIGUSR1Handler() { SetSignalHandler(ExitOnSIGUSR1Handler); } @@ -658,7 +658,7 @@ void DumpMemory(const uint8_t * mem, uint32_t len, const char * prefix) DumpMemory(mem, len, prefix, kRowWidth); } -static void RebootCallbackFn(void) +static void RebootCallbackFn() { char * lArgv[sRestartCallbackCtx.mArgc + 2]; int i; @@ -762,7 +762,7 @@ void SetupFaultInjectionContext(int argc, char * argv[]) SetupFaultInjectionContext(argc, argv, nullptr, nullptr); } -void SetupFaultInjectionContext(int argc, char * argv[], int32_t (*aNumEventsAvailable)(void), +void SetupFaultInjectionContext(int argc, char * argv[], int32_t (*aNumEventsAvailable)(), void (*aInjectAsyncEvents)(int32_t index)) { nl::FaultInjection::Manager & weavemgr = chip::FaultInjection::GetManager(); diff --git a/src/inet/tests/TestInetCommon.h b/src/inet/tests/TestInetCommon.h index eaeb2c123b8576..3bd78cf8ea05a0 100644 --- a/src/inet/tests/TestInetCommon.h +++ b/src/inet/tests/TestInetCommon.h @@ -74,18 +74,18 @@ extern chip::Inet::InetLayer gInet; extern bool gDone; extern bool gSigusr1Received; -extern void InitTestInetCommon(void); -extern void SetSIGUSR1Handler(void); -extern void InitSystemLayer(void); -extern void ShutdownSystemLayer(void); +extern void InitTestInetCommon(); +extern void SetSIGUSR1Handler(); +extern void InitSystemLayer(); +extern void ShutdownSystemLayer(); typedef void (*SignalHandler)(int signum); extern void SetSignalHandler(SignalHandler handler); -extern void InitNetwork(void); +extern void InitNetwork(); extern void ServiceEvents(struct ::timeval & aSleepTime); -extern void ShutdownNetwork(void); +extern void ShutdownNetwork(); extern void DumpMemory(const uint8_t * mem, uint32_t len, const char * prefix, uint32_t rowWidth); extern void DumpMemory(const uint8_t * mem, uint32_t len, const char * prefix); @@ -95,6 +95,6 @@ inline static void ServiceNetwork(struct ::timeval & aSleepTime) } extern void SetupFaultInjectionContext(int argc, char * argv[]); -extern void SetupFaultInjectionContext(int argc, char * argv[], int32_t (*aNumEventsAvailable)(void), +extern void SetupFaultInjectionContext(int argc, char * argv[], int32_t (*aNumEventsAvailable)(), void (*aInjectAsyncEvents)(int32_t index)); #endif /* CHIP_TEST_INET_COMMON_H_ */ diff --git a/src/inet/tests/TestInetEndPoint.cpp b/src/inet/tests/TestInetEndPoint.cpp index 81c536d92db1fb..f3f63da9171fb8 100644 --- a/src/inet/tests/TestInetEndPoint.cpp +++ b/src/inet/tests/TestInetEndPoint.cpp @@ -547,7 +547,7 @@ static int TestTeardown(void * inContext) } #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS -int TestInetEndPointInternal(void) +int TestInetEndPointInternal() { #if CHIP_SYSTEM_CONFIG_USE_SOCKETS // clang-format off diff --git a/src/inet/tests/TestInetEndPointDriver.cpp b/src/inet/tests/TestInetEndPointDriver.cpp index b6b84cdf7e0481..8df6c13be8bd63 100644 --- a/src/inet/tests/TestInetEndPointDriver.cpp +++ b/src/inet/tests/TestInetEndPointDriver.cpp @@ -27,7 +27,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/inet/tests/TestInetErrorStrDriver.cpp b/src/inet/tests/TestInetErrorStrDriver.cpp index dadeae183f6233..479e07863182b1 100644 --- a/src/inet/tests/TestInetErrorStrDriver.cpp +++ b/src/inet/tests/TestInetErrorStrDriver.cpp @@ -27,7 +27,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/inet/tests/TestInetLayer.cpp b/src/inet/tests/TestInetLayer.cpp index 46cfce752a3434..9c48f7481c05b9 100644 --- a/src/inet/tests/TestInetLayer.cpp +++ b/src/inet/tests/TestInetLayer.cpp @@ -80,8 +80,8 @@ static void HandleSignal(int aSignal); static bool HandleOption(const char * aProgram, OptionSet * aOptions, int aIdentifier, const char * aName, const char * aValue); static bool HandleNonOptionArgs(const char * aProgram, int argc, char * argv[]); -static void StartTest(void); -static void CleanupTest(void); +static void StartTest(); +static void CleanupTest(); /* Global Variables */ @@ -761,7 +761,7 @@ static void HandleUDPReceiveError(IPEndPointBasis * aEndPoint, INET_ERROR aError SetStatusFailed(sTestState.mStatus); } -static bool IsTransportReadyForSend(void) +static bool IsTransportReadyForSend() { bool lStatus = false; @@ -796,7 +796,7 @@ static bool IsTransportReadyForSend(void) return (lStatus); } -static INET_ERROR PrepareTransportForSend(void) +static INET_ERROR PrepareTransportForSend() { INET_ERROR lStatus = INET_NO_ERROR; @@ -885,7 +885,7 @@ static INET_ERROR DriveSendForDestination(const IPAddress & aAddress, uint16_t a return (lStatus); } -void DriveSend(void) +void DriveSend() { INET_ERROR lStatus = INET_NO_ERROR; @@ -932,7 +932,7 @@ void DriveSend(void) return; } -static void StartTest(void) +static void StartTest() { IPAddressType lIPAddressType = kIPAddressType_IPv6; IPProtocol lIPProtocol = kIPProtocol_ICMPv6; @@ -1044,7 +1044,7 @@ static void StartTest(void) DriveSend(); } -static void CleanupTest(void) +static void CleanupTest() { INET_ERROR lStatus; diff --git a/src/inet/tests/TestInetLayerCommon.cpp b/src/inet/tests/TestInetLayerCommon.cpp index b32a489ca1fff3..19503e59829ce4 100644 --- a/src/inet/tests/TestInetLayerCommon.cpp +++ b/src/inet/tests/TestInetLayerCommon.cpp @@ -92,12 +92,12 @@ uint32_t gOptFlags = 0; namespace Common { -bool IsReceiver(void) +bool IsReceiver() { return ((gOptFlags & kOptFlagListen) == kOptFlagListen); } -bool IsSender(void) +bool IsSender() { return (!IsReceiver()); } diff --git a/src/inet/tests/TestInetLayerCommon.hpp b/src/inet/tests/TestInetLayerCommon.hpp index 25fbc15f6c2e72..ff8a75c8b79ef9 100644 --- a/src/inet/tests/TestInetLayerCommon.hpp +++ b/src/inet/tests/TestInetLayerCommon.hpp @@ -125,8 +125,8 @@ extern uint32_t gOptFlags; namespace Common { -extern bool IsReceiver(void); -extern bool IsSender(void); +extern bool IsReceiver(); +extern bool IsSender(); extern bool IsTesting(const TestStatus & aTestStatus); extern bool WasSuccessful(const TestStatus & aTestStatus); @@ -168,6 +168,6 @@ extern void HandleUDPReceiveError(const Inet::IPEndPointBasis * aEndPoint, const // Period send function to be implemented by individual tests but // referenced by common code. -extern void DriveSend(void); +extern void DriveSend(); #endif // CHIP_TEST_INETLAYER_COMMON_HPP diff --git a/src/inet/tests/TestInetLayerDNS.cpp b/src/inet/tests/TestInetLayerDNS.cpp index 1e7620bf68fa2a..7a1fa036ff1047 100644 --- a/src/inet/tests/TestInetLayerDNS.cpp +++ b/src/inet/tests/TestInetLayerDNS.cpp @@ -666,7 +666,7 @@ static void HandleSIGUSR1(int sig) exit(0); } -int TestInetLayerDNSInternal(void) +int TestInetLayerDNSInternal() { // clang-format off const nlTest DNSTests[] = diff --git a/src/inet/tests/TestInetLayerDNSDriver.cpp b/src/inet/tests/TestInetLayerDNSDriver.cpp index 8506e19322d49f..94a4e50a28c1ca 100644 --- a/src/inet/tests/TestInetLayerDNSDriver.cpp +++ b/src/inet/tests/TestInetLayerDNSDriver.cpp @@ -27,7 +27,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/inet/tests/TestInetLayerMulticast.cpp b/src/inet/tests/TestInetLayerMulticast.cpp index fce26d301cf3f0..76fe11e9bd5681 100644 --- a/src/inet/tests/TestInetLayerMulticast.cpp +++ b/src/inet/tests/TestInetLayerMulticast.cpp @@ -98,8 +98,8 @@ static bool ParseGroupOpt(const char * aProgram, const char * aValue, bool aIPv6 static bool ParseAndUpdateExpectedGroupPackets(const char * aProgram, const char * aValue, uint32_t aGroup, const char * aDescription, uint32_t & aOutExpected); -static void StartTest(void); -static void CleanupTest(void); +static void StartTest(); +static void CleanupTest(); /* Global Variables */ @@ -724,7 +724,7 @@ static void HandleUDPReceiveError(IPEndPointBasis * aEndPoint, INET_ERROR aError SetStatusFailed(sTestState.mStatus); } -static bool IsTransportReadyForSend(void) +static bool IsTransportReadyForSend() { bool lStatus = false; @@ -740,7 +740,7 @@ static bool IsTransportReadyForSend(void) return (lStatus); } -static INET_ERROR PrepareTransportForSend(void) +static INET_ERROR PrepareTransportForSend() { INET_ERROR lStatus = INET_NO_ERROR; @@ -835,7 +835,7 @@ static INET_ERROR DriveSendForGroups(GroupAddresses & aGroupAddresses return (lStatus); } -void DriveSend(void) +void DriveSend() { INET_ERROR lStatus = INET_NO_ERROR; @@ -868,7 +868,7 @@ void DriveSend(void) return; } -static void StartTest(void) +static void StartTest() { IPAddressType lIPAddressType = kIPAddressType_IPv6; IPProtocol lIPProtocol = kIPProtocol_ICMPv6; @@ -988,7 +988,7 @@ static void StartTest(void) DriveSend(); } -static void CleanupTest(void) +static void CleanupTest() { IPEndPointBasis * lEndPoint = nullptr; INET_ERROR lStatus; diff --git a/src/lib/core/CHIPCircularTLVBuffer.cpp b/src/lib/core/CHIPCircularTLVBuffer.cpp index 75c9a1664e84e6..d84870f89248e7 100644 --- a/src/lib/core/CHIPCircularTLVBuffer.cpp +++ b/src/lib/core/CHIPCircularTLVBuffer.cpp @@ -114,7 +114,7 @@ CHIPCircularTLVBuffer::CHIPCircularTLVBuffer(uint8_t * inBuffer, size_t inBuffer * or by the TLVReader. * */ -CHIP_ERROR CHIPCircularTLVBuffer::EvictHead(void) +CHIP_ERROR CHIPCircularTLVBuffer::EvictHead() { CircularTLVReader reader; uint8_t * newHead; diff --git a/src/lib/core/CHIPCircularTLVBuffer.h b/src/lib/core/CHIPCircularTLVBuffer.h index 958d4c5a0f574f..8ec40dd54eeef1 100644 --- a/src/lib/core/CHIPCircularTLVBuffer.h +++ b/src/lib/core/CHIPCircularTLVBuffer.h @@ -65,14 +65,14 @@ class DLL_EXPORT CHIPCircularTLVBuffer CHIP_ERROR FinalizeBuffer(TLVWriter & ioWriter, uint8_t * inBufStart, uint32_t inBufLen); CHIP_ERROR GetNextBuffer(TLVReader & ioReader, const uint8_t *& outBufStart, uint32_t & outBufLen); - inline uint8_t * QueueHead(void) const { return mQueueHead; } - inline uint8_t * QueueTail(void) const { return mQueue + (((mQueueHead - mQueue) + mQueueLength) % mQueueSize); } - inline size_t DataLength(void) const { return mQueueLength; } - inline size_t AvailableDataLength(void) const { return mQueueSize - mQueueLength; } - inline size_t GetQueueSize(void) const { return mQueueSize; } - inline uint8_t * GetQueue(void) const { return mQueue; } - - CHIP_ERROR EvictHead(void); + inline uint8_t * QueueHead() const { return mQueueHead; } + inline uint8_t * QueueTail() const { return mQueue + (((mQueueHead - mQueue) + mQueueLength) % mQueueSize); } + inline size_t DataLength() const { return mQueueLength; } + inline size_t AvailableDataLength() const { return mQueueSize - mQueueLength; } + inline size_t GetQueueSize() const { return mQueueSize; } + inline uint8_t * GetQueue() const { return mQueue; } + + CHIP_ERROR EvictHead(); static CHIP_ERROR GetNewBufferFunct(TLVWriter & ioWriter, uintptr_t & inBufHandle, uint8_t *& outBufStart, uint32_t & outBufLen); diff --git a/src/lib/core/CHIPError.cpp b/src/lib/core/CHIPError.cpp index b2e75b96e0f7b4..3e3578fdb46945 100644 --- a/src/lib/core/CHIPError.cpp +++ b/src/lib/core/CHIPError.cpp @@ -31,7 +31,7 @@ namespace chip { /** * Register a text error formatter for CHIP core errors. */ -void RegisterCHIPLayerErrorFormatter(void) +void RegisterCHIPLayerErrorFormatter() { static ErrorFormatter sCHIPErrorFormatter = { FormatCHIPError, nullptr }; diff --git a/src/lib/core/CHIPError.h b/src/lib/core/CHIPError.h index c9db9464fb0640..30ca69b819ab12 100644 --- a/src/lib/core/CHIPError.h +++ b/src/lib/core/CHIPError.h @@ -1703,7 +1703,7 @@ typedef CHIP_CONFIG_ERROR_TYPE CHIP_ERROR; namespace chip { -extern void RegisterCHIPLayerErrorFormatter(void); +extern void RegisterCHIPLayerErrorFormatter(); extern bool FormatCHIPError(char * buf, uint16_t bufSize, int32_t err); } // namespace chip diff --git a/src/lib/core/CHIPTLV.h b/src/lib/core/CHIPTLV.h index e79b41a376c7a5..094f313ab0a11c 100644 --- a/src/lib/core/CHIPTLV.h +++ b/src/lib/core/CHIPTLV.h @@ -104,13 +104,13 @@ class DLL_EXPORT TLVReader void Init(PacketBuffer * buf, uint32_t maxLen = 0xFFFFFFFFUL); void Init(PacketBuffer * buf, uint32_t maxLen, bool allowDiscontiguousBuffers); - CHIP_ERROR Next(void); + CHIP_ERROR Next(); CHIP_ERROR Next(TLVType expectedType, uint64_t expectedTag); - TLVType GetType(void) const; - uint64_t GetTag(void) const; - uint32_t GetLength(void) const; - uint16_t GetControlByte(void) const; + TLVType GetType() const; + uint64_t GetTag() const; + uint32_t GetLength() const; + uint16_t GetControlByte() const; CHIP_ERROR Get(bool & v); CHIP_ERROR Get(int8_t & v); @@ -133,16 +133,16 @@ class DLL_EXPORT TLVReader CHIP_ERROR ExitContainer(TLVType outerContainerType); CHIP_ERROR OpenContainer(TLVReader & containerReader); CHIP_ERROR CloseContainer(TLVReader & containerReader); - TLVType GetContainerType(void) const; - CHIP_ERROR VerifyEndOfContainer(void); + TLVType GetContainerType() const; + CHIP_ERROR VerifyEndOfContainer(); - uint32_t GetLengthRead(void) const { return mLenRead; } - uint32_t GetRemainingLength(void) const { return mMaxLen - mLenRead; } + uint32_t GetLengthRead() const { return mLenRead; } + uint32_t GetRemainingLength() const { return mMaxLen - mLenRead; } - const uint8_t * GetReadPoint(void) const { return mReadPoint; } - uintptr_t GetBufHandle(void) const { return mBufHandle; } + const uint8_t * GetReadPoint() const { return mReadPoint; } + uintptr_t GetBufHandle() const { return mBufHandle; } - CHIP_ERROR Skip(void); + CHIP_ERROR Skip(); uint32_t ImplicitProfileId; void * AppData; @@ -166,19 +166,19 @@ class DLL_EXPORT TLVReader bool mContainerOpen; protected: - bool IsContainerOpen(void) const { return mContainerOpen; } + bool IsContainerOpen() const { return mContainerOpen; } void SetContainerOpen(bool aContainerOpen) { mContainerOpen = aContainerOpen; } - CHIP_ERROR ReadElement(void); - void ClearElementState(void); - CHIP_ERROR SkipData(void); - CHIP_ERROR SkipToEndOfContainer(void); - CHIP_ERROR VerifyElement(void); + CHIP_ERROR ReadElement(); + void ClearElementState(); + CHIP_ERROR SkipData(); + CHIP_ERROR SkipToEndOfContainer(); + CHIP_ERROR VerifyElement(); uint64_t ReadTag(TLVTagControl tagControl, const uint8_t *& p); CHIP_ERROR EnsureData(CHIP_ERROR noDataErr); CHIP_ERROR ReadData(uint8_t * buf, uint32_t len); CHIP_ERROR GetElementHeadLength(uint8_t & elemHeadBytes) const; - TLVElementType ElementType(void) const; + TLVElementType ElementType() const; static CHIP_ERROR GetNextPacketBuffer(TLVReader & reader, uintptr_t & bufHandle, const uint8_t *& bufStart, uint32_t & bufLen); static CHIP_ERROR FailGetNextBuffer(TLVReader & reader, uintptr_t & bufHandle, const uint8_t *& bufStart, uint32_t & bufLen); @@ -210,7 +210,7 @@ class DLL_EXPORT TLVWriter void Init(PacketBuffer * buf, uint32_t maxLen = 0xFFFFFFFFUL); void Init(PacketBuffer * buf, uint32_t maxLen, bool allowDiscontiguousBuffers); - CHIP_ERROR Finalize(void); + CHIP_ERROR Finalize(); CHIP_ERROR Put(uint64_t tag, int8_t v); CHIP_ERROR Put(uint64_t tag, int8_t v, bool preserveSize); @@ -248,9 +248,9 @@ class DLL_EXPORT TLVWriter CHIP_ERROR CopyContainer(TLVReader & container); CHIP_ERROR CopyContainer(uint64_t tag, TLVReader & container); CHIP_ERROR CopyContainer(uint64_t tag, const uint8_t * encodedContainer, uint16_t encodedContainerLen); - TLVType GetContainerType(void) const; + TLVType GetContainerType() const; - uint32_t GetLengthWritten(void); + uint32_t GetLengthWritten(); uint32_t ImplicitProfileId; void * AppData; @@ -280,7 +280,7 @@ class DLL_EXPORT TLVWriter bool mCloseContainerReserved; protected: - bool IsContainerOpen(void) const { return mContainerOpen; } + bool IsContainerOpen() const { return mContainerOpen; } void SetContainerOpen(bool aContainerOpen) { mContainerOpen = aContainerOpen; } enum @@ -294,7 +294,7 @@ class DLL_EXPORT TLVWriter * CloseContainer symbol at the point of starting / opening the * container. */ - bool IsCloseContainerReserved(void) const { return mCloseContainerReserved; } + bool IsCloseContainerReserved() const { return mCloseContainerReserved; } /** * @brief @@ -351,19 +351,19 @@ class DLL_EXPORT TLVUpdater public: CHIP_ERROR Init(uint8_t * buf, uint32_t dataLen, uint32_t maxLen); CHIP_ERROR Init(TLVReader & aReader, uint32_t freeLen); - CHIP_ERROR Finalize(void) { return mUpdaterWriter.Finalize(); } + CHIP_ERROR Finalize() { return mUpdaterWriter.Finalize(); } // Common methods void SetImplicitProfileId(uint32_t profileId); - uint32_t GetImplicitProfileId(void) { return mUpdaterReader.ImplicitProfileId; } - CHIP_ERROR Move(void); - void MoveUntilEnd(void); + uint32_t GetImplicitProfileId() { return mUpdaterReader.ImplicitProfileId; } + CHIP_ERROR Move(); + void MoveUntilEnd(); CHIP_ERROR EnterContainer(TLVType & outerContainerType); CHIP_ERROR ExitContainer(TLVType outerContainerType); void GetReader(TLVReader & containerReader) { containerReader = mUpdaterReader; } // Reader methods - CHIP_ERROR Next(void); + CHIP_ERROR Next(); CHIP_ERROR Get(bool & v) { return mUpdaterReader.Get(v); } CHIP_ERROR Get(int8_t & v) { return mUpdaterReader.Get(v); } @@ -381,14 +381,14 @@ class DLL_EXPORT TLVUpdater CHIP_ERROR GetString(char * buf, uint32_t bufSize) { return mUpdaterReader.GetString(buf, bufSize); } CHIP_ERROR DupString(char *& buf) { return mUpdaterReader.DupString(buf); } - TLVType GetType(void) const { return mUpdaterReader.GetType(); } - uint64_t GetTag(void) const { return mUpdaterReader.GetTag(); } - uint32_t GetLength(void) const { return mUpdaterReader.GetLength(); } + TLVType GetType() const { return mUpdaterReader.GetType(); } + uint64_t GetTag() const { return mUpdaterReader.GetTag(); } + uint32_t GetLength() const { return mUpdaterReader.GetLength(); } CHIP_ERROR GetDataPtr(const uint8_t *& data) { return mUpdaterReader.GetDataPtr(data); } - CHIP_ERROR VerifyEndOfContainer(void) { return mUpdaterReader.VerifyEndOfContainer(); } - TLVType GetContainerType(void) const { return mUpdaterReader.GetContainerType(); } - uint32_t GetLengthRead(void) const { return mUpdaterReader.GetLengthRead(); } - uint32_t GetRemainingLength(void) const { return mUpdaterReader.GetRemainingLength(); } + CHIP_ERROR VerifyEndOfContainer() { return mUpdaterReader.VerifyEndOfContainer(); } + TLVType GetContainerType() const { return mUpdaterReader.GetContainerType(); } + uint32_t GetLengthRead() const { return mUpdaterReader.GetLengthRead(); } + uint32_t GetRemainingLength() const { return mUpdaterReader.GetRemainingLength(); } // Writer methods CHIP_ERROR Put(uint64_t tag, int8_t v) { return mUpdaterWriter.Put(tag, v); } @@ -421,11 +421,11 @@ class DLL_EXPORT TLVUpdater return mUpdaterWriter.StartContainer(tag, containerType, outerContainerType); } CHIP_ERROR EndContainer(TLVType outerContainerType) { return mUpdaterWriter.EndContainer(outerContainerType); } - uint32_t GetLengthWritten(void) { return mUpdaterWriter.GetLengthWritten(); } - uint32_t GetRemainingFreeLength(void) { return mUpdaterWriter.mRemainingLen; } + uint32_t GetLengthWritten() { return mUpdaterWriter.GetLengthWritten(); } + uint32_t GetRemainingFreeLength() { return mUpdaterWriter.mRemainingLen; } private: - void AdjustInternalWriterFreeSpace(void); + void AdjustInternalWriterFreeSpace(); private: TLVWriter mUpdaterWriter; diff --git a/src/lib/core/CHIPTLVReader.cpp b/src/lib/core/CHIPTLVReader.cpp index 85437cdd2f3b8f..826b073b0bf5c4 100644 --- a/src/lib/core/CHIPTLVReader.cpp +++ b/src/lib/core/CHIPTLVReader.cpp @@ -1206,7 +1206,7 @@ CHIP_ERROR TLVReader::Skip() * This method is used to position the reader before the first TLV, * between TLVs or after the last TLV. */ -void TLVReader::ClearElementState(void) +void TLVReader::ClearElementState() { mElemTag = AnonymousTag; mControlByte = kTLVControlByte_NotSpecified; @@ -1223,7 +1223,7 @@ void TLVReader::ClearElementState(void) * GetNextBuffer() function. Only possible when GetNextBuffer is * non-NULL. */ -CHIP_ERROR TLVReader::SkipData(void) +CHIP_ERROR TLVReader::SkipData() { CHIP_ERROR err = CHIP_NO_ERROR; TLVElementType elemType = ElementType(); diff --git a/src/lib/core/Optional.h b/src/lib/core/Optional.h index fb5bd4c89feb03..6c95556a3fb28b 100644 --- a/src/lib/core/Optional.h +++ b/src/lib/core/Optional.h @@ -49,10 +49,10 @@ class Optional } /** Invalidate the value inside the optional. Optional now has no value */ - void ClearValue(void) { mHasValue = false; } + void ClearValue() { mHasValue = false; } /** Gets the current value of the optional. Valid IFF `HasValue`. */ - const T & Value(void) const + const T & Value() const { assert(HasValue()); return mValue; @@ -71,7 +71,7 @@ class Optional bool operator!=(const Optional & other) const { return !(*this == other); } /** Convenience method to create an optional without a valid value. */ - static Optional Missing(void) { return Optional(); } + static Optional Missing() { return Optional(); } /** Convenience method to create an optional containing the specified value. */ static Optional Value(const T & value) { return Optional(value); } diff --git a/src/lib/core/ReferenceCounted.h b/src/lib/core/ReferenceCounted.h index 27115549d11579..6fb6b14217f38e 100644 --- a/src/lib/core/ReferenceCounted.h +++ b/src/lib/core/ReferenceCounted.h @@ -42,7 +42,7 @@ class ReferenceCounted typedef uint32_t count_type; /** Adds one to the usage count of this class */ - SUBCLASS * Retain(void) + SUBCLASS * Retain() { if (mRefCount == std::numeric_limits::max()) { @@ -54,7 +54,7 @@ class ReferenceCounted } /** Release usage of this class */ - void Release(void) + void Release() { if (mRefCount == 0) { diff --git a/src/lib/core/tests/TestCHIPCallbackDriver.cpp b/src/lib/core/tests/TestCHIPCallbackDriver.cpp index a4c5a2b21c1b8b..090556f26dae1b 100644 --- a/src/lib/core/tests/TestCHIPCallbackDriver.cpp +++ b/src/lib/core/tests/TestCHIPCallbackDriver.cpp @@ -26,7 +26,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/lib/core/tests/TestCHIPErrorStrDriver.cpp b/src/lib/core/tests/TestCHIPErrorStrDriver.cpp index 27232edd717a75..1139acdd9048ce 100644 --- a/src/lib/core/tests/TestCHIPErrorStrDriver.cpp +++ b/src/lib/core/tests/TestCHIPErrorStrDriver.cpp @@ -26,7 +26,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/lib/core/tests/TestCHIPTLVDriver.cpp b/src/lib/core/tests/TestCHIPTLVDriver.cpp index 3b311b64468d69..67a5d74a23fa62 100644 --- a/src/lib/core/tests/TestCHIPTLVDriver.cpp +++ b/src/lib/core/tests/TestCHIPTLVDriver.cpp @@ -32,7 +32,7 @@ #include -int main(void) +int main() { #if CHIP_SYSTEM_CONFIG_USE_LWIP tcpip_init(NULL, NULL); diff --git a/src/lib/core/tests/TestReferenceCountedDriver.cpp b/src/lib/core/tests/TestReferenceCountedDriver.cpp index e7cec70f05e61c..57dd578e97f052 100644 --- a/src/lib/core/tests/TestReferenceCountedDriver.cpp +++ b/src/lib/core/tests/TestReferenceCountedDriver.cpp @@ -26,7 +26,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/lib/message/CHIPBinding.cpp b/src/lib/message/CHIPBinding.cpp index 3d27c0bf14ff3c..b436ccd6b61849 100644 --- a/src/lib/message/CHIPBinding.cpp +++ b/src/lib/message/CHIPBinding.cpp @@ -235,7 +235,7 @@ void Binding::Release() * Calling Close() decrements the reference count associated with the binding, freeing the object if the * reference count becomes zero. */ -void Binding::Close(void) +void Binding::Close() { VerifyOrDie(mState != kState_NotAllocated); VerifyOrDie(mRefCount > 0); @@ -266,7 +266,7 @@ void Binding::Reset() /** * Get a unique id for the binding. */ -uint16_t Binding::GetLogId(void) const +uint16_t Binding::GetLogId() const { return mExchangeManager->GetBindingLogId(this); } @@ -410,7 +410,7 @@ void Binding::DoReset(State newState) /** * Transition the binding to the Closed state if not already closed. */ -void Binding::DoClose(void) +void Binding::DoClose() { // If not already closed... if (mState != kState_Closed) @@ -1318,12 +1318,12 @@ CHIP_ERROR Binding::AllocateRightSizedBuffer(PacketBuffer *& buf, const uint32_t return err; } -uint32_t Binding::GetChipHeaderSize(void) +uint32_t Binding::GetChipHeaderSize() { return CHIP_SYSTEM_CONFIG_HEADER_RESERVE_SIZE; } -uint32_t Binding::GetChipTrailerSize(void) +uint32_t Binding::GetChipTrailerSize() { return CHIP_TRAILER_RESERVE_SIZE; } @@ -1609,7 +1609,7 @@ Binding::Configuration & Binding::Configuration::Security_None() * * @return A reference to the binding object. */ -Binding::Configuration & Binding::Configuration::Security_CASESession(void) +Binding::Configuration & Binding::Configuration::Security_CASESession() { #if CHIP_CONFIG_ENABLE_CASE_INITIATOR mBinding.mSecurityOption = kSecurityOption_CASESession; @@ -1630,7 +1630,7 @@ Binding::Configuration & Binding::Configuration::Security_CASESession(void) * * @return A reference to the binding object. */ -Binding::Configuration & Binding::Configuration::Security_SharedCASESession(void) +Binding::Configuration & Binding::Configuration::Security_SharedCASESession() { #if CHIP_CONFIG_ENABLE_CASE_INITIATOR mBinding.mSecurityOption = kSecurityOption_SharedCASESession; diff --git a/src/lib/message/CHIPBinding.h b/src/lib/message/CHIPBinding.h index 2577bd38deba4f..096f5569376043 100644 --- a/src/lib/message/CHIPBinding.h +++ b/src/lib/message/CHIPBinding.h @@ -167,29 +167,29 @@ class Binding void * AppState; - void AddRef(void); - void Release(void); - void Close(void); - void Reset(void); + void AddRef(); + void Release(); + void Close(); + void Reset(); Configuration BeginConfiguration(); CHIP_ERROR RequestPrepare(); - State GetState(void) const; - bool IsPreparing(void) const; - bool IsReady(void) const; - bool CanBePrepared(void) const; + State GetState() const; + bool IsPreparing() const; + bool IsReady() const; + bool CanBePrepared() const; - uint16_t GetLogId(void) const; + uint16_t GetLogId() const; - uint64_t GetPeerNodeId(void) const; + uint64_t GetPeerNodeId() const; void GetPeerIPAddress(Inet::IPAddress & address, uint16_t & port, InterfaceId & interfaceId) const; - uint32_t GetKeyId(void) const; - uint8_t GetEncryptionType(void) const; + uint32_t GetKeyId() const; + uint8_t GetEncryptionType() const; uint32_t GetDefaultResponseTimeout() const; void SetDefaultResponseTimeout(uint32_t msec); - const RMPConfig & GetDefaultRMPConfig(void) const; + const RMPConfig & GetDefaultRMPConfig() const; void SetDefaultRMPConfig(const RMPConfig & RMPConfig); EventCallback GetEventCallback() const; void SetEventCallback(EventCallback aEventCallback); @@ -308,18 +308,18 @@ class Binding CHIP_ERROR DoPrepare(CHIP_ERROR configErr); void DoReset(State newState); - void DoClose(void); - void ResetConfig(void); - void PrepareAddress(void); - void PrepareTransport(void); - void PrepareSecurity(void); - void HandleBindingReady(void); + void DoClose(); + void ResetConfig(); + void PrepareAddress(); + void PrepareTransport(); + void PrepareSecurity(); + void HandleBindingReady(); void HandleBindingFailed(CHIP_ERROR err, Protocols::StatusReporting::StatusReport * statusReport, bool raiseEvent); void OnKeyFailed(uint64_t peerNodeId, uint32_t keyId, CHIP_ERROR keyErr); - void OnSecurityManagerAvailable(void); + void OnSecurityManagerAvailable(); void OnConnectionClosed(ChipConnection * con, CHIP_ERROR conErr); - uint32_t GetChipTrailerSize(void); - uint32_t GetChipHeaderSize(void); + uint32_t GetChipTrailerSize(); + uint32_t GetChipHeaderSize(); static void OnSecureSessionReady(ChipSecurityManager * sm, ChipConnection * con, void * reqState, uint16_t keyId, uint64_t peerNodeId, uint8_t encType); @@ -352,7 +352,7 @@ class Binding::Configuration Configuration & Target_NodeId(uint64_t aPeerNodeId); Configuration & Target_ServiceEndpoint(uint64_t aPeerNodeId); - Configuration & TargetAddress_ChipService(void); + Configuration & TargetAddress_ChipService(); Configuration & TargetAddress_ChipFabric(uint16_t aSubnetId); Configuration & TargetAddress_IP(Inet::IPAddress aPeerAddress, uint16_t aPeerPort = CHIP_PORT, InterfaceId aInterfaceId = INET_NULL_INTERFACEID); @@ -363,18 +363,18 @@ class Binding::Configuration Configuration & DNS_Options(uint8_t dnsOptions); - Configuration & Transport_TCP(void); - Configuration & Transport_UDP(void); - Configuration & Transport_UDP_RMP(void); + Configuration & Transport_TCP(); + Configuration & Transport_UDP(); + Configuration & Transport_UDP_RMP(); Configuration & Transport_UDP_PathMTU(uint32_t aPathMTU); Configuration & Transport_DefaultRMPConfig(const RMPConfig & aRMPConfig); Configuration & Transport_ExistingConnection(ChipConnection * apConnection); Configuration & Exchange_ResponseTimeoutMsec(uint32_t aResponseTimeoutMsec); - Configuration & Security_None(void); - Configuration & Security_CASESession(void); - Configuration & Security_SharedCASESession(void); + Configuration & Security_None(); + Configuration & Security_CASESession(); + Configuration & Security_SharedCASESession(); Configuration & Security_SharedCASESession(uint64_t aRouterNodeId); Configuration & Security_PASESession(uint8_t aPasswordSource); Configuration & Security_TAKESession(); @@ -385,9 +385,9 @@ class Binding::Configuration Configuration & ConfigureFromMessage(const ChipMessageInfo * aMsgInfo, const Inet::IPPacketInfo * aPacketInfo); - CHIP_ERROR PrepareBinding(void); + CHIP_ERROR PrepareBinding(); - CHIP_ERROR GetError(void) const; + CHIP_ERROR GetError() const; private: friend class Binding; @@ -464,7 +464,7 @@ struct Binding::OutEventParam * Documentation for these functions can be found in the .cpp file. */ -inline Binding::State Binding::GetState(void) const +inline Binding::State Binding::GetState() const { return mState; } @@ -479,7 +479,7 @@ inline bool Binding::IsReady() const return mState == kState_Ready; } -inline bool Binding::CanBePrepared(void) const +inline bool Binding::CanBePrepared() const { return mState == kState_NotConfigured || mState == kState_Failed; } @@ -496,12 +496,12 @@ inline void Binding::GetPeerIPAddress(Inet::IPAddress & address, uint16_t & port interfaceId = mInterfaceId; } -inline uint32_t Binding::GetKeyId(void) const +inline uint32_t Binding::GetKeyId() const { return mKeyId; } -inline uint8_t Binding::GetEncryptionType(void) const +inline uint8_t Binding::GetEncryptionType() const { return mEncType; } @@ -516,7 +516,7 @@ inline void Binding::SetDefaultResponseTimeout(uint32_t timeout) mDefaultResponseTimeoutMsec = timeout; } -inline const RMPConfig & Binding::GetDefaultRMPConfig(void) const +inline const RMPConfig & Binding::GetDefaultRMPConfig() const { return mDefaultRMPConfig; } @@ -598,12 +598,12 @@ inline Binding::Configuration Binding::BeginConfiguration() return Configuration(*this); } -inline CHIP_ERROR Binding::Configuration::PrepareBinding(void) +inline CHIP_ERROR Binding::Configuration::PrepareBinding() { return mBinding.DoPrepare(mError); } -inline CHIP_ERROR Binding::Configuration::GetError(void) const +inline CHIP_ERROR Binding::Configuration::GetError() const { return mError; } diff --git a/src/lib/message/CHIPConnection.cpp b/src/lib/message/CHIPConnection.cpp index 58e9821b654d02..a5ca915a36ff8c 100644 --- a/src/lib/message/CHIPConnection.cpp +++ b/src/lib/message/CHIPConnection.cpp @@ -901,7 +901,7 @@ CHIP_ERROR ChipConnection::SetUserTimeout(uint32_t userTimeoutMillis) * @retval other Inet layer errors related to the TCP endpoint resetting of the TCP user timeout. * */ -CHIP_ERROR ChipConnection::ResetUserTimeout(void) +CHIP_ERROR ChipConnection::ResetUserTimeout() { return SetUserTimeout(0); } diff --git a/src/lib/message/CHIPExchangeMgr.cpp b/src/lib/message/CHIPExchangeMgr.cpp index 7ac3fbf90e1424..ce963f217c4ad4 100644 --- a/src/lib/message/CHIPExchangeMgr.cpp +++ b/src/lib/message/CHIPExchangeMgr.cpp @@ -529,7 +529,7 @@ void ChipExchangeManager::HandleConnectionClosed(ChipConnection * con, CHIP_ERRO * @return Number of timers found running. */ #if CHIP_CONFIG_TEST -size_t ChipExchangeManager::ExpireExchangeTimers(void) +size_t ChipExchangeManager::ExpireExchangeTimers() { size_t retval = 0; ExchangeContext * ec = (ExchangeContext *) ContextPool; @@ -1227,7 +1227,7 @@ void ChipExchangeManager::TicklessDebugDumpRetransTable(const char * log) * that action. * */ -void ChipExchangeManager::RMPExecuteActions(void) +void ChipExchangeManager::RMPExecuteActions() { ExchangeContext * ec = nullptr; @@ -1321,7 +1321,7 @@ void ChipExchangeManager::RMPExecuteActions(void) * RMP timer tick expiry. * */ -void ChipExchangeManager::RMPExpireTicks(void) +void ChipExchangeManager::RMPExpireTicks() { uint64_t now = 0; ExchangeContext * ec = nullptr; @@ -1762,7 +1762,7 @@ void ChipExchangeManager::RMPStopTimer() * Initialize the shared pool of Bindings. * */ -void ChipExchangeManager::InitBindingPool(void) +void ChipExchangeManager::InitBindingPool() { memset(BindingPool, 0, sizeof(BindingPool)); for (size_t i = 0; i < CHIP_CONFIG_MAX_BINDINGS; ++i) @@ -1779,7 +1779,7 @@ void ChipExchangeManager::InitBindingPool(void) * @return A pointer to the newly allocated Binding, or NULL if the pool has been exhausted * */ -Binding * ChipExchangeManager::AllocBinding(void) +Binding * ChipExchangeManager::AllocBinding() { Binding * pResult = nullptr; diff --git a/src/lib/message/CHIPExchangeMgr.h b/src/lib/message/CHIPExchangeMgr.h index 9983e6c4dc26a3..c5e94024605bef 100644 --- a/src/lib/message/CHIPExchangeMgr.h +++ b/src/lib/message/CHIPExchangeMgr.h @@ -135,21 +135,21 @@ class DLL_EXPORT ExchangeContext /**< Deprecated alias for \c kSendFlag_DefaultMulticastSourceAddress */ }; - bool IsInitiator(void) const; - bool IsConnectionClosed(void) const; - bool IsResponseExpected(void) const; + bool IsInitiator() const; + bool IsConnectionClosed() const; + bool IsResponseExpected() const; void SetInitiator(bool inInitiator); void SetConnectionClosed(bool inConnectionClosed); - bool ShouldDropAck(void) const; - bool IsAckPending(void) const; + bool ShouldDropAck() const; + bool IsAckPending() const; void SetDropAck(bool inDropAck); void SetAckPending(bool inAckPending); - bool HasPeerRequestedAck(void) const; + bool HasPeerRequestedAck() const; void SetPeerRequestedAck(bool inPeerRequestedAck); - bool HasRcvdMsgFromPeer(void) const; + bool HasRcvdMsgFromPeer() const; void SetMsgRcvdFromPeer(bool inMsgRcvdFromPeer); - CHIP_ERROR RMPFlushAcks(void); - uint32_t GetCurrentRetransmitTimeout(void); + CHIP_ERROR RMPFlushAcks(); + uint32_t GetCurrentRetransmitTimeout(); void SetResponseExpected(bool inResponseExpected); bool AutoRequestAck() const; void SetAutoRequestAck(bool autoReqAck); @@ -157,7 +157,7 @@ class DLL_EXPORT ExchangeContext void SetAutoReleaseKey(bool autoReleaseKey); bool ShouldAutoReleaseConnection() const; void SetShouldAutoReleaseConnection(bool autoReleaseCon); - bool UseEphemeralUDPPort(void) const; + bool UseEphemeralUDPPort() const; #if CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT void SetUseEphemeralUDPPort(bool val); #endif @@ -166,10 +166,10 @@ class DLL_EXPORT ExchangeContext void * msgCtxt = nullptr); CHIP_ERROR SendMessage(uint32_t profileId, uint8_t msgType, PacketBuffer * msgBuf, uint16_t sendFlags, ChipMessageInfo * msgInfo, void * msgCtxt = nullptr); - CHIP_ERROR SendCommonNullMessage(void); + CHIP_ERROR SendCommonNullMessage(); CHIP_ERROR EncodeExchHeader(ChipExchangeHeader * exchangeHeader, uint32_t profileId, uint8_t msgType, PacketBuffer * msgBuf, uint16_t sendFlags); - void TeardownTrickleRetransmit(void); + void TeardownTrickleRetransmit(); /** * This function is the application callback for handling a received CHIP message. @@ -241,7 +241,7 @@ class DLL_EXPORT ExchangeContext */ KeyErrorFunct OnKeyError; - void CancelRetrans(void); + void CancelRetrans(); CHIP_ERROR RMPSendThrottleFlow(uint32_t PauseTimeMillis); CHIP_ERROR RMPSendDelayedDelivery(uint32_t PauseTimeMillis, uint64_t DelayedNodeId); @@ -297,11 +297,11 @@ class DLL_EXPORT ExchangeContext * can hold onto it while it's out of their direct control * to make sure it isn't closed before everyone's ready. */ - void AddRef(void); - void Close(void); - void Abort(void); - void Release(void); - CHIP_ERROR StartTimerT(void); + void AddRef(); + void Close(); + void Abort(); + void Release(); + CHIP_ERROR StartTimerT(); enum { @@ -321,14 +321,14 @@ class DLL_EXPORT ExchangeContext uint8_t rebroadcastThreshold; // re-broadcast threshold uint16_t mFlags; // Internal state flags - CHIP_ERROR ResendMessage(void); + CHIP_ERROR ResendMessage(); bool MatchExchange(ChipConnection * msgCon, const ChipMessageInfo * msgInfo, const ChipExchangeHeader * exchangeHeader); static void CancelRetransmissionTimer(System::Layer * aSystemLayer, void * aAppState, System::Error aError); static void TimerTau(System::Layer * aSystemLayer, void * aAppState, System::Error aError); static void TimerT(System::Layer * aSystemLayer, void * aAppState, System::Error aError); - CHIP_ERROR StartResponseTimer(void); - void CancelResponseTimer(void); + CHIP_ERROR StartResponseTimer(); + void CancelResponseTimer(); static void HandleResponseTimeout(System::Layer * aSystemLayer, void * aAppState, System::Error aError); uint32_t mPendingPeerAckId; @@ -373,7 +373,7 @@ class DLL_EXPORT ChipExchangeManager kState_Initialized = 1 /**< Used to indicate that the ChipExchangeManager is initialized */ }; - ChipExchangeManager(void); + ChipExchangeManager(); ChipExchangeManager(const ChipExchangeManager &) = delete; ChipExchangeManager operator=(const ChipExchangeManager &) = delete; @@ -382,10 +382,10 @@ class DLL_EXPORT ChipExchangeManager uint8_t State; /**< [READ ONLY] The state of the ChipExchangeManager object. */ CHIP_ERROR Init(ChipMessageLayer * msgLayer); - CHIP_ERROR Shutdown(void); + CHIP_ERROR Shutdown(); #if CHIP_CONFIG_TEST - size_t ExpireExchangeTimers(void); + size_t ExpireExchangeTimers(); #endif ExchangeContext * NewContext(const uint64_t & peerNodeId, void * appState = nullptr); @@ -441,10 +441,10 @@ class DLL_EXPORT ChipExchangeManager uint16_t nextRetransTime; /**< A counter representing the next retransmission time for the message. */ uint8_t sendCount; /**< A counter representing the number of times the message has been sent. */ }; - void RMPExecuteActions(void); - void RMPExpireTicks(void); - void RMPStartTimer(void); - void RMPStopTimer(void); + void RMPExecuteActions(); + void RMPExpireTicks(); + void RMPStartTimer(); + void RMPStopTimer(); void RMPProcessDDMessage(uint32_t PauseTimeMillis, uint64_t DelayedNodeId); uint32_t GetTickCounterFromTimeDelta(uint64_t newTime, uint64_t oldTime); static void RMPTimeout(System::Layer * aSystemLayer, void * aAppState, System::Error aError); @@ -483,7 +483,7 @@ class DLL_EXPORT ChipExchangeManager UnsolicitedMessageHandler UMHandlerPool[CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS]; void (*OnExchangeContextChanged)(size_t numContextsInUse); - ExchangeContext * AllocContext(void); + ExchangeContext * AllocContext(); void HandleConnectionReceived(ChipConnection * con); void HandleConnectionClosed(ChipConnection * con, CHIP_ERROR conErr); @@ -498,8 +498,8 @@ class DLL_EXPORT ChipExchangeManager static CHIP_ERROR PrependHeader(ChipExchangeHeader * exchangeHeader, PacketBuffer * buf); static CHIP_ERROR DecodeHeader(ChipExchangeHeader * exchangeHeader, ChipMessageInfo * msgInfo, PacketBuffer * buf); - void InitBindingPool(void); - Binding * AllocBinding(void); + void InitBindingPool(); + Binding * AllocBinding(); void FreeBinding(Binding * binding); uint16_t GetBindingLogId(const Binding * const binding) const; diff --git a/src/lib/message/CHIPFabricState.cpp b/src/lib/message/CHIPFabricState.cpp index 28b9bef22faae4..834ff1bfe65d18 100644 --- a/src/lib/message/CHIPFabricState.cpp +++ b/src/lib/message/CHIPFabricState.cpp @@ -117,7 +117,7 @@ const uint8_t kChipMsgEncAppKeyDiversifier[] = { 0xB1, 0x1D, 0xAE, 0x5B }; /** * Initialize a ChipSessionKey object. */ -void ChipSessionKey::Init(void) +void ChipSessionKey::Init() { NodeId = kNodeIdNotSpecified; NextMsgId.Init(0); @@ -133,7 +133,7 @@ void ChipSessionKey::Init(void) /** * Reset a ChipSessionKey object. */ -void ChipSessionKey::Clear(void) +void ChipSessionKey::Clear() { Init(); ClearSecretData((uint8_t *) &MsgEncKey.EncKey, sizeof(MsgEncKey.EncKey)); @@ -1074,7 +1074,7 @@ void ChipFabricState::OnMsgCounterSyncRespRcvd(uint64_t peerNodeId, uint32_t pee } // Start message counter synchronization timer. -void ChipFabricState::StartMsgCounterSyncTimer(void) +void ChipFabricState::StartMsgCounterSyncTimer() { // Arm timer to call MsgCounterSyncRespTimeout after CHIP_CONFIG_MSG_COUNTER_SYNC_RESP_TIMEOUT. CHIP_ERROR res = MessageLayer->SystemLayer->StartTimer((uint32_t) CHIP_CONFIG_MSG_COUNTER_SYNC_RESP_TIMEOUT, @@ -1682,7 +1682,7 @@ void ChipFabricState::HandleConnectionClosed(ChipConnection * con) // ChipSessionState Members -ChipSessionState::ChipSessionState(void) +ChipSessionState::ChipSessionState() { MsgEncKey = nullptr; AuthMode = kChipAuthMode_NotSpecified; @@ -1701,7 +1701,7 @@ ChipSessionState::ChipSessionState(ChipMsgEncryptionKey * msgEncKey, ChipAuthMod RcvFlags = rcvFlags; } -uint32_t ChipSessionState::NewMessageId(void) +uint32_t ChipSessionState::NewMessageId() { uint32_t newMsgId = NextMsgId->GetValue(); @@ -1710,7 +1710,7 @@ uint32_t ChipSessionState::NewMessageId(void) return newMsgId; } -bool ChipSessionState::MessageIdNotSynchronized(void) +bool ChipSessionState::MessageIdNotSynchronized() { return (RcvFlags == nullptr) || (((*RcvFlags) & kReceiveFlags_MessageIdSynchronized) == 0); } diff --git a/src/lib/message/CHIPFabricState.h b/src/lib/message/CHIPFabricState.h index e0957385c80068..6915c8dc5190ba 100644 --- a/src/lib/message/CHIPFabricState.h +++ b/src/lib/message/CHIPFabricState.h @@ -356,15 +356,15 @@ class ChipSessionState kReceiveFlags_MessageIdFlagsMask = ~kReceiveFlags_MessageIdSynchronized }; - ChipSessionState(void); + ChipSessionState(); ChipSessionState(ChipMsgEncryptionKey * msgEncKey, ChipAuthMode authMode, MonotonicallyIncreasingCounter * nextMsgId, uint32_t * maxRcvdMsgId, ReceiveFlagsType * rcvFlags); ChipMsgEncryptionKey * MsgEncKey; ChipAuthMode AuthMode; - uint32_t NewMessageId(void); - bool MessageIdNotSynchronized(void); + uint32_t NewMessageId(); + bool MessageIdNotSynchronized(); bool IsDuplicateMessage(uint32_t msgId); private: @@ -402,8 +402,8 @@ class ChipSessionKey uint8_t ReserveCount; /**< Number of times the session key has been reserved. */ uint8_t Flags; /**< Various flags associated with the session. */ - void Init(void); - void Clear(void); + void Init(); + void Clear(); bool IsAllocated() const { return MsgEncKey.KeyId != ChipKeyId::kNone; } bool IsKeySet() const { return MsgEncKey.EncType != 0; } @@ -430,9 +430,9 @@ class ChipSessionKey class ChipMsgEncryptionKeyCache { public: - void Init(void); - void Reset(void); - void Shutdown(void); + void Init(); + void Reset(); + void Shutdown(); ChipMsgEncryptionKey * FindOrAllocateKeyEntry(uint16_t keyId, uint8_t encType); @@ -512,7 +512,7 @@ class DLL_EXPORT ChipFabricState kState_Initialized = 1 }; - ChipFabricState(void); + ChipFabricState(); ChipMessageLayer * MessageLayer; // [READ ONLY] The associated ChipMessageLayer object. uint64_t FabricId; // [READ ONLY] Node's Fabric Id (0 means node is not a member of a fabric). @@ -534,9 +534,9 @@ class DLL_EXPORT ChipFabricState IPAddress ListenIPv6Addr; #endif - CHIP_ERROR Init(void); + CHIP_ERROR Init(); CHIP_ERROR Init(chip::Protocols::Security::AppKeys::GroupKeyStoreBase * groupKeyStore); - CHIP_ERROR Shutdown(void); + CHIP_ERROR Shutdown(); CHIP_ERROR AllocSessionKey(uint64_t peerNodeId, uint16_t keyId, ChipConnection * boundCon, ChipSessionKey *& sessionKey); CHIP_ERROR SetSessionKey(uint16_t keyId, uint64_t peerNodeId, uint8_t encType, ChipAuthMode authMode, @@ -570,8 +570,8 @@ class DLL_EXPORT ChipFabricState CHIP_ERROR GetPassword(uint8_t pwSrc, const char *& ps, uint16_t & pwLen); - CHIP_ERROR CreateFabric(void); - void ClearFabricState(void); + CHIP_ERROR CreateFabric(); + void ClearFabricState(); CHIP_ERROR GetFabricState(uint8_t * buf, uint32_t bufSize, uint32_t & fabricStateLen); CHIP_ERROR JoinExistingFabric(const uint8_t * fabricState, uint32_t fabricStateLen); @@ -593,7 +593,7 @@ class DLL_EXPORT ChipFabricState #if CHIP_CONFIG_USE_APP_GROUP_KEYS_FOR_MSG_ENC void OnMsgCounterSyncRespRcvd(uint64_t peerNodeId, uint32_t peerMsgId, uint32_t requestorMsgCounter); void OnMsgCounterSyncReqSent(uint32_t messageId); - bool IsMsgCounterSyncReqInProgress(void); + bool IsMsgCounterSyncReqInProgress(); CHIP_ERROR GetMsgEncKeyIdForAppGroup(uint32_t appGroupGlobalId, uint32_t rootKeyId, bool useRotatingKey, uint32_t & keyId); CHIP_ERROR CheckMsgEncForAppGroup(const ChipMessageInfo * msgInfo, uint32_t appGroupGlobalId, uint32_t rootKeyId, bool requireRotatingKey); @@ -671,7 +671,7 @@ class DLL_EXPORT ChipFabricState bool FindSharedSessionEndNode(uint64_t endNodeId, const ChipSessionKey * sessionKey); #if CHIP_CONFIG_USE_APP_GROUP_KEYS_FOR_MSG_ENC - void StartMsgCounterSyncTimer(void); + void StartMsgCounterSyncTimer(); static void OnMsgCounterSyncRespTimeout(System::Layer * aSystemLayer, void * aAppState, System::Error aError); #endif @@ -688,7 +688,7 @@ class DLL_EXPORT ChipFabricState * @retval bool Whether or not peer's message counter synchronization * is in progress. */ -inline bool ChipFabricState::IsMsgCounterSyncReqInProgress(void) +inline bool ChipFabricState::IsMsgCounterSyncReqInProgress() { return (MsgCounterSyncStatus & kFlag_ReqInProgress) != 0; } diff --git a/src/lib/message/CHIPMessageLayer.cpp b/src/lib/message/CHIPMessageLayer.cpp index e9e79d12d3d737..d762774dc131a3 100644 --- a/src/lib/message/CHIPMessageLayer.cpp +++ b/src/lib/message/CHIPMessageLayer.cpp @@ -2093,7 +2093,7 @@ CHIP_ERROR ChipMessageLayer::CloseEndpoints() return CHIP_NO_ERROR; } -void ChipMessageLayer::CloseListeningEndpoints(void) +void ChipMessageLayer::CloseListeningEndpoints() { ChipBindLog("Closing endpoints"); @@ -2213,7 +2213,7 @@ void ChipMessageLayer::SetSignalMessageLayerActivityChanged( OnMessageLayerActivityChange = messageLayerActivityChangeHandler; } -bool ChipMessageLayer::IsMessageLayerActive(void) +bool ChipMessageLayer::IsMessageLayerActive() { return (ExchangeMgr->mContextsInUse != 0) #if CHIP_CONFIG_USE_APP_GROUP_KEYS_FOR_MSG_ENC @@ -2232,7 +2232,7 @@ bool ChipMessageLayer::IsMessageLayerActive(void) * * @retval None. */ -void ChipMessageLayer::SignalMessageLayerActivityChanged(void) +void ChipMessageLayer::SignalMessageLayerActivityChanged() { if (OnMessageLayerActivityChange) { diff --git a/src/lib/message/CHIPMessageLayer.h b/src/lib/message/CHIPMessageLayer.h index b4d106694cfa46..1c724dc3b444c8 100644 --- a/src/lib/message/CHIPMessageLayer.h +++ b/src/lib/message/CHIPMessageLayer.h @@ -240,8 +240,8 @@ class ChipConnection an explicitly encoded destination node identifier, false otherwise. */ - void AddRef(void); - void Release(void); + void AddRef(); + void Release(); // Note: a downcall to Connect() may call OnConnectionComplete before it returns. CHIP_ERROR Connect(uint64_t peerNodeId); @@ -267,28 +267,28 @@ class ChipConnection CHIP_ERROR SendMessage(ChipMessageInfo * msgInfo, PacketBuffer * msgBuf); // TODO COM-311: implement EnableReceived/DisableReceive for BLE ChipConnections. - void EnableReceive(void); - void DisableReceive(void); + void EnableReceive(); + void DisableReceive(); - CHIP_ERROR Shutdown(void); + CHIP_ERROR Shutdown(); - CHIP_ERROR Close(void); + CHIP_ERROR Close(); CHIP_ERROR Close(bool suppressCloseLog); - void Abort(void); + void Abort(); void SetConnectTimeout(const uint32_t connTimeoutMsecs); CHIP_ERROR SetIdleTimeout(uint32_t timeoutMS); CHIP_ERROR EnableKeepAlive(uint16_t interval, uint16_t timeoutCount); - CHIP_ERROR DisableKeepAlive(void); + CHIP_ERROR DisableKeepAlive(); CHIP_ERROR SetUserTimeout(uint32_t userTimeoutMillis); - CHIP_ERROR ResetUserTimeout(void); - uint16_t LogId(void) const { return static_cast(reinterpret_cast(this)); } + CHIP_ERROR ResetUserTimeout(); + uint16_t LogId() const { return static_cast(reinterpret_cast(this)); } - TCPEndPoint * GetTCPEndPoint(void) const { return mTcpEndPoint; } + TCPEndPoint * GetTCPEndPoint() const { return mTcpEndPoint; } /** * This function is the application callback that is invoked when a connection setup is complete. @@ -338,7 +338,7 @@ class ChipConnection typedef void (*ReceiveErrorFunct)(ChipConnection * con, CHIP_ERROR err); ReceiveErrorFunct OnReceiveError; - bool IsIncoming(void) const { return GetFlag(mFlags, kFlag_IsIncoming); } + bool IsIncoming() const { return GetFlag(mFlags, kFlag_IsIncoming); } void SetIncoming(bool val) { SetFlag(mFlags, kFlag_IsIncoming, val); } private: @@ -366,12 +366,12 @@ class ChipConnection void Init(ChipMessageLayer * msgLayer); void MakeConnectedTcp(TCPEndPoint * endPoint, const IPAddress & localAddr, const IPAddress & peerAddr); - CHIP_ERROR StartConnect(void); + CHIP_ERROR StartConnect(); void DoClose(CHIP_ERROR err, uint8_t flags); CHIP_ERROR TryNextPeerAddress(CHIP_ERROR lastErr); - void StartSession(void); - bool StateAllowsSend(void) const { return State == kState_EstablishingSession || State == kState_Connected; } - bool StateAllowsReceive(void) const + void StartSession(); + bool StateAllowsSend() const { return State == kState_EstablishingSession || State == kState_Connected; } + bool StateAllowsReceive() const { return State == kState_EstablishingSession || State == kState_Connected || State == kState_SendShutdown; } @@ -465,7 +465,7 @@ class DLL_EXPORT ChipMessageLayer * The InitContext constructor. * */ - InitContext(void) + InitContext() { systemLayer = nullptr; inet = nullptr; @@ -482,7 +482,7 @@ class DLL_EXPORT ChipMessageLayer } }; - ChipMessageLayer(void); + ChipMessageLayer(); ChipMessageLayer(const ChipMessageLayer &) = delete; ChipMessageLayer & operator=(const ChipMessageLayer &) = delete; @@ -500,7 +500,7 @@ class DLL_EXPORT ChipMessageLayer drops the message and returns. */ CHIP_ERROR Init(InitContext * context); - CHIP_ERROR Shutdown(void); + CHIP_ERROR Shutdown(); CHIP_ERROR SendMessage(ChipMessageInfo * msgInfo, PacketBuffer * msgBuf); CHIP_ERROR SendMessage(const IPAddress & destAddr, ChipMessageInfo * msgInfo, PacketBuffer * msgBuf); @@ -512,7 +512,7 @@ class DLL_EXPORT ChipMessageLayer CHIP_ERROR ResendMessage(const IPAddress & destAddr, uint16_t destPort, InterfaceId interfaceId, ChipMessageInfo * msgInfo, PacketBuffer * msgBuf); - ChipConnection * NewConnection(void); + ChipConnection * NewConnection(); void GetConnectionPoolStats(chip::System::Stats::count_t & aOutInUse) const; @@ -592,23 +592,23 @@ class DLL_EXPORT ChipMessageLayer CHIP_ERROR EncodeMessage(const IPAddress & destAddr, uint16_t destPort, InterfaceId sendIntId, ChipMessageInfo * msgInfo, PacketBuffer * payload); - CHIP_ERROR RefreshEndpoints(void); - CHIP_ERROR CloseEndpoints(void); + CHIP_ERROR RefreshEndpoints(); + CHIP_ERROR CloseEndpoints(); - bool IPv4ListenEnabled(void) const; - bool IPv6ListenEnabled(void) const; - bool TCPListenEnabled(void) const; + bool IPv4ListenEnabled() const; + bool IPv6ListenEnabled() const; + bool TCPListenEnabled() const; void SetTCPListenEnabled(bool val); - bool UDPListenEnabled(void) const; + bool UDPListenEnabled() const; void SetUDPListenEnabled(bool val); - bool UnsecuredListenEnabled(void) const; - bool EphemeralUDPPortEnabled(void) const; + bool UnsecuredListenEnabled() const; + bool EphemeralUDPPortEnabled() const; #if CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT void SetEphemeralUDPPortEnabled(bool val); #endif - bool IsBoundToLocalIPv4Address(void) const; - bool IsBoundToLocalIPv6Address(void) const; + bool IsBoundToLocalIPv4Address() const; + bool IsBoundToLocalIPv6Address() const; /** * This function is the application callback for reporting message layer activity change. @@ -620,7 +620,7 @@ class DLL_EXPORT ChipMessageLayer */ typedef void (*MessageLayerActivityChangeHandlerFunct)(bool messageLayerIsActive); void SetSignalMessageLayerActivityChanged(MessageLayerActivityChangeHandlerFunct messageLayerActivityChangeHandler); - bool IsMessageLayerActive(void); + bool IsMessageLayerActive(); static uint32_t GetMaxChipPayloadSize(const PacketBuffer * msgBuf, bool isUDP, uint32_t udpMTU); @@ -672,12 +672,12 @@ class DLL_EXPORT ChipMessageLayer void * UnsecuredConnectionReceivedAppState; MessageLayerActivityChangeHandlerFunct OnMessageLayerActivityChange; - CHIP_ERROR EnableUnsecuredListen(void); - CHIP_ERROR DisableUnsecuredListen(void); + CHIP_ERROR EnableUnsecuredListen(); + CHIP_ERROR DisableUnsecuredListen(); - void SignalMessageLayerActivityChanged(void); + void SignalMessageLayerActivityChanged(); - void CloseListeningEndpoints(void); + void CloseListeningEndpoints(); CHIP_ERROR RefreshEndpoint(TCPEndPoint *& endPoint, bool enable, const char * name, IPAddressType addrType, IPAddress addr, uint16_t port); @@ -724,7 +724,7 @@ class DLL_EXPORT ChipMessageLayer * Check if the ChipMessageLayer is configured to listen for inbound communications * over IPv4. */ -inline bool ChipMessageLayer::IPv4ListenEnabled(void) const +inline bool ChipMessageLayer::IPv4ListenEnabled() const { // When IPv4 is supported, and the targeted listen feature is enabled, enable IPv4 listening // when the message layer has been bound to a specific IPv4 listening address OR the message @@ -744,7 +744,7 @@ inline bool ChipMessageLayer::IPv4ListenEnabled(void) const * Check if the ChipMessageLayer is configured to listen for inbound communications * over IPv4. */ -inline bool ChipMessageLayer::IPv6ListenEnabled(void) const +inline bool ChipMessageLayer::IPv6ListenEnabled() const { // When the targeted listen feature is enabled, enable IPv6 listening when the message layer has // been bound to a specific IPv6 listening address OR the message @@ -758,7 +758,7 @@ inline bool ChipMessageLayer::IPv6ListenEnabled(void) const /** * Check if the ChipMessageLayer is configured to listen for inbound TCP connections. */ -inline bool ChipMessageLayer::TCPListenEnabled(void) const +inline bool ChipMessageLayer::TCPListenEnabled() const { return GetFlag(mFlags, kFlag_ListenTCP); } @@ -776,7 +776,7 @@ inline void ChipMessageLayer::SetTCPListenEnabled(bool val) /** * Check if the ChipMessageLayer is configured to listen for inbound UDP messages. */ -inline bool ChipMessageLayer::UDPListenEnabled(void) const +inline bool ChipMessageLayer::UDPListenEnabled() const { return GetFlag(mFlags, kFlag_ListenUDP); } @@ -795,7 +795,7 @@ inline void ChipMessageLayer::SetUDPListenEnabled(bool val) * Check if locally initiated CHIP UDP exchanges should be sent from an ephemeral * UDP source port. */ -inline bool ChipMessageLayer::EphemeralUDPPortEnabled(void) const +inline bool ChipMessageLayer::EphemeralUDPPortEnabled() const { #if CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT return GetFlag(mFlags, kFlag_EphemeralUDPPortEnabled); @@ -829,7 +829,7 @@ inline bool ChipMessageLayer::UnsecuredListenEnabled() const /** * Check if the ChipMessageLayer is bound to a local IPv4 address. */ -inline bool ChipMessageLayer::IsBoundToLocalIPv4Address(void) const +inline bool ChipMessageLayer::IsBoundToLocalIPv4Address() const { #if INET_CONFIG_ENABLE_IPV4 && CHIP_CONFIG_ENABLE_TARGETED_LISTEN return FabricState->ListenIPv4Addr != IPAddress::Any; @@ -841,7 +841,7 @@ inline bool ChipMessageLayer::IsBoundToLocalIPv4Address(void) const /** * Check if the ChipMessageLayer is bound to a local IPv6 address. */ -inline bool ChipMessageLayer::IsBoundToLocalIPv6Address(void) const +inline bool ChipMessageLayer::IsBoundToLocalIPv6Address() const { #if CHIP_CONFIG_ENABLE_TARGETED_LISTEN return FabricState->ListenIPv6Addr != IPAddress::Any; diff --git a/src/lib/message/CHIPSecurityMgr.cpp b/src/lib/message/CHIPSecurityMgr.cpp index 2f71bee31b546b..78e4094dd5a2a0 100644 --- a/src/lib/message/CHIPSecurityMgr.cpp +++ b/src/lib/message/CHIPSecurityMgr.cpp @@ -63,7 +63,7 @@ using namespace chip::Protocols::Security; using namespace chip::Protocols::Security::AppKeys; using namespace chip::Encoding; -ChipSecurityManager::ChipSecurityManager(void) +ChipSecurityManager::ChipSecurityManager() { State = kState_NotInitialized; mSystemLayer = nullptr; @@ -109,7 +109,7 @@ CHIP_ERROR ChipSecurityManager::Init(ChipExchangeManager & aExchangeMgr, System: return err; } -CHIP_ERROR ChipSecurityManager::Shutdown(void) +CHIP_ERROR ChipSecurityManager::Shutdown() { if (State != kState_NotInitialized) { @@ -587,7 +587,7 @@ void ChipSecurityManager::HandleMsgCounterSyncRespMsg(ChipMessageInfo * msgInfo, #endif // CHIP_CONFIG_USE_APP_GROUP_KEYS_FOR_MSG_ENC -CHIP_ERROR ChipSecurityManager::HandleSessionEstablished(void) +CHIP_ERROR ChipSecurityManager::HandleSessionEstablished() { CHIP_ERROR err = CHIP_NO_ERROR; uint64_t peerNodeId = mEC->PeerNodeId; @@ -610,7 +610,7 @@ CHIP_ERROR ChipSecurityManager::HandleSessionEstablished(void) return err; } -void ChipSecurityManager::HandleSessionComplete(void) +void ChipSecurityManager::HandleSessionComplete() { ChipConnection * con = mCon; uint64_t peerNodeId = mEC->PeerNodeId; @@ -822,7 +822,7 @@ CHIP_ERROR ChipSecurityManager::SendStatusReport(CHIP_ERROR localErr, ExchangeCo return err; } -void ChipSecurityManager::Reset(void) +void ChipSecurityManager::Reset() { if (mEC != nullptr) { @@ -850,7 +850,7 @@ void ChipSecurityManager::Reset(void) mStartSecureSession_ReqState = nullptr; } -void ChipSecurityManager::StartSessionTimer(void) +void ChipSecurityManager::StartSessionTimer() { ChipLogProgress(SecurityManager, "%s", __FUNCTION__); @@ -860,7 +860,7 @@ void ChipSecurityManager::StartSessionTimer(void) } } -void ChipSecurityManager::CancelSessionTimer(void) +void ChipSecurityManager::CancelSessionTimer() { ChipLogProgress(SecurityManager, "%s", __FUNCTION__); mSystemLayer->CancelTimer(HandleSessionTimeout, this); @@ -877,7 +877,7 @@ void ChipSecurityManager::HandleSessionTimeout(System::Layer * aSystemLayer, voi } } -void ChipSecurityManager::StartIdleSessionTimer(void) +void ChipSecurityManager::StartIdleSessionTimer() { if (IdleSessionTimeout != 0 && !GetFlag(mFlags, kFlag_IdleSessionTimerRunning)) { @@ -891,7 +891,7 @@ void ChipSecurityManager::StartIdleSessionTimer(void) } } -void ChipSecurityManager::StopIdleSessionTimer(void) +void ChipSecurityManager::StopIdleSessionTimer() { System::Layer * systemLayer = FabricState->MessageLayer->SystemLayer; systemLayer->CancelTimer(HandleIdleSessionTimeout, this); diff --git a/src/lib/message/CHIPSecurityMgr.h b/src/lib/message/CHIPSecurityMgr.h index e9c75080175cfc..c4519770699a6c 100644 --- a/src/lib/message/CHIPSecurityMgr.h +++ b/src/lib/message/CHIPSecurityMgr.h @@ -101,10 +101,10 @@ class DLL_EXPORT ChipSecurityManager uint32_t SessionEstablishTimeout; // The amount of time after which an in-progress session establishment will timeout. uint32_t IdleSessionTimeout; // The amount of time after which an idle session will be removed. - ChipSecurityManager(void); + ChipSecurityManager(); CHIP_ERROR Init(ChipExchangeManager & aExchangeMgr, System::Layer & aSystemLayer); - CHIP_ERROR Shutdown(void); + CHIP_ERROR Shutdown(); typedef void (*SessionEstablishedFunct)(ChipSecurityManager * sm, ChipConnection * con, void * reqState, uint16_t sessionKeyId, uint64_t peerNodeId, uint8_t encType); @@ -186,12 +186,12 @@ class DLL_EXPORT ChipSecurityManager System::Layer * mSystemLayer; uint8_t mFlags; - void StartSessionTimer(void); - void CancelSessionTimer(void); + void StartSessionTimer(); + void CancelSessionTimer(); static void HandleSessionTimeout(System::Layer * aSystemLayer, void * aAppState, System::Error aError); - void StartIdleSessionTimer(void); - void StopIdleSessionTimer(void); + void StartIdleSessionTimer(); + void StopIdleSessionTimer(); static void HandleIdleSessionTimeout(System::Layer * aLayer, void * aAppState, System::Error aError); static void HandleUnsolicitedMessage(ExchangeContext * ec, const IPPacketInfo * pktInfo, const ChipMessageInfo * msgInfo, @@ -204,15 +204,15 @@ class DLL_EXPORT ChipSecurityManager ExchangeContext *& ec); #endif CHIP_ERROR NewSessionExchange(uint64_t peerNodeId, IPAddress peerAddr, uint16_t peerPort); - CHIP_ERROR HandleSessionEstablished(void); - void HandleSessionComplete(void); + CHIP_ERROR HandleSessionEstablished(); + void HandleSessionComplete(); void HandleSessionError(CHIP_ERROR err, PacketBuffer * statusReportMsgBuf); static void HandleConnectionClosed(ExchangeContext * ec, ChipConnection * con, CHIP_ERROR conErr); static CHIP_ERROR SendStatusReport(CHIP_ERROR localError, ExchangeContext * ec); static void RMPHandleAckRcvd(ExchangeContext * ec, void * msgCtxt); static void RMPHandleSendError(ExchangeContext * ec, CHIP_ERROR err, void * msgCtxt); - void Reset(void); + void Reset(); void AsyncNotifySecurityManagerAvailable(); static void DoNotifySecurityManagerAvailable(System::Layer * systemLayer, void * appState, System::Error err); diff --git a/src/lib/message/CHIPServerBase.h b/src/lib/message/CHIPServerBase.h index 976b44aed0716e..076c76bc4295ad 100644 --- a/src/lib/message/CHIPServerBase.h +++ b/src/lib/message/CHIPServerBase.h @@ -62,7 +62,7 @@ class ChipServerBase uint16_t sendFlags); protected: - ChipServerBase(void) {} + ChipServerBase() {} ChipServerBase(const ChipServerBase &) = delete; ChipServerBase & operator=(const ChipServerBase &) = delete; @@ -78,7 +78,7 @@ class ChipServerDelegateBase friend class ChipServerBase; protected: - ChipServerDelegateBase(void) {} + ChipServerDelegateBase() {} typedef uint8_t AccessControlResult; diff --git a/src/lib/message/ExchangeContext.cpp b/src/lib/message/ExchangeContext.cpp index db21d840da1168..b9960667daa8e7 100644 --- a/src/lib/message/ExchangeContext.cpp +++ b/src/lib/message/ExchangeContext.cpp @@ -79,7 +79,7 @@ enum * @return Returns 'true' if it is the initiator, else 'false'. * */ -bool ExchangeContext::IsInitiator(void) const +bool ExchangeContext::IsInitiator() const { return GetFlag(mFlags, static_cast(kFlagInitiator)); } @@ -89,7 +89,7 @@ bool ExchangeContext::IsInitiator(void) const * * @return Returns 'true' if connection is closed, else 'false'. */ -bool ExchangeContext::IsConnectionClosed(void) const +bool ExchangeContext::IsConnectionClosed() const { return GetFlag(mFlags, static_cast(kFlagConnectionClosed)); } @@ -100,7 +100,7 @@ bool ExchangeContext::IsConnectionClosed(void) const * * @return Returns 'true' if response expected, else 'false'. */ -bool ExchangeContext::IsResponseExpected(void) const +bool ExchangeContext::IsResponseExpected() const { return GetFlag(mFlags, static_cast(kFlagResponseExpected)); } @@ -139,7 +139,7 @@ void ExchangeContext::SetConnectionClosed(bool inConnectionClosed) * to the peer on this exchange. * */ -bool ExchangeContext::IsAckPending(void) const +bool ExchangeContext::IsAckPending() const { return GetFlag(mFlags, static_cast(kFlagAckPending)); } @@ -150,7 +150,7 @@ bool ExchangeContext::IsAckPending(void) const * * @return Returns 'true' if acknowledgment requested, else 'false'. */ -bool ExchangeContext::HasPeerRequestedAck(void) const +bool ExchangeContext::HasPeerRequestedAck() const { return GetFlag(mFlags, static_cast(kFlagPeerRequestedAck)); } @@ -161,7 +161,7 @@ bool ExchangeContext::HasPeerRequestedAck(void) const * * @return Returns 'true' if message received, else 'false'. */ -bool ExchangeContext::HasRcvdMsgFromPeer(void) const +bool ExchangeContext::HasRcvdMsgFromPeer() const { return GetFlag(mFlags, static_cast(kFlagMsgRcvdFromPeer)); } @@ -230,7 +230,7 @@ void ExchangeContext::SetDropAck(bool inDropAck) * For internal, debug use only. * */ -bool ExchangeContext::ShouldDropAck(void) const +bool ExchangeContext::ShouldDropAck() const { return GetFlag(mFlags, static_cast(kFlagDropAck)); } @@ -326,7 +326,7 @@ void ExchangeContext::SetShouldAutoReleaseConnection(bool autoReleaseCon) #if CHIP_CONFIG_ENABLE_EPHEMERAL_UDP_PORT -bool ExchangeContext::UseEphemeralUDPPort(void) const +bool ExchangeContext::UseEphemeralUDPPort() const { return GetFlag(mFlags, static_cast(kFlagUseEphemeralUDPPort)); } @@ -594,7 +594,7 @@ CHIP_ERROR ExchangeContext::SendMessage(uint32_t profileId, uint8_t msgType, Pac * @retval other Another critical error returned by SendMessage(). * */ -CHIP_ERROR ExchangeContext::SendCommonNullMessage(void) +CHIP_ERROR ExchangeContext::SendCommonNullMessage() { CHIP_ERROR err = CHIP_NO_ERROR; PacketBuffer * msgBuf = nullptr; @@ -790,7 +790,7 @@ void ExchangeContext::Abort() * and stop all timers. * */ -void ExchangeContext::Release(void) +void ExchangeContext::Release() { VerifyOrDie(ExchangeMgr != nullptr && mRefCount != 0); @@ -1042,7 +1042,7 @@ bool ExchangeContext::RMPCheckAndRemRetransTable(uint32_t ackMsgId, void ** rCtx } // Flush the pending Ack -CHIP_ERROR ExchangeContext::RMPFlushAcks(void) +CHIP_ERROR ExchangeContext::RMPFlushAcks() { CHIP_ERROR err = CHIP_NO_ERROR; @@ -1070,7 +1070,7 @@ CHIP_ERROR ExchangeContext::RMPFlushAcks(void) * * @return the current retransmit time. */ -uint32_t ExchangeContext::GetCurrentRetransmitTimeout(void) +uint32_t ExchangeContext::GetCurrentRetransmitTimeout() { return (HasRcvdMsgFromPeer() ? mRMPConfig.mActiveRetransTimeout : mRMPConfig.mInitialRetransTimeout); } diff --git a/src/lib/message/support/crypto/AESBlockCipher.h b/src/lib/message/support/crypto/AESBlockCipher.h index 97e3028699fe1a..cb4dc30ebfc6a5 100644 --- a/src/lib/message/support/crypto/AESBlockCipher.h +++ b/src/lib/message/support/crypto/AESBlockCipher.h @@ -73,11 +73,11 @@ class AES128BlockCipher kRoundCount = 10 }; - void Reset(void); + void Reset(); protected: - AES128BlockCipher(void); - ~AES128BlockCipher(void); + AES128BlockCipher(); + ~AES128BlockCipher(); #if CHIP_CRYPTO_OPENSSL AES_KEY mKey; @@ -119,11 +119,11 @@ class AES256BlockCipher kRoundCount = 14 }; - void Reset(void); + void Reset(); protected: - AES256BlockCipher(void); - ~AES256BlockCipher(void); + AES256BlockCipher(); + ~AES256BlockCipher(); #if CHIP_CONFIG_AES_IMPLEMENTATION_OPENSSL AES_KEY mKey; diff --git a/src/lib/message/support/crypto/CTRMode.h b/src/lib/message/support/crypto/CTRMode.h index e6a4a4737966fe..1ffcaf0a645f23 100644 --- a/src/lib/message/support/crypto/CTRMode.h +++ b/src/lib/message/support/crypto/CTRMode.h @@ -45,8 +45,8 @@ class DLL_EXPORT CTRMode kCounterLength = BlockCipher::kBlockLength }; - CTRMode(void); - ~CTRMode(void); + CTRMode(); + ~CTRMode(); // The CTR-mode encryption counter. The algorithm assumes the counter is in big-endian // form and increments it once for each encrypted block. @@ -57,7 +57,7 @@ class DLL_EXPORT CTRMode void SetChipMessageCounter(uint64_t sendingNodeId, uint32_t msgId); void EncryptData(const uint8_t * inData, uint16_t dataLen, uint8_t * outData); - void Reset(void); + void Reset(); private: BlockCipher mBlockCipher; diff --git a/src/lib/message/support/crypto/HMAC.h b/src/lib/message/support/crypto/HMAC.h index e59d6093de3eeb..b20006e4e68339 100644 --- a/src/lib/message/support/crypto/HMAC.h +++ b/src/lib/message/support/crypto/HMAC.h @@ -48,8 +48,8 @@ class DLL_EXPORT HMAC kDigestLength = H::kHashLength }; - HMAC(void); - ~HMAC(void); + HMAC(); + ~HMAC(); void Begin(const uint8_t * keyData, uint16_t keyLen); void AddData(const uint8_t * msgData, uint16_t dataLen); @@ -57,7 +57,7 @@ class DLL_EXPORT HMAC void AddData(const BIGNUM & num); #endif void Finish(uint8_t * hashBuf); - void Reset(void); + void Reset(); private: enum diff --git a/src/lib/message/support/crypto/HashAlgos.h b/src/lib/message/support/crypto/HashAlgos.h index 77f78be5188772..12a9d8825fbe79 100644 --- a/src/lib/message/support/crypto/HashAlgos.h +++ b/src/lib/message/support/crypto/HashAlgos.h @@ -82,16 +82,16 @@ class DLL_EXPORT SHA1 kBlockLength = 64 }; - SHA1(void); - ~SHA1(void); + SHA1(); + ~SHA1(); - void Begin(void); + void Begin(); void AddData(const uint8_t * data, uint16_t dataLen); #if CHIP_WITH_OPENSSL void AddData(const BIGNUM & num); #endif void Finish(uint8_t * hashBuf); - void Reset(void); + void Reset(); private: #if CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL @@ -112,16 +112,16 @@ class SHA256 kBlockLength = 64 }; - SHA256(void); - ~SHA256(void); + SHA256(); + ~SHA256(); - void Begin(void); + void Begin(); void AddData(const uint8_t * data, uint16_t dataLen); #if CHIP_WITH_OPENSSL void AddData(const BIGNUM & num); #endif void Finish(uint8_t * hashBuf); - void Reset(void); + void Reset(); private: #if CHIP_CONFIG_HASH_IMPLEMENTATION_OPENSSL diff --git a/src/lib/protocols/common/CHIPMessage.h b/src/lib/protocols/common/CHIPMessage.h index b9b8fc664191cd..128a9a09615298 100644 --- a/src/lib/protocols/common/CHIPMessage.h +++ b/src/lib/protocols/common/CHIPMessage.h @@ -132,18 +132,18 @@ class DLL_EXPORT RetainedPacketBuffer { public: // Con/destructors - RetainedPacketBuffer(void); + RetainedPacketBuffer(); RetainedPacketBuffer(const RetainedPacketBuffer & aRetainedPacketBuffer); - ~RetainedPacketBuffer(void); + ~RetainedPacketBuffer(); RetainedPacketBuffer & operator=(const RetainedPacketBuffer & aRetainedPacketBuffer); - virtual bool IsRetaining(void) const; + virtual bool IsRetaining() const; void Retain(System::PacketBuffer * aBuffer); - virtual void Release(void); + virtual void Release(); - inline System::PacketBuffer * GetBuffer(void) { return (mBuffer); } + inline System::PacketBuffer * GetBuffer() { return (mBuffer); } protected: System::PacketBuffer * mBuffer; ///< A pointer to the retained packet buffer. @@ -172,18 +172,18 @@ class DLL_EXPORT MessageIterator : public RetainedPacketBuffer CHIP_ERROR writeString(uint16_t, char *); CHIP_ERROR writeBytes(uint16_t, uint8_t *); // standard iterator operations - MessageIterator & operator++(void); + MessageIterator & operator++(); MessageIterator & operator+(uint16_t); MessageIterator & operator-(uint16_t); bool operator==(const MessageIterator &); bool operator!=(const MessageIterator &); - uint8_t & operator*(void); - void append(void); + uint8_t & operator*(); + void append(); // size checking bool hasData(uint16_t); bool hasRoom(uint16_t); // finishing - void finishWriting(void); + void finishWriting(); // data members uint8_t * thePoint; }; @@ -195,7 +195,7 @@ class DLL_EXPORT ReferencedString : public RetainedPacketBuffer { public: // constructor - ReferencedString(void); + ReferencedString(); // initializers CHIP_ERROR init(uint16_t aLength, char * aString, System::PacketBuffer * aBuffer); CHIP_ERROR init(uint16_t aLength, char * aString); @@ -207,7 +207,7 @@ class DLL_EXPORT ReferencedString : public RetainedPacketBuffer // comparison bool operator==(const ReferencedString &) const; // print string generation (for testing) - char * printString(void); + char * printString(); // data members uint16_t theLength; char * theString; @@ -241,7 +241,7 @@ class DLL_EXPORT ReferencedTLVData : public RetainedPacketBuffer // constructor - ReferencedTLVData(void); + ReferencedTLVData(); // initializers @@ -256,9 +256,9 @@ class DLL_EXPORT ReferencedTLVData : public RetainedPacketBuffer * left to lose. */ - void free(void); + void free(); - bool isFree(void); + bool isFree(); /** * Check if a ReferencedTLVData object has anything in it. @@ -271,7 +271,7 @@ class DLL_EXPORT ReferencedTLVData : public RetainedPacketBuffer * callback in hand, false otherwise. */ - inline bool isEmpty(void) { return (theLength == 0 && theWriteCallback == nullptr); } + inline bool isEmpty() { return (theLength == 0 && theWriteCallback == nullptr); } // packing and parsing @@ -302,7 +302,7 @@ class DLL_EXPORT ReferencedTLVData : public RetainedPacketBuffer * @return the integer length of the packed data. */ - inline uint16_t packedLength(void) { return theLength; } + inline uint16_t packedLength() { return theLength; } /** * @fn CHIP_ERROR parse(System::PacketBuffer *buff, ReferencedTLVData &aTarget) diff --git a/src/lib/protocols/fabric-provisioning/FabricProvisioning.h b/src/lib/protocols/fabric-provisioning/FabricProvisioning.h index 7c8afdd4a1f53f..78fdbc982a6ca9 100644 --- a/src/lib/protocols/fabric-provisioning/FabricProvisioning.h +++ b/src/lib/protocols/fabric-provisioning/FabricProvisioning.h @@ -118,7 +118,7 @@ class FabricProvisioningDelegate : public ChipServerDelegateBase * @retval other Other CHIP or platform-specific error codes indicating that an error * occurred preventing the device from creating a fabric. */ - virtual CHIP_ERROR HandleCreateFabric(void) = 0; + virtual CHIP_ERROR HandleCreateFabric() = 0; /** * Indicates that the device has joined an existing Fabric. @@ -127,7 +127,7 @@ class FabricProvisioningDelegate : public ChipServerDelegateBase * @retval other Other CHIP or platform-specific error codes indicating that an error * occurred preventing the device from joining the fabric. */ - virtual CHIP_ERROR HandleJoinExistingFabric(void) = 0; + virtual CHIP_ERROR HandleJoinExistingFabric() = 0; /** * Indicates that the device has left a Fabric. @@ -136,7 +136,7 @@ class FabricProvisioningDelegate : public ChipServerDelegateBase * @retval other Other CHIP or platform-specific error codes indicating that an error * occurred preventing the device from leaving the fabric. */ - virtual CHIP_ERROR HandleLeaveFabric(void) = 0; + virtual CHIP_ERROR HandleLeaveFabric() = 0; /** * Indicates that the configuration of the current CHIP Fabric has been @@ -146,7 +146,7 @@ class FabricProvisioningDelegate : public ChipServerDelegateBase * @retval other Other CHIP or platform-specific error codes indicating that an error * occurred preventing the device from returning the fabric config. */ - virtual CHIP_ERROR HandleGetFabricConfig(void) = 0; + virtual CHIP_ERROR HandleGetFabricConfig() = 0; /** * Enforce message-level access control for an incoming Fabric Provisioning request message. @@ -179,19 +179,19 @@ class FabricProvisioningDelegate : public ChipServerDelegateBase class DLL_EXPORT FabricProvisioningServer : public ChipServerBase { public: - FabricProvisioningServer(void); + FabricProvisioningServer(); FabricProvisioningServer(const FabricProvisioningServer &) = delete; FabricProvisioningServer & operator=(const FabricProvisioningServer &) = delete; CHIP_ERROR Init(ChipExchangeManager * exchangeMgr); - CHIP_ERROR Shutdown(void); + CHIP_ERROR Shutdown(); void SetDelegate(FabricProvisioningDelegate * delegate); // Check if the session is marked as privileged to retrieve fabric config information. bool SessionHasFabricConfigAccessPrivilege(uint16_t keyId, uint64_t peerNodeId) const; - virtual CHIP_ERROR SendSuccessResponse(void); + virtual CHIP_ERROR SendSuccessResponse(); virtual CHIP_ERROR SendStatusReport(uint32_t statusProfileId, uint16_t statusCode, CHIP_ERROR sysError = CHIP_NO_ERROR); protected: @@ -206,9 +206,9 @@ class DLL_EXPORT FabricProvisioningServer : public ChipServerBase // about whether the current security session is privileged to // access fabric config information. void GrantFabricConfigAccessPrivilege(uint16_t keyId, uint64_t peerNodeId); - void ClearFabricConfigAccessPrivilege(void); + void ClearFabricConfigAccessPrivilege(); static void HandleSessionEnd(uint16_t keyId, uint64_t peerNodeId, void * context); - CHIP_ERROR RegisterSessionEndCallbackWithFabricState(void); + CHIP_ERROR RegisterSessionEndCallbackWithFabricState(); // Indicates the session that is privileged to // retrieve fabric config information. diff --git a/src/lib/protocols/security/CHIPApplicationKeys.h b/src/lib/protocols/security/CHIPApplicationKeys.h index c3d43008d8c0e2..6a4b471eba739a 100644 --- a/src/lib/protocols/security/CHIPApplicationKeys.h +++ b/src/lib/protocols/security/CHIPApplicationKeys.h @@ -129,7 +129,7 @@ class DLL_EXPORT GroupKeyStoreBase virtual CHIP_ERROR DeleteGroupKey(uint32_t keyId) = 0; virtual CHIP_ERROR DeleteGroupKeysOfAType(uint32_t keyType) = 0; virtual CHIP_ERROR EnumerateGroupKeys(uint32_t keyType, uint32_t * keyIds, uint8_t keyIdsArraySize, uint8_t & keyCount) = 0; - virtual CHIP_ERROR Clear(void) = 0; + virtual CHIP_ERROR Clear() = 0; // Get the current time. virtual CHIP_ERROR GetCurrentUTCTime(uint32_t & utcTime); @@ -149,12 +149,12 @@ class DLL_EXPORT GroupKeyStoreBase uint32_t LastUsedEpochKeyId; uint32_t NextEpochKeyStartTime; - void Init(void); - void OnEpochKeysChange(void); + void Init(); + void OnEpochKeysChange(); // Retrieve and Store LastUsedEpochKeyId value. - virtual CHIP_ERROR RetrieveLastUsedEpochKeyId(void) = 0; - virtual CHIP_ERROR StoreLastUsedEpochKeyId(void) = 0; + virtual CHIP_ERROR RetrieveLastUsedEpochKeyId() = 0; + virtual CHIP_ERROR StoreLastUsedEpochKeyId() = 0; private: // Derive fabric/client root key. diff --git a/src/lib/protocols/security/CHIPDummyGroupKeyStore.h b/src/lib/protocols/security/CHIPDummyGroupKeyStore.h index 914e64ff394892..6c5f9c5710c5de 100644 --- a/src/lib/protocols/security/CHIPDummyGroupKeyStore.h +++ b/src/lib/protocols/security/CHIPDummyGroupKeyStore.h @@ -44,7 +44,7 @@ namespace AppKeys { class DummyGroupKeyStore : public GroupKeyStoreBase { public: - DummyGroupKeyStore(void); + DummyGroupKeyStore(); // Manage application group key material storage. CHIP_ERROR RetrieveGroupKey(uint32_t keyId, ChipGroupKey & key) override; @@ -52,12 +52,12 @@ class DummyGroupKeyStore : public GroupKeyStoreBase CHIP_ERROR DeleteGroupKey(uint32_t keyId) override; CHIP_ERROR DeleteGroupKeysOfAType(uint32_t keyType) override; CHIP_ERROR EnumerateGroupKeys(uint32_t keyType, uint32_t * keyIds, uint8_t keyIdsArraySize, uint8_t & keyCount) override; - CHIP_ERROR Clear(void) override; + CHIP_ERROR Clear() override; private: // Retrieve and Store LastUsedEpochKeyId value. - CHIP_ERROR RetrieveLastUsedEpochKeyId(void) override; - CHIP_ERROR StoreLastUsedEpochKeyId(void) override; + CHIP_ERROR RetrieveLastUsedEpochKeyId() override; + CHIP_ERROR StoreLastUsedEpochKeyId() override; // Get current platform UTC time in seconds. CHIP_ERROR GetCurrentUTCTime(uint32_t & utcTime) override; diff --git a/src/lib/protocols/status-report/StatusReportProtocol.h b/src/lib/protocols/status-report/StatusReportProtocol.h index 93e8597e71a7d0..0e452c34fce1d9 100644 --- a/src/lib/protocols/status-report/StatusReportProtocol.h +++ b/src/lib/protocols/status-report/StatusReportProtocol.h @@ -61,8 +61,8 @@ namespace StatusReporting { class DLL_EXPORT StatusReport { public: - StatusReport(void); - ~StatusReport(void); + StatusReport(); + ~StatusReport(); CHIP_ERROR init(uint32_t aProtocolId, uint16_t aCode, ReferencedTLVData * aInfo = nullptr); @@ -75,12 +75,12 @@ class DLL_EXPORT StatusReport CHIP_ERROR init(CHIP_ERROR aError); CHIP_ERROR pack(PacketBuffer * aBuffer, uint32_t maxLen = 0xFFFFFFFFUL); - uint16_t packedLength(void); + uint16_t packedLength(); static CHIP_ERROR parse(PacketBuffer * aBuffer, StatusReport & aDestination); bool operator==(const StatusReport & another) const; - bool success(void); + bool success(); /* * here are some static convenience methods for adding metadata diff --git a/src/lib/shell/streamer.h b/src/lib/shell/streamer.h index c5d168cb0e386d..4d964da7401ebe 100644 --- a/src/lib/shell/streamer.h +++ b/src/lib/shell/streamer.h @@ -50,7 +50,7 @@ int streamer_write(streamer_t * self, const char * buf, size_t len); int streamer_vprintf(streamer_t * self, const char * fmt, va_list ap); int streamer_printf(streamer_t * self, const char * fmt, ...); void streamer_print_hex(streamer_t * self, const uint8_t * data, int len); -streamer_t * streamer_get(void); +streamer_t * streamer_get(); } // namespace Shell } // namespace chip diff --git a/src/lib/shell/streamer_stdio.cpp b/src/lib/shell/streamer_stdio.cpp index 6d575f7221635e..1fbe5747f8f4ae 100644 --- a/src/lib/shell/streamer_stdio.cpp +++ b/src/lib/shell/streamer_stdio.cpp @@ -35,7 +35,7 @@ namespace Shell { static struct termios the_original_stdin_termios; -static void streamer_restore_termios(void) +static void streamer_restore_termios() { int in_fd = fileno(stdin); tcsetattr(in_fd, TCSAFLUSH, &the_original_stdin_termios); @@ -77,7 +77,7 @@ static streamer_t streamer_stdio = { .write_cb = streamer_stdio_write, }; -streamer_t * streamer_get(void) +streamer_t * streamer_get() { return &streamer_stdio; } diff --git a/src/lib/support/CHIPCounter.cpp b/src/lib/support/CHIPCounter.cpp index 4f93e583b732f5..8c9abeb0e1fe45 100644 --- a/src/lib/support/CHIPCounter.cpp +++ b/src/lib/support/CHIPCounter.cpp @@ -21,9 +21,9 @@ namespace chip { -MonotonicallyIncreasingCounter::MonotonicallyIncreasingCounter(void) : mCounterValue(0) {} +MonotonicallyIncreasingCounter::MonotonicallyIncreasingCounter() : mCounterValue(0) {} -MonotonicallyIncreasingCounter::~MonotonicallyIncreasingCounter(void) {} +MonotonicallyIncreasingCounter::~MonotonicallyIncreasingCounter() {} CHIP_ERROR MonotonicallyIncreasingCounter::Init(uint32_t aStartValue) @@ -36,7 +36,7 @@ MonotonicallyIncreasingCounter::Init(uint32_t aStartValue) } CHIP_ERROR -MonotonicallyIncreasingCounter::Advance(void) +MonotonicallyIncreasingCounter::Advance() { CHIP_ERROR err = CHIP_NO_ERROR; @@ -45,7 +45,7 @@ MonotonicallyIncreasingCounter::Advance(void) return err; } -uint32_t MonotonicallyIncreasingCounter::GetValue(void) +uint32_t MonotonicallyIncreasingCounter::GetValue() { return mCounterValue; } diff --git a/src/lib/support/CHIPCounter.h b/src/lib/support/CHIPCounter.h index 3573c94015a488..aa5c2accc97830 100644 --- a/src/lib/support/CHIPCounter.h +++ b/src/lib/support/CHIPCounter.h @@ -41,8 +41,8 @@ namespace chip { class Counter { public: - Counter(void) {} - virtual ~Counter(void) {} + Counter() {} + virtual ~Counter() {} /** * @brief @@ -50,7 +50,7 @@ class Counter * * @return A CHIP error code if anything failed, CHIP_NO_ERROR otherwise. */ - virtual CHIP_ERROR Advance(void) = 0; + virtual CHIP_ERROR Advance() = 0; /** * @brief @@ -58,7 +58,7 @@ class Counter * * @return The current value of the counter. */ - virtual uint32_t GetValue(void) = 0; + virtual uint32_t GetValue() = 0; }; /** @@ -71,8 +71,8 @@ class Counter class MonotonicallyIncreasingCounter : public Counter { public: - MonotonicallyIncreasingCounter(void); - ~MonotonicallyIncreasingCounter(void) override; + MonotonicallyIncreasingCounter(); + ~MonotonicallyIncreasingCounter() override; /** * @brief @@ -90,7 +90,7 @@ class MonotonicallyIncreasingCounter : public Counter * * @return A CHIP error code if something fails, CHIP_NO_ERROR otherwise */ - CHIP_ERROR Advance(void) override; + CHIP_ERROR Advance() override; /** * @brief @@ -98,7 +98,7 @@ class MonotonicallyIncreasingCounter : public Counter * * @return The current value of the counter. */ - uint32_t GetValue(void) override; + uint32_t GetValue() override; protected: uint32_t mCounterValue; diff --git a/src/lib/support/CHIPFaultInjection.cpp b/src/lib/support/CHIPFaultInjection.cpp index db7db682249b75..a8dccb5deb3b4b 100644 --- a/src/lib/support/CHIPFaultInjection.cpp +++ b/src/lib/support/CHIPFaultInjection.cpp @@ -48,7 +48,7 @@ static const nl::FaultInjection::Name sFaultNames[] = { /** * Get the singleton FaultInjection::Manager for Inet faults */ -nl::FaultInjection::Manager & GetManager(void) +nl::FaultInjection::Manager & GetManager() { if (0 == sChipFaultInMgr.GetNumFaults()) { diff --git a/src/lib/support/CHIPFaultInjection.h b/src/lib/support/CHIPFaultInjection.h index 779d564d8178f1..44b25fdf49a5b5 100644 --- a/src/lib/support/CHIPFaultInjection.h +++ b/src/lib/support/CHIPFaultInjection.h @@ -66,7 +66,7 @@ typedef enum kFault_NumItems, } Id; -DLL_EXPORT nl::FaultInjection::Manager & GetManager(void); +DLL_EXPORT nl::FaultInjection::Manager & GetManager(); /** * The number of ways in which chip Fault Injection fuzzers can diff --git a/src/lib/support/CHIPMem-Malloc.cpp b/src/lib/support/CHIPMem-Malloc.cpp index 5e57fda0ae4d09..0db336c7bcf26d 100644 --- a/src/lib/support/CHIPMem-Malloc.cpp +++ b/src/lib/support/CHIPMem-Malloc.cpp @@ -38,7 +38,7 @@ CHIP_ERROR MemoryInit(void * buf, size_t bufSize) return CHIP_NO_ERROR; } -void MemoryShutdown(void) {} +void MemoryShutdown() {} void * MemoryAlloc(size_t size) { diff --git a/src/lib/support/CHIPMem.h b/src/lib/support/CHIPMem.h index a5b1907ab47961..f53131cd8f0cf8 100644 --- a/src/lib/support/CHIPMem.h +++ b/src/lib/support/CHIPMem.h @@ -66,7 +66,7 @@ extern CHIP_ERROR MemoryInit(void * buf = nullptr, size_t bufSize = 0); * for memory allocation. * */ -extern void MemoryShutdown(void); +extern void MemoryShutdown(); /** * This function is called by the CHIP layer to allocate a block of memory of "size" bytes. diff --git a/src/lib/support/PersistedCounter.cpp b/src/lib/support/PersistedCounter.cpp index 48c2ebc58e89eb..790549a5fe096b 100644 --- a/src/lib/support/PersistedCounter.cpp +++ b/src/lib/support/PersistedCounter.cpp @@ -27,11 +27,11 @@ namespace chip { -PersistedCounter::PersistedCounter(void) : +PersistedCounter::PersistedCounter() : MonotonicallyIncreasingCounter(), mId(chip::Platform::PersistedStorage::kEmptyKey), mEpoch(0), mNextEpoch(0) {} -PersistedCounter::~PersistedCounter(void) +PersistedCounter::~PersistedCounter() { return; } @@ -68,7 +68,7 @@ PersistedCounter::Init(const chip::Platform::PersistedStorage::Key aId, uint32_t } CHIP_ERROR -PersistedCounter::Advance(void) +PersistedCounter::Advance() { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/lib/support/PersistedCounter.h b/src/lib/support/PersistedCounter.h index ae1e17c26773b3..38d413e7c57ae5 100644 --- a/src/lib/support/PersistedCounter.h +++ b/src/lib/support/PersistedCounter.h @@ -57,8 +57,8 @@ namespace chip { class PersistedCounter : public MonotonicallyIncreasingCounter { public: - PersistedCounter(void); - ~PersistedCounter(void) override; + PersistedCounter(); + ~PersistedCounter() override; /** * @brief @@ -83,7 +83,7 @@ class PersistedCounter : public MonotonicallyIncreasingCounter * * @return Any error returned by a write to persisted storage. */ - CHIP_ERROR Advance(void) override; + CHIP_ERROR Advance() override; private: /** diff --git a/src/lib/support/RandUtils.h b/src/lib/support/RandUtils.h index c21a6884ebaefb..28629cddfacabd 100644 --- a/src/lib/support/RandUtils.h +++ b/src/lib/support/RandUtils.h @@ -39,7 +39,7 @@ namespace chip { * @return 64-bit unsigned random integer. * */ -extern uint64_t GetRandU64(void); +extern uint64_t GetRandU64(); /** * This function generates 32-bit unsigned random number. @@ -47,7 +47,7 @@ extern uint64_t GetRandU64(void); * @return 32-bit unsigned random integer. * */ -extern uint32_t GetRandU32(void); +extern uint32_t GetRandU32(); /** * This function generates 16-bit unsigned random number. @@ -55,7 +55,7 @@ extern uint32_t GetRandU32(void); * @return 16-bit unsigned random integer. * */ -extern uint16_t GetRandU16(void); +extern uint16_t GetRandU16(); /** * This function generates 8-bit unsigned random number. @@ -63,7 +63,7 @@ extern uint16_t GetRandU16(void); * @return 8-bit unsigned random integer. * */ -extern uint8_t GetRandU8(void); +extern uint8_t GetRandU8(); } // namespace chip diff --git a/src/lib/support/TestUtils.h b/src/lib/support/TestUtils.h index cf4a6582d4289b..1130c6a62cee82 100644 --- a/src/lib/support/TestUtils.h +++ b/src/lib/support/TestUtils.h @@ -51,7 +51,7 @@ namespace chip { -typedef int (*UnitTestTriggerFunction)(void); +typedef int (*UnitTestTriggerFunction)(); CHIP_ERROR RegisterUnitTests(UnitTestTriggerFunction tests); diff --git a/src/lib/support/logging/CHIPLogging.h b/src/lib/support/logging/CHIPLogging.h index 4493b11abacf5f..07f59a7b42176c 100644 --- a/src/lib/support/logging/CHIPLogging.h +++ b/src/lib/support/logging/CHIPLogging.h @@ -191,7 +191,7 @@ enum LogCategory extern void LogV(uint8_t module, uint8_t category, const char * msg, va_list args); extern void Log(uint8_t module, uint8_t category, const char * msg, ...); -extern uint8_t GetLogFilter(void); +extern uint8_t GetLogFilter(); extern void SetLogFilter(uint8_t category); #ifndef CHIP_ERROR_LOGGING diff --git a/src/lib/support/tests/TestBufBoundDriver.cpp b/src/lib/support/tests/TestBufBoundDriver.cpp index 7ba220c8e6cf76..9cd3f8414d7dce 100644 --- a/src/lib/support/tests/TestBufBoundDriver.cpp +++ b/src/lib/support/tests/TestBufBoundDriver.cpp @@ -25,7 +25,7 @@ #include "TestSupport.h" -int main(void) +int main() { return TestBufBound(); } diff --git a/src/lib/support/tests/TestCHIPArgParserDriver.cpp b/src/lib/support/tests/TestCHIPArgParserDriver.cpp index 83302c42008908..d399bc051e08ac 100644 --- a/src/lib/support/tests/TestCHIPArgParserDriver.cpp +++ b/src/lib/support/tests/TestCHIPArgParserDriver.cpp @@ -25,7 +25,7 @@ #include "TestSupport.h" -int main(void) +int main() { return (TestCHIPArgParser()); } diff --git a/src/lib/support/tests/TestCHIPMemDriver.cpp b/src/lib/support/tests/TestCHIPMemDriver.cpp index 2cba5123ca983c..1ea1114bb0a4b0 100644 --- a/src/lib/support/tests/TestCHIPMemDriver.cpp +++ b/src/lib/support/tests/TestCHIPMemDriver.cpp @@ -24,7 +24,7 @@ #include "TestSupport.h" -int main(void) +int main() { return (TestMemAlloc()); } diff --git a/src/lib/support/tests/TestErrorStr.cpp b/src/lib/support/tests/TestErrorStr.cpp index de435b577b06fe..c7c3df1eb48bf0 100644 --- a/src/lib/support/tests/TestErrorStr.cpp +++ b/src/lib/support/tests/TestErrorStr.cpp @@ -54,7 +54,7 @@ static bool trueFormat(char * buf, uint16_t bufSize, int32_t err) return true; // means I handled it } -static bool testRegisterDeregisterErrorFormatter(void) +static bool testRegisterDeregisterErrorFormatter() { static ErrorFormatter falseFormatter = { falseFormat, nullptr }; static ErrorFormatter falseFormatter2 = { falseFormat2, nullptr }; diff --git a/src/lib/support/tests/TestErrorStrDriver.cpp b/src/lib/support/tests/TestErrorStrDriver.cpp index 75b9a484dee108..c42c25ec06c496 100644 --- a/src/lib/support/tests/TestErrorStrDriver.cpp +++ b/src/lib/support/tests/TestErrorStrDriver.cpp @@ -24,7 +24,7 @@ #include "TestSupport.h" -int main(void) +int main() { return (TestErrorStr()); } diff --git a/src/lib/support/tests/TestTimeUtils.cpp b/src/lib/support/tests/TestTimeUtils.cpp index 6367667781d52f..a2169daa1da5f6 100644 --- a/src/lib/support/tests/TestTimeUtils.cpp +++ b/src/lib/support/tests/TestTimeUtils.cpp @@ -800,7 +800,7 @@ OrdinalDateTestValue LeapYearOrdinalDates[] = }; // clang-format on -void TestOrdinalDateConversion(void) +void TestOrdinalDateConversion() { for (uint16_t year = 0; year <= 10000; year++) { @@ -823,7 +823,7 @@ void TestOrdinalDateConversion(void) } } -void TestDaysSinceEpochConversion(void) +void TestDaysSinceEpochConversion() { uint32_t daysSinceEpoch = 0; @@ -869,7 +869,7 @@ void TestDaysSinceEpochConversion(void) } } -void TestSecondsSinceEpochConversion(void) +void TestSecondsSinceEpochConversion() { uint32_t daysSinceEpoch = 0; uint32_t timeOfDay = 0; diff --git a/src/lib/support/tests/TestTimeUtilsDriver.cpp b/src/lib/support/tests/TestTimeUtilsDriver.cpp index 1f780736daca9a..a3680ef79c808e 100644 --- a/src/lib/support/tests/TestTimeUtilsDriver.cpp +++ b/src/lib/support/tests/TestTimeUtilsDriver.cpp @@ -24,7 +24,7 @@ #include "TestSupport.h" -int main(void) +int main() { return (TestTimeUtils()); } diff --git a/src/lib/support/verhoeff/Verhoeff.h b/src/lib/support/verhoeff/Verhoeff.h index 18af779dbf4a63..672dda85eb291d 100644 --- a/src/lib/support/verhoeff/Verhoeff.h +++ b/src/lib/support/verhoeff/Verhoeff.h @@ -64,8 +64,8 @@ class DLL_EXPORT Verhoeff10 static char ValToChar(int val); private: - Verhoeff10(void) = delete; - ~Verhoeff10(void) = delete; + Verhoeff10() = delete; + ~Verhoeff10() = delete; static uint8_t sMultiplyTable[]; static uint8_t sPermTable[]; @@ -101,8 +101,8 @@ class DLL_EXPORT Verhoeff16 static char ValToChar(int val); private: - Verhoeff16(void) = delete; - ~Verhoeff16(void) = delete; + Verhoeff16() = delete; + ~Verhoeff16() = delete; static uint8_t sMultiplyTable[]; static uint8_t sPermTable[]; @@ -140,8 +140,8 @@ class DLL_EXPORT Verhoeff32 static char ValToChar(int val); private: - Verhoeff32(void) = delete; - ~Verhoeff32(void) = delete; + Verhoeff32() = delete; + ~Verhoeff32() = delete; static uint8_t sMultiplyTable[]; static uint8_t sPermTable[]; @@ -175,8 +175,8 @@ class DLL_EXPORT Verhoeff36 static char ValToChar(int val); private: - Verhoeff36(void) = delete; - ~Verhoeff36(void) = delete; + Verhoeff36() = delete; + ~Verhoeff36() = delete; static uint8_t sMultiplyTable[]; static uint8_t sPermTable[]; diff --git a/src/platform/GeneralUtils.cpp b/src/platform/GeneralUtils.cpp index 01c8d771433177..4c95722161952c 100644 --- a/src/platform/GeneralUtils.cpp +++ b/src/platform/GeneralUtils.cpp @@ -92,7 +92,7 @@ CHIP_ERROR Parse24HourTimeStr(const char * timeStr, uint8_t & hour, uint8_t & mi /** * Register a text error formatter for Device Layer errors. */ -void RegisterDeviceLayerErrorFormatter(void) +void RegisterDeviceLayerErrorFormatter() { static ErrorFormatter sDeviceLayerErrorFormatter = { FormatDeviceLayerError, nullptr }; diff --git a/src/platform/Linux/BLEManagerImpl.cpp b/src/platform/Linux/BLEManagerImpl.cpp index c3d85cacced0db..576904852bf8a6 100644 --- a/src/platform/Linux/BLEManagerImpl.cpp +++ b/src/platform/Linux/BLEManagerImpl.cpp @@ -159,7 +159,7 @@ CHIP_ERROR BLEManagerImpl::_SetDeviceName(const char * deviceName) return CHIP_NO_ERROR; } -uint16_t BLEManagerImpl::_NumConnections(void) +uint16_t BLEManagerImpl::_NumConnections() { uint16_t numCons = 0; return numCons; @@ -186,12 +186,12 @@ CHIP_ERROR BLEManagerImpl::ConfigureBle(uint32_t aNodeId, bool aIsCentral) return err; } -CHIP_ERROR BLEManagerImpl::StartBLEAdvertising(void) +CHIP_ERROR BLEManagerImpl::StartBLEAdvertising() { return StartBluezAdv(mpAppState); } -CHIP_ERROR BLEManagerImpl::StopBLEAdvertising(void) +CHIP_ERROR BLEManagerImpl::StopBLEAdvertising() { return StopBluezAdv(mpAppState); } diff --git a/src/platform/Linux/BLEManagerImpl.h b/src/platform/Linux/BLEManagerImpl.h index ca2b83fc187f8b..a8df0bbce452cb 100644 --- a/src/platform/Linux/BLEManagerImpl.h +++ b/src/platform/Linux/BLEManagerImpl.h @@ -97,21 +97,21 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla private: // ===== Members that implement the BLEManager internal interface. - CHIP_ERROR _Init(void); - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); + CHIP_ERROR _Init(); + CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(); CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); - bool _IsAdvertisingEnabled(void); + bool _IsAdvertisingEnabled(); CHIP_ERROR _SetAdvertisingEnabled(bool val); - bool _IsFastAdvertisingEnabled(void); + bool _IsFastAdvertisingEnabled(); CHIP_ERROR _SetFastAdvertisingEnabled(bool val); - bool _IsAdvertising(void); + bool _IsAdvertising(); CHIP_ERROR _GetDeviceName(char * buf, size_t bufSize); CHIP_ERROR _SetDeviceName(const char * deviceName); - uint16_t _NumConnections(void); + uint16_t _NumConnections(); void _OnPlatformEvent(const ChipDeviceEvent * event); void HandlePlatformSpecificBLEEvent(const ChipDeviceEvent * event); - BleLayer * _GetBleLayer(void) const; + BleLayer * _GetBleLayer() const; // ===== Members that implement virtual methods on BlePlatformDelegate. @@ -134,8 +134,8 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla // ===== Members for internal use by the following friends. - friend BLEManager & BLEMgr(void); - friend BLEManagerImpl & BLEMgrImpl(void); + friend BLEManager & BLEMgr(); + friend BLEManagerImpl & BLEMgrImpl(); static BLEManagerImpl sInstance; @@ -161,8 +161,8 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla kMaxAdvertismentDataSetSize = 31 // TODO: verify this }; - CHIP_ERROR StartBLEAdvertising(void); - CHIP_ERROR StopBLEAdvertising(void); + CHIP_ERROR StartBLEAdvertising(); + CHIP_ERROR StopBLEAdvertising(); void DriveBLEState(); static void DriveBLEState(intptr_t arg); @@ -182,7 +182,7 @@ class BLEManagerImpl final : public BLEManager, private BleLayer, private BlePla * Internal components should use this to access features of the BLEManager object * that are common to all platforms. */ -inline BLEManager & BLEMgr(void) +inline BLEManager & BLEMgr() { return BLEManagerImpl::sInstance; } @@ -193,7 +193,7 @@ inline BLEManager & BLEMgr(void) * Internal components can use this to gain access to features of the BLEManager * that are specific to the Linux platforms. */ -inline BLEManagerImpl & BLEMgrImpl(void) +inline BLEManagerImpl & BLEMgrImpl() { return BLEManagerImpl::sInstance; } @@ -203,22 +203,22 @@ inline BleLayer * BLEManagerImpl::_GetBleLayer() const return (BleLayer *) (this); } -inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode(void) +inline BLEManager::CHIPoBLEServiceMode BLEManagerImpl::_GetCHIPoBLEServiceMode() { return mServiceMode; } -inline bool BLEManagerImpl::_IsAdvertisingEnabled(void) +inline bool BLEManagerImpl::_IsAdvertisingEnabled() { return GetFlag(mFlags, kFlag_AdvertisingEnabled); } -inline bool BLEManagerImpl::_IsFastAdvertisingEnabled(void) +inline bool BLEManagerImpl::_IsFastAdvertisingEnabled() { return GetFlag(mFlags, kFlag_FastAdvertisingEnabled); } -inline bool BLEManagerImpl::_IsAdvertising(void) +inline bool BLEManagerImpl::_IsAdvertising() { return GetFlag(mFlags, kFlag_Advertising); } diff --git a/src/platform/Linux/CHIPLinuxStorage.cpp b/src/platform/Linux/CHIPLinuxStorage.cpp index d9a1e0037f390b..000dd99630c8d9 100644 --- a/src/platform/Linux/CHIPLinuxStorage.cpp +++ b/src/platform/Linux/CHIPLinuxStorage.cpp @@ -266,7 +266,7 @@ CHIP_ERROR ChipLinuxStorage::ClearValue(const char * key) return retval; } -CHIP_ERROR ChipLinuxStorage::ClearAll(void) +CHIP_ERROR ChipLinuxStorage::ClearAll() { CHIP_ERROR retval = CHIP_NO_ERROR; @@ -302,7 +302,7 @@ bool ChipLinuxStorage::HasValue(const char * key) return retval; } -CHIP_ERROR ChipLinuxStorage::Commit(void) +CHIP_ERROR ChipLinuxStorage::Commit() { CHIP_ERROR retval = CHIP_NO_ERROR; diff --git a/src/platform/Linux/CHIPLinuxStorage.h b/src/platform/Linux/CHIPLinuxStorage.h index cf46b59fe054c6..1aeb1f2563fd49 100644 --- a/src/platform/Linux/CHIPLinuxStorage.h +++ b/src/platform/Linux/CHIPLinuxStorage.h @@ -81,8 +81,8 @@ class ChipLinuxStorage : private ChipLinuxStorageIni CHIP_ERROR WriteValueStr(const char * key, const char * val); CHIP_ERROR WriteValueBin(const char * key, const uint8_t * data, size_t dataLen); CHIP_ERROR ClearValue(const char * key); - CHIP_ERROR ClearAll(void); - CHIP_ERROR Commit(void); + CHIP_ERROR ClearAll(); + CHIP_ERROR Commit(); bool HasValue(const char * key); private: diff --git a/src/platform/Linux/CHIPLinuxStorageIni.cpp b/src/platform/Linux/CHIPLinuxStorageIni.cpp index ffae3d35e07432..037bfbd519dd02 100644 --- a/src/platform/Linux/CHIPLinuxStorageIni.cpp +++ b/src/platform/Linux/CHIPLinuxStorageIni.cpp @@ -38,7 +38,7 @@ namespace chip { namespace DeviceLayer { namespace Internal { -CHIP_ERROR ChipLinuxStorageIni::Init(void) +CHIP_ERROR ChipLinuxStorageIni::Init() { return RemoveAll(); } diff --git a/src/platform/Linux/CHIPLinuxStorageIni.h b/src/platform/Linux/CHIPLinuxStorageIni.h index 0ea616a9684464..08bf31b06cdd36 100644 --- a/src/platform/Linux/CHIPLinuxStorageIni.h +++ b/src/platform/Linux/CHIPLinuxStorageIni.h @@ -36,7 +36,7 @@ namespace Internal { class ChipLinuxStorageIni { public: - CHIP_ERROR Init(void); + CHIP_ERROR Init(); CHIP_ERROR AddConfig(const std::string & configFile); CHIP_ERROR CommitConfig(const std::string & configFile); CHIP_ERROR GetUIntValue(const char * key, uint32_t & val); @@ -48,7 +48,7 @@ class ChipLinuxStorageIni protected: CHIP_ERROR AddEntry(const char * key, const char * value); CHIP_ERROR RemoveEntry(const char * key); - CHIP_ERROR RemoveAll(void); + CHIP_ERROR RemoveAll(); private: CHIP_ERROR GetDefaultSection(std::map & section); diff --git a/src/platform/Linux/ConfigurationManagerImpl.h b/src/platform/Linux/ConfigurationManagerImpl.h index 88376d8a7d2934..571d1a28ce3ea9 100644 --- a/src/platform/Linux/ConfigurationManagerImpl.h +++ b/src/platform/Linux/ConfigurationManagerImpl.h @@ -49,10 +49,10 @@ class ConfigurationManagerImpl final : public ConfigurationManager, private: // ===== Members that implement the ConfigurationManager public interface. - CHIP_ERROR _Init(void); + CHIP_ERROR _Init(); CHIP_ERROR _GetPrimaryWiFiMACAddress(uint8_t * buf); - bool _CanFactoryReset(void); - void _InitiateFactoryReset(void); + bool _CanFactoryReset(); + void _InitiateFactoryReset(); CHIP_ERROR _ReadPersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t & value); CHIP_ERROR _WritePersistedStorageValue(::chip::Platform::PersistedStorage::Key key, uint32_t value); @@ -60,8 +60,8 @@ class ConfigurationManagerImpl final : public ConfigurationManager, // ===== Members for internal use by the following friends. - friend ConfigurationManager & ConfigurationMgr(void); - friend ConfigurationManagerImpl & ConfigurationMgrImpl(void); + friend ConfigurationManager & ConfigurationMgr(); + friend ConfigurationManagerImpl & ConfigurationMgrImpl(); static ConfigurationManagerImpl sInstance; @@ -76,7 +76,7 @@ class ConfigurationManagerImpl final : public ConfigurationManager, * chip applications should use this to access features of the ConfigurationManager object * that are common to all platforms. */ -inline ConfigurationManager & ConfigurationMgr(void) +inline ConfigurationManager & ConfigurationMgr() { return ConfigurationManagerImpl::sInstance; } @@ -87,7 +87,7 @@ inline ConfigurationManager & ConfigurationMgr(void) * chip applications can use this to gain access to features of the ConfigurationManager * that are specific to the ESP32 platform. */ -inline ConfigurationManagerImpl & ConfigurationMgrImpl(void) +inline ConfigurationManagerImpl & ConfigurationMgrImpl() { return ConfigurationManagerImpl::sInstance; } diff --git a/src/platform/Linux/ConnectivityManagerImpl.cpp b/src/platform/Linux/ConnectivityManagerImpl.cpp index 700a991aeb7893..ce9e8acf0686d7 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl.cpp @@ -95,17 +95,17 @@ void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event) uint16_t ConnectivityManagerImpl::mConnectivityFlag; struct GDBusWpaSupplicant ConnectivityManagerImpl::mWpaSupplicant; -bool ConnectivityManagerImpl::_HaveIPv4InternetConnectivity(void) +bool ConnectivityManagerImpl::_HaveIPv4InternetConnectivity() { return ((mConnectivityFlag & kFlag_HaveIPv4InternetConnectivity) != 0); } -bool ConnectivityManagerImpl::_HaveIPv6InternetConnectivity(void) +bool ConnectivityManagerImpl::_HaveIPv6InternetConnectivity() { return ((mConnectivityFlag & kFlag_HaveIPv6InternetConnectivity) != 0); } -bool ConnectivityManagerImpl::_IsWiFiStationConnected(void) +bool ConnectivityManagerImpl::_IsWiFiStationConnected() { bool ret = false; const gchar * state = nullptr; diff --git a/src/platform/Linux/ConnectivityManagerImpl.h b/src/platform/Linux/ConnectivityManagerImpl.h index 986992e420b43f..ac6e2d468e70d0 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.h +++ b/src/platform/Linux/ConnectivityManagerImpl.h @@ -108,14 +108,14 @@ class ConnectivityManagerImpl final : public ConnectivityManager, private: // ===== Members that implement the ConnectivityManager abstract interface. - bool _HaveIPv4InternetConnectivity(void); - bool _HaveIPv6InternetConnectivity(void); - bool _HaveServiceConnectivity(void); - CHIP_ERROR _Init(void); + bool _HaveIPv4InternetConnectivity(); + bool _HaveIPv6InternetConnectivity(); + bool _HaveServiceConnectivity(); + CHIP_ERROR _Init(); void _OnPlatformEvent(const ChipDeviceEvent * event); #if CHIP_DEVICE_CONFIG_ENABLE_WPA - bool _IsWiFiStationConnected(void); + bool _IsWiFiStationConnected(); bool _CanStartWiFiScan(); static void _OnWpaProxyReady(GObject * source_object, GAsyncResult * res, gpointer user_data); static void _OnWpaInterfaceRemoved(WpaFiW1Wpa_supplicant1 * proxy, const gchar * path, GVariant * properties, @@ -130,13 +130,13 @@ class ConnectivityManagerImpl final : public ConnectivityManager, // ===== Members for internal use by the following friends. - friend ConnectivityManager & ConnectivityMgr(void); - friend ConnectivityManagerImpl & ConnectivityMgrImpl(void); + friend ConnectivityManager & ConnectivityMgr(); + friend ConnectivityManagerImpl & ConnectivityMgrImpl(); static ConnectivityManagerImpl sInstance; }; -inline bool ConnectivityManagerImpl::_HaveServiceConnectivity(void) +inline bool ConnectivityManagerImpl::_HaveServiceConnectivity() { return _HaveServiceConnectivityViaThread(); } @@ -147,7 +147,7 @@ inline bool ConnectivityManagerImpl::_HaveServiceConnectivity(void) * chip applications should use this to access features of the ConnectivityManager object * that are common to all platforms. */ -inline ConnectivityManager & ConnectivityMgr(void) +inline ConnectivityManager & ConnectivityMgr() { return ConnectivityManagerImpl::sInstance; } @@ -158,7 +158,7 @@ inline ConnectivityManager & ConnectivityMgr(void) * chip applications can use this to gain access to features of the ConnectivityManager * that are specific to the ESP32 platform. */ -inline ConnectivityManagerImpl & ConnectivityMgrImpl(void) +inline ConnectivityManagerImpl & ConnectivityMgrImpl() { return ConnectivityManagerImpl::sInstance; } diff --git a/src/platform/Linux/Logging.cpp b/src/platform/Linux/Logging.cpp index 7432c97d01673e..1b351c527c9308 100644 --- a/src/platform/Linux/Logging.cpp +++ b/src/platform/Linux/Logging.cpp @@ -42,7 +42,7 @@ namespace DeviceLayer { * This function is intended be overridden by the application to, e.g., * schedule output of queued log entries. */ -void __attribute__((weak)) OnLogOutput(void) {} +void __attribute__((weak)) OnLogOutput() {} } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/Linux/PlatformManagerImpl.cpp b/src/platform/Linux/PlatformManagerImpl.cpp index 58e8e30dc23525..15c0fa4df6323f 100644 --- a/src/platform/Linux/PlatformManagerImpl.cpp +++ b/src/platform/Linux/PlatformManagerImpl.cpp @@ -44,7 +44,7 @@ static void GDBus_Thread() } #endif -CHIP_ERROR PlatformManagerImpl::_InitChipStack(void) +CHIP_ERROR PlatformManagerImpl::_InitChipStack() { CHIP_ERROR err; diff --git a/src/platform/Linux/PlatformManagerImpl.h b/src/platform/Linux/PlatformManagerImpl.h index 39cc3840e8664a..129041b86beddb 100644 --- a/src/platform/Linux/PlatformManagerImpl.h +++ b/src/platform/Linux/PlatformManagerImpl.h @@ -56,12 +56,12 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener private: // ===== Methods that implement the PlatformManager abstract interface. - CHIP_ERROR _InitChipStack(void); + CHIP_ERROR _InitChipStack(); // ===== Members for internal use by the following friends. - friend PlatformManager & PlatformMgr(void); - friend PlatformManagerImpl & PlatformMgrImpl(void); + friend PlatformManager & PlatformMgr(); + friend PlatformManagerImpl & PlatformMgrImpl(); friend class Internal::BLEManagerImpl; static PlatformManagerImpl sInstance; @@ -82,7 +82,7 @@ class PlatformManagerImpl final : public PlatformManager, public Internal::Gener * chip applications should use this to access features of the PlatformManager object * that are common to all platforms. */ -inline PlatformManager & PlatformMgr(void) +inline PlatformManager & PlatformMgr() { return PlatformManagerImpl::sInstance; } @@ -93,7 +93,7 @@ inline PlatformManager & PlatformMgr(void) * chip applications can use this to gain access to features of the PlatformManager * that are specific to the ESP32 platform. */ -inline PlatformManagerImpl & PlatformMgrImpl(void) +inline PlatformManagerImpl & PlatformMgrImpl() { return PlatformManagerImpl::sInstance; } diff --git a/src/platform/Linux/PosixConfig.cpp b/src/platform/Linux/PosixConfig.cpp index 939fbe38dbfbf5..2086650bc25861 100644 --- a/src/platform/Linux/PosixConfig.cpp +++ b/src/platform/Linux/PosixConfig.cpp @@ -459,7 +459,7 @@ CHIP_ERROR PosixConfig::ClearNamespace(const char * ns) return err; } -CHIP_ERROR PosixConfig::FactoryResetConfig(void) +CHIP_ERROR PosixConfig::FactoryResetConfig() { CHIP_ERROR err = CHIP_NO_ERROR; ChipLinuxStorage * storage; diff --git a/src/platform/Linux/PosixConfig.h b/src/platform/Linux/PosixConfig.h index ea5728f9837c3c..0e8d20468e9d2e 100644 --- a/src/platform/Linux/PosixConfig.h +++ b/src/platform/Linux/PosixConfig.h @@ -80,7 +80,7 @@ class PosixConfig static const char kGroupKeyNamePrefix[]; - static CHIP_ERROR Init(void); + static CHIP_ERROR Init(); // Config value accessors. static CHIP_ERROR ReadConfigValue(Key key, bool & val); @@ -96,9 +96,9 @@ class PosixConfig static CHIP_ERROR WriteConfigValueBin(Key key, const uint8_t * data, size_t dataLen); static CHIP_ERROR ClearConfigValue(Key key); static bool ConfigValueExists(Key key); - static CHIP_ERROR FactoryResetConfig(void); + static CHIP_ERROR FactoryResetConfig(); - static void RunConfigUnitTest(void); + static void RunConfigUnitTest(); protected: // NVS Namespace helper functions. diff --git a/src/platform/Linux/SystemTimeSupport.cpp b/src/platform/Linux/SystemTimeSupport.cpp index e0680350219379..c2fdc91188b0b7 100644 --- a/src/platform/Linux/SystemTimeSupport.cpp +++ b/src/platform/Linux/SystemTimeSupport.cpp @@ -37,7 +37,7 @@ namespace System { namespace Platform { namespace Layer { -uint64_t GetClock_Monotonic(void) +uint64_t GetClock_Monotonic() { std::chrono::microseconds epoch = std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()); @@ -46,7 +46,7 @@ uint64_t GetClock_Monotonic(void) return static_cast(epoch.count()); } -uint64_t GetClock_MonotonicMS(void) +uint64_t GetClock_MonotonicMS() { std::chrono::milliseconds epoch = std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()); @@ -55,7 +55,7 @@ uint64_t GetClock_MonotonicMS(void) return static_cast(epoch.count()); } -uint64_t GetClock_MonotonicHiRes(void) +uint64_t GetClock_MonotonicHiRes() { std::chrono::microseconds epoch = std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()); diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp index afeb67fa8eb888..7ed7e29f0e842b 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.cpp +++ b/src/platform/Linux/ThreadStackManagerImpl.cpp @@ -413,17 +413,17 @@ CHIP_ERROR ThreadStackManagerImpl::_GetPrimary802154MACAddress(uint8_t * buf) return OTBR_TO_CHIP_ERROR(error); } -CHIP_ERROR ThreadStackManagerImpl::_JoinerStart(void) +CHIP_ERROR ThreadStackManagerImpl::_JoinerStart() { return CHIP_ERROR_NOT_IMPLEMENTED; } -ThreadStackManager & ThreadStackMgr(void) +ThreadStackManager & ThreadStackMgr() { return chip::DeviceLayer::ThreadStackManagerImpl::sInstance; } -ThreadStackManagerImpl & ThreadStackMgrImpl(void) +ThreadStackManagerImpl & ThreadStackMgrImpl() { return chip::DeviceLayer::ThreadStackManagerImpl::sInstance; } diff --git a/src/platform/Linux/ThreadStackManagerImpl.h b/src/platform/Linux/ThreadStackManagerImpl.h index 3cd86382c1a1d6..59d828f4edf543 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.h +++ b/src/platform/Linux/ThreadStackManagerImpl.h @@ -84,7 +84,7 @@ class ThreadStackManagerImpl : public ThreadStackManager CHIP_ERROR _GetPrimary802154MACAddress(uint8_t * buf); - CHIP_ERROR _JoinerStart(void); + CHIP_ERROR _JoinerStart(); ~ThreadStackManagerImpl() = default; diff --git a/src/platform/tests/TestCHIPoBLEStackMgr.h b/src/platform/tests/TestCHIPoBLEStackMgr.h index f87ed33cfaa8bb..dfa33d0b199742 100644 --- a/src/platform/tests/TestCHIPoBLEStackMgr.h +++ b/src/platform/tests/TestCHIPoBLEStackMgr.h @@ -25,6 +25,6 @@ #define CHIP_TEST_CHIP_BLE_STACK_MGR_H #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE -int TestCHIPoBLEStackManager(void); +int TestCHIPoBLEStackManager(); #endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE #endif // CHIP_TEST_CHIP_BLE_STACK_MGR_H diff --git a/src/platform/tests/TestConfigurationMgr.cpp b/src/platform/tests/TestConfigurationMgr.cpp index 9a98397c2bc5f5..b7302312abf8ca 100644 --- a/src/platform/tests/TestConfigurationMgr.cpp +++ b/src/platform/tests/TestConfigurationMgr.cpp @@ -422,7 +422,7 @@ static const nlTest sTests[] = { NL_TEST_SENTINEL() }; -int TestConfigurationMgr(void) +int TestConfigurationMgr() { nlTestSuite theSuite = { "CHIP DeviceLayer time tests", &sTests[0], nullptr, nullptr }; diff --git a/src/platform/tests/TestConfigurationMgr.h b/src/platform/tests/TestConfigurationMgr.h index f150dc0a3d81db..45f10decdd4038 100644 --- a/src/platform/tests/TestConfigurationMgr.h +++ b/src/platform/tests/TestConfigurationMgr.h @@ -24,6 +24,6 @@ #ifndef TESTCONFIGURATIONMGR_H #define TESTCONFIGURATIONMGR_H -int TestConfigurationMgr(void); +int TestConfigurationMgr(); #endif // TESTCONFIGURATIONMGR_H diff --git a/src/platform/tests/TestConfigurationMgrDriver.cpp b/src/platform/tests/TestConfigurationMgrDriver.cpp index 1af1df458ccbdb..9a62f6efa0d5d0 100644 --- a/src/platform/tests/TestConfigurationMgrDriver.cpp +++ b/src/platform/tests/TestConfigurationMgrDriver.cpp @@ -24,7 +24,7 @@ #include "TestConfigurationMgr.h" -int main(void) +int main() { return (TestConfigurationMgr()); } diff --git a/src/platform/tests/TestPlatformMgr.cpp b/src/platform/tests/TestPlatformMgr.cpp index 799538e151e5f9..2fe62b1f432383 100644 --- a/src/platform/tests/TestPlatformMgr.cpp +++ b/src/platform/tests/TestPlatformMgr.cpp @@ -100,7 +100,7 @@ static const nlTest sTests[] = { NL_TEST_SENTINEL() }; -int TestPlatformMgr(void) +int TestPlatformMgr() { nlTestSuite theSuite = { "CHIP DeviceLayer time tests", &sTests[0], nullptr, nullptr }; diff --git a/src/platform/tests/TestPlatformMgr.h b/src/platform/tests/TestPlatformMgr.h index 01a94df5cb93f0..93178cad1c269c 100644 --- a/src/platform/tests/TestPlatformMgr.h +++ b/src/platform/tests/TestPlatformMgr.h @@ -24,6 +24,6 @@ #ifndef TESTPLATFORMMGR_H #define TESTPLATFORMMGR_H -int TestPlatformMgr(void); +int TestPlatformMgr(); #endif // TESTPLATFORMMGR_H diff --git a/src/platform/tests/TestPlatformMgrDriver.cpp b/src/platform/tests/TestPlatformMgrDriver.cpp index aa4eb72595930c..13422e52f3965d 100644 --- a/src/platform/tests/TestPlatformMgrDriver.cpp +++ b/src/platform/tests/TestPlatformMgrDriver.cpp @@ -24,7 +24,7 @@ #include "TestPlatformMgr.h" -int main(void) +int main() { return (TestPlatformMgr()); } diff --git a/src/platform/tests/TestPlatformTime.cpp b/src/platform/tests/TestPlatformTime.cpp index efd9b178e650f4..2c2b33507e8bc2 100644 --- a/src/platform/tests/TestPlatformTime.cpp +++ b/src/platform/tests/TestPlatformTime.cpp @@ -202,7 +202,7 @@ static const nlTest sTests[] = { NL_TEST_SENTINEL() }; -int TestPlatformTime(void) +int TestPlatformTime() { nlTestSuite theSuite = { "CHIP DeviceLayer tests", &sTests[0], nullptr, nullptr }; diff --git a/src/platform/tests/TestPlatformTime.h b/src/platform/tests/TestPlatformTime.h index 66f52f1edd35dc..7c9d933963a5e4 100644 --- a/src/platform/tests/TestPlatformTime.h +++ b/src/platform/tests/TestPlatformTime.h @@ -24,6 +24,6 @@ #ifndef TESTPLATFORMTIME_H #define TESTPLATFORMTIME_H -int TestPlatformTime(void); +int TestPlatformTime(); #endif // TESTCONFIGURATIONMGR_H diff --git a/src/platform/tests/TestPlatformTimeDriver.cpp b/src/platform/tests/TestPlatformTimeDriver.cpp index f301a0b7820faf..0fa1d1d5dfd55b 100644 --- a/src/platform/tests/TestPlatformTimeDriver.cpp +++ b/src/platform/tests/TestPlatformTimeDriver.cpp @@ -24,7 +24,7 @@ #include "TestPlatformTime.h" -int main(void) +int main() { return (TestPlatformTime()); } diff --git a/src/platform/tests/TestThreadStackMgr.cpp b/src/platform/tests/TestThreadStackMgr.cpp index 99040e94394357..bf4cbe0c01f070 100644 --- a/src/platform/tests/TestThreadStackMgr.cpp +++ b/src/platform/tests/TestThreadStackMgr.cpp @@ -47,7 +47,7 @@ void EventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg } } -int TestThreadStackManager(void) +int TestThreadStackManager() { chip::DeviceLayer::ThreadStackManagerImpl impl; chip::DeviceLayer::Internal::DeviceNetworkInfo info; diff --git a/src/setup_payload/SetupPayload.cpp b/src/setup_payload/SetupPayload.cpp index 4e87e072f79313..778b05683413c0 100644 --- a/src/setup_payload/SetupPayload.cpp +++ b/src/setup_payload/SetupPayload.cpp @@ -203,7 +203,7 @@ CHIP_ERROR SetupPayload::getSerialNumber(string & outSerialNumber) return err; } -CHIP_ERROR SetupPayload::removeSerialNumber(void) +CHIP_ERROR SetupPayload::removeSerialNumber() { CHIP_ERROR err = CHIP_NO_ERROR; VerifyOrExit(optionalExtensionData.find(kSerialNumberTag) != optionalExtensionData.end(), err = CHIP_ERROR_KEY_NOT_FOUND); diff --git a/src/setup_payload/SetupPayload.h b/src/setup_payload/SetupPayload.h index 9806ffc4e50fd6..5e945e26a4873f 100644 --- a/src/setup_payload/SetupPayload.h +++ b/src/setup_payload/SetupPayload.h @@ -186,7 +186,7 @@ class SetupPayload /** @brief A function to remove the serial number from the payload * @return Returns a CHIP_ERROR_KEY_NOT_FOUND on error, CHIP_NO_ERROR otherwise **/ - CHIP_ERROR removeSerialNumber(void); + CHIP_ERROR removeSerialNumber(); // Test that the Setup Payload is within expected value ranges SetupPayload() : diff --git a/src/setup_payload/tests/TestManualCode.cpp b/src/setup_payload/tests/TestManualCode.cpp index 4e0700bfa027fc..aed2a2864e233f 100644 --- a/src/setup_payload/tests/TestManualCode.cpp +++ b/src/setup_payload/tests/TestManualCode.cpp @@ -536,7 +536,7 @@ struct TestContext /** * Main */ -int TestManualSetupCode(void) +int TestManualSetupCode() { // clang-format off nlTestSuite theSuite = diff --git a/src/setup_payload/tests/TestManualCode.h b/src/setup_payload/tests/TestManualCode.h index 8a12ec4964944f..ced1c00ec0a30e 100644 --- a/src/setup_payload/tests/TestManualCode.h +++ b/src/setup_payload/tests/TestManualCode.h @@ -24,6 +24,6 @@ #ifndef TESTMANUALCODE_H #define TESTMANUALCODE_H -int TestManualSetupCode(void); +int TestManualSetupCode(); #endif // TESTMANUALCODE_H diff --git a/src/setup_payload/tests/TestManualCodeDriver.cpp b/src/setup_payload/tests/TestManualCodeDriver.cpp index 8df838dfb1cbd0..3bab2a1b76d42e 100644 --- a/src/setup_payload/tests/TestManualCodeDriver.cpp +++ b/src/setup_payload/tests/TestManualCodeDriver.cpp @@ -24,7 +24,7 @@ #include "TestManualCode.h" -int main(void) +int main() { return (TestManualSetupCode()); } diff --git a/src/setup_payload/tests/TestQRCode.cpp b/src/setup_payload/tests/TestQRCode.cpp index 9dd42bc50dab2d..ead0f7310f2c09 100644 --- a/src/setup_payload/tests/TestQRCode.cpp +++ b/src/setup_payload/tests/TestQRCode.cpp @@ -331,7 +331,7 @@ struct TestContext /** * Main */ -int TestQuickResponseCode(void) +int TestQuickResponseCode() { // clang-format off nlTestSuite theSuite = diff --git a/src/setup_payload/tests/TestQRCode.h b/src/setup_payload/tests/TestQRCode.h index cc7e38c2f12475..9632bd57ae25fc 100644 --- a/src/setup_payload/tests/TestQRCode.h +++ b/src/setup_payload/tests/TestQRCode.h @@ -24,6 +24,6 @@ #ifndef TESTQRCODE_H #define TESTQRCODE_H -int TestQuickResponseCode(void); +int TestQuickResponseCode(); #endif // TESTQRCODE_H diff --git a/src/setup_payload/tests/TestQRCodeDriver.cpp b/src/setup_payload/tests/TestQRCodeDriver.cpp index 06145ca4f5c4f3..6bc7d01abbefe3 100644 --- a/src/setup_payload/tests/TestQRCodeDriver.cpp +++ b/src/setup_payload/tests/TestQRCodeDriver.cpp @@ -24,7 +24,7 @@ #include "TestQRCode.h" -int main(void) +int main() { return (TestQuickResponseCode()); } diff --git a/src/setup_payload/tests/TestQRCodeTLV.cpp b/src/setup_payload/tests/TestQRCodeTLV.cpp index a05b6b1eda21ea..27ea1153a5770c 100644 --- a/src/setup_payload/tests/TestQRCodeTLV.cpp +++ b/src/setup_payload/tests/TestQRCodeTLV.cpp @@ -285,7 +285,7 @@ struct TestContext /** * Main */ -int TestQRCodeTLV(void) +int TestQRCodeTLV() { // clang-format off nlTestSuite theSuite = diff --git a/src/setup_payload/tests/TestQRCodeTLV.h b/src/setup_payload/tests/TestQRCodeTLV.h index 2fe98f7f8ee153..b86e085d8ea0e3 100644 --- a/src/setup_payload/tests/TestQRCodeTLV.h +++ b/src/setup_payload/tests/TestQRCodeTLV.h @@ -24,6 +24,6 @@ #ifndef TESTQRCODETLV_H #define TESTQRCODETLV_H -int TestQRCodeTLV(void); +int TestQRCodeTLV(); #endif // TESTQRCODETLV_H diff --git a/src/setup_payload/tests/TestQRCodeTLVDriver.cpp b/src/setup_payload/tests/TestQRCodeTLVDriver.cpp index 334e6767d86464..5e9c5e901518f3 100644 --- a/src/setup_payload/tests/TestQRCodeTLVDriver.cpp +++ b/src/setup_payload/tests/TestQRCodeTLVDriver.cpp @@ -24,7 +24,7 @@ #include "TestQRCodeTLV.h" -int main(void) +int main() { return (TestQRCodeTLV()); } diff --git a/src/system/SystemClock.cpp b/src/system/SystemClock.cpp index 795d4ed0f2b50f..623fc26aafc599 100644 --- a/src/system/SystemClock.cpp +++ b/src/system/SystemClock.cpp @@ -84,7 +84,7 @@ namespace Layer { #endif #endif // HAVE_CLOCK_GETTIME -uint64_t GetClock_Monotonic(void) +uint64_t GetClock_Monotonic() { #if HAVE_CLOCK_GETTIME struct timespec ts; @@ -99,12 +99,12 @@ uint64_t GetClock_Monotonic(void) #endif // HAVE_CLOCK_GETTIME } -uint64_t GetClock_MonotonicMS(void) +uint64_t GetClock_MonotonicMS() { return GetClock_Monotonic() / 1000; } -uint64_t GetClock_MonotonicHiRes(void) +uint64_t GetClock_MonotonicHiRes() { #if HAVE_CLOCK_GETTIME && defined(MONOTONIC_RAW_CLOCK_ID) struct timespec ts; diff --git a/src/system/SystemClock.h b/src/system/SystemClock.h index 56f653ea97c0ed..88277329ec9d87 100644 --- a/src/system/SystemClock.h +++ b/src/system/SystemClock.h @@ -69,7 +69,7 @@ namespace Layer { * * @returns Elapsed time in microseconds since an arbitrary, platform-defined epoch. */ -extern uint64_t GetClock_Monotonic(void); +extern uint64_t GetClock_Monotonic(); /** * @brief @@ -91,7 +91,7 @@ extern uint64_t GetClock_Monotonic(void); * * @returns Elapsed time in milliseconds since an arbitrary, platform-defined epoch. */ -extern uint64_t GetClock_MonotonicMS(void); +extern uint64_t GetClock_MonotonicMS(); /** * @brief @@ -117,7 +117,7 @@ extern uint64_t GetClock_MonotonicMS(void); * * @returns Elapsed time in microseconds since an arbitrary, platform-defined epoch. */ -extern uint64_t GetClock_MonotonicHiRes(void); +extern uint64_t GetClock_MonotonicHiRes(); /** * @brief diff --git a/src/system/SystemError.cpp b/src/system/SystemError.cpp index b91ada6984a566..bd1dfb36c7136b 100644 --- a/src/system/SystemError.cpp +++ b/src/system/SystemError.cpp @@ -102,7 +102,7 @@ namespace System { /** * Register a text error formatter for System Layer errors. */ -void RegisterLayerErrorFormatter(void) +void RegisterLayerErrorFormatter() { static ErrorFormatter sSystemLayerErrorFormatter = { FormatLayerError, nullptr }; @@ -212,7 +212,7 @@ DLL_EXPORT bool IsErrorPOSIX(Error aError) /** * Register a text error formatter for POSIX errors. */ -void RegisterPOSIXErrorFormatter(void) +void RegisterPOSIXErrorFormatter() { static ErrorFormatter sPOSIXErrorFormatter = { FormatPOSIXError, nullptr }; diff --git a/src/system/SystemError.h b/src/system/SystemError.h index d66ab818dc38a9..502af1235f4699 100644 --- a/src/system/SystemError.h +++ b/src/system/SystemError.h @@ -174,13 +174,13 @@ namespace System { */ typedef CHIP_SYSTEM_CONFIG_ERROR_TYPE Error; -extern void RegisterLayerErrorFormatter(void); +extern void RegisterLayerErrorFormatter(); extern bool FormatLayerError(char * buf, uint16_t bufSize, int32_t err); extern Error MapErrorPOSIX(int code); extern const char * DescribeErrorPOSIX(Error code); extern bool IsErrorPOSIX(Error code); -extern void RegisterPOSIXErrorFormatter(void); +extern void RegisterPOSIXErrorFormatter(); extern bool FormatPOSIXError(char * buf, uint16_t bufSize, int32_t err); extern Error MapErrorZephyr(int code); diff --git a/src/system/SystemFaultInjection.cpp b/src/system/SystemFaultInjection.cpp index 6b31418103422d..b79653fce4b0fd 100644 --- a/src/system/SystemFaultInjection.cpp +++ b/src/system/SystemFaultInjection.cpp @@ -49,10 +49,10 @@ static const Name sFaultNames[] = { "AsyncEvent", }; -static int32_t (*sGetNumEventsAvailable)(void); +static int32_t (*sGetNumEventsAvailable)(); static void (*sInjectAsyncEvent)(int32_t index); -Manager & GetManager(void) +Manager & GetManager() { if (0 == sManager.GetNumFaults()) { @@ -67,7 +67,7 @@ Manager & GetManager(void) return sManager; } -void InjectAsyncEvent(void) +void InjectAsyncEvent() { int32_t numEventsAvailable = 0; chip::System::FaultInjection::Id faultID = kFault_AsyncEvent; @@ -99,7 +99,7 @@ void InjectAsyncEvent(void) } } -void SetAsyncEventCallbacks(int32_t (*aGetNumEventsAvailable)(void), void (*aInjectAsyncEvent)(int32_t index)) +void SetAsyncEventCallbacks(int32_t (*aGetNumEventsAvailable)(), void (*aInjectAsyncEvent)(int32_t index)) { sGetNumEventsAvailable = aGetNumEventsAvailable; sInjectAsyncEvent = aInjectAsyncEvent; diff --git a/src/system/SystemFaultInjection.h b/src/system/SystemFaultInjection.h index e3568b4ca71f97..e7f85f911350ab 100644 --- a/src/system/SystemFaultInjection.h +++ b/src/system/SystemFaultInjection.h @@ -55,7 +55,7 @@ typedef enum kFault_NumberOfFaultIdentifiers, } Id; -DLL_EXPORT nl::FaultInjection::Manager & GetManager(void); +DLL_EXPORT nl::FaultInjection::Manager & GetManager(); /** * Callback to the application that returns how many asynchronous events the application could @@ -63,7 +63,7 @@ DLL_EXPORT nl::FaultInjection::Manager & GetManager(void); * * @return The number of events */ -typedef int32_t (*GetNumEventsAvailableCb)(void); +typedef int32_t (*GetNumEventsAvailableCb)(); /** * Callback to the application to inject the asynchronous event specified by argument. @@ -86,7 +86,7 @@ DLL_EXPORT void SetAsyncEventCallbacks(GetNumEventsAvailableCb aGetNumEventsAvai /** * @see CHIP_SYSTEM_FAULT_INJECT_ASYNC_EVENT */ -DLL_EXPORT void InjectAsyncEvent(void); +DLL_EXPORT void InjectAsyncEvent(); } // namespace FaultInjection } // namespace System diff --git a/src/system/SystemLayer.cpp b/src/system/SystemLayer.cpp index 36ba895d5ba202..dbac652ae4ee12 100644 --- a/src/system/SystemLayer.cpp +++ b/src/system/SystemLayer.cpp @@ -401,7 +401,7 @@ Error Layer::ScheduleWork(TimerCompleteFunct aComplete, void * aAppState) * * @returns Elapsed time in microseconds since an arbitrary, platform-defined epoch. */ -uint64_t Layer::GetClock_Monotonic(void) +uint64_t Layer::GetClock_Monotonic() { // Current implementation is a simple pass-through to the platform. return Platform::Layer::GetClock_Monotonic(); @@ -425,7 +425,7 @@ uint64_t Layer::GetClock_Monotonic(void) * * @returns Elapsed time in milliseconds since an arbitrary, platform-defined epoch. */ -uint64_t Layer::GetClock_MonotonicMS(void) +uint64_t Layer::GetClock_MonotonicMS() { // Current implementation is a simple pass-through to the platform. return Platform::Layer::GetClock_MonotonicMS(); @@ -452,7 +452,7 @@ uint64_t Layer::GetClock_MonotonicMS(void) * * @returns Elapsed time in microseconds since an arbitrary, platform-defined epoch. */ -uint64_t Layer::GetClock_MonotonicHiRes(void) +uint64_t Layer::GetClock_MonotonicHiRes() { // Current implementation is a simple pass-through to the platform. return Platform::Layer::GetClock_MonotonicHiRes(); diff --git a/src/system/SystemLayer.h b/src/system/SystemLayer.h index a8c0b1b5e2b153..6cfdf5d15795ed 100644 --- a/src/system/SystemLayer.h +++ b/src/system/SystemLayer.h @@ -127,15 +127,15 @@ class LwIPEventHandlerDelegate class DLL_EXPORT Layer { public: - Layer(void); + Layer(); Error Init(void * aContext); - Error Shutdown(void); + Error Shutdown(); - void * GetPlatformData(void) const; + void * GetPlatformData() const; void SetPlatformData(void * aPlatformData); - LayerState State(void) const; + LayerState State() const; Error NewTimer(Timer *& aTimerPtr); @@ -151,7 +151,7 @@ class DLL_EXPORT Layer #if CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK void PrepareSelect(int & aSetSize, fd_set * aReadSet, fd_set * aWriteSet, fd_set * aExceptionSet, struct timeval & aSleepTime); void HandleSelectResult(int aSetSize, fd_set * aReadSet, fd_set * aWriteSet, fd_set * aExceptionSet); - void WakeSelect(void); + void WakeSelect(); #endif // CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK #if CHIP_SYSTEM_CONFIG_USE_LWIP @@ -168,9 +168,9 @@ class DLL_EXPORT Layer Error HandlePlatformTimer(void); #endif // CHIP_SYSTEM_CONFIG_USE_LWIP - static uint64_t GetClock_Monotonic(void); - static uint64_t GetClock_MonotonicMS(void); - static uint64_t GetClock_MonotonicHiRes(void); + static uint64_t GetClock_Monotonic(); + static uint64_t GetClock_MonotonicMS(); + static uint64_t GetClock_MonotonicHiRes(); static Error GetClock_RealTime(uint64_t & curTime); static Error GetClock_RealTimeMS(uint64_t & curTimeMS); static Error SetClock_RealTime(uint64_t newCurTime); @@ -218,7 +218,7 @@ class DLL_EXPORT Layer /** * This returns the current state of the layer object. */ -inline LayerState Layer::State(void) const +inline LayerState Layer::State() const { return this->mLayerState; } diff --git a/src/system/SystemMutex.h b/src/system/SystemMutex.h index 135dd4f055b160..3d946345fabad5 100644 --- a/src/system/SystemMutex.h +++ b/src/system/SystemMutex.h @@ -62,13 +62,13 @@ namespace System { class DLL_EXPORT Mutex { public: - Mutex(void); - ~Mutex(void); + Mutex(); + ~Mutex(); static Error Init(Mutex & aMutex); - void Lock(void); /**< Acquire the mutual exclusion lock, blocking the current thread indefinitely if necessary. */ - void Unlock(void); /**< Release the mutual exclusion lock (can block on some systems until scheduler completes). */ + void Lock(); /**< Acquire the mutual exclusion lock, blocking the current thread indefinitely if necessary. */ + void Unlock(); /**< Release the mutual exclusion lock (can block on some systems until scheduler completes). */ private: #if CHIP_SYSTEM_CONFIG_POSIX_LOCKING @@ -87,17 +87,17 @@ class DLL_EXPORT Mutex Mutex & operator=(const Mutex &) = delete; }; -inline Mutex::Mutex(void) {} +inline Mutex::Mutex() {} -inline Mutex::~Mutex(void) {} +inline Mutex::~Mutex() {} #if CHIP_SYSTEM_CONFIG_POSIX_LOCKING -inline void Mutex::Lock(void) +inline void Mutex::Lock() { pthread_mutex_lock(&this->mPOSIXMutex); } -inline void Mutex::Unlock(void) +inline void Mutex::Unlock() { pthread_mutex_unlock(&this->mPOSIXMutex); } diff --git a/src/system/SystemObject.cpp b/src/system/SystemObject.cpp index ec649b51f7d5da..c909f94b3dc997 100644 --- a/src/system/SystemObject.cpp +++ b/src/system/SystemObject.cpp @@ -45,7 +45,7 @@ namespace System { * Decrements the reference count for the CHIP System Layer object. Recycles the object back into the pool if the reference * count is decremented to zero. No destructor is invoked. */ -DLL_EXPORT void Object::Release(void) +DLL_EXPORT void Object::Release() { unsigned int oldCount = __sync_fetch_and_sub(&this->mRefCount, 1); diff --git a/src/system/SystemObject.h b/src/system/SystemObject.h index f9ad7642702d2f..1b3f8dc9c9eeef 100644 --- a/src/system/SystemObject.h +++ b/src/system/SystemObject.h @@ -79,9 +79,9 @@ class DLL_EXPORT Object /** Test whether this object is retained by \c aLayer. Concurrency safe. */ bool IsRetained(const Layer & aLayer) const; - void Retain(void); - void Release(void); - Layer & SystemLayer(void) const; + void Retain(); + void Release(); + Layer & SystemLayer() const; protected: #if CHIP_SYSTEM_CONFIG_USE_LWIP @@ -97,8 +97,8 @@ class DLL_EXPORT Object #endif // CHIP_SYSTEM_CONFIG_USE_LWIP private: - Object(void); - ~Object(void); + Object(); + ~Object(); Object(const Object &) = delete; Object & operator=(const Object &) = delete; @@ -130,7 +130,7 @@ inline bool Object::IsRetained(const Layer & aLayer) const * @brief * Increments the reference count for the CHIP System Layer object. The object is assumed to be live. */ -inline void Object::Retain(void) +inline void Object::Retain() { __sync_fetch_and_add(&this->mRefCount, 1); } @@ -140,16 +140,16 @@ inline void Object::Retain(void) * Returns a reference to the CHIP System Layer object provided when the object was initially retained from its corresponding * object pool instance. The object is assumed to be live. */ -inline Layer & Object::SystemLayer(void) const +inline Layer & Object::SystemLayer() const { return *this->mSystemLayer; } /** Deleted. */ -inline Object::Object(void) {} +inline Object::Object() {} /** Deleted. */ -inline Object::~Object(void) {} +inline Object::~Object() {} /** * @brief @@ -176,7 +176,7 @@ template class ObjectPool { public: - static size_t Size(void); + static size_t Size(); T * Get(const Layer & aLayer, size_t aIndex); T * TryCreate(Layer & aLayer); @@ -199,7 +199,7 @@ class ObjectPool * Returns the number of objects that can be simultaneously retained from a pool. */ template -inline size_t ObjectPool::Size(void) +inline size_t ObjectPool::Size() { return N; } diff --git a/src/system/SystemPacketBuffer.cpp b/src/system/SystemPacketBuffer.cpp index 8395020ca217ae..91a2d270160955 100644 --- a/src/system/SystemPacketBuffer.cpp +++ b/src/system/SystemPacketBuffer.cpp @@ -556,7 +556,7 @@ PacketBuffer * PacketBuffer::New(uint16_t aReservedSize) * The reserved size (#CHIP_SYSTEM_CONFIG_HEADER_RESERVE_SIZE) is large enough to hold transport layer headers as well as headers * required by \c chipMessageLayer and \c chipExchangeLayer. */ -PacketBuffer * PacketBuffer::New(void) +PacketBuffer * PacketBuffer::New() { return PacketBuffer::New(CHIP_SYSTEM_CONFIG_HEADER_RESERVE_SIZE); } @@ -620,7 +620,7 @@ void PacketBuffer::Free(PacketBuffer * aPacket) * * This method is called by Free(), before the buffer is released to the free buffer pool. */ -void PacketBuffer::Clear(void) +void PacketBuffer::Clear() { tot_len = 0; len = 0; diff --git a/src/system/SystemPacketBuffer.h b/src/system/SystemPacketBuffer.h index 55a25a29d2c227..d4288dc8fa69f2 100644 --- a/src/system/SystemPacketBuffer.h +++ b/src/system/SystemPacketBuffer.h @@ -93,37 +93,37 @@ struct pbuf class DLL_EXPORT PacketBuffer : private pbuf { public: - size_t AllocSize(void) const; + size_t AllocSize() const; - uint8_t * Start(void) const; + uint8_t * Start() const; void SetStart(uint8_t * aNewStart); - uint16_t DataLength(void) const; + uint16_t DataLength() const; void SetDataLength(uint16_t aNewLen, PacketBuffer * aChainHead = nullptr); - uint16_t TotalLength(void) const; + uint16_t TotalLength() const; - uint16_t MaxDataLength(void) const; - uint16_t AvailableDataLength(void) const; + uint16_t MaxDataLength() const; + uint16_t AvailableDataLength() const; - uint16_t ReservedSize(void) const; + uint16_t ReservedSize() const; - PacketBuffer * Next(void) const; + PacketBuffer * Next() const; void AddToEnd(PacketBuffer * aPacket); - PacketBuffer * DetachTail(void); - void CompactHead(void); + PacketBuffer * DetachTail(); + void CompactHead(); PacketBuffer * Consume(uint16_t aConsumeLength); void ConsumeHead(uint16_t aConsumeLength); bool EnsureReservedSize(uint16_t aReservedSize); bool AlignPayload(uint16_t aAlignBytes); - void AddRef(void); + void AddRef(); static PacketBuffer * NewWithAvailableSize(size_t aAvailableSize); static PacketBuffer * NewWithAvailableSize(uint16_t aReservedSize, size_t aAvailableSize); - static PacketBuffer * New(void); + static PacketBuffer * New(); static PacketBuffer * New(uint16_t aReservedSize); static PacketBuffer * RightSize(PacketBuffer * aPacket); @@ -135,10 +135,10 @@ class DLL_EXPORT PacketBuffer : private pbuf #if !CHIP_SYSTEM_CONFIG_USE_LWIP && CHIP_SYSTEM_CONFIG_PACKETBUFFER_MAXALLOC static PacketBuffer * sFreeList; - static PacketBuffer * BuildFreeList(void); + static PacketBuffer * BuildFreeList(); #endif // !CHIP_SYSTEM_CONFIG_USE_LWIP && CHIP_SYSTEM_CONFIG_PACKETBUFFER_MAXALLOC - void Clear(void); + void Clear(); }; } // namespace System @@ -207,7 +207,7 @@ typedef union * * @return size of the allocation */ -inline size_t PacketBuffer::AllocSize(void) const +inline size_t PacketBuffer::AllocSize() const { #if CHIP_SYSTEM_CONFIG_USE_LWIP #if LWIP_PBUF_FROM_CUSTOM_POOLS diff --git a/src/system/SystemStats.cpp b/src/system/SystemStats.cpp index da3acaefcd2bc9..0f8f4d8ce625c6 100644 --- a/src/system/SystemStats.cpp +++ b/src/system/SystemStats.cpp @@ -65,17 +65,17 @@ static const Label sStatsStrings[chip::System::Stats::kNumEntries] = { count_t sResourcesInUse[kNumEntries]; count_t sHighWatermarks[kNumEntries]; -const Label * GetStrings(void) +const Label * GetStrings() { return sStatsStrings; } -count_t * GetResourcesInUse(void) +count_t * GetResourcesInUse() { return sResourcesInUse; } -count_t * GetHighWatermarks(void) +count_t * GetHighWatermarks() { return sHighWatermarks; } diff --git a/src/system/SystemStats.h b/src/system/SystemStats.h index f79813017f669e..983edb1c5cda97 100644 --- a/src/system/SystemStats.h +++ b/src/system/SystemStats.h @@ -93,15 +93,15 @@ class Snapshot bool Difference(Snapshot & result, Snapshot & after, Snapshot & before); void UpdateSnapshot(Snapshot & aSnapshot); -count_t * GetResourcesInUse(void); -count_t * GetHighWatermarks(void); +count_t * GetResourcesInUse(); +count_t * GetHighWatermarks(); #if CHIP_SYSTEM_CONFIG_USE_LWIP && LWIP_STATS && MEMP_STATS void UpdateLwipPbufCounts(void); #endif typedef const char * Label; -const Label * GetStrings(void); +const Label * GetStrings(); } // namespace Stats } // namespace System diff --git a/src/system/SystemTimer.cpp b/src/system/SystemTimer.cpp index 1c96f7bdfed7dd..48da9ff924c439 100644 --- a/src/system/SystemTimer.cpp +++ b/src/system/SystemTimer.cpp @@ -84,7 +84,7 @@ ObjectPool Timer::sPool; * * @return A timestamp in milliseconds. */ -Timer::Epoch Timer::GetCurrentEpoch(void) +Timer::Epoch Timer::GetCurrentEpoch() { return Platform::Layer::GetClock_MonotonicMS(); } diff --git a/src/system/SystemTimer.h b/src/system/SystemTimer.h index 74a725712c3234..0342f1beb7c940 100644 --- a/src/system/SystemTimer.h +++ b/src/system/SystemTimer.h @@ -63,14 +63,14 @@ class DLL_EXPORT Timer : public Object */ typedef uint64_t Epoch; - static Epoch GetCurrentEpoch(void); + static Epoch GetCurrentEpoch(); static bool IsEarlierEpoch(const Epoch & first, const Epoch & second); typedef void (*OnCompleteFunct)(Layer * aLayer, void * aAppState, Error aError); OnCompleteFunct OnComplete; Error Start(uint32_t aDelayMilliseconds, OnCompleteFunct aOnComplete, void * aAppState); - Error Cancel(void); + Error Cancel(); static void GetStatistics(chip::System::Stats::count_t & aNumInUse, chip::System::Stats::count_t & aHighWatermark); @@ -79,7 +79,7 @@ class DLL_EXPORT Timer : public Object Epoch mAwakenEpoch; - void HandleComplete(void); + void HandleComplete(); Error ScheduleWork(OnCompleteFunct aOnComplete, void * aAppState); diff --git a/src/system/tests/TestSystemErrorStrDriver.cpp b/src/system/tests/TestSystemErrorStrDriver.cpp index d29b58c790c7ba..afb5ddf9dea0c6 100644 --- a/src/system/tests/TestSystemErrorStrDriver.cpp +++ b/src/system/tests/TestSystemErrorStrDriver.cpp @@ -27,7 +27,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/system/tests/TestSystemObject.cpp b/src/system/tests/TestSystemObject.cpp index 147b2200016eb5..76f73970abe67d 100644 --- a/src/system/tests/TestSystemObject.cpp +++ b/src/system/tests/TestSystemObject.cpp @@ -74,7 +74,7 @@ static int Finalize(void * aContext); class TestObject : public Object { public: - Error Init(void); + Error Init(); static void CheckRetention(nlTestSuite * inSuite, void * aContext); static void CheckConcurrency(nlTestSuite * inSuite, void * aContext); @@ -111,7 +111,7 @@ class TestObject : public Object ObjectPool TestObject::sPool; -Error TestObject::Init(void) +Error TestObject::Init() { #if CHIP_SYSTEM_CONFIG_POSIX_LOCKING this->mDelay = kMaxDelayIterations > 0 ? 1 : 0; diff --git a/src/system/tests/TestSystemPacketBufferDriver.cpp b/src/system/tests/TestSystemPacketBufferDriver.cpp index b52a5ea5ec1cee..8579ce32abdaea 100644 --- a/src/system/tests/TestSystemPacketBufferDriver.cpp +++ b/src/system/tests/TestSystemPacketBufferDriver.cpp @@ -33,7 +33,7 @@ #include -int main(void) +int main() { #if CHIP_SYSTEM_CONFIG_USE_LWIP tcpip_init(NULL, NULL); diff --git a/src/transport/MessageHeader.h b/src/transport/MessageHeader.h index 425d529ec7affc..efa26826ad5777 100644 --- a/src/transport/MessageHeader.h +++ b/src/transport/MessageHeader.h @@ -109,7 +109,7 @@ class PacketHeader */ const Optional & GetDestinationNodeId() const { return mDestinationNodeId; } - uint16_t GetEncryptionKeyID(void) const { return mEncryptionKeyID; } + uint16_t GetEncryptionKeyID() const { return mEncryptionKeyID; } /** Get the length of encrypted payload. */ uint16_t GetPayloadLength() const { return mPayloadLength; } @@ -117,9 +117,9 @@ class PacketHeader const Header::Flags & GetFlags() const { return mFlags; } /** Check if it's a secure session control message. */ - bool IsSecureSessionControlMsg(void) const { return (mFlags.value & Header::Flags::kSecureSessionControlMessage) != 0; } + bool IsSecureSessionControlMsg() const { return (mFlags.value & Header::Flags::kSecureSessionControlMessage) != 0; } - Header::EncryptionType GetEncryptionType(void) const { return mEncryptionType; } + Header::EncryptionType GetEncryptionType() const { return mEncryptionType; } PacketHeader & SetSecureSessionControlMsg(bool value) { @@ -296,13 +296,13 @@ class PayloadHeader const Optional & GetVendorId() const { return mVendorId; } /** Get the Session ID from this header. */ - uint16_t GetExchangeID(void) const { return mExchangeID; } + uint16_t GetExchangeID() const { return mExchangeID; } /** Get the Protocol ID from this header. */ - uint16_t GetProtocolID(void) const { return mProtocolID; } + uint16_t GetProtocolID() const { return mProtocolID; } /** Get the secure msg type from this header. */ - uint8_t GetMessageType(void) const { return mMessageType; } + uint8_t GetMessageType() const { return mMessageType; } /** Set the vendor id for this header. */ PayloadHeader & SetVendorId(uint16_t id) @@ -413,7 +413,7 @@ class PayloadHeader class MessageAuthenticationCode { public: - const uint8_t * GetTag(void) const { return &mTag[0]; } + const uint8_t * GetTag() const { return &mTag[0]; } /** Set the message auth tag for this header. */ MessageAuthenticationCode & SetTag(PacketHeader * header, Header::EncryptionType encType, uint8_t * tag, size_t len) diff --git a/src/transport/SecurePairingSession.cpp b/src/transport/SecurePairingSession.cpp index 1cefba129a9ad4..8a2f68d95020a8 100644 --- a/src/transport/SecurePairingSession.cpp +++ b/src/transport/SecurePairingSession.cpp @@ -41,9 +41,9 @@ const char * kSpake2pContext = "CHIP 1.0 Provisioning"; const char * kSpake2pI2RSessionInfo = "Commissioning I2R Key"; const char * kSpake2pR2ISessionInfo = "Commissioning R2I Key"; -SecurePairingSession::SecurePairingSession(void) {} +SecurePairingSession::SecurePairingSession() {} -SecurePairingSession::~SecurePairingSession(void) +SecurePairingSession::~SecurePairingSession() { if (mDelegate != nullptr) { diff --git a/src/transport/SecurePairingSession.h b/src/transport/SecurePairingSession.h index 92a070153f92ec..fc87189662dcd5 100644 --- a/src/transport/SecurePairingSession.h +++ b/src/transport/SecurePairingSession.h @@ -71,13 +71,13 @@ class DLL_EXPORT SecurePairingSessionDelegate : public ReferenceCounted myNodeId, uint16_t myKeyId, SecurePairingSessionDelegate * delegate) diff --git a/src/transport/SecureSession.cpp b/src/transport/SecureSession.cpp index 13e2c4892be845..aa71b946d18a43 100644 --- a/src/transport/SecureSession.cpp +++ b/src/transport/SecureSession.cpp @@ -93,7 +93,7 @@ CHIP_ERROR SecureSession::Init(const Crypto::P256Keypair & local_keypair, const return error; } -void SecureSession::Reset(void) +void SecureSession::Reset() { mKeyAvailable = false; memset(mKey, 0, sizeof(mKey)); diff --git a/src/transport/SecureSession.h b/src/transport/SecureSession.h index 0c9aba63b9e232..c8e35bdc35400a 100644 --- a/src/transport/SecureSession.h +++ b/src/transport/SecureSession.h @@ -35,7 +35,7 @@ namespace chip { class DLL_EXPORT SecureSession { public: - SecureSession(void); + SecureSession(); SecureSession(SecureSession &&) = default; SecureSession(const SecureSession &) = default; SecureSession & operator=(const SecureSession &) = default; @@ -104,12 +104,12 @@ class DLL_EXPORT SecureSession * * @return number of bytes. */ - size_t EncryptionOverhead(void); + size_t EncryptionOverhead(); /** * Clears the internal state of secure session back to the state of a new object. */ - void Reset(void); + void Reset(); private: static constexpr size_t kAES_CCM128_Key_Length = 16; diff --git a/src/transport/SecureSessionMgr.cpp b/src/transport/SecureSessionMgr.cpp index 33f122710c98a2..22be010f7d4647 100644 --- a/src/transport/SecureSessionMgr.cpp +++ b/src/transport/SecureSessionMgr.cpp @@ -198,7 +198,7 @@ CHIP_ERROR SecureSessionMgrBase::NewPairing(const OptionalStartTimer(CHIP_PEER_CONNECTION_TIMEOUT_CHECK_FREQUENCY_MS, SecureSessionMgrBase::ExpiryTimerCallback, this); @@ -206,7 +206,7 @@ void SecureSessionMgrBase::ScheduleExpiryTimer(void) VerifyOrDie(err == CHIP_NO_ERROR); } -void SecureSessionMgrBase::CancelExpiryTimer(void) +void SecureSessionMgrBase::CancelExpiryTimer() { if (mSystemLayer != nullptr) { diff --git a/src/transport/SecureSessionMgr.h b/src/transport/SecureSessionMgr.h index 5cb10cfca7fef7..c39b37a5b2299a 100644 --- a/src/transport/SecureSessionMgr.h +++ b/src/transport/SecureSessionMgr.h @@ -165,10 +165,10 @@ class DLL_EXPORT SecureSessionMgrBase : public ReferenceCounted -int main(void) +int main() { nlTestSetOutputStyle(OUTPUT_CSV); return TestMessageHeader(); diff --git a/src/transport/tests/TestPeerConnectionsDriver.cpp b/src/transport/tests/TestPeerConnectionsDriver.cpp index 818ee8288e8c63..cc007b4bdd2008 100644 --- a/src/transport/tests/TestPeerConnectionsDriver.cpp +++ b/src/transport/tests/TestPeerConnectionsDriver.cpp @@ -27,7 +27,7 @@ #include -int main(void) +int main() { nlTestSetOutputStyle(OUTPUT_CSV); return TestPeerConnectionsFn(); diff --git a/src/transport/tests/TestSecurePairingSessionDriver.cpp b/src/transport/tests/TestSecurePairingSessionDriver.cpp index 2c50140c07c7d9..ff36db97209e91 100644 --- a/src/transport/tests/TestSecurePairingSessionDriver.cpp +++ b/src/transport/tests/TestSecurePairingSessionDriver.cpp @@ -26,7 +26,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/transport/tests/TestSecureSessionDriver.cpp b/src/transport/tests/TestSecureSessionDriver.cpp index 436fc29ec1889c..79c81e257ecb62 100644 --- a/src/transport/tests/TestSecureSessionDriver.cpp +++ b/src/transport/tests/TestSecureSessionDriver.cpp @@ -26,7 +26,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/transport/tests/TestSecureSessionMgrDriver.cpp b/src/transport/tests/TestSecureSessionMgrDriver.cpp index 9e64f0a8e00610..bfa749f343d352 100644 --- a/src/transport/tests/TestSecureSessionMgrDriver.cpp +++ b/src/transport/tests/TestSecureSessionMgrDriver.cpp @@ -26,7 +26,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/transport/tests/TestTCPDriver.cpp b/src/transport/tests/TestTCPDriver.cpp index ef1d2bab082f23..2d75322a481068 100644 --- a/src/transport/tests/TestTCPDriver.cpp +++ b/src/transport/tests/TestTCPDriver.cpp @@ -26,7 +26,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV); diff --git a/src/transport/tests/TestUDPDriver.cpp b/src/transport/tests/TestUDPDriver.cpp index 98868711ee7aa0..bad3407c4a4ab2 100644 --- a/src/transport/tests/TestUDPDriver.cpp +++ b/src/transport/tests/TestUDPDriver.cpp @@ -26,7 +26,7 @@ #include -int main(void) +int main() { // Generate machine-readable, comma-separated value (CSV) output. nlTestSetOutputStyle(OUTPUT_CSV);