From d76ea9843e57542ae84c0e341ff491df6d321e2f Mon Sep 17 00:00:00 2001 From: Dmitrij Naumov <dmitrij@naumov.de> Date: Sun, 18 Aug 2013 00:18:01 +0200 Subject: [PATCH] Reduce number of warnings in MeshLib when using clang. --- MeshLib/Elements/Element.h | 5 ++--- MeshLib/Location.h | 2 +- MeshLib/Mesh.h | 26 +++++++++++++------------- MeshLib/Node.h | 14 +++++++------- 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/MeshLib/Elements/Element.h b/MeshLib/Elements/Element.h index 7663bc6c6d5..a609ff86fb0 100644 --- a/MeshLib/Elements/Element.h +++ b/MeshLib/Elements/Element.h @@ -64,7 +64,7 @@ public: void setNode(unsigned idx, Node* node); /// Get array of element nodes. - Node* const* getNodes() const { return _nodes; }; + Node* const* getNodes() const { return _nodes; } /// Get dimension of the mesh element. virtual unsigned getDimension() const = 0; @@ -129,9 +129,8 @@ public: /** * Get the value for this element. The value can be used to store a link * to external information (for instance an index of a field) like material groups. - * @return */ - unsigned getValue() const { return _value; }; + unsigned getValue() const { return _value; } /** * Set the index value for external information. diff --git a/MeshLib/Location.h b/MeshLib/Location.h index 5ad300e3b7b..3bcbf9e1a2c 100644 --- a/MeshLib/Location.h +++ b/MeshLib/Location.h @@ -33,7 +33,7 @@ struct Location std::size_t item_id; Location(std::size_t meshid, MeshItemType itemtype, std::size_t itemid) - : mesh_id(meshid), item_type(itemtype), item_id(itemid){}; + : mesh_id(meshid), item_type(itemtype), item_id(itemid){} }; /// Lexicographic order of Location. diff --git a/MeshLib/Mesh.h b/MeshLib/Mesh.h index e46ae30a1a1..b1480cff30f 100644 --- a/MeshLib/Mesh.h +++ b/MeshLib/Mesh.h @@ -52,40 +52,40 @@ public: void addElement(Element* elem); /// Returns the dimension of the mesh (determined by the maximum dimension over all elements). - unsigned getDimension() const { return _mesh_dimension; }; + unsigned getDimension() const { return _mesh_dimension; } /// Get the minimum edge length over all elements of the mesh. - double getMinEdgeLength() { return _edge_length[0]; }; + double getMinEdgeLength() { return _edge_length[0]; } /// Get the maximum edge length over all elements of the mesh. - double getMaxEdgeLength() { return _edge_length[1]; }; + double getMaxEdgeLength() { return _edge_length[1]; } /// Get the node with the given index. - const Node* getNode(unsigned idx) const { return _nodes[idx]; }; + const Node* getNode(unsigned idx) const { return _nodes[idx]; } /// Get the element with the given index. - const Element* getElement(unsigned idx) const { return _elements[idx]; }; + const Element* getElement(unsigned idx) const { return _elements[idx]; } /// Get the minimum edge length for the mesh - double getMinEdgeLength() const { return _edge_length[0]; }; + double getMinEdgeLength() const { return _edge_length[0]; } /// Get the maximum edge length for the mesh - double getMaxEdgeLength() const { return _edge_length[1]; }; + double getMaxEdgeLength() const { return _edge_length[1]; } /// Get the number of elements - std::size_t getNElements() const { return _elements.size(); }; + std::size_t getNElements() const { return _elements.size(); } /// Get the number of nodes - std::size_t getNNodes() const { return _nodes.size(); }; + std::size_t getNNodes() const { return _nodes.size(); } /// Get name of the mesh. - const std::string getName() const { return _name; }; + const std::string getName() const { return _name; } /// Get the nodes-vector for the mesh. - std::vector<Node*> const& getNodes() const { return _nodes; }; + std::vector<Node*> const& getNodes() const { return _nodes; } /// Get the element-vector for the mesh. - std::vector<Element*> const& getElements() const { return _elements; }; + std::vector<Element*> const& getElements() const { return _elements; } /// Resets the IDs of all mesh-nodes to their position in the node vector void resetNodeIDs(); @@ -98,7 +98,7 @@ public: void setEdgeLengthRange(const double &min_length, const double &max_length); /// Changes the name of the mesh. - void setName(const std::string &name) { this->_name = name; }; + void setName(const std::string &name) { this->_name = name; } /// Get id of the mesh std::size_t getID() const {return _id; } diff --git a/MeshLib/Node.h b/MeshLib/Node.h index 0ad7341fe9e..0ac6e2d93dd 100644 --- a/MeshLib/Node.h +++ b/MeshLib/Node.h @@ -60,16 +60,16 @@ public: Node(const Node &node); /// Return all the nodes connected to this one - const std::vector<MeshLib::Node*>& getConnectedNodes() const { return _connected_nodes; }; + const std::vector<MeshLib::Node*>& getConnectedNodes() const { return _connected_nodes; } /// Get an element the node is part of. - const Element* getElement(unsigned idx) const { return _elements[idx]; }; + const Element* getElement(unsigned idx) const { return _elements[idx]; } /// Get all elements the node is part of. - const std::vector<Element*>& getElements() const { return _elements; }; + const std::vector<Element*>& getElements() const { return _elements; } /// Get number of elements the node is part of. - std::size_t getNElements() const { return _elements.size(); }; + std::size_t getNElements() const { return _elements.size(); } /// Destructor virtual ~Node(); @@ -79,12 +79,12 @@ protected: * Add an element the node is part of. * This method is called by Mesh::addElement(Element*), see friend definition. */ - void addElement(Element* elem) { _elements.push_back(elem); }; + void addElement(Element* elem) { _elements.push_back(elem); } - void setConnectedNodes(std::vector<Node*> &connected_nodes) { this->_connected_nodes = connected_nodes; }; + void setConnectedNodes(std::vector<Node*> &connected_nodes) { this->_connected_nodes = connected_nodes; } /// Sets the ID of a node to the given value. - void setID(unsigned id) { this->_id = id; }; + void setID(unsigned id) { this->_id = id; } /// Update coordinates of a node. /// This method automatically also updates the areas/volumes of all connected elements. -- GitLab