Skip to content

Commit 9a1942a

Browse files
Fix many clang-tidy, clazy and cppcheck hints and warnings.
Signed-off-by: Volker Christian <me@vchrist.at>
1 parent 20dc444 commit 9a1942a

58 files changed

Lines changed: 89 additions & 83 deletions

Some content is hidden

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

src/apps/express_compat_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static void tracePush(const std::shared_ptr<express::Request>& req, const std::s
6363
static json traceGet(const std::shared_ptr<express::Request>& req) {
6464
json arr = json::array();
6565
req->getAttribute<Trace>(
66-
[&](Trace& t) {
66+
[&](const Trace& t) {
6767
for (auto const& e : t) {
6868
arr.push_back(e);
6969
}

src/apps/jsonclient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ int main(int argc, char* argv[]) {
6868
req->type("application/json");
6969
req->set("Connection", "close");
7070
req->send(
71-
"{\"userId\":1,\"schnitzel\":\"good\",\"hungry\":false}",
71+
R"({"userId":1,"schnitzel":"good","hungry":false})",
7272
[]([[maybe_unused]] const std::shared_ptr<Request>& req, const std::shared_ptr<Response>& res) {
7373
VLOG(1) << "-- OnResponse";
7474
VLOG(1) << " Status:";

src/core/DynamicLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ namespace core {
193193
return ret;
194194
}
195195

196-
int DynamicLoader::dlClose(Library& library) {
196+
int DynamicLoader::dlClose(const Library& library) {
197197
int ret = 0;
198198

199199
ret = realExecDlClose(library);

src/core/DynamicLoader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace core {
7777

7878
private:
7979
static std::string canonicalizePath(const std::string& libFile);
80-
static int dlClose(Library& library);
80+
static int dlClose(const Library& library);
8181

8282
static int realExecDlClose(const Library& library);
8383
static void execDlCloseDeleyed();

src/core/EventLoop.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ namespace core {
133133
return eventLoopState == State::INITIALIZED;
134134
}
135135

136-
TickStatus EventLoop::_tick(const utils::Timeval& tickTimeOut) {
136+
TickStatus EventLoop::_tick(const utils::Timeval& timeOut) {
137137
TickStatus tickStatus = TickStatus::SUCCESS;
138138

139139
tickCounter++;
@@ -148,7 +148,7 @@ namespace core {
148148
sigprocmask(SIG_BLOCK, &newSet, &oldSet);
149149

150150
if (eventLoopState == State::RUNNING || eventLoopState == State::STOPPING) {
151-
tickStatus = eventMultiplexer.tick(tickTimeOut, oldSet);
151+
tickStatus = eventMultiplexer.tick(timeOut, oldSet);
152152
}
153153

154154
sigprocmask(SIG_SETMASK, &oldSet, nullptr);

src/core/TimerEventPublisher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ namespace core {
9595
timerList.insert(timer);
9696
}
9797

98-
bool TimerEventPublisher::empty() {
98+
bool TimerEventPublisher::empty() const {
9999
return timerList.empty();
100100
}
101101

src/core/TimerEventPublisher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace core {
7171
void erase(TimerEventReceiver* timer);
7272
void insert(TimerEventReceiver* timer);
7373

74-
bool empty();
74+
bool empty() const;
7575

7676
void stop();
7777

src/core/multiplexer/poll/DescriptorEventPublisher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ namespace core::multiplexer::poll {
8787
}
8888

8989
void DescriptorEventPublisher::spanActiveEvents() {
90-
pollfd* pollfds = pollFds.getEvents();
90+
const pollfd* pollfds = pollFds.getEvents();
9191

9292
const PollFdsManager::pollfdindex_map& pollFdsIndices = pollFds.getPollFdIndices();
9393

src/core/pipe/Sink.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ namespace core::pipe {
5656
}
5757

5858
void Sink::pipe(Source* source) {
59-
if (source->isOpen())
59+
if (source->isOpen()) {
6060
this->source = source;
61+
}
6162

6263
onSourceConnect(source);
6364
}
6465

65-
bool Sink::isStreaming() {
66+
bool Sink::isStreaming() const {
6667
return source != nullptr;
6768
}
6869

src/core/pipe/Sink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace core::pipe {
7272
void pipe(Source* source);
7373

7474
protected:
75-
bool isStreaming();
75+
bool isStreaming() const;
7676
void stop();
7777

7878
private:

0 commit comments

Comments
 (0)