mirror of
https://github.com/SWG-Source/src.git
synced 2026-08-01 01:16:03 -04:00
Minor fixes including removing <> from make_pair usage and using explicit conversions where required by the explicit constructor flags
Now builds/runs using c++11
This commit is contained in:
@@ -66,22 +66,6 @@ namespace std
|
||||
template <class _Key, class _Tp, class _Hash, class _Compare, class _Alloc> class unordered_map;
|
||||
template <class _Key, class _Hash, class _Compare, class _Alloc> class unordered_set;
|
||||
}
|
||||
|
||||
template <class ForwardIterator>
|
||||
bool is_sorted (ForwardIterator first, ForwardIterator last)
|
||||
{
|
||||
if (first==last) return true;
|
||||
ForwardIterator next = first;
|
||||
while (++next!=last) {
|
||||
if (*next<*first) // or, if (comp(*next,*first)) for version (2)
|
||||
return false;
|
||||
|
||||
++first;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc = std::allocator<_Tp> > struct stddeque
|
||||
|
||||
@@ -543,8 +543,8 @@ void AiDebugString::addCircleAtObjectOffset(NetworkId const & target, Vector con
|
||||
// Object-space circle relative to the target
|
||||
|
||||
if (radius > 0.0f)
|
||||
{
|
||||
m_circleList->push_back(std::make_pair(target, std::make_pair(Circle(position_o, radius), color)));
|
||||
{
|
||||
m_circleList->push_back(std::make_pair(CachedNetworkId(target), std::make_pair(Circle(position_o, radius), color)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -100,7 +100,7 @@ void AppearanceManager::install()
|
||||
crcStringVector = new CrcStringVector();
|
||||
crcStringVector->reserve(static_cast<size_t>(numberOfColumns));
|
||||
|
||||
ms_objectTemplateAppearanceTemplateMap.insert(std::make_pair(new PersistentCrcString(crcSourceName), crcStringVector));
|
||||
ms_objectTemplateAppearanceTemplateMap.insert(std::make_pair((const CrcString*)new PersistentCrcString(crcSourceName), crcStringVector));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,35 +59,35 @@ extern "C"
|
||||
|
||||
// ======================================================================
|
||||
|
||||
void *operator new(size_t size, MemoryManagerNotALeak) throw (std::bad_alloc)
|
||||
void *operator new(size_t size, MemoryManagerNotALeak)
|
||||
{
|
||||
return MemoryManager::allocate(size, reinterpret_cast<uint32>(__builtin_return_address(0)), false, false);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void *operator new(size_t size) throw (std::bad_alloc)
|
||||
void *operator new(std::size_t size)
|
||||
{
|
||||
return MemoryManager::allocate(size, reinterpret_cast<uint32>(__builtin_return_address(0)), false, true);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void *operator new[](size_t size) throw (std::bad_alloc)
|
||||
void *operator new[](size_t size)
|
||||
{
|
||||
return MemoryManager::allocate(size, reinterpret_cast<uint32>(__builtin_return_address(0)), true, true);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void *operator new(size_t size, const char *file, int line) throw (std::bad_alloc)
|
||||
void *operator new(size_t size, const char *file, int line)
|
||||
{
|
||||
return MemoryManager::allocate(size, reinterpret_cast<uint32>(__builtin_return_address(0)), false, true);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void *operator new[](size_t size, const char *file, int line) throw (std::bad_alloc)
|
||||
void *operator new[](size_t size, const char *file, int line)
|
||||
{
|
||||
return MemoryManager::allocate(size, reinterpret_cast<uint32>(__builtin_return_address(0)), true, true);
|
||||
}
|
||||
|
||||
@@ -10,17 +10,18 @@
|
||||
#define INCLUDED_OsNewDel_H
|
||||
|
||||
// ======================================================================
|
||||
#include <cstddef>
|
||||
|
||||
enum MemoryManagerNotALeak
|
||||
{
|
||||
MM_notALeak
|
||||
};
|
||||
|
||||
void *operator new(size_t size, MemoryManagerNotALeak) throw(std::bad_alloc);
|
||||
void *operator new(size_t size) throw(std::bad_alloc);
|
||||
void *operator new[](size_t size) throw(std::bad_alloc);
|
||||
void *operator new(size_t size, char const *file, int line) throw(std::bad_alloc);
|
||||
void *operator new[](size_t size, char const *file, int line) throw(std::bad_alloc);
|
||||
void *operator new(size_t size, MemoryManagerNotALeak);
|
||||
void *operator new(size_t size);
|
||||
void *operator new[](std::size_t size);
|
||||
void *operator new(size_t size, char const *file, int line);
|
||||
void *operator new[](size_t size, char const *file, int line);
|
||||
|
||||
void operator delete(void *pointer) throw();
|
||||
void operator delete[](void *pointer) throw();
|
||||
|
||||
@@ -630,7 +630,7 @@ void AppearanceTemplateListNamespace::addNamedAppearanceTemplate(AppearanceTempl
|
||||
NOT_NULL(appearanceTemplate);
|
||||
|
||||
//-- add to named list
|
||||
std::pair<NamedTemplates::iterator, bool> result = ms_namedTemplates.insert(std::make_pair(&appearanceTemplate->getCrcName(), appearanceTemplate));
|
||||
std::pair<NamedTemplates::iterator, bool> result = ms_namedTemplates.insert(std::make_pair((const CrcString*)&appearanceTemplate->getCrcName(), appearanceTemplate));
|
||||
|
||||
//-- make sure it's not already there
|
||||
DEBUG_FATAL(!result.second, ("tried to add existing named appearanceTemplate %s", appearanceTemplate->getName()));
|
||||
@@ -649,7 +649,7 @@ void AppearanceTemplateListNamespace::addNamedTimedAppearanceTemplate(Appearance
|
||||
NOT_NULL(appearanceTemplate);
|
||||
|
||||
//-- add to named list
|
||||
std::pair<NamedTimedTemplates::iterator, bool> result = ms_namedTimedTemplates.insert(std::make_pair(&appearanceTemplate->getCrcName(), std::make_pair(ms_keepTime + Random::randomReal(ms_keepEpsilon), appearanceTemplate)));
|
||||
std::pair<NamedTimedTemplates::iterator, bool> result = ms_namedTimedTemplates.insert(std::make_pair((const CrcString*)&appearanceTemplate->getCrcName(), std::make_pair(ms_keepTime + Random::randomReal(ms_keepEpsilon), appearanceTemplate)));
|
||||
|
||||
//-- make sure it's not already there
|
||||
DEBUG_FATAL(!result.second, ("tried to add existing named timed appearanceTemplate %s", appearanceTemplate->getName()));
|
||||
|
||||
Reference in New Issue
Block a user