Skip to content

Commit 52e228f

Browse files
authored
Add modernize-redundant-void-arg to clang-tidy (#23760)
* Add modernize-redundant-void-arg to clang-tidy * Update coding style guide * Fix redundant void arg for Darwin, Tizen and webOS
1 parent 23a961e commit 52e228f

File tree

122 files changed

+191
-190
lines changed

Some content is hidden

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

122 files changed

+191
-190
lines changed

.clang-tidy

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
Checks: >
33
bugprone-*,
4+
modernize-redundant-void-arg,
45
modernize-use-bool-literals,
56
modernize-use-nullptr,
67
performance-for-range-copy,

docs/style/coding/CODING_STYLE_GUIDE.adoc

+11-11
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ leveraged through toolchain-compatibility preprocessor macros.
154154
CHIP strives to use the latest C++ functionality as long as existing compilers
155155
support such standards.
156156

157-
C{plusplus}14 is considered pervasive enough to be used. As compilers start
157+
C{plusplus}14 is considered pervasive enough to be used. As compilers start
158158
supporting standards such as C{plusplus}17, C{plusplus}20 and beyond,
159159
CHIP may follow suit.
160160

@@ -354,7 +354,7 @@ static chipDEFINE_ALIGNED_VAR(sThreadAttributes, sizeof (pthread_attr_t), uint64
354354
355355
#endif // USE_STRUCT_STORAGE
356356
357-
int foobar(void)
357+
int foobar()
358358
{
359359
int retval;
360360
int status;
@@ -427,10 +427,10 @@ destructed after deinitialization.
427427
class ThreadAttributes
428428
{
429429
public:
430-
ThreadAttributes(void) {};
431-
~ThreadAttributes(void) {};
430+
ThreadAttributes() {};
431+
~ThreadAttributes() {};
432432
433-
operator pthread_attr_t *(void) { return &mAttributes; }
433+
operator pthread_attr_t *() { return &mAttributes; }
434434
435435
private:
436436
pthread_attr_t mAttributes;
@@ -444,7 +444,7 @@ extern void * foobar_entry(void *aArgument);
444444
445445
static chipDEFINE_ALIGNED_VAR(sThreadAttributes, sizeof (ThreadAttributes), uint64_t);
446446
447-
int foobar(void)
447+
int foobar()
448448
{
449449
int retval = -1;
450450
int status;
@@ -530,9 +530,9 @@ storage of objects from a static array of storage.
530530
class Foo
531531
{
532532
public:
533-
Foo(void);
533+
Foo();
534534
Foo(const Foo &inFoo);
535-
~Foo(void);
535+
~Foo();
536536
};
537537
538538
// Global Variables
@@ -554,7 +554,7 @@ static void CreateFooAllocator(void *inStorage,
554554
inDestroy);
555555
}
556556
557-
static StaticAllocatorBitmap &GetFooAllocator(void)
557+
static StaticAllocatorBitmap &GetFooAllocator()
558558
{
559559
return *sFooAllocator;
560560
}
@@ -571,7 +571,7 @@ static void FooDestroy(AllocatorBase &inAllocator, void *inObject)
571571
return;
572572
}
573573
574-
int Init(void)
574+
int Init()
575575
{
576576
static const size_t sFooCount = CHIP_FOO_COUNT;
577577
static chipAllocatorStaticBitmapStorageDefine(sFooStorage, Foo, sFooCount, uint32_t, sizeof (void *));
@@ -586,7 +586,7 @@ int Init(void)
586586
return retval;
587587
}
588588
589-
Foo * FooAllocate(void)
589+
Foo * FooAllocate()
590590
{
591591
Foo *foo;
592592

examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr
9696
}
9797
} // anonymous namespace
9898

99-
void MatterActionsPluginServerInitCallback(void)
99+
void MatterActionsPluginServerInitCallback()
100100
{
101101
registerAttributeAccessOverride(&gAttrAccess);
102102
}

examples/bridge-app/linux/bridged-actions-stub.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ CHIP_ERROR ActionsAttrAccess::Read(const ConcreteReadAttributePath & aPath, Attr
131131
}
132132
} // anonymous namespace
133133

134-
void MatterActionsPluginServerInitCallback(void)
134+
void MatterActionsPluginServerInitCallback()
135135
{
136136
registerAttributeAccessOverride(&gAttrAccess);
137137
}

examples/chip-tool/commands/common/Command.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ const char * Command::GetArgumentDescription(size_t index) const
803803
return nullptr;
804804
}
805805

