Core/Misc: Removed unused defines, added missing include and removed a few warnings

This commit is contained in:
Shauren
2014-03-23 22:14:25 +01:00
parent 3affa3a824
commit c3d2236d14
5 changed files with 19 additions and 9 deletions

View File

@@ -23,6 +23,7 @@
#include "DetourAlloc.h"
#include "DetourNavMesh.h"
#include "DetourNavMeshQuery.h"
#include <string>
// move map related classes
namespace MMAP

View File

@@ -47,12 +47,6 @@ namespace Movement
float computeFallTime(float path_length, bool isSafeFall);
float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity = 0.0f);
#ifndef static_assert
#define CONCAT(x, y) CONCAT1 (x, y)
#define CONCAT1(x, y) x##y
#define static_assert(expr, msg) typedef char CONCAT(static_assert_failed_at_line_, __LINE__) [(expr) ? 1 : -1]
#endif
template<class T, T limit>
class counter
{

View File

@@ -56,7 +56,7 @@ protected:
// client's value is 20, blizzs use 2-3 steps to compute length
STEPS_PER_SEGMENT = 3
};
static_assert(STEPS_PER_SEGMENT > 0, "shouldn't be lesser than 1");
static_assert(STEPS_PER_SEGMENT > 0, "STEPS_PER_SEGMENT shouldn't be lesser than 1");
protected:
void EvaluateLinear(index_type, float, Vector3&) const;

View File

@@ -33,8 +33,8 @@ class LinkedListElement
LinkedListElement* iNext;
LinkedListElement* iPrev;
public:
LinkedListElement(): iNext(NULL), iPrev(NULL) { }
~LinkedListElement() { delink(); }
LinkedListElement() : iNext(NULL), iPrev(NULL) { }
virtual ~LinkedListElement() { delink(); }
bool hasNext() const { return(iNext && iNext->iNext != NULL); }
bool hasPrev() const { return(iPrev && iPrev->iPrev != NULL); }
@@ -73,6 +73,10 @@ class LinkedListElement
iNext->iPrev = pElem;
iNext = pElem;
}
private:
LinkedListElement(LinkedListElement const&);
LinkedListElement& operator=(LinkedListElement const&);
};
//============================================
@@ -83,6 +87,7 @@ class LinkedListHead
LinkedListElement iFirst;
LinkedListElement iLast;
uint32 iSize;
public:
LinkedListHead(): iSize(0)
{
@@ -92,6 +97,8 @@ class LinkedListHead
iLast.iPrev = &iFirst;
}
virtual ~LinkedListHead() { }
bool isEmpty() const { return(!iFirst.iNext->isInList()); }
LinkedListElement * getFirst() { return(isEmpty() ? NULL : iFirst.iNext); }
@@ -239,6 +246,10 @@ class LinkedListHead
};
typedef Iterator<LinkedListElement> iterator;
private:
LinkedListHead(LinkedListHead const&);
LinkedListHead& operator=(LinkedListHead const&);
};
//============================================

View File

@@ -94,6 +94,10 @@ template <class TO, class FROM> class Reference : public LinkedListElement
TO* getTarget() const { return iRefTo; }
FROM* GetSource() const { return iRefFrom; }
private:
Reference(Reference const&);
Reference& operator=(Reference const&);
};
//=====================================================