浏览代码

AMFImporter: fix coverity findings.

Kim Kulling 8 年之前
父节点
当前提交
0300574b8b
共有 1 个文件被更改,包括 13 次插入35 次删除
  1. 13 35
      code/AMFImporter_Node.hpp

+ 13 - 35
code/AMFImporter_Node.hpp

@@ -60,18 +60,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 /// \class CAMFImporter_NodeElement
 /// \class CAMFImporter_NodeElement
 /// Base class for elements of nodes.
 /// Base class for elements of nodes.
-class CAMFImporter_NodeElement
-{
-	/***********************************************/
-	/******************** Types ********************/
-	/***********************************************/
+class CAMFImporter_NodeElement {
 
 
 public:
 public:
-
-	/// \enum EType
 	/// Define what data type contain node element.
 	/// Define what data type contain node element.
-	enum EType
-	{
+	enum EType {
 		ENET_Color,        ///< Color element: <color>.
 		ENET_Color,        ///< Color element: <color>.
 		ENET_Constellation,///< Grouping element: <constellation>.
 		ENET_Constellation,///< Grouping element: <constellation>.
 		ENET_Coordinates,  ///< Coordinates element: <coordinates>.
 		ENET_Coordinates,  ///< Coordinates element: <coordinates>.
@@ -92,52 +85,37 @@ public:
 		ENET_Invalid       ///< Element has invalid type and possible contain invalid data.
 		ENET_Invalid       ///< Element has invalid type and possible contain invalid data.
 	};
 	};
 
 
-	/***********************************************/
-	/****************** Constants ******************/
-	/***********************************************/
-
-public:
-
 	const EType Type;///< Type of element.
 	const EType Type;///< Type of element.
-
-	/***********************************************/
-	/****************** Variables ******************/
-	/***********************************************/
-
-public:
-
 	std::string ID;///< ID of element.
 	std::string ID;///< ID of element.
-	CAMFImporter_NodeElement* Parent;///< Parrent element. If nullptr then this node is root.
+	CAMFImporter_NodeElement* Parent;///< Parent element. If nullptr then this node is root.
 	std::list<CAMFImporter_NodeElement*> Child;///< Child elements.
 	std::list<CAMFImporter_NodeElement*> Child;///< Child elements.
 
 
-	/***********************************************/
-	/****************** Functions ******************/
-	/***********************************************/
+public:                                               /// Destructor, virtual..
+    virtual ~CAMFImporter_NodeElement() {
+        // empty
+    }
 
 
 private:
 private:
-
-	/// \fn CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement)
 	/// Disabled copy constructor.
 	/// Disabled copy constructor.
 	CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement);
 	CAMFImporter_NodeElement(const CAMFImporter_NodeElement& pNodeElement);
 
 
-	/// \fn CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement)
 	/// Disabled assign operator.
 	/// Disabled assign operator.
 	CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement);
 	CAMFImporter_NodeElement& operator=(const CAMFImporter_NodeElement& pNodeElement);
 
 
-	/// \fn CAMFImporter_NodeElement()
 	/// Disabled default constructor.
 	/// Disabled default constructor.
 	CAMFImporter_NodeElement();
 	CAMFImporter_NodeElement();
 
 
 protected:
 protected:
-
-	/// \fn CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent)
 	/// In constructor inheritor must set element type.
 	/// In constructor inheritor must set element type.
 	/// \param [in] pType - element type.
 	/// \param [in] pType - element type.
 	/// \param [in] pParent - parent element.
 	/// \param [in] pParent - parent element.
 	CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent)
 	CAMFImporter_NodeElement(const EType pType, CAMFImporter_NodeElement* pParent)
-		: Type(pType), Parent(pParent)
-	{}
-
+	: Type(pType)
+    , ID()
+    , Parent(pParent)
+    , Child() {
+        // empty
+    }
 };// class IAMFImporter_NodeElement
 };// class IAMFImporter_NodeElement
 
 
 /// \struct CAMFImporter_NodeElement_Constellation
 /// \struct CAMFImporter_NodeElement_Constellation