Skip to content

Commit 7ff132d

Browse files
committed
[ML] Standardise on not using explicit void argument lists (#34)
We've started mixing explicit void and empty argument lists. For C++ they are equivalent. If we needed C headers for any of our existing functionality we'd almost certainly have to provide a wrapper API anyway. Therefore, this change switches to empty argument lists on the grounds that it is less typing.
1 parent cd091bb commit 7ff132d

File tree

925 files changed

+6593
-6593
lines changed

Some content is hidden

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

925 files changed

+6593
-6593
lines changed

bin/controller/CBlockingCallCancellerThread.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ CBlockingCallCancellerThread::CBlockingCallCancellerThread(core::CThread::TThrea
2424
{
2525
}
2626

27-
void CBlockingCallCancellerThread::run(void)
27+
void CBlockingCallCancellerThread::run()
2828
{
2929
char c;
3030
while (m_MonitorStream >> c)
@@ -42,7 +42,7 @@ void CBlockingCallCancellerThread::run(void)
4242
}
4343
}
4444

45-
void CBlockingCallCancellerThread::shutdown(void)
45+
void CBlockingCallCancellerThread::shutdown()
4646
{
4747
m_Shutdown = true;
4848

bin/controller/CBlockingCallCancellerThread.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class CBlockingCallCancellerThread : public core::CThread
4444

4545
protected:
4646
//! Called when the thread is started.
47-
virtual void run(void);
47+
virtual void run();
4848

4949
//! Called when the thread is stopped.
50-
virtual void shutdown(void);
50+
virtual void shutdown();
5151

5252
private:
5353
//! Thread ID of the thread that this object will cancel blocking IO in

bin/controller/unittest/CBlockingCallCancellerThreadTest.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ class CEofThread : public ml::core::CThread
2727
}
2828

2929
protected:
30-
virtual void run(void)
30+
virtual void run()
3131
{
3232
ml::core::CSleep::sleep(200);
3333

3434
m_Buf.signalEndOfFile();
3535
}
3636

37-
virtual void shutdown(void)
37+
virtual void shutdown()
3838
{
3939
}
4040

@@ -55,7 +55,7 @@ CppUnit::Test *CBlockingCallCancellerThreadTest::suite()
5555
return suiteOfTests;
5656
}
5757

58-
void CBlockingCallCancellerThreadTest::testCancelBlock(void)
58+
void CBlockingCallCancellerThreadTest::testCancelBlock()
5959
{
6060
ml::core::CDualThreadStreamBuf buf;
6161
std::istream monStrm(&buf);

bin/controller/unittest/CBlockingCallCancellerThreadTest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class CBlockingCallCancellerThreadTest : public CppUnit::TestFixture
1212
{
1313
public:
14-
void testCancelBlock(void);
14+
void testCancelBlock();
1515

1616
static CppUnit::Test *suite();
1717
};

bin/controller/unittest/CCommandProcessorTest.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ CppUnit::Test *CCommandProcessorTest::suite()
6868
return suiteOfTests;
6969
}
7070

71-
void CCommandProcessorTest::testStartPermitted(void)
71+
void CCommandProcessorTest::testStartPermitted()
7272
{
7373
// Remove any output file left behind by a previous failed test, but don't
7474
// check the return code as this will usually fail
@@ -103,7 +103,7 @@ void CCommandProcessorTest::testStartPermitted(void)
103103
CPPUNIT_ASSERT_EQUAL(0, ::remove(OUTPUT_FILE.c_str()));
104104
}
105105

106-
void CCommandProcessorTest::testStartNonPermitted(void)
106+
void CCommandProcessorTest::testStartNonPermitted()
107107
{
108108
ml::controller::CCommandProcessor::TStrVec permittedPaths(1, "some other process");
109109
ml::controller::CCommandProcessor processor(permittedPaths);
@@ -132,7 +132,7 @@ void CCommandProcessorTest::testStartNonPermitted(void)
132132
CPPUNIT_ASSERT_EQUAL(SLOGAN2, content);
133133
}
134134

135-
void CCommandProcessorTest::testStartNonExistent(void)
135+
void CCommandProcessorTest::testStartNonExistent()
136136
{
137137
ml::controller::CCommandProcessor::TStrVec permittedPaths(1, "some other process");
138138
ml::controller::CCommandProcessor processor(permittedPaths);
@@ -143,7 +143,7 @@ void CCommandProcessorTest::testStartNonExistent(void)
143143
CPPUNIT_ASSERT(!processor.handleCommand(command));
144144
}
145145

