Skip to content

Commit d4e4cca

Browse files
authored
[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 29a3567 commit d4e4cca

File tree

927 files changed

+6595
-6595
lines changed

Some content is hidden

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

927 files changed

+6595
-6595
lines changed

bin/controller/CBlockingCallCancellerThread.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ CBlockingCallCancellerThread::CBlockingCallCancellerThread(core::CThread::TThrea
3333
{
3434
}
3535

36-
void CBlockingCallCancellerThread::run(void)
36+
void CBlockingCallCancellerThread::run()
3737
{
3838
char c;
3939
while (m_MonitorStream >> c)
@@ -51,7 +51,7 @@ void CBlockingCallCancellerThread::run(void)
5151
}
5252
}
5353

54-
void CBlockingCallCancellerThread::shutdown(void)
54+
void CBlockingCallCancellerThread::shutdown()
5555
{
5656
m_Shutdown = true;
5757

bin/controller/CBlockingCallCancellerThread.h

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

5454
protected:
5555
//! Called when the thread is started.
56-
virtual void run(void);
56+
virtual void run();
5757

5858
//! Called when the thread is stopped.
59-
virtual void shutdown(void);
59+
virtual void shutdown();
6060

6161
private:
6262
//! 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
@@ -36,14 +36,14 @@ class CEofThread : public ml::core::CThread
3636
}
3737

3838
protected:
39-
virtual void run(void)
39+
virtual void run()
4040
{
4141
ml::core::CSleep::sleep(200);
4242

4343
m_Buf.signalEndOfFile();
4444
}
4545

46-
virtual void shutdown(void)
46+
virtual void shutdown()
4747
{
4848
}
4949

@@ -64,7 +64,7 @@ CppUnit::Test *CBlockingCallCancellerThreadTest::suite()
6464
return suiteOfTests;
6565
}
6666

67-
void CBlockingCallCancellerThreadTest::testCancelBlock(void)
67+
void CBlockingCallCancellerThreadTest::testCancelBlock()
6868
{
6969
ml::core::CDualThreadStreamBuf buf;
7070
std::istream monStrm(&buf);

bin/controller/unittest/CBlockingCallCancellerThreadTest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class CBlockingCallCancellerThreadTest : public CppUnit::TestFixture
2121
{
2222
public:
23-
void testCancelBlock(void);
23+
void testCancelBlock();
2424

2525
static CppUnit::Test *suite();
2626
};

bin/controller/unittest/CCommandProcessorTest.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ CppUnit::Test *CCommandProcessorTest::suite()
7777
return suiteOfTests;
7878
}
7979

80-
void CCommandProcessorTest::testStartPermitted(void)
80+
void CCommandProcessorTest::testStartPermitted()
8181
{
8282
// Remove any output file left behind by a previous failed test, but don't
8383
// check the return code as this will usually fail
@@ -112,7 +112,7 @@ void CCommandProcessorTest::testStartPermitted(void)
112112
CPPUNIT_ASSERT_EQUAL(0, ::remove(OUTPUT_FILE.c_str()));
113113
}
114114

115-
void CCommandProcessorTest::testStartNonPermitted(void)
115+
void CCommandProcessorTest::testStartNonPermitted()
116116
{
117117
ml::controller::CCommandProcessor::TStrVec permittedPaths(1, "some other process");
118118
ml::controller::CCommandProcessor processor(permittedPaths);
@@ -141,7 +141,7 @@ void CCommandProcessorTest::testStartNonPermitted(void)
141141
CPPUNIT_ASSERT_EQUAL(SLOGAN2, content);
142142
}
143143

144-
void CCommandProcessorTest::testStartNonExistent(void)
144+
void CCommandProcessorTest::testStartNonExistent()
145145
{
146146
ml::controller::CCommandProcessor::TStrVec permittedPaths(1, "some other process");
147147
ml::controller::CCommandProcessor processor(permittedPaths);
@@ -152,7 +152,7 @@ void CCommandProcessorTest::testStartNonExistent(void)
152152
CPPUNIT_ASSERT(!processor.handleCommand(command));
153153
}
154154

