summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-18 01:18:34 -0400
committerDavid Robillard <d@drobilla.net>2022-08-18 01:18:34 -0400
commit9126ed67acf17bb2009430cb6de25b2ffd783d8e (patch)
tree235eb9e377333520e026f568f020889dd9bdc21d /src/server
parent86a914ed7bf5316cad6dcac5f69cc3b300b40a23 (diff)
downloadingen-9126ed67acf17bb2009430cb6de25b2ffd783d8e.tar.gz
ingen-9126ed67acf17bb2009430cb6de25b2ffd783d8e.tar.bz2
ingen-9126ed67acf17bb2009430cb6de25b2ffd783d8e.zip
Make empty methods and trivial constructors noexcept
Diffstat (limited to 'src/server')
-rw-r--r--src/server/ControlBindings.hpp8
-rw-r--r--src/server/Event.hpp5
-rw-r--r--src/server/EventWriter.hpp4
-rw-r--r--src/server/LV2Block.hpp2
-rw-r--r--src/server/PortImpl.hpp4
-rw-r--r--src/server/PortType.hpp2
-rw-r--r--src/server/PostProcessor.cpp2
-rw-r--r--src/server/UndoStack.cpp4
-rw-r--r--src/server/UndoStack.hpp7
-rw-r--r--src/server/Worker.hpp2
10 files changed, 25 insertions, 15 deletions
diff --git a/src/server/ControlBindings.hpp b/src/server/ControlBindings.hpp
index 1c231e22..e71befa1 100644
--- a/src/server/ControlBindings.hpp
+++ b/src/server/ControlBindings.hpp
@@ -64,15 +64,21 @@ public:
};
struct Key {
- Key(Type t=Type::NULL_CONTROL, int16_t n=0) : type(t), num(n) {}
+ Key(Type t = Type::NULL_CONTROL, int16_t n = 0) noexcept
+ : type(t), num(n)
+ {}
+
inline bool operator<(const Key& other) const {
return ((type < other.type) ||
(type == other.type && num < other.num));
}
+
inline bool operator==(const Key& other) const {
return type == other.type && num == other.num;
}
+
inline bool operator!() const { return type == Type::NULL_CONTROL; }
+
Type type;
int16_t num;
};
diff --git a/src/server/Event.hpp b/src/server/Event.hpp
index e00aa0d1..53d33e89 100644
--- a/src/server/Event.hpp
+++ b/src/server/Event.hpp
@@ -114,7 +114,10 @@ public:
inline Engine& engine() { return _engine; }
protected:
- Event(Engine& engine, std::shared_ptr<Interface> client, int32_t id, FrameTime time)
+ Event(Engine& engine,
+ std::shared_ptr<Interface> client,
+ int32_t id,
+ FrameTime time) noexcept
: _engine(engine)
, _next(nullptr)
, _request_client(std::move(client))
diff --git a/src/server/EventWriter.hpp b/src/server/EventWriter.hpp
index 184cefb7..437f65a5 100644
--- a/src/server/EventWriter.hpp
+++ b/src/server/EventWriter.hpp
@@ -62,12 +62,12 @@ public:
void operator()(const Delta&);
void operator()(const Disconnect&);
void operator()(const DisconnectAll&);
- void operator()(const Error&) {}
+ void operator()(const Error&) noexcept {}
void operator()(const Get&);
void operator()(const Move&);
void operator()(const Put&);
void operator()(const Redo&);
- void operator()(const Response&) {}
+ void operator()(const Response&) noexcept {}
void operator()(const SetProperty&);
void operator()(const Undo&);
diff --git a/src/server/LV2Block.hpp b/src/server/LV2Block.hpp
index c8f9e59a..77270234 100644
--- a/src/server/LV2Block.hpp
+++ b/src/server/LV2Block.hpp
@@ -125,7 +125,7 @@ public:
protected:
struct Instance : public raul::Noncopyable {
- explicit Instance(LilvInstance* i) : instance(i) {}
+ explicit Instance(LilvInstance* i) noexcept : instance(i) {}
~Instance() { lilv_instance_free(instance); }
diff --git a/src/server/PortImpl.hpp b/src/server/PortImpl.hpp
index ee3a2bf8..11c82539 100644
--- a/src/server/PortImpl.hpp
+++ b/src/server/PortImpl.hpp
@@ -91,10 +91,8 @@ public:
};
struct Voice {
- Voice() : buffer(nullptr) {}
-
SetState set_state;
- BufferRef buffer;
+ BufferRef buffer{nullptr};
};
using Voices = raul::Array<Voice>;
diff --git a/src/server/PortType.hpp b/src/server/PortType.hpp
index f84c271f..d67429c9 100644
--- a/src/server/PortType.hpp
+++ b/src/server/PortType.hpp
@@ -56,7 +56,7 @@ public:
}
}
- PortType(ID id) : _id(id) {}
+ PortType(ID id) noexcept : _id(id) {}
inline const URI& uri() const { return type_uri(_id); }
inline ID id() const { return _id; }
diff --git a/src/server/PostProcessor.cpp b/src/server/PostProcessor.cpp
index 5a0a8f3e..a4f94fe9 100644
--- a/src/server/PostProcessor.cpp
+++ b/src/server/PostProcessor.cpp
@@ -28,7 +28,7 @@ class PreProcessContext;
class Sentinel : public Event {
public:
- explicit Sentinel(Engine& engine) : Event(engine) {}
+ explicit Sentinel(Engine& engine) noexcept : Event(engine) {}
bool pre_process(PreProcessContext&) override { return false; }
void execute(RunContext&) override {}
diff --git a/src/server/UndoStack.cpp b/src/server/UndoStack.cpp
index 40c59af5..3dd4b3b0 100644
--- a/src/server/UndoStack.cpp
+++ b/src/server/UndoStack.cpp
@@ -118,7 +118,7 @@ UndoStack::pop()
}
struct BlankIDs {
- explicit BlankIDs(char prefix='b') : c(prefix) {}
+ explicit BlankIDs(const char prefix = 'b') noexcept : c{prefix} {}
SerdNode get() {
snprintf(buf, sizeof(buf), "%c%u", c, n++);
@@ -127,7 +127,7 @@ struct BlankIDs {
char buf[16]{};
unsigned n{0};
- const char c{'b'};
+ const char c;
};
struct ListContext {
diff --git a/src/server/UndoStack.hpp b/src/server/UndoStack.hpp
index 713ad777..a6d90e9c 100644
--- a/src/server/UndoStack.hpp
+++ b/src/server/UndoStack.hpp
@@ -42,7 +42,7 @@ namespace server {
class INGEN_SERVER_API UndoStack : public AtomSink {
public:
struct Entry {
- Entry(time_t t=0) : time(t) {}
+ Entry(time_t t = 0) noexcept : time(t) {}
Entry(const Entry& copy)
: time(copy.time)
@@ -83,7 +83,10 @@ public:
std::deque<LV2_Atom*> events;
};
- UndoStack(URIs& uris, URIMap& map) : _uris(uris), _map(map), _depth(0) {}
+ UndoStack(URIs& uris, URIMap& map) noexcept
+ : _uris(uris), _map(map), _depth(0)
+ {
+ }
int start_entry();
bool write(const LV2_Atom* msg, int32_t default_id=0) override;
diff --git a/src/server/Worker.hpp b/src/server/Worker.hpp
index dd799174..ed9a2470 100644
--- a/src/server/Worker.hpp
+++ b/src/server/Worker.hpp
@@ -44,7 +44,7 @@ public:
~Worker();
struct Schedule : public LV2Features::Feature {
- Schedule(bool sync) : synchronous(sync) {}
+ Schedule(bool sync) noexcept : synchronous(sync) {}
const char* uri() const override { return LV2_WORKER__schedule; }