146-
void CCommandProcessorTest::testKillDisallowed(void)
146+
void CCommandProcessorTest::testKillDisallowed()
147147
{
148148
// Attempt to kill a process that exists but isn't allowed to be killed,
149149
// namely the unit test program
@@ -158,7 +158,7 @@ void CCommandProcessorTest::testKillDisallowed(void)
158158
CPPUNIT_ASSERT(!processor.handleCommand(command));
159159
}
160160

161-
void CCommandProcessorTest::testInvalidVerb(void)
161+
void CCommandProcessorTest::testInvalidVerb()
162162
{
163163
ml::controller::CCommandProcessor::TStrVec permittedPaths(1, "some other process");
164164
ml::controller::CCommandProcessor processor(permittedPaths);

bin/controller/unittest/CCommandProcessorTest.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
class CCommandProcessorTest : public CppUnit::TestFixture
1212
{
1313
public:
14-
void testStartPermitted(void);
15-
void testStartNonPermitted(void);
16-
void testStartNonExistent(void);
17-
void testKillDisallowed(void);
18-
void testInvalidVerb(void);
14+
void testStartPermitted();
15+
void testStartNonPermitted();
16+
void testStartNonExistent();
17+
void testKillDisallowed();
18+
void testInvalidVerb();
1919

2020
static CppUnit::Test *suite();
2121
};

include/api/CAnomalyJob.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,20 @@ class API_EXPORT CAnomalyJob : public CDataProcessor
171171
const std::string &timeFieldFormat = EMPTY_STRING,
172172
size_t maxAnomalyRecords = 0u);
173173

174-
virtual ~CAnomalyJob(void);
174+
virtual ~CAnomalyJob();
175175

176176
//! We're going to be writing to a new output stream
177-
virtual void newOutputStream(void);
177+
virtual void newOutputStream();
178178

179179
//! Access the output handler
180-
virtual COutputHandler &outputHandler(void);
180+
virtual COutputHandler &outputHandler();
181181

182182
//! Receive a single record to be processed, and produce output
183183
//! with any required modifications
184184
virtual bool handleRecord(const TStrStrUMap &dataRowFields);
185185

186186
//! Perform any final processing once all input data has been seen.
187-
virtual void finalise(void);
187+
virtual void finalise();
188188

189189
//! Restore previously saved state
190190
virtual bool restoreState(core::CDataSearcher &restoreSearcher,
@@ -197,13 +197,13 @@ class API_EXPORT CAnomalyJob : public CDataProcessor
197197
virtual bool initNormalizer(const std::string &quantilesStateFile);
198198

199199
//! How many records did we handle?
200-
virtual uint64_t numRecordsHandled(void) const;
200+
virtual uint64_t numRecordsHandled() const;
201201

202202
//! Log a list of the detectors and keys
203-
void description(void) const;
203+
void description() const;
204204

205205
//! Log a list of the detectors, keys and their memory usage
206-
void descriptionAndDebugMemoryUsage(void) const;
206+
void descriptionAndDebugMemoryUsage() const;
207207

208208
//! Extra information on the success/failure of restoring the model state.
209209
//! In certain situations such as no data being loaded from the restorer
@@ -311,7 +311,7 @@ class API_EXPORT CAnomalyJob : public CDataProcessor
311311

312312
//! Get the bucketLength, or half the bucketLength if
313313
//! out-of-phase buckets are active
314-
core_t::TTime effectiveBucketLength(void) const;
314+
core_t::TTime effectiveBucketLength() const;
315315

316316
//! Update configuration
317317
void updateConfig(const std::string &config);
@@ -363,7 +363,7 @@ class API_EXPORT CAnomalyJob : public CDataProcessor
363363

364364
//! Iterate over the models, refresh their memory status, and send a report
365365
//! to the API
366-
void refreshMemoryAndReport(void);
366+
void refreshMemoryAndReport();
367367

368368
//! Update configuration
369369
void doForecast(const std::string &controlMessage);
@@ -409,7 +409,7 @@ class API_EXPORT CAnomalyJob : public CDataProcessor
409409
model::CResourceMonitor &resourceMonitor);
410410

411411
//! Prune all the models
412-
void pruneAllModels(void);
412+
void pruneAllModels();
413413

414414
private:
415415
//! The job ID

include/api/CBackgroundPersister.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ class API_EXPORT CBackgroundPersister : private core::CNonCopyable
8181
const TFirstProcessorPeriodicPersistFunc &firstProcessorPeriodicPersistFunc,
8282
core::CDataAdder &dataAdder);
8383

84-
~CBackgroundPersister(void);
84+
~CBackgroundPersister();
8585

8686
//! Is background persistence currently in progress?
87-
bool isBusy(void) const;
87+
bool isBusy() const;
8888

