diff --git a/include/IFileList.h b/include/IFileList.h index 37d14a1c..dcdd85f7 100644 --- a/include/IFileList.h +++ b/include/IFileList.h @@ -16,10 +16,6 @@ namespace io class IFileList : public virtual IReferenceCounted { public: - - //! Destructor - virtual ~IFileList() {} - //! Get the number of files in the filelist. /** \return Amount of files and directories in the file list. */ virtual u32 getFileCount() const = 0; @@ -37,11 +33,10 @@ public: \return File name of the file. Returns 0, if an error occured. */ virtual const c8* getFullFileName(u32 index) = 0; - //! Returns of the file is a directory - /** \param index is the zero based index of the file which name should + //! Check if the file is a directory + /** \param index The zero based index of the file whose name shall be returned. The index has to be smaller than the amount getFileCount() returns. - \return True, if the file is a directory, and false, if it is not. - If an error occurs, the result is undefined. */ + \return True if the file is a directory, else false. */ virtual bool isDirectory(u32 index) const = 0; }; diff --git a/include/IFileSystem.h b/include/IFileSystem.h index 7036a75f..148d93f2 100644 --- a/include/IFileSystem.h +++ b/include/IFileSystem.h @@ -32,9 +32,6 @@ class IFileSystem : public virtual IReferenceCounted { public: - //! Destructor - virtual ~IFileSystem() {} - //! Opens a file for read access. /** \param filename: Name of file to open. \return Returns a pointer to the created file interface. @@ -189,7 +186,7 @@ public: //! Creates a new empty collection of attributes, usable for serialization and more. /** \param driver: Video driver to be used to load textures when specified as attribute values. Can be null to prevent automatic texture loading by attributes. - \return Returns a pointer to the created object. + \return Pointer to the created object. If you no longer need the object, you should call IAttributes::drop(). See IReferenceCounted::drop() for more information. */ virtual IAttributes* createEmptyAttributes(video::IVideoDriver* driver=0) = 0; diff --git a/include/IGUIElement.h b/include/IGUIElement.h index 14561b17..06823baa 100644 --- a/include/IGUIElement.h +++ b/include/IGUIElement.h @@ -223,7 +223,6 @@ public: parentAbsoluteClip = Parent->AbsoluteClippingRect; } - diffx = parentAbsolute.getWidth() - LastParentRect.getWidth(); diffy = parentAbsolute.getHeight() - LastParentRect.getHeight(); @@ -233,7 +232,6 @@ public: if (AlignTop == EGUIA_SCALE || AlignBottom == EGUIA_SCALE) fh = (f32)parentAbsolute.getHeight(); - switch (AlignLeft) { case EGUIA_UPPERLEFT: @@ -296,8 +294,8 @@ public: RelativeRect = DesiredRect; - s32 w = RelativeRect.getWidth(); - s32 h = RelativeRect.getHeight(); + const s32 w = RelativeRect.getWidth(); + const s32 h = RelativeRect.getHeight(); // make sure the desired rectangle is allowed if (w < MinSize.Width) diff --git a/include/IReadFile.h b/include/IReadFile.h index fb2fb5b4..0abbf13c 100644 --- a/include/IReadFile.h +++ b/include/IReadFile.h @@ -16,18 +16,15 @@ namespace io class IReadFile : public virtual IReferenceCounted { public: - //! Destructor - virtual ~IReadFile() {} - //! Reads an amount of bytes from the file. - /** \param buffer Pointer to buffer where to read bytes will be written to. + /** \param buffer Pointer to buffer where read bytes are written to. \param sizeToRead Amount of bytes to read from the file. \return How much bytes were read. */ virtual s32 read(void* buffer, u32 sizeToRead) = 0; //! Changes position in file - /** \param finalPos: Destination position in the file. - \param relativeMovement: If set to true, the position in the file is + /** \param finalPos Destination position in the file. + \param relativeMovement If set to true, the position in the file is changed relative to current position. Otherwise the position is changed from beginning of file. \return True if successful, otherwise false. */ diff --git a/include/IWriteFile.h b/include/IWriteFile.h index f766a628..aaf182fc 100644 --- a/include/IWriteFile.h +++ b/include/IWriteFile.h @@ -16,9 +16,6 @@ namespace io class IWriteFile : public virtual IReferenceCounted { public: - //! Destructor - virtual ~IWriteFile() {} - //! Writes an amount of bytes to the file. /** \param buffer Pointer to buffer of bytes to write. \param sizeToWrite Amount of bytes to write to the file. diff --git a/include/irrMap.h b/include/irrMap.h index b6c86454..98e7752a 100644 --- a/include/irrMap.h +++ b/include/irrMap.h @@ -26,8 +26,6 @@ class map : LeftChild(0), RightChild(0), Parent(0), Key(k), Value(v), IsRed(true) {} - ~RBTree() {} - void setLeftChild(RBTree* p) { LeftChild=p; @@ -280,10 +278,10 @@ class map //! Parent First Iterator. - //! Traverses the tree from top to bottom. Typical usage is - //! when storing the tree structure, because when reading it - //! later (and inserting elements) the tree structure will - //! be the same. + /** Traverses the tree from top to bottom. Typical usage is + when storing the tree structure, because when reading it + later (and inserting elements) the tree structure will + be the same. */ class ParentFirstIterator { public: @@ -388,10 +386,10 @@ class map //! Parent Last Iterator - //! Traverse the tree from bottom to top. - //! Typical usage is when deleting all elements in the tree - //! because you must delete the children before you delete - //! their parent. + /** Traverse the tree from bottom to top. + Typical usage is when deleting all elements in the tree + because you must delete the children before you delete + their parent. */ class ParentLastIterator { public: @@ -475,7 +473,6 @@ class map Cur = Cur->getParent(); } - Node* Root; Node* Cur; }; // ParentLastIterator @@ -539,10 +536,9 @@ class map //------------------------------ //! Inserts a new node into the tree - //! \param keyNew: the index for this value - //! \param v: the value to insert - //! \return Returns true if successful, - //! false if it fails (already exists) + /** \param keyNew: the index for this value + \param v: the value to insert + \return True if successful, false if it fails (already exists) */ bool insert(const KeyType& keyNew, const ValueType& v) { // First insert node the "usual" way (no fancy balance logic yet) @@ -622,10 +618,9 @@ class map return true; } - //! Replaces the value if the key already exists, - //! otherwise inserts a new element. - //! \param k: the index for this value - //! \param v: the new value of + //! Replaces the value if the key already exists, otherwise inserts a new element. + /** \param k The index for this value + \param v The new value of */ void set(const KeyType& k, const ValueType& v) { Node* p = find(k); @@ -636,9 +631,9 @@ class map } //! Removes a node from the tree and returns it. - //! The returned node must be deleted by the user - //! \param k: the key to remove - //! \return: A pointer to the node, or 0 if not found + /** The returned node must be deleted by the user + \param k the key to remove + \return A pointer to the node, or 0 if not found */ Node* delink(const KeyType& k) { Node* p = find(k); @@ -677,7 +672,7 @@ class map } //! Removes a node from the tree and deletes it. - //! \return True if the node was found and deleted + /** \return True if the node was found and deleted */ bool remove(const KeyType& k) { Node* p = find(k); @@ -916,7 +911,6 @@ class map //! Pull up node's left child and let it knock node down to the right void rotateRight(Node* p) { - Node* left = p->getLeftChild(); p->setLeftChild(left->getRightChild()); diff --git a/include/irrString.h b/include/irrString.h index e4ec772d..12831e49 100644 --- a/include/irrString.h +++ b/include/irrString.h @@ -713,10 +713,13 @@ public: //! \param length: Length of substring. string subString(u32 begin, s32 length) const { + // if start after string + // or no proper substring length + if ((length <= 0) || (begin>=size())) + return string(""); + // clamp length to maximal value if ((length+begin) > size()) length = size()-begin; - if (length <= 0) - return string(""); string o; o.reserve(length+1); diff --git a/include/vector2d.h b/include/vector2d.h index dc93794b..a775c698 100644 --- a/include/vector2d.h +++ b/include/vector2d.h @@ -217,7 +217,7 @@ public: \return True if this vector is between begin and end, false if not. */ bool isBetweenPoints(const vector2d& begin, const vector2d& end) const { - T f = (end - begin).getLengthSQ(); + const T f = (end - begin).getLengthSQ(); return getDistanceFromSQ(begin) < f && getDistanceFromSQ(end) < f; }