Changed: Replace ~0 by std::numeric_limits

This commit is contained in:
kervala 2016-06-07 13:31:21 +02:00
parent 938128499a
commit 08cfaf90c9

View file

@ -27,6 +27,8 @@
#include "nel/misc/common.h"
#include <limits>
namespace CLFECOMMON {
@ -230,7 +232,7 @@ const uint MAX_PROPERTIES_PER_ENTITY = NB_VISUAL_PROPERTIES;
// Special constant for unassociating
const TPropIndex PROPERTY_DISASSOCIATION = (TPropIndex)(~0)-1;
const TPropIndex PROPERTY_DISASSOCIATION = std::numeric_limits<TPropIndex>::max()-1;
// Names (debug info)
@ -399,13 +401,13 @@ public:
bool BranchHasPayload;
/// Constructor
TVPNodeBase() : VPParent(NULL), VPA(NULL), VPB(NULL), PropIndex(~0), BranchHasPayload(false) {}
TVPNodeBase() : VPParent(NULL), VPA(NULL), VPB(NULL), PropIndex(std::numeric_limits<TPropIndex>::max()), BranchHasPayload(false) {}
virtual ~TVPNodeBase() {}
/// Return true if the node is root of a tree
bool isRoot() const { return VPParent == NULL; }
/// Return true if the node is leaf of a tree
bool isLeaf() const { return PropIndex != (CLFECOMMON::TPropIndex)~0; }
bool isLeaf() const { return PropIndex != std::numeric_limits<TPropIndex>::max(); }
/// Return the level of the node in a tree (root=1)
uint getLevel() const