8989
//! Wait for any background persistence currently in progress to
9090
//! complete
91-
bool waitForIdle(void);
91+
bool waitForIdle();
9292

9393
//! Add a function to be called when the background persist is started.
9494
//! This will be rejected if a background persistence is currently in
@@ -108,13 +108,13 @@ class API_EXPORT CBackgroundPersister : private core::CNonCopyable
108108
//! Start a background persist is one is not running.
109109
//! Calls the first processor periodic persist function first.
110110
//! Concurrent calls to this method are not threadsafe.
111-
bool startBackgroundPersist(void);
111+
bool startBackgroundPersist();
112112

113113
//! If the periodic persist interval has passed since the last persist
114114
//! then it is appropriate to persist now. Start it by calling the
115115
//! first processor periodic persist function.
116116
//! Concurrent calls to this method are not threadsafe.
117-
bool startBackgroundPersistIfAppropriate(void);
117+
bool startBackgroundPersistIfAppropriate();
118118

119119
private:
120120
//! Implementation of the background thread
@@ -125,8 +125,8 @@ class API_EXPORT CBackgroundPersister : private core::CNonCopyable
125125

126126
protected:
127127
//! Inherited virtual interface
128-
virtual void run(void);
129-
virtual void shutdown(void);
128+
virtual void run();
129+
virtual void shutdown();
130130

131131
private:
132132
//! Reference to the owning background persister
@@ -140,13 +140,13 @@ class API_EXPORT CBackgroundPersister : private core::CNonCopyable
140140

141141
//! When this function is called a background persistence will be
142142
//! triggered unless there is already one in progress.
143-
bool startPersist(void);
143+
bool startPersist();
144144

145145
//! Clear any persistence functions that have been added but not yet
146146
//! invoked. This will be rejected if a background persistence is
147147
//! currently in progress.
148148
//! \return true if the list of functions is clear; false if not.
149-
bool clear(void);
149+
bool clear();
150150

151151
private:
152152
//! How frequently should background persistence be attempted?

include/api/CBaseTokenListDataTyper.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class API_EXPORT CBaseTokenListDataTyper : public CDataTyper
105105
const std::string &fieldName);
106106

107107
//! Dump stats
108-
virtual void dumpStats(void) const;
108+
virtual void dumpStats() const;
109109

110110
//! Compute a type from a string. The raw string length may be longer
111111
//! than the length of the passed string, because the passed string may
@@ -130,7 +130,7 @@ class API_EXPORT CBaseTokenListDataTyper : public CDataTyper
130130
bool &wasCached);
131131

132132
//! Has the data typer's state changed?
133-
virtual bool hasChanged(void) const;
133+
virtual bool hasChanged() const;
134134

135135
//! Populate the object from part of a state document
136136
virtual bool acceptRestoreTraverser(core::CStateRestoreTraverser &traverser);
@@ -139,7 +139,7 @@ class API_EXPORT CBaseTokenListDataTyper : public CDataTyper
139139
virtual void acceptPersistInserter(core::CStatePersistInserter &inserter) const;
140140

141141
//! Make a function that can be called later to persist state
142-
virtual TPersistFunc makePersistFunc(void) const;
142+
virtual TPersistFunc makePersistFunc() const;
143143

144144
protected:
145145
//! Split the string into a list of tokens. The result of the
@@ -202,13 +202,13 @@ class API_EXPORT CBaseTokenListDataTyper : public CDataTyper
202202
size_t index);
203203

204204
//! Accessors
205-
const std::string &str(void) const;
206-
size_t index(void) const;
207-
size_t typeCount(void) const;
205+
const std::string &str() const;
206+
size_t index() const;
207+
size_t typeCount() const;
208208
void typeCount(size_t typeCount);
209209

210210
//! Increment the type count
211-
void incTypeCount(void);
211+
void incTypeCount();
212212

213213
private:
214214
//! String value of the token

include/api/CBenchMarker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class API_EXPORT CBenchMarker
5656
using TRegexIntSizeStrPrMapPrVecCItr = TRegexIntSizeStrPrMapPrVec::const_iterator;
5757

5858
public:
59-
CBenchMarker(void);
59+
CBenchMarker();
6060

6161
//! Initialise from a file
6262
bool init(const std::string &regexFilename);
@@ -65,7 +65,7 @@ class API_EXPORT CBenchMarker
6565
void addResult(const std::string &message,
6666
int type);
6767

68-
void dumpResults(void) const;
68+
void dumpResults() const;
6969

7070
private:
7171
//! Number of messages passed to the benchmarker

0 commit comments

Comments
 (0)