155-
void CCommandProcessorTest::testKillDisallowed(void)
155+
void CCommandProcessorTest::testKillDisallowed()
156156
{
157157
// Attempt to kill a process that exists but isn't allowed to be killed,
158158
// namely the unit test program
@@ -167,7 +167,7 @@ void CCommandProcessorTest::testKillDisallowed(void)
167167
CPPUNIT_ASSERT(!processor.handleCommand(command));
168168
}
169169

170-
void CCommandProcessorTest::testInvalidVerb(void)
170+
void CCommandProcessorTest::testInvalidVerb()
171171
{
172172
ml::controller::CCommandProcessor::TStrVec permittedPaths(1, "some other process");
173173
ml::controller::CCommandProcessor processor(permittedPaths);

bin/controller/unittest/CCommandProcessorTest.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
class CCommandProcessorTest : public CppUnit::TestFixture
2121
{
2222
public:
23-
void testStartPermitted(void);
24-
void testStartNonPermitted(void);
25-
void testStartNonExistent(void);
26-
void testKillDisallowed(void);
27-
void testInvalidVerb(void);
23+
void testStartPermitted();
24+
void testStartNonPermitted();
25+
void testStartNonExistent();
26+
void testKillDisallowed();
27+
void testInvalidVerb();
2828

2929
static CppUnit::Test *suite();
3030
};

include/api/CAnomalyJob.h

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

183-
virtual ~CAnomalyJob(void);
183+
virtual ~CAnomalyJob();
184184

185185
//! We're going to be writing to a new output stream
186-
virtual void newOutputStream(void);
186+
virtual void newOutputStream();
187187

188188
//! Access the output handler
189-
virtual COutputHandler &outputHandler(void);
189+
virtual COutputHandler &outputHandler();
190190

191191
//! Receive a single record to be processed, and produce output
192192
//! with any required modifications
193193
virtual bool handleRecord(const TStrStrUMap &dataRowFields);
194194

195195
//! Perform any final processing once all input data has been seen.
196-
virtual void finalise(void);
196+
virtual void finalise();
197197

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

208208
//! How many records did we handle?
209-
virtual uint64_t numRecordsHandled(void) const;
209+
virtual uint64_t numRecordsHandled() const;
210210

211211
//! Log a list of the detectors and keys
212-
void description(void) const;
212+
void description() const;
213213

214214
//! Log a list of the detectors, keys and their memory usage
215-
void descriptionAndDebugMemoryUsage(void) const;
215+
void descriptionAndDebugMemoryUsage() const;
216216

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

321321
//! Get the bucketLength, or half the bucketLength if
322322
//! out-of-phase buckets are active
323-
core_t::TTime effectiveBucketLength(void) const;
323+
core_t::TTime effectiveBucketLength() const;
324324

325325
//! Update configuration
326326
void updateConfig(const std::string &config);
@@ -372,7 +372,7 @@ class API_EXPORT CAnomalyJob : public CDataProcessor
372372

373373
//! Iterate over the models, refresh their memory status, and send a report
374374
//! to the API
375-
void refreshMemoryAndReport(void);
375+
void refreshMemoryAndReport();
376376

377377
//! Update configuration
378378
void doForecast(const std::string &controlMessage);
@@ -418,7 +418,7 @@ class API_EXPORT CAnomalyJob : public CDataProcessor
418418
model::CResourceMonitor &resourceMonitor);
419419

420420
//! Prune all the models
421-
void pruneAllModels(void);
421+
void pruneAllModels();
422422

423423
private:
424424
//! The job ID

include/api/CBackgroundPersister.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ class API_EXPORT CBackgroundPersister : private core::CNonCopyable
9090
const TFirstProcessorPeriodicPersistFunc &firstProcessorPeriodicPersistFunc,
9191
core::CDataAdder &dataAdder);
9292