806-
const char * Command::GetAttribute(void) const
806+
const char * Command::GetAttribute() const
807807
{
808808
size_t argsCount = mArgs.size();
809809
for (size_t i = 0; i < argsCount; i++)
@@ -818,7 +818,7 @@ const char * Command::GetAttribute(void) const
818818
return nullptr;
819819
}
820820

821-
const char * Command::GetEvent(void) const
821+
const char * Command::GetEvent() const
822822
{
823823
size_t argsCount = mArgs.size();
824824
for (size_t i = 0; i < argsCount; i++)

src/app/AttributePathExpandIterator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ using namespace chip;
3636
// Note: Some of the generated files that depended by af.h are gen_config.h and gen_tokens.h
3737
typedef uint8_t EmberAfClusterMask;
3838

39-
extern uint16_t emberAfEndpointCount(void);
39+
extern uint16_t emberAfEndpointCount();
4040
extern uint16_t emberAfIndexFromEndpoint(EndpointId endpoint);
4141
extern uint8_t emberAfClusterCount(EndpointId endpoint, bool server);
4242
extern uint16_t emberAfGetServerAttributeCount(chip::EndpointId endpoint, chip::ClusterId cluster);

src/app/EventManagement.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CircularEventReader : public TLV::TLVReader
5858
virtual ~CircularEventReader() = default;
5959
};
6060

61-
EventManagement & EventManagement::GetInstance(void)
61+
EventManagement & EventManagement::GetInstance()
6262
{
6363
return sInstance;
6464
}

src/app/clusters/application-launcher-server/application-launcher-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ bool emberAfApplicationLauncherClusterHideAppCallback(app::CommandHandler * comm
471471
// -----------------------------------------------------------------------------
472472
// Plugin initialization
473473

474-
void MatterApplicationLauncherPluginServerInitCallback(void)
474+
void MatterApplicationLauncherPluginServerInitCallback()
475475
{
476476
registerAttributeAccessOverride(&gApplicationLauncherAttrAccess);
477477
}

src/app/clusters/content-launch-server/content-launch-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ bool emberAfContentLauncherClusterLaunchURLCallback(CommandHandler * commandObj,
265265
// -----------------------------------------------------------------------------
266266
// Plugin initialization
267267

268-
void MatterContentLauncherPluginServerInitCallback(void)
268+
void MatterContentLauncherPluginServerInitCallback()
269269
{
270270
registerAttributeAccessOverride(&gContentLauncherAttrAccess);
271271
}

src/app/clusters/descriptor/descriptor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ CHIP_ERROR DescriptorAttrAccess::Read(const ConcreteReadAttributePath & aPath, A
184184
}
185185
} // anonymous namespace
186186

187-
void MatterDescriptorPluginServerInitCallback(void)
187+
void MatterDescriptorPluginServerInitCallback()
188188
{
189189
registerAttributeAccessOverride(&gAttrAccess);
190190
}

src/app/clusters/fixed-label-server/fixed-label-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ CHIP_ERROR FixedLabelAttrAccess::Read(const ConcreteReadAttributePath & aPath, A
108108
}
109109
} // anonymous namespace
110110

111-
void MatterFixedLabelPluginServerInitCallback(void)
111+
void MatterFixedLabelPluginServerInitCallback()
112112
{
113113
registerAttributeAccessOverride(&gAttrAccess);
114114
}

src/app/clusters/localization-configuration-server/localization-configuration-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ void emberAfLocalizationConfigurationClusterServerInitCallback(EndpointId endpoi
215215
}
216216
}
217217

218-
void MatterLocalizationConfigurationPluginServerInitCallback(void)
218+
void MatterLocalizationConfigurationPluginServerInitCallback()
219219
{
220220
registerAttributeAccessOverride(&gAttrAccess);
221221
}

src/app/clusters/mode-select-server/mode-select-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ inline bool areStartUpModeAndCurrentModeNonVolatile(EndpointId endpointId)
215215

216216
} // namespace
217217

