From 43a6d78acd8a5327f586d078ed9677387f2d8a47 Mon Sep 17 00:00:00 2001 From: Ioan Chera Date: Sun, 8 Oct 2023 08:43:34 +0300 Subject: [PATCH] Added noexcept to some functions (useless though) --- src/Document.h | 2 +- src/Instance.h | 2 +- src/Vertex.h | 6 +++--- src/e_main.cc | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Document.h b/src/Document.h index b0894c1e5..7928dc11f 100644 --- a/src/Document.h +++ b/src/Document.h @@ -72,7 +72,7 @@ struct Document { return static_cast(things.size()); } - int numVertices() const + int numVertices() const noexcept { return static_cast(vertices.size()); } diff --git a/src/Instance.h b/src/Instance.h index fa3d85112..68b47d35a 100644 --- a/src/Instance.h +++ b/src/Instance.h @@ -200,7 +200,7 @@ class Instance const Sector *front, const Sector *back) const; // E_MAIN - void CalculateLevelBounds(); + void CalculateLevelBounds() noexcept; void Editor_ChangeMode(char mode_char); void Editor_ChangeMode_Raw(ObjType new_mode); void Editor_ClearAction(); diff --git a/src/Vertex.h b/src/Vertex.h index e24b809dd..93de107ab 100644 --- a/src/Vertex.h +++ b/src/Vertex.h @@ -32,15 +32,15 @@ struct Vertex enum { F_X, F_Y }; - inline double x() const + inline double x() const noexcept { return static_cast(raw_x); } - inline double y() const + inline double y() const noexcept { return static_cast(raw_y); } - inline v2double_t xy() const + inline v2double_t xy() const noexcept { return { x(), y() }; } diff --git a/src/e_main.cc b/src/e_main.cc index 8e3e86374..1372b6b0f 100644 --- a/src/e_main.cc +++ b/src/e_main.cc @@ -373,7 +373,7 @@ void Instance::Editor_ChangeMode(char mode_char) //------------------------------------------------------------------------ -static void UpdateLevelBounds(Instance &inst, int start_vert) +static void UpdateLevelBounds(Instance &inst, int start_vert) noexcept { for(int i = start_vert; i < inst.level.numVertices(); i++) { @@ -387,7 +387,7 @@ static void UpdateLevelBounds(Instance &inst, int start_vert) } } -void Instance::CalculateLevelBounds() +void Instance::CalculateLevelBounds() noexcept { if (level.numVertices() == 0) {