summaryrefslogtreecommitdiffstats
path: root/include/ingen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-05-12 09:58:30 -0400
committerDavid Robillard <d@drobilla.net>2023-05-12 09:58:30 -0400
commitc076e93136799096da613950eb14e7d5fbe9375a (patch)
tree5f681c9bf3982a01611cd032863d68612fd52174 /include/ingen
parent21d99ff04daafae8fbd03f612c1b8ee070d0d950 (diff)
downloadingen-c076e93136799096da613950eb14e7d5fbe9375a.tar.gz
ingen-c076e93136799096da613950eb14e7d5fbe9375a.tar.bz2
ingen-c076e93136799096da613950eb14e7d5fbe9375a.zip
Fix const correctness
Diffstat (limited to 'include/ingen')
-rw-r--r--include/ingen/QueuedInterface.hpp4
-rw-r--r--include/ingen/Tee.hpp2
-rw-r--r--include/ingen/client/SocketClient.hpp2
-rw-r--r--include/ingen/fmt.hpp8
4 files changed, 9 insertions, 7 deletions
diff --git a/include/ingen/QueuedInterface.hpp b/include/ingen/QueuedInterface.hpp
index fc3e539c..4bb6baea 100644
--- a/include/ingen/QueuedInterface.hpp
+++ b/include/ingen/QueuedInterface.hpp
@@ -42,14 +42,14 @@ public:
URI uri() const override { return URI("ingen:/QueuedInterface"); }
void message(const Message& message) override {
- std::lock_guard<std::mutex> lock(_mutex);
+ const std::lock_guard<std::mutex> lock{_mutex};
_messages.emplace_back(message);
}
void emit() {
std::vector<Message> messages;
{
- std::lock_guard<std::mutex> lock(_mutex);
+ const std::lock_guard<std::mutex> lock{_mutex};
_messages.swap(messages);
}
diff --git a/include/ingen/Tee.hpp b/include/ingen/Tee.hpp
index 2158190f..562ff298 100644
--- a/include/ingen/Tee.hpp
+++ b/include/ingen/Tee.hpp
@@ -46,7 +46,7 @@ public:
}
void message(const Message& message) override {
- std::lock_guard<std::mutex> lock(_sinks_mutex);
+ const std::lock_guard<std::mutex> lock{_sinks_mutex};
for (const auto& s : _sinks) {
s->message(message);
}
diff --git a/include/ingen/client/SocketClient.hpp b/include/ingen/client/SocketClient.hpp
index 3dc00d6f..7434da90 100644
--- a/include/ingen/client/SocketClient.hpp
+++ b/include/ingen/client/SocketClient.hpp
@@ -66,7 +66,7 @@ public:
? raul::Socket::Type::UNIX
: raul::Socket::Type::TCP);
- std::shared_ptr<raul::Socket> sock(new raul::Socket(type));
+ const std::shared_ptr<raul::Socket> sock{new raul::Socket(type)};
if (!sock->connect(uri)) {
world.log().error("Failed to connect <%1%> (%2%)\n",
sock->uri(), strerror(errno));
diff --git a/include/ingen/fmt.hpp b/include/ingen/fmt.hpp
index b2924d29..7ca5de9f 100644
--- a/include/ingen/fmt.hpp
+++ b/include/ingen/fmt.hpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2016 David Robillard <http://drobilla.net/>
+ Copyright 2007-2023 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -27,8 +27,10 @@ template <typename... Args>
std::string
fmt(const char* fmt, Args&&... args)
{
- boost::format f(fmt);
- std::initializer_list<char> l{(static_cast<void>(f % args), char{})...};
+ boost::format f{fmt}; // NOLINT(misc-const-correctness)
+ const std::initializer_list<char> l{
+ (static_cast<void>(f % args), char{})...};
+
(void)l;
return boost::str(f);
}