93-
~CBackgroundPersister(void);
93+
~CBackgroundPersister();
9494

9595
//! Is background persistence currently in progress?
96-
bool isBusy(void) const;
96+
bool isBusy() const;
9797

9898
//! Wait for any background persistence currently in progress to
9999
//! complete
100-
bool waitForIdle(void);
100+
bool waitForIdle();
101101

102102
//! Add a function to be called when the background persist is started.
103103
//! This will be rejected if a background persistence is currently in
@@ -117,13 +117,13 @@ class API_EXPORT CBackgroundPersister : private core::CNonCopyable
117117
//! Start a background persist is one is not running.
118118
//! Calls the first processor periodic persist function first.
119119
//! Concurrent calls to this method are not threadsafe.
120-
bool startBackgroundPersist(void);
120+
bool startBackgroundPersist();
121121

122122
//! If the periodic persist interval has passed since the last persist
123123
//! then it is appropriate to persist now. Start it by calling the
124124
//! first processor periodic persist function.
125125
//! Concurrent calls to this method are not threadsafe.
126-
bool startBackgroundPersistIfAppropriate(void);
126+
bool startBackgroundPersistIfAppropriate();
127127

128128
private:
129129
//! Implementation of the background thread
@@ -134,8 +134,8 @@ class API_EXPORT CBackgroundPersister : private core::CNonCopyable
134134

135135
protected:
136136
//! Inherited virtual interface
137-
virtual void run(void);
138-
virtual void shutdown(void);
137+
virtual void run();
138+
virtual void shutdown();
139139

140140
private:
141141
//! Reference to the owning background persister
@@ -149,13 +149,13 @@ class API_EXPORT CBackgroundPersister : private core::CNonCopyable
149149

150150
//! When this function is called a background persistence will be
151151
//! triggered unless there is already one in progress.
152-
bool startPersist(void);
152+
bool startPersist();
153153

154154
//! Clear any persistence functions that have been added but not yet
155155
//! invoked. This will be rejected if a background persistence is
156156
//! currently in progress.
157157
//! \return true if the list of functions is clear; false if not.
158-
bool clear(void);
158+
bool clear();
159159

160160
private:
161161
//! 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
@@ -114,7 +114,7 @@ class API_EXPORT CBaseTokenListDataTyper : public CDataTyper
114114
const std::string &fieldName);
115115

116116
//! Dump stats
117-
virtual void dumpStats(void) const;
117+
virtual void dumpStats() const;
118118

119119
//! Compute a type from a string. The raw string length may be longer
120120
//! than the length of the passed string, because the passed string may
@@ -139,7 +139,7 @@ class API_EXPORT CBaseTokenListDataTyper : public CDataTyper
139139
bool &wasCached);
140140

141141
//! Has the data typer's state changed?
142-
virtual bool hasChanged(void) const;
142+
virtual bool hasChanged() const;
143143

144144
//! Populate the object from part of a state document
145145
virtual bool acceptRestoreTraverser(core::CStateRestoreTraverser &traverser);
@@ -148,7 +148,7 @@ class API_EXPORT CBaseTokenListDataTyper : public CDataTyper
148148
virtual void acceptPersistInserter(core::CStatePersistInserter &inserter) const;
149149

150150
//! Make a function that can be called later to persist state
151-
virtual TPersistFunc makePersistFunc(void) const;
151+
virtual TPersistFunc makePersistFunc() const;
152152

153153
protected:
154154
//! Split the string into a list of tokens. The result of the
@@ -211,13 +211,13 @@ class API_EXPORT CBaseTokenListDataTyper : public CDataTyper
211211
size_t index);
212212

213213
//! Accessors
214-
const std::string &str(void) const;
215-
size_t index(void) const;
216-
size_t typeCount(void) const;
214+
const std::string &str() const;
215+
size_t index() const;
216+
size_t typeCount() const;
217217
void typeCount(size_t typeCount);
218218