218-
void MatterModeSelectPluginServerInitCallback(void)
218+
void MatterModeSelectPluginServerInitCallback()
219219
{
220220
registerAttributeAccessOverride(&gModeSelectAttrAccess);
221221
}

src/app/clusters/on-off-server/on-off-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ bool OnOffServer::OnWithRecallGlobalSceneCommand(app::CommandHandler * commandOb
433433
return true;
434434
}
435435

436-
uint32_t OnOffServer::calculateNextWaitTimeMS(void)
436+
uint32_t OnOffServer::calculateNextWaitTimeMS()
437437
{
438438
const chip::System::Clock::Timestamp currentTime = chip::System::SystemClock().GetMonotonicTimestamp();
439439
chip::System::Clock::Timestamp waitTime = UPDATE_TIME_MS;

src/app/clusters/operational-credentials-server/operational-credentials-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class OpCredsFabricTableDelegate : public chip::FabricTable::Delegate
395395

396396
OpCredsFabricTableDelegate gFabricDelegate;
397397

398-
void MatterOperationalCredentialsPluginServerInitCallback(void)
398+
void MatterOperationalCredentialsPluginServerInitCallback()
399399
{
400400
registerAttributeAccessOverride(&gAttrAccess);
401401

src/app/clusters/ota-requestor/DefaultOTARequestorDriver.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void DefaultOTARequestorDriver::StopPeriodicQueryTimer()
388388
CancelDelayedAction(PeriodicQueryTimerHandler, this);
389389
}
390390

391-
void DefaultOTARequestorDriver::RekickPeriodicQueryTimer(void)
391+
void DefaultOTARequestorDriver::RekickPeriodicQueryTimer()
392392
{
393393
ChipLogProgress(SoftwareUpdate, "Rekicking the Periodic Query timer");
394394
StopPeriodicQueryTimer();

src/app/clusters/ota-requestor/ota-requestor-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ bool emberAfOtaSoftwareUpdateRequestorClusterAnnounceOtaProviderCallback(
287287
// -----------------------------------------------------------------------------
288288
// Plugin initialization
289289

290-
void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(void)
290+
void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback()
291291
{
292292
registerAttributeAccessOverride(&gAttrAccess);
293293
}

src/app/clusters/power-source-configuration-server/power-source-configuration-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ CHIP_ERROR PowerSourceConfigurationAttrAccess::Read(const ConcreteReadAttributeP
9898

9999
} // anonymous namespace
100100

101-
void MatterPowerSourceConfigurationPluginServerInitCallback(void)
101+
void MatterPowerSourceConfigurationPluginServerInitCallback()
102102
{
103103
registerAttributeAccessOverride(&gAttrAccess);
104104
}

src/app/clusters/power-source-server/power-source-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ CHIP_ERROR PowerSourceAttrAccess::Read(const ConcreteReadAttributePath & aPath,
6464

6565
} // anonymous namespace
6666

67-
void MatterPowerSourcePluginServerInitCallback(void)
67+
void MatterPowerSourcePluginServerInitCallback()
6868
{
6969
registerAttributeAccessOverride(&gAttrAccess);
7070
}

src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ enum class RemoteSensorType : uint8_t
6060
kTemperatureSensor = 0x03,
6161
};
6262

63-
static RemoteSensorType detectRemoteSensorConnected(void)
63+
static RemoteSensorType detectRemoteSensorConnected()
6464
{
6565
// TODO: Detect the sensor types attached to the pump control cluster
6666
// this could be pressure, flow or temperature sensors.
@@ -462,7 +462,7 @@ void MatterPumpConfigurationAndControlClusterServerAttributeChangedCallback(cons
462462
}
463463
}
464464

465-
void MatterPumpConfigurationAndControlPluginServerInitCallback(void)
465+
void MatterPumpConfigurationAndControlPluginServerInitCallback()
466466
{
467467
emberAfDebugPrintln("Initialize PCC Plugin Server Cluster.");
468468

src/app/clusters/scenes/scenes.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ EmberAfStatus emberAfScenesClusterMakeInvalidCallback(EndpointId endpoint)
147147
ZCL_BOOLEAN_ATTRIBUTE_TYPE);
148148
}
149149

150-
void emAfPluginScenesServerPrintInfo(void)
150+
void emAfPluginScenesServerPrintInfo()
151151
{
152152
uint8_t i;
153153
EmberAfSceneTableEntry entry;

src/app/clusters/test-cluster-server/test-cluster-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ bool emberAfUnitTestingClusterTestSimpleOptionalArgumentRequestCallback(
995995
// -----------------------------------------------------------------------------
996996
// Plugin initialization
997997

998-
void MatterUnitTestingPluginServerInitCallback(void)
998+
void MatterUnitTestingPluginServerInitCallback()
999999
{
10001000
registerAttributeAccessOverride(&gAttrAccess);
10011001
}

src/app/clusters/thermostat-client/thermostat-client.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
using namespace chip;
2525

26-
void emberAfThermostatClusterClientInitCallback(void)
26+
void emberAfThermostatClusterClientInitCallback()
2727
{
2828
// TODO
2929
}

src/app/clusters/time-format-localization-server/time-format-localization-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void emberAfTimeFormatLocalizationClusterServerInitCallback(EndpointId endpoint)
220220
}
221221
}
222222

223-
void MatterTimeFormatLocalizationPluginServerInitCallback(void)
223+
void MatterTimeFormatLocalizationPluginServerInitCallback()
224224
{
225225
registerAttributeAccessOverride(&gAttrAccess);
226226
}

src/app/clusters/user-label-server/user-label-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class UserLabelFabricTableDelegate : public chip::FabricTable::Delegate
217217

218218
UserLabelFabricTableDelegate gUserLabelFabricDelegate;
219219

220-
void MatterUserLabelPluginServerInitCallback(void)
220+
void MatterUserLabelPluginServerInitCallback()
221221
{
222222
registerAttributeAccessOverride(&gAttrAccess);
223223
Server::GetInstance().GetFabricTable().AddFabricDelegate(&gUserLabelFabricDelegate);

src/app/tests/integration/MockEvents.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ size_t EventGenerator::GetNumStates()
4444
return mNumStates;
4545
}
4646

47-
LivenessEventGenerator::LivenessEventGenerator(void) : EventGenerator(10, 0) {}
47+
LivenessEventGenerator::LivenessEventGenerator() : EventGenerator(10, 0) {}
4848

49-
void LivenessEventGenerator::Generate(void)
49+
void LivenessEventGenerator::Generate()
5050
{
5151
// Scenario: monitoring liveness for two devices -- self and remote. Remote device goes offline and returns.
5252
switch (mState)
@@ -131,13 +131,13 @@ chip::EventNumber LivenessEventGenerator::LogLiveness(chip::NodeId aNodeId, chip
131131
return number;
132132
}
133133

134-
MockEventGenerator * MockEventGenerator::GetInstance(void)
134+
MockEventGenerator * MockEventGenerator::GetInstance()
135135
{
136136
static MockEventGeneratorImpl gMockEventGenerator;
137137
return &gMockEventGenerator;
138138
}
139139

140-
MockEventGeneratorImpl::MockEventGeneratorImpl(void) :
140+
MockEventGeneratorImpl::MockEventGeneratorImpl() :
141141
mpExchangeMgr(nullptr), mTimeBetweenEvents(0), mEventWraparound(false), mpEventGenerator(nullptr), mEventsLeft(0)
142142
{}
143143

src/app/tests/integration/common.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ chip::TestPersistentStorageDelegate gStorage;
4444
chip::PersistentStorageOperationalKeystore gOperationalKeystore;
4545
chip::Credentials::PersistentStorageOpCertStore gOpCertStore;
4646

47-
void InitializeChip(void)
47+
void InitializeChip()
4848
{
4949
CHIP_ERROR err = CHIP_NO_ERROR;
5050
chip::FabricTable::InitParams fabricTableInitParams;
@@ -84,7 +84,7 @@ void InitializeChip(void)
8484
}
8585
}
8686

87-
void ShutdownChip(void)
87+
void ShutdownChip()
8888
{
8989
gMessageCounterManager.Shutdown();
9090
gExchangeManager.Shutdown();

src/app/util/af-event.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct EmberEventData
3737
/** The control structure for the event. */
3838
EmberEventControl * control;
3939
/** The procedure to call when the event fires. */
40-
void (*handler)(void);
40+
void (*handler)();
4141
};
4242

4343
// *****************************************************************************

0 commit comments

Comments
 (0)