Skip to content

Commit 0b00ba1

Browse files
Tidy-up C++ headers in demos (zeroc-ice#229)
1 parent 79e5102 commit 0b00ba1

File tree

27 files changed

+51
-54
lines changed

27 files changed

+51
-54
lines changed

.clang-tidy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ Checks:
55
cert-*,
66
modernize-*,
77
-modernize-avoid-c-arrays,
8+
-modernize-use-nodiscard,
89
-modernize-use-trailing-return-type,
910
performance-*,
1011
-performance-avoid-endl
1112
'
1213
WarningsAsErrors: '*'
13-
HeaderFilterRegex: ''
14+
HeaderFilterRegex: '.*'
15+
ExcludeHeaderFilterRegex: 'include/.*'
1416
UseColor: true
1517
FormatStyle: 'file'
1618
ExtraArgs: ['-std=c++17']

cpp/Ice/async/HelloI.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ class HelloI : public Demo::Hello
1212
{
1313
public:
1414
HelloI(const std::shared_ptr<WorkQueue>&);
15-
virtual void
16-
sayHelloAsync(int, std::function<void()>, std::function<void(std::exception_ptr)>, const Ice::Current&);
17-
virtual void shutdown(const Ice::Current&);
15+
void
16+
sayHelloAsync(int, std::function<void()>, std::function<void(std::exception_ptr)>, const Ice::Current&) override;
17+
void shutdown(const Ice::Current&) override;
1818

1919
private:
2020
std::shared_ptr<WorkQueue> _workQueue;

cpp/Ice/async/WorkQueue.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
using namespace std;
1010

11-
WorkQueue::WorkQueue() : _done(false) {}
12-
1311
void
1412
WorkQueue::start()
1513
{

cpp/Ice/async/WorkQueue.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
class WorkQueue
1616
{
1717
public:
18-
WorkQueue();
19-
2018
void run();
2119

2220
void add(int, std::function<void()>, std::function<void(std::exception_ptr)>);
@@ -31,7 +29,7 @@ class WorkQueue
3129
std::condition_variable _condition;
3230

3331
std::list<CallbackEntry> _callbacks;
34-
bool _done;
32+
bool _done{false};
3533
std::thread _thread;
3634
};
3735

cpp/Ice/asyncInvocation/CalculatorI.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
class CalculatorI : public Demo::Calculator
1111
{
1212
public:
13-
virtual int add(int, int, const Ice::Current&) override;
14-
virtual int subtract(int, int, const Ice::Current&) override;
15-
virtual int divide(int, int, int&, const Ice::Current&) override;
16-
virtual int square(int, const Ice::Current&) override;
17-
virtual double squareRoot(int, const Ice::Current&) override;
18-
virtual void shutdown(const Ice::Current&) override;
13+
int add(int, int, const Ice::Current&) override;
14+
int subtract(int, int, const Ice::Current&) override;
15+
int divide(int, int, int&, const Ice::Current&) override;
16+
int square(int, const Ice::Current&) override;
17+
double squareRoot(int, const Ice::Current&) override;
18+
void shutdown(const Ice::Current&) override;
1919
};
2020

2121
#endif

cpp/Ice/context/ContextI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
class ContextI : public Demo::Context
1111
{
1212
public:
13-
virtual void call(const Ice::Current&) override;
14-
virtual void shutdown(const Ice::Current&) override;
13+
void call(const Ice::Current&) override;
14+
void shutdown(const Ice::Current&) override;
1515
};
1616

1717
#endif

cpp/Ice/hello/HelloI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
class HelloI : public Demo::Hello
1111
{
1212
public:
13-
virtual void sayHello(int delay, const Ice::Current&) override;
14-
virtual void shutdown(const Ice::Current&) override;
13+
void sayHello(int delay, const Ice::Current&) override;
14+
void shutdown(const Ice::Current&) override;
1515
};
1616

1717
#endif

cpp/Ice/interceptor/AuthenticatorI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class AuthenticatorI : public Demo::Authenticator
1515
{
1616
public:
1717
AuthenticatorI();
18-
virtual std::string getToken(const Ice::Current&) override;
18+
std::string getToken(const Ice::Current&) override;
1919
void validateToken(const std::string&);
2020

2121
private:

cpp/Ice/interceptor/ThermostatI.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
class ThermostatI : public Demo::Thermostat
1212
{
1313
public:
14-
virtual float getTemp(const Ice::Current&) override;
15-
virtual void setTemp(float, const Ice::Current&) override;
16-
virtual void shutdown(const Ice::Current&) override;
14+
float getTemp(const Ice::Current&) override;
15+
void setTemp(float, const Ice::Current&) override;
16+
void shutdown(const Ice::Current&) override;
1717

1818
private:
1919
// Temperature in Celsius.

cpp/Ice/locator/HelloI.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
class HelloI : public Demo::Hello
1111
{
1212
public:
13-
virtual void sayHello(const Ice::Current&) override;
14-
virtual void shutdown(const Ice::Current&) override;
13+
void sayHello(const Ice::Current&) override;
14+
void shutdown(const Ice::Current&) override;
1515
};
1616

1717
#endif

0 commit comments

Comments
 (0)