219219
//! Increment the type count
220-
void incTypeCount(void);
220+
void incTypeCount();
221221

222222
private:
223223
//! String value of the token

include/api/CBenchMarker.h

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

6767
public:
68-
CBenchMarker(void);
68+
CBenchMarker();
6969

7070
//! Initialise from a file
7171
bool init(const std::string &regexFilename);
@@ -74,7 +74,7 @@ class API_EXPORT CBenchMarker
7474
void addResult(const std::string &message,
7575
int type);
7676

77-
void dumpResults(void) const;
77+
void dumpResults() const;
7878

7979
private:
8080
//! Number of messages passed to the benchmarker

include/api/CCategoryExamplesCollector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class API_EXPORT CCategoryExamplesCollector
7070
bool acceptRestoreTraverser(core::CStateRestoreTraverser &traverser);
7171

7272
//! Clear all examples
73-
void clear(void);
73+
void clear();
7474

7575
private:
7676
using TSizeStrSetUMap = boost::unordered_map<std::size_t, TStrSet>;

include/api/CCmdSkeleton.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class API_EXPORT CCmdSkeleton : private core::CNonCopyable
5454
CDataProcessor &processor);
5555

5656
//! Pass input to the processor until it's consumed as much as it can.
57-
bool ioLoop(void);
57+
bool ioLoop();
5858

5959
private:
6060
//! Persists the state of the models
61-
bool persistState(void);
61+
bool persistState();
6262

6363
private:
6464
//! NULL if state restoration is not required.

include/api/CCsvInputParser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class API_EXPORT CCsvInputParser : public CInputParser
153153
char separator = COMMA);
154154

155155
//! Get field name row exactly as it was in the input
156-
const std::string &fieldNameStr(void) const;
156+
const std::string &fieldNameStr() const;
157157

158158
//! Read records from the stream. The supplied reader function is called
159159
//! once per record. If the supplied reader function returns false,
@@ -165,10 +165,10 @@ class API_EXPORT CCsvInputParser : public CInputParser
165165
private:
166166
//! Attempt to parse a single CSV record from the stream into the
167167
//! working record. The CSV is assumed to be in the Excel style.
168-
bool parseCsvRecordFromStream(void);
168+
bool parseCsvRecordFromStream();
169169

170170
//! Attempt to parse the field names from the working record.
171-
bool parseFieldNames(void);
171+
bool parseFieldNames();
172172

173173
//! Attempt to parse the current working record into data fields.
174174
bool parseDataRecord(const TStrRefVec &fieldValRefs);

include/api/CCsvOutputWriter.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ class API_EXPORT CCsvOutputWriter : public COutputHandler
8181
char separator = COMMA);
8282

8383
//! Destructor flushes the stream
84-
virtual ~CCsvOutputWriter(void);
84+
virtual ~CCsvOutputWriter();
8585

8686
//! Set field names, adding extra field names if they're not already
8787
//! present - this is only allowed once
8888
virtual bool fieldNames(const TStrVec &fieldNames,
8989
const TStrVec &extraFieldNames);
9090

9191
//! Get field names
92-
virtual const TStrVec &fieldNames(void) const;
92+
virtual const TStrVec &fieldNames() const;
9393

9494
// Bring the other overload of fieldNames() into scope
9595
using COutputHandler::fieldNames;
@@ -106,11 +106,11 @@ class API_EXPORT CCsvOutputWriter : public COutputHandler
106106

107107
//! Get the contents of the internal string stream - for use with the
108108
//! zero argument constructor
109-
std::string internalString(void) const;
109+
std::string internalString() const;
110110

111111
protected:
112112
//! Output stream accessor
113-
std::ostream &outputStream(void);
113+
std::ostream &outputStream();
114114

115115
private:
116116
//! Append a field to the work record, quoting it if required, and

0 commit comments

Comments
 (0)