From 459c5f0c67c066f9271b62e62e3d453c5660ba4f Mon Sep 17 00:00:00 2001 From: Philip Trettner <trettner@shapedcode.com> Date: Wed, 1 Nov 2023 14:20:32 +0100 Subject: [PATCH] fixed warning --- glfw/glow-extras/glfw/GlfwApp.cc | 8 +++--- vector/glow-extras/vector/graphics2D.hh | 2 +- viewer/glow-extras/viewer/canvas.hh | 2 +- .../viewer/detail/MeshAttribute.hh | 26 +++++++++---------- .../glow-extras/viewer/materials/Texturing.hh | 4 +-- .../viewer/renderables/GeometricRenderable.cc | 6 ++--- .../viewer/renderables/QuadricRenderable.hh | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/glfw/glow-extras/glfw/GlfwApp.cc b/glfw/glow-extras/glfw/GlfwApp.cc index a8d4793b..fb600f2f 100644 --- a/glfw/glow-extras/glfw/GlfwApp.cc +++ b/glfw/glow-extras/glfw/GlfwApp.cc @@ -460,15 +460,15 @@ void GlfwApp::mainLoop() { // Loop until the user closes the window - unsigned frames = 0; + [[maybe_unused]] unsigned frames = 0; double lastTime = glfwGetTime(); [[maybe_unused]] double lastStatsTime = lastTime; double lastScheduledUpdateTime = lastTime; double timeAccum = 0.000001; mCurrentTime = 0.0; - size_t primitives = 0; - size_t fragments = 0; - double cpuRenderTime = 0; + [[maybe_unused]] size_t primitives = 0; + [[maybe_unused]] size_t fragments = 0; + [[maybe_unused]] double cpuRenderTime = 0; int updatesPerFrame = 1; mCurrentRenderDeltaTime = 1.0 / mUpdateRate; // tracks time between renders, init is for first frame only while (!shouldClose()) diff --git a/vector/glow-extras/vector/graphics2D.hh b/vector/glow-extras/vector/graphics2D.hh index 9e624854..0e2172f3 100644 --- a/vector/glow-extras/vector/graphics2D.hh +++ b/vector/glow-extras/vector/graphics2D.hh @@ -47,7 +47,7 @@ struct font2D float line_height = 1.f; font2D(char const* face) : face(face) {} - font2D(std::string face, float size = 16.f, text_align align = text_align::baseline_left) : face(move(face)), size(size), align(align) {} + font2D(std::string face, float size = 16.f, text_align align = text_align::baseline_left) : face(std::move(face)), size(size), align(align) {} }; /// High-level API for writing to images diff --git a/viewer/glow-extras/viewer/canvas.hh b/viewer/glow-extras/viewer/canvas.hh index 053c9c0e..91db69a1 100644 --- a/viewer/glow-extras/viewer/canvas.hh +++ b/viewer/glow-extras/viewer/canvas.hh @@ -1192,7 +1192,7 @@ public: auto start_cnt = _state.lines_curr->size(); float current_length = segment_length; PosT prev_position = bezier.control_points[0]; - int segment_counter = 0; + [[maybe_unused]] int segment_counter = 0; while (current_length <= 1.0f) { diff --git a/viewer/glow-extras/viewer/detail/MeshAttribute.hh b/viewer/glow-extras/viewer/detail/MeshAttribute.hh index bb67ebae..3aad9e47 100644 --- a/viewer/glow-extras/viewer/detail/MeshAttribute.hh +++ b/viewer/glow-extras/viewer/detail/MeshAttribute.hh @@ -35,7 +35,7 @@ class MeshAttribute public: std::string const& name() const { return mName; } - MeshAttribute(std::string name) : mName(move(name)) {} + MeshAttribute(std::string name) : mName(std::move(name)) {} virtual SharedArrayBuffer createMeshRenderableArrayBuffer(MeshDefinition&) { @@ -86,7 +86,7 @@ public: T mConstant; - ConstantMeshAttribute(std::string name, T const& constant) : MeshAttribute(move(name)), mConstant(constant) {} + ConstantMeshAttribute(std::string name, T const& constant) : MeshAttribute(std::move(name)), mConstant(constant) {} SharedArrayBuffer createMeshRenderableArrayBuffer(MeshDefinition&) override { return nullptr; } // works SharedArrayBuffer createLineRenderableArrayBuffer(MeshDefinition&) override { return nullptr; } // works @@ -185,7 +185,7 @@ public: throw std::logic_error("Mesh type " + std::string(typeid(mesh).name()) + " not supported"); } - VertexMeshAttribute(std::string name, polymesh::vertex_attribute<T> const& data) : MeshAttribute(move(name)) + VertexMeshAttribute(std::string name, polymesh::vertex_attribute<T> const& data) : MeshAttribute(std::move(name)) { polymesh::Mesh const& mesh = data.mesh(); mMeshInfo = make_mesh_info(mesh); @@ -194,12 +194,12 @@ public: for (auto v : mesh.all_vertices()) mData.push_back(data[v]); } - VertexMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(move(name)) + VertexMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(std::move(name)) { mMeshInfo.vertexCount = data.size(); mData = data; } - VertexMeshAttribute(std::string name, std::vector<std::vector<T>> const& data) : MeshAttribute(move(name)) + VertexMeshAttribute(std::string name, std::vector<std::vector<T>> const& data) : MeshAttribute(std::move(name)) { mMeshInfo.vertexCount = 0; @@ -211,7 +211,7 @@ public: } } template <int N> - VertexMeshAttribute(std::string name, std::vector<std::array<T, N>> const& data) : MeshAttribute(move(name)) + VertexMeshAttribute(std::string name, std::vector<std::array<T, N>> const& data) : MeshAttribute(std::move(name)) { mMeshInfo.vertexCount = 0; @@ -306,7 +306,7 @@ public: throw std::logic_error("Mesh type " + std::string(typeid(mesh).name()) + " not supported"); } - EdgeMeshAttribute(std::string name, polymesh::edge_attribute<T> const& data) : MeshAttribute(move(name)) + EdgeMeshAttribute(std::string name, polymesh::edge_attribute<T> const& data) : MeshAttribute(std::move(name)) { polymesh::Mesh const& mesh = data.mesh(); mMeshInfo = make_mesh_info(mesh); @@ -315,7 +315,7 @@ public: for (auto e : mesh.all_edges()) mData.push_back(data[e]); } - EdgeMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(move(name)) + EdgeMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(std::move(name)) { mMeshInfo.edgeCount = data.size(); mData = data; @@ -425,7 +425,7 @@ public: throw std::logic_error("Mesh type " + std::string(typeid(mesh).name()) + " not supported"); } - FaceMeshAttribute(std::string name, polymesh::face_attribute<T> const& data) : MeshAttribute(move(name)) + FaceMeshAttribute(std::string name, polymesh::face_attribute<T> const& data) : MeshAttribute(std::move(name)) { polymesh::Mesh const& mesh = data.mesh(); mMeshInfo = make_mesh_info(mesh); @@ -434,7 +434,7 @@ public: for (auto f : mesh.all_faces()) mData.push_back(data[f]); } - FaceMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(move(name)) + FaceMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(std::move(name)) { mMeshInfo.faceCount = data.size(); mData = data; @@ -521,7 +521,7 @@ public: throw std::logic_error("Mesh type " + std::string(typeid(mesh).name()) + " not supported"); } - HalfedgeMeshAttribute(std::string name, polymesh::halfedge_attribute<T> const& data) : MeshAttribute(move(name)) + HalfedgeMeshAttribute(std::string name, polymesh::halfedge_attribute<T> const& data) : MeshAttribute(std::move(name)) { polymesh::Mesh const& mesh = data.mesh(); mMeshInfo = make_mesh_info(mesh); @@ -530,7 +530,7 @@ public: for (auto h : mesh.all_halfedges()) mData.push_back(data[h]); } - HalfedgeMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(move(name)) + HalfedgeMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(std::move(name)) { mMeshInfo.edgeCount = data.size() / 2; mData = data; @@ -717,7 +717,7 @@ public: throw std::logic_error("Mesh type " + std::string(typeid(mesh).name()) + " not supported"); } - RawMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(move(name)) { mData = data; } + RawMeshAttribute(std::string name, std::vector<T> const& data) : MeshAttribute(std::move(name)) { mData = data; } float computeMaxFloat() override { diff --git a/viewer/glow-extras/viewer/materials/Texturing.hh b/viewer/glow-extras/viewer/materials/Texturing.hh index 291e9a77..851ac481 100644 --- a/viewer/glow-extras/viewer/materials/Texturing.hh +++ b/viewer/glow-extras/viewer/materials/Texturing.hh @@ -20,7 +20,7 @@ class Texturing { SharedTexture mTexture; - ExplicitTexture(SharedTexture tex) : mTexture(move(tex)) {} + ExplicitTexture(SharedTexture tex) : mTexture(std::move(tex)) {} SharedTexture queryTexture() const override { return mTexture; } }; @@ -38,7 +38,7 @@ public: Texturing& texture(SharedTexture t) { - mTexture = std::make_shared<ExplicitTexture>(move(t)); + mTexture = std::make_shared<ExplicitTexture>(std::move(t)); return *this; } template <class T> diff --git a/viewer/glow-extras/viewer/renderables/GeometricRenderable.cc b/viewer/glow-extras/viewer/renderables/GeometricRenderable.cc index 7cc7761c..822bb33f 100644 --- a/viewer/glow-extras/viewer/renderables/GeometricRenderable.cc +++ b/viewer/glow-extras/viewer/renderables/GeometricRenderable.cc @@ -12,7 +12,7 @@ void GeometricRenderable::addAttribute(viewer::detail::SharedMeshAttribute attr) glow::error() << "Attribute " << attr->name() << " already added"; return; } - mAttributes.emplace_back(move(attr)); + mAttributes.emplace_back(std::move(attr)); } bool GeometricRenderable::hasAttribute(const std::string& name) const @@ -37,13 +37,13 @@ void GeometricRenderable::initGeometry(viewer::detail::SharedMeshDefinition def, { TG_ASSERT(def != nullptr); - mAttributes = move(attributes); + mAttributes = std::move(attributes); addAttribute(def->computePositionAttribute()); mIndexBuffer = def->computeIndexBuffer(); mMeshAABB = def->computeAABB(); - mMeshDefinition = move(def); + mMeshDefinition = std::move(def); } size_t GeometricRenderable::computeGenericGeometryHash() const diff --git a/viewer/glow-extras/viewer/renderables/QuadricRenderable.hh b/viewer/glow-extras/viewer/renderables/QuadricRenderable.hh index e2738797..830dd4cb 100644 --- a/viewer/glow-extras/viewer/renderables/QuadricRenderable.hh +++ b/viewer/glow-extras/viewer/renderables/QuadricRenderable.hh @@ -34,7 +34,7 @@ struct boxed_quadric void invert() { quadric = -quadric; } private: - float _padding = 0; + [[maybe_unused]] float _padding = 0; }; static_assert(sizeof(boxed_quadric) == 28 * sizeof(float)); -- GitLab