Browse Source

Fix pnUtils for clang.

Darryl Pogue 13 years ago
parent
commit
f58161ace0
  1. 2
      Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h
  2. 3
      Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h
  3. 39
      Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp
  4. 1
      Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h

2
Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h

@ -823,7 +823,7 @@ void TArray<T,C>::AdjustSizeChunked (unsigned newAlloc, unsigned newCount) {
// Process growing the allocation
else
newAlloc = CalcAllocGrowth(newAlloc, this->m_alloc, &this->m_chunkSize);
newAlloc = this->CalcAllocGrowth(newAlloc, this->m_alloc, &this->m_chunkSize);
// Perform the allocation
this->AdjustSize(newAlloc, newCount);

3
Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h

@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnUtList.h"
#include "pnUtArray.h"
#include "pnUtMath.h"
#include "pnUtStr.h"
/****************************************************************************
*
@ -536,7 +537,7 @@ const T * THashTable<T,K>::Find (const K & key) const {
unsigned hash = key.GetHash();
const LIST(T) & slotList = this->GetSlotList(hash);
for (const T * curr = slotList.Head(); curr; curr = slotList.Next(curr))
if ((GetHash(curr) == hash) && (*curr == key))
if ((this->GetHash(curr) == hash) && (*curr == key))
return curr;
return nil;
}

39
Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp

@ -69,6 +69,25 @@ static uint32_t s_hashValue[] = {
* Internal functions
*
***/
//===========================================================================
template<class chartype>
static unsigned IStrLen (const chartype str[]) {
unsigned chars = 0;
for (; *str++; ++chars)
NULL_STMT;
return chars;
}
//===========================================================================
template<class chartype>
static void IStrCopy (chartype * dest, const chartype source[], unsigned chars) {
while ((chars > 1) && ((*dest = *source++) != 0)) {
--chars;
++dest;
}
if (chars)
*dest = 0;
}
//===========================================================================
template<class chartype>
@ -207,17 +226,6 @@ static int IStrCmpI (const chartype str1[], const chartype str2[], unsigned char
return 0;
}
//===========================================================================
template<class chartype>
static void IStrCopy (chartype * dest, const chartype source[], unsigned chars) {
while ((chars > 1) && ((*dest = *source++) != 0)) {
--chars;
++dest;
}
if (chars)
*dest = 0;
}
//===========================================================================
// returns StrLen(dest)
template<class chartype>
@ -284,15 +292,6 @@ static chartype * IStrStrI (chartype source[], const chartype match[]) {
return nil;
}
//===========================================================================
template<class chartype>
static unsigned IStrLen (const chartype str[]) {
unsigned chars = 0;
for (; *str++; ++chars)
NULL_STMT;
return chars;
}
//===========================================================================
template<class chartype>
static void IStrLower (chartype * dest, unsigned chars) {

1
Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "Pch.h"
#include "pnUtArray.h"
#include <wchar.h>
/*****************************************************************************
*

Loading…
Cancel
Save