1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Complete the previous commit by also removing the inline min and max

functions defined in HeadSpin.h without breaking (3ds)Max compilation
This commit is contained in:
2014-07-22 22:22:22 -07:00
parent e36220cca5
commit 72f18e8ebb
20 changed files with 49 additions and 86 deletions

View File

@ -60,7 +60,7 @@ unsigned CBaseArray::CalcAllocGrowth (unsigned newAlloc, unsigned oldAlloc, unsi
// If this is the initial allocation, or if the new allocation is more
// than twice as big as the old allocation and larger than the chunk
// size, then allocate exactly the amount of memory requested
if (!oldAlloc || (newAlloc >= max(2 * oldAlloc, *chunkSize)))
if (!oldAlloc || (newAlloc >= std::max(2 * oldAlloc, *chunkSize)))
return newAlloc;
// Otherwise, allocate memory beyond what was requested in preparation
@ -69,7 +69,7 @@ unsigned CBaseArray::CalcAllocGrowth (unsigned newAlloc, unsigned oldAlloc, unsi
// For small allocations, double the size of the buffer each time
if (newAlloc < *chunkSize)
return max(newAlloc, 2 * oldAlloc);
return std::max(newAlloc, 2 * oldAlloc);
// For larger allocations, grow by the chunk size each time
if (oldAlloc + *chunkSize > newAlloc) {

View File

@ -740,25 +740,25 @@ public:
//===========================================================================
template<class T, class C>
TArray<T,C>::TArray () : TFArray<T,C>() {
m_chunkSize = max(1, 256 / sizeof(T));
m_chunkSize = std::max(1u, 256 / sizeof(T));
}
//===========================================================================
template<class T, class C>
TArray<T,C>::TArray (const char file[], int line) : TFArray<T,C>(file, line) {
m_chunkSize = max(1, 256 / sizeof(T));
m_chunkSize = std::max(1u, 256 / sizeof(T));
}
//===========================================================================
template<class T, class C>
TArray<T,C>::TArray (unsigned count) : TFArray<T,C>(count) {
m_chunkSize = max(1, 256 / sizeof(T));
m_chunkSize = std::max(1u, 256 / sizeof(T));
}
//===========================================================================
template<class T, class C>
TArray<T,C>::TArray (const T * source, unsigned count) : TFArray<T,C>(source, count) {
m_chunkSize = max(1, 256 / sizeof(T));
m_chunkSize = std::max(1u, 256 / sizeof(T));
}
//===========================================================================
@ -890,8 +890,8 @@ void TArray<T,C>::Move (unsigned destIndex, unsigned sourceIndex, unsigned count
// Remove it from the source
if (destIndex >= sourceIndex) {
C::Destruct(this->m_data + sourceIndex, min(count, destIndex - sourceIndex));
C::Construct(this->m_data + sourceIndex, min(count, destIndex - sourceIndex));
C::Destruct(this->m_data + sourceIndex, std::min(count, destIndex - sourceIndex));
C::Construct(this->m_data + sourceIndex, std::min(count, destIndex - sourceIndex));
}
else {
unsigned overlap = (destIndex + count > sourceIndex) ? (destIndex + count - sourceIndex) : 0;
@ -936,7 +936,7 @@ T TArray<T,C>::Pop () {
//===========================================================================
template<class T, class C>
void TArray<T,C>::Reserve (unsigned additionalCount) {
AdjustSizeChunked(max(this->m_alloc, this->m_count + additionalCount), this->m_count);
AdjustSizeChunked(std::max(this->m_alloc, this->m_count + additionalCount), this->m_count);
}
//===========================================================================
@ -956,7 +956,7 @@ void TArray<T,C>::SetChunkSize (unsigned chunkSize) {
//===========================================================================
template<class T, class C>
void TArray<T,C>::SetCount (unsigned count) {
AdjustSizeChunked(max(this->m_alloc, count), count);
AdjustSizeChunked(std::max(this->m_alloc, count), count);
}
//===========================================================================

View File

@ -158,7 +158,7 @@ CICmdParser::CICmdParser (const CmdArgDef def[], unsigned defCount) {
arg.nameChars = def[loop].name ? StrLen(def[loop].name) : 0;
arg.isSpecified = false;
SetDefaultValue(arg);
maxId = max(maxId, def[loop].id);
maxId = std::max(maxId, def[loop].id);
// Track the number of unflagged arguments
if (!flagged)
@ -167,7 +167,7 @@ CICmdParser::CICmdParser (const CmdArgDef def[], unsigned defCount) {
}
// Build the id lookup table
unsigned idTableSize = min(maxId + 1, defCount * 2);
unsigned idTableSize = std::min(maxId + 1, defCount * 2);
m_idLookupArray.SetCount(idTableSize);
m_idLookupArray.Zero();
for (loop = 0; loop < defCount; ++loop)

View File

@ -432,7 +432,7 @@ void TBaseHashTable<T>::SetLinkOffset (int linkOffset, unsigned maxSize) {
v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16;
v++;
SetSlotCount(max(kSlotMinCount, v));
SetSlotCount(std::max(static_cast<unsigned>(kSlotMinCount), v));
}
}
@ -459,7 +459,7 @@ void TBaseHashTable<T>::SetSlotCount (unsigned count) {
template<class T>
void TBaseHashTable<T>::SetSlotMaxCount (unsigned count) {
if (count)
m_slotMaxCount = max(kSlotMinCount, count);
m_slotMaxCount = std::max(static_cast<unsigned>(kSlotMinCount), count);
}
//===========================================================================