Changed: #1448 Compilation with CLang (patch provided by GelluleX, thanks !)

This commit is contained in:
kervala 2012-04-07 11:14:21 +02:00
parent b1bfd3da01
commit 425927cd50
10 changed files with 37 additions and 17 deletions

View file

@ -463,7 +463,7 @@ MACRO(NL_SETUP_BUILD)
ENDIF(NOT APPLE)
SET(NL_DEBUG_CFLAGS "-DNL_DEBUG -D_DEBUG")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O6")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3")
ENDIF(MSVC)
ENDMACRO(NL_SETUP_BUILD)

View file

@ -27,12 +27,16 @@
#include <vector>
#include <limits>
namespace NLMISC {
class CMatrix;
}
namespace NL3D {
class CTextureFont;
class CMatrix;
struct CComputedString;
// ***************************************************************************

View file

@ -227,7 +227,7 @@ void CCubeGrid<TCell>::compile()
// build the _StaticGrid
_StaticGrids[i].build(_Grids[i]);
// And reset the grid. contReset is necessary to clean the CBlockMemory.
contReset(_Grids[i]);
NLMISC::contReset(_Grids[i]);
}
// done

View file

@ -96,7 +96,7 @@ public:
try
{
newStart = new uint8[sizeof(T) * capacity + (1 << snapPower)];
T *newTab = (T *) ( (uint) (newStart + (1 << snapPower)) & ~((1 << snapPower) - 1)); // snap to a page
T *newTab = (T *) ( (size_t) (newStart + (1 << snapPower)) & ~((1 << snapPower) - 1)); // snap to a page

View file

@ -172,7 +172,7 @@ template<class T>
void CStaticQuadGrid<T>::build(CQuadGrid<T> &quadGrid)
{
clear();
contReset(_Grid);
NLMISC::contReset(_Grid);
// Copy from quadGrid, and init quads
_Size= quadGrid.getSize();

View file

@ -218,7 +218,7 @@ protected:
date*= previous->OODeltaTime;
NLMISC::clamp(date, 0,1);
date = ease(previous, date);
date = this->ease(previous, date);
float hb[4];
this->computeHermiteBasis(date, hb);
@ -242,7 +242,7 @@ protected:
ITrackKeyFramer<CKeyT>::compile();
// Ease Precompute.
compileTCBEase(this->_MapKey, this->getLoopMode());
this->compileTCBEase(this->_MapKey, this->getLoopMode());
// Tangents Precompute.
@ -314,7 +314,7 @@ private:
float ksm,ksp,kdm,kdp;
// compute tangents factors.
computeTCBFactors(key, timeBefore, time, timeAfter, rangeDelta, firstKey, endKey, isLoop, ksm,ksp,kdm,kdp);
this->computeTCBFactors(key, timeBefore, time, timeAfter, rangeDelta, firstKey, endKey, isLoop, ksm,ksp,kdm,kdp);
// Delta.
TKeyValueType delm, delp;
@ -413,7 +413,7 @@ public:
ITrackKeyFramer<CKeyTCBQuat>::compile();
// Ease Precompute.
compileTCBEase(_MapKey, getLoopMode());
this->compileTCBEase(_MapKey, getLoopMode());
TMapTimeCKey::iterator it;
TMapTimeCKey::iterator itNext;

View file

@ -501,8 +501,8 @@ namespace STRING_MANAGER
// callback->onSwap(it - context.Reference.begin(), refCount, context);
callback->onSwap(index, refCount, context);
// swap(*it, context.Reference[refCount]);
swap(context.Reference[index], context.Reference[refCount]);
// std::swap(*it, context.Reference[refCount]);
std::swap(context.Reference[index], context.Reference[refCount]);
}
}
else if (getHashValue(context.Addition, addCount) != getHashValue(context.Reference, refCount))

View file

@ -302,10 +302,10 @@ public :
virtual CCDBNodeLeaf *findLeafAtCount( uint& count ) = 0;
/// Set the atomic branch flag (when all the modified nodes of a branch should be tranmitted at the same time)
void setAtomic( bool atomicBranch ) { _Atomic = atomicBranch; }
void setAtomic( bool atomicBranch ) { _AtomicFlag = atomicBranch; }
/// Return true if the branch has the atomic flag
bool isAtomic() const { return _Atomic; }
bool isAtomic() const { return _AtomicFlag; }
// test if the node is a leaf
virtual bool isLeaf() const = 0;
@ -333,14 +333,14 @@ public :
protected:
/// Constructor
ICDBNode() : _Atomic(false)
ICDBNode() : _AtomicFlag(false)
{
if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper();
_Name = NLMISC::CStringMapper::emptyId();
}
/// Constructor
ICDBNode (const std::string &name) : _Atomic(false)
ICDBNode (const std::string &name) : _AtomicFlag(false)
{
if (_DBSM == NULL) _DBSM = NLMISC::CStringMapper::createLocalMapper();
_Name = _DBSM->localMap(name);
@ -351,7 +351,7 @@ protected:
void _buildFullName(NLMISC::CSString &fullName);
/// Atomic flag: is the branch an atomic group, or is the leaf a member of an atomic group
bool _Atomic : 1;
bool _AtomicFlag : 1;
/// Name of the node
NLMISC::TStringId _Name;

View file

@ -66,6 +66,22 @@ private:
const T _Default;
};
// forward declarations for specialisations
std::string getConfigVarTypename(const float &dummy);
bool getConfigVarValue(CLuaObject &luaValue, float &dest);
std::string getConfigVarTypename(const double &dummy);
bool getConfigVarValue(CLuaObject &luaValue, double &dest);
std::string getConfigVarTypename(const sint32 &dummy);
bool getConfigVarValue(CLuaObject &luaValue, sint32 &dest);
std::string getConfigVarTypename(const std::string &dummy);
bool getConfigVarValue(CLuaObject &luaValue, std::string &dest);
std::string getConfigVarTypename(const NLMISC::CRGBA &dummy);
bool getConfigVarValue(CLuaObject &luaValue, NLMISC::CRGBA &dest);
template <class T> const T &CConfigVar<T>::get() const
{
// Relies on R2 'getConfigVarValue' and 'getConfigVarTypename' functions specialization to retrieve the value (see below)

View file

@ -1005,7 +1005,7 @@ NLNET::TServiceId8 CMirrorPropValueAlice<T,CPropLocationClass>::getWriterSer
if ( _InMirror )
return CMirrorPropValue<T,CPropLocationClass>::getWriterServiceId();
else
return ~0;
return NLNET::TServiceId8(std::numeric_limits<uint8>::max());
}
#endif