mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-31 00:15:55 -04:00
Check Point: compiling to about 11% before first error.
This commit is contained in:
Regular → Executable
+18
-18
@@ -1,18 +1,18 @@
|
||||
cmake-build*
|
||||
*.geany
|
||||
PVS*
|
||||
*.cfg
|
||||
*.cmd
|
||||
.project
|
||||
*.kdev4
|
||||
latex
|
||||
html
|
||||
build*/
|
||||
!game/server/database/build/
|
||||
game/server/database/data/templates.sql
|
||||
.codelite/
|
||||
.idea/
|
||||
build.log
|
||||
*.phprj
|
||||
*.project
|
||||
*.workspace
|
||||
cmake-build*
|
||||
*.geany
|
||||
PVS*
|
||||
*.cfg
|
||||
*.cmd
|
||||
.project
|
||||
*.kdev4
|
||||
latex
|
||||
html
|
||||
build*/
|
||||
!game/server/database/build/
|
||||
game/server/database/data/templates.sql
|
||||
.codelite/
|
||||
.idea/
|
||||
build.log
|
||||
*.phprj
|
||||
*.project
|
||||
*.workspace
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ elseif (UNIX)
|
||||
endif ()
|
||||
|
||||
# our "always on" flags - build by default for the system we're on but include all instruction sets
|
||||
set(CMAKE_CXX_FLAGS "-m32 -pipe -march=native -mtune=native \
|
||||
set(CMAKE_CXX_FLAGS "-pipe -march=native -mtune=native \
|
||||
-Wformat -Wno-overloaded-virtual -Wno-missing-braces -Wno-format \
|
||||
-Wno-write-strings -Wno-unknown-pragmas \
|
||||
-Wno-uninitialized -Wno-reorder -Wno-tautological-constant-out-of-range-compare -Wno-stringop-overflow -Wno-address-of-packed-member")
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
add_subdirectory(client)
|
||||
add_subdirectory(server)
|
||||
add_subdirectory(shared)
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ namespace Base
|
||||
|
||||
target.assign((const char *)buf, (const char *)(buf + size));
|
||||
|
||||
const unsigned int readSize = size * sizeof(char);
|
||||
const uint32_t readSize = size * sizeof(char);
|
||||
source.advance(readSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -385,8 +385,8 @@ static bool dwarfSearch(char const *dwarfLines, unsigned int linesLength, void c
|
||||
if (valid)
|
||||
{
|
||||
unsigned int addrOffset = 0;
|
||||
if (progAddr < reinterpret_cast<unsigned int>(info.dli_fbase))
|
||||
addrOffset = reinterpret_cast<unsigned int>(info.dli_fbase);
|
||||
if (progAddr < reinterpret_cast<long unsigned int>(info.dli_fbase))
|
||||
addrOffset = reinterpret_cast<long unsigned int>(info.dli_fbase);
|
||||
const void *testAddr = reinterpret_cast<const void *>(progAddr+addrOffset);
|
||||
if (testAddr >= addr)
|
||||
{
|
||||
@@ -509,12 +509,12 @@ static bool stabSearch(Stab const *stab, unsigned int stabSize, char const *stab
|
||||
if (reinterpret_cast<void const *>(stab->n_value) > info.dli_fbase)
|
||||
funcBase = reinterpret_cast<void const *>(stab->n_value);
|
||||
else
|
||||
funcBase = reinterpret_cast<void const *>(reinterpret_cast<unsigned int>(info.dli_fbase)+stab->n_value);
|
||||
funcBase = reinterpret_cast<void const *>(reinterpret_cast<long unsigned int>(info.dli_fbase)+stab->n_value);
|
||||
foundSrcLine = -1;
|
||||
}
|
||||
else if (stab->n_type == N_SLINE && addr >= funcBase) // source line
|
||||
{
|
||||
if (stab->n_value < reinterpret_cast<unsigned int>(addr)-reinterpret_cast<unsigned int>(funcBase))
|
||||
if (stab->n_value < reinterpret_cast<long unsigned int>(addr)-reinterpret_cast<long unsigned int>(funcBase))
|
||||
foundSrcLine = stab->n_desc;
|
||||
else
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ inline FormattedString<bufferSize>::FormattedString()
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <int bufferSize>
|
||||
template <int32_t bufferSize>
|
||||
inline char const * FormattedString<bufferSize>::sprintf(char const * const format, ...)
|
||||
{
|
||||
char const * result = nullptr;
|
||||
@@ -55,7 +55,7 @@ inline char const * FormattedString<bufferSize>::sprintf(char const * const form
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
template <int bufferSize>
|
||||
template <int32_t bufferSize>
|
||||
inline char const * FormattedString<bufferSize>::vsprintf(char const * const format, va_list const & va)
|
||||
{
|
||||
// Format the string
|
||||
|
||||
@@ -226,11 +226,11 @@ inline void imemcpy(void *destination, const void *source, int length)
|
||||
* @param length Number of bytes to copy
|
||||
*/
|
||||
|
||||
inline void *memmove(void *destination, const void *source, int length)
|
||||
inline void *memmove(void *destination, const void *source, int32_t length)
|
||||
{
|
||||
DEBUG_FATAL(!destination, ("nullptr destination arg"));
|
||||
DEBUG_FATAL(!source, ("nullptr source arg"));
|
||||
return memmove(destination, source, static_cast<uint>(length));
|
||||
return memmove(destination, source, static_cast<int32_t>(length));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -182,7 +182,7 @@ PathSearchNode * PathSearchNode::createSearchNode( PathNode const * node )
|
||||
|
||||
PathSearchNode * oldNode = nullptr;
|
||||
|
||||
int mark = node->getMark(3);
|
||||
int64_t mark = node->getMark(3);
|
||||
|
||||
if(mark != -1)
|
||||
{
|
||||
@@ -193,7 +193,7 @@ PathSearchNode * PathSearchNode::createSearchNode( PathNode const * node )
|
||||
|
||||
PathSearchNode * searchNode = new PathSearchNode(m_search,m_graph,node);
|
||||
|
||||
node->setMark( 3, (int)((void*)searchNode) );
|
||||
node->setMark( 3, (int64_t)((void*)searchNode) );
|
||||
|
||||
m_search->m_visitedNodes->push_back(node);
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace Base
|
||||
public:
|
||||
BlockAllocator();
|
||||
~BlockAllocator();
|
||||
void *getBlock(unsigned accum);
|
||||
void returnBlock(unsigned *handle);
|
||||
void *getBlock(long unsigned accum);
|
||||
void returnBlock(long unsigned *handle);
|
||||
|
||||
private:
|
||||
uintptr_t *m_blocks[31];
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Base
|
||||
{
|
||||
while(m_blocks[i] != nullptr)
|
||||
{
|
||||
unsigned *tmp = m_blocks[i];
|
||||
m_blocks[i] = (unsigned *)*m_blocks[i];
|
||||
long unsigned *tmp = m_blocks[i];
|
||||
m_blocks[i] = (long unsigned *)*m_blocks[i];
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
@@ -33,10 +33,10 @@ namespace Base
|
||||
// Allocate a block that is the next power of two greater than the # of bytes passed.
|
||||
// 33 bytes yields a 64 byte block of memory and so forth.
|
||||
|
||||
void *BlockAllocator::getBlock(unsigned bytes)
|
||||
void *BlockAllocator::getBlock(long unsigned bytes)
|
||||
{
|
||||
unsigned accum = 16, bits = 16;
|
||||
unsigned *handle = nullptr;
|
||||
long unsigned accum = 16, bits = 16;
|
||||
long unsigned *handle = nullptr;
|
||||
|
||||
// Perform a binary search looking for the highest bit.
|
||||
|
||||
@@ -44,14 +44,14 @@ namespace Base
|
||||
{
|
||||
// If bytes is less than the bit we're testing for, subtract half
|
||||
// from the bit value and repeat
|
||||
if(bytes < (unsigned)(1 << accum))
|
||||
if(bytes < (long unsigned)(1 << accum))
|
||||
{
|
||||
bits /= 2;
|
||||
accum -= bits;
|
||||
}
|
||||
// If bytes is greater than the bit we're testing for, add half
|
||||
// from the but value and repeat
|
||||
else if(bytes > (unsigned)(1 << accum))
|
||||
else if(bytes > (long unsigned)(1 << accum))
|
||||
{
|
||||
bits /= 2;
|
||||
accum += bits;
|
||||
@@ -79,7 +79,7 @@ namespace Base
|
||||
if(m_blocks[accum] == 0)
|
||||
{
|
||||
// remove the pre allocated block from the linked list
|
||||
handle = (unsigned *)calloc(((1 << accum) / 4) + 2, sizeof(unsigned));
|
||||
handle = (long unsigned *)calloc(((1 << accum) / 4) + 2, sizeof(long unsigned));
|
||||
handle[1] = accum;
|
||||
handle[0] = 0;
|
||||
}
|
||||
@@ -87,20 +87,20 @@ namespace Base
|
||||
{
|
||||
// Allocate a new block
|
||||
handle = m_blocks[accum];
|
||||
m_blocks[accum] = (unsigned *)handle[0];
|
||||
m_blocks[accum] = (long unsigned *)handle[0];
|
||||
handle[0] = 0;
|
||||
}
|
||||
// return a pointer that skips over the header used for the allocator's purposes
|
||||
return(handle + 2);
|
||||
}
|
||||
|
||||
void BlockAllocator::returnBlock(unsigned *handle)
|
||||
void BlockAllocator::returnBlock(long unsigned *handle)
|
||||
{
|
||||
// C++ allows for safe deletion of a nullptr pointer
|
||||
if(handle)
|
||||
{
|
||||
// Update the allocator linked list, insert this entry at the head
|
||||
*(handle - 2) = (unsigned)m_blocks[*(handle - 1)];
|
||||
*(handle - 2) = (long unsigned)m_blocks[*(handle - 1)];
|
||||
// Add this entry to the proper linked list node
|
||||
m_blocks[*(handle - 1)] = (handle - 2);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace Base
|
||||
public:
|
||||
BlockAllocator();
|
||||
~BlockAllocator();
|
||||
void *getBlock(unsigned accum);
|
||||
void returnBlock(unsigned *handle);
|
||||
void *getBlock(long unsigned accum);
|
||||
void returnBlock(long unsigned *handle);
|
||||
|
||||
private:
|
||||
uintptr_t *m_blocks[31];
|
||||
|
||||
+11
-11
@@ -23,8 +23,8 @@ namespace Base
|
||||
{
|
||||
while(m_blocks[i] != nullptr)
|
||||
{
|
||||
unsigned *tmp = m_blocks[i];
|
||||
m_blocks[i] = (unsigned *)*m_blocks[i];
|
||||
long unsigned *tmp = m_blocks[i];
|
||||
m_blocks[i] = (long unsigned *)*m_blocks[i];
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
@@ -33,10 +33,10 @@ namespace Base
|
||||
// Allocate a block that is the next power of two greater than the # of bytes passed.
|
||||
// 33 bytes yields a 64 byte block of memory and so forth.
|
||||
|
||||
void *BlockAllocator::getBlock(unsigned bytes)
|
||||
void *BlockAllocator::getBlock(long unsigned bytes)
|
||||
{
|
||||
unsigned accum = 16, bits = 16;
|
||||
unsigned *handle = nullptr;
|
||||
long unsigned accum = 16, bits = 16;
|
||||
long unsigned *handle = nullptr;
|
||||
|
||||
// Perform a binary search looking for the highest bit.
|
||||
|
||||
@@ -44,14 +44,14 @@ namespace Base
|
||||
{
|
||||
// If bytes is less than the bit we're testing for, subtract half
|
||||
// from the bit value and repeat
|
||||
if(bytes < (unsigned)(1 << accum))
|
||||
if(bytes < (long unsigned)(1 << accum))
|
||||
{
|
||||
bits /= 2;
|
||||
accum -= bits;
|
||||
}
|
||||
// If bytes is greater than the bit we're testing for, add half
|
||||
// from the but value and repeat
|
||||
else if(bytes > (unsigned)(1 << accum))
|
||||
else if(bytes > (long unsigned)(1 << accum))
|
||||
{
|
||||
bits /= 2;
|
||||
accum += bits;
|
||||
@@ -79,7 +79,7 @@ namespace Base
|
||||
if(m_blocks[accum] == 0)
|
||||
{
|
||||
// remove the pre allocated block from the linked list
|
||||
handle = (unsigned *)calloc(((1 << accum) / 4) + 2, sizeof(unsigned));
|
||||
handle = (long unsigned *)calloc(((1 << accum) / 4) + 2, sizeof(long unsigned));
|
||||
handle[1] = accum;
|
||||
handle[0] = 0;
|
||||
}
|
||||
@@ -87,20 +87,20 @@ namespace Base
|
||||
{
|
||||
// Allocate a new block
|
||||
handle = m_blocks[accum];
|
||||
m_blocks[accum] = (unsigned *)handle[0];
|
||||
m_blocks[accum] = (long unsigned *)handle[0];
|
||||
handle[0] = 0;
|
||||
}
|
||||
// return a pointer that skips over the header used for the allocator's purposes
|
||||
return(handle + 2);
|
||||
}
|
||||
|
||||
void BlockAllocator::returnBlock(unsigned *handle)
|
||||
void BlockAllocator::returnBlock(long unsigned *handle)
|
||||
{
|
||||
// C++ allows for safe deletion of a nullptr pointer
|
||||
if(handle)
|
||||
{
|
||||
// Update the allocator linked list, insert this entry at the head
|
||||
*(handle - 2) = (unsigned)m_blocks[*(handle - 1)];
|
||||
*(handle - 2) = (long unsigned)m_blocks[*(handle - 1)];
|
||||
// Add this entry to the proper linked list node
|
||||
m_blocks[*(handle - 1)] = (handle - 2);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace Base
|
||||
public:
|
||||
BlockAllocator();
|
||||
~BlockAllocator();
|
||||
void *getBlock(unsigned accum);
|
||||
void returnBlock(unsigned *handle);
|
||||
void *getBlock(long unsigned accum);
|
||||
void returnBlock(long unsigned *handle);
|
||||
|
||||
private:
|
||||
uintptr_t *m_blocks[31];
|
||||
|
||||
+11
-11
@@ -23,8 +23,8 @@ namespace Base
|
||||
{
|
||||
while(m_blocks[i] != nullptr)
|
||||
{
|
||||
unsigned *tmp = m_blocks[i];
|
||||
m_blocks[i] = (unsigned *)*m_blocks[i];
|
||||
long unsigned *tmp = m_blocks[i];
|
||||
m_blocks[i] = (long unsigned *)*m_blocks[i];
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
@@ -33,10 +33,10 @@ namespace Base
|
||||
// Allocate a block that is the next power of two greater than the # of bytes passed.
|
||||
// 33 bytes yields a 64 byte block of memory and so forth.
|
||||
|
||||
void *BlockAllocator::getBlock(unsigned bytes)
|
||||
void *BlockAllocator::getBlock(long unsigned bytes)
|
||||
{
|
||||
unsigned accum = 16, bits = 16;
|
||||
unsigned *handle = nullptr;
|
||||
long unsigned accum = 16, bits = 16;
|
||||
long unsigned *handle = nullptr;
|
||||
|
||||
// Perform a binary search looking for the highest bit.
|
||||
|
||||
@@ -44,14 +44,14 @@ namespace Base
|
||||
{
|
||||
// If bytes is less than the bit we're testing for, subtract half
|
||||
// from the bit value and repeat
|
||||
if(bytes < (unsigned)(1 << accum))
|
||||
if(bytes < (long unsigned)(1 << accum))
|
||||
{
|
||||
bits /= 2;
|
||||
accum -= bits;
|
||||
}
|
||||
// If bytes is greater than the bit we're testing for, add half
|
||||
// from the but value and repeat
|
||||
else if(bytes > (unsigned)(1 << accum))
|
||||
else if(bytes > (long unsigned)(1 << accum))
|
||||
{
|
||||
bits /= 2;
|
||||
accum += bits;
|
||||
@@ -79,7 +79,7 @@ namespace Base
|
||||
if(m_blocks[accum] == 0)
|
||||
{
|
||||
// remove the pre allocated block from the linked list
|
||||
handle = (unsigned *)calloc(((1 << accum) / 4) + 2, sizeof(unsigned));
|
||||
handle = (long unsigned *)calloc(((1 << accum) / 4) + 2, sizeof(long unsigned));
|
||||
handle[1] = accum;
|
||||
handle[0] = 0;
|
||||
}
|
||||
@@ -87,20 +87,20 @@ namespace Base
|
||||
{
|
||||
// Allocate a new block
|
||||
handle = m_blocks[accum];
|
||||
m_blocks[accum] = (unsigned *)handle[0];
|
||||
m_blocks[accum] = (long unsigned *)handle[0];
|
||||
handle[0] = 0;
|
||||
}
|
||||
// return a pointer that skips over the header used for the allocator's purposes
|
||||
return(handle + 2);
|
||||
}
|
||||
|
||||
void BlockAllocator::returnBlock(unsigned *handle)
|
||||
void BlockAllocator::returnBlock(long unsigned *handle)
|
||||
{
|
||||
// C++ allows for safe deletion of a nullptr pointer
|
||||
if(handle)
|
||||
{
|
||||
// Update the allocator linked list, insert this entry at the head
|
||||
*(handle - 2) = (unsigned)m_blocks[*(handle - 1)];
|
||||
*(handle - 2) = (long unsigned)m_blocks[*(handle - 1)];
|
||||
// Add this entry to the proper linked list node
|
||||
m_blocks[*(handle - 1)] = (handle - 2);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ byte OAEP_P_DEFAULT[1];
|
||||
|
||||
void xorbuf(byte *buf, const byte *mask, unsigned int count)
|
||||
{
|
||||
if (((unsigned int)buf | (unsigned int)mask | count) % WORD_SIZE == 0)
|
||||
if (((long unsigned int)buf | (long unsigned int)mask | count) % WORD_SIZE == 0)
|
||||
XorWords((word *)buf, (const word *)mask, count/WORD_SIZE);
|
||||
else
|
||||
{
|
||||
@@ -21,7 +21,7 @@ void xorbuf(byte *buf, const byte *mask, unsigned int count)
|
||||
|
||||
void xorbuf(byte *output, const byte *input, const byte *mask, unsigned int count)
|
||||
{
|
||||
if (((unsigned int)output | (unsigned int)input | (unsigned int)mask | count) % WORD_SIZE == 0)
|
||||
if (((long unsigned int)output | (long unsigned int)input | (long unsigned int)mask | count) % WORD_SIZE == 0)
|
||||
XorWords((word *)output, (const word *)input, (const word *)mask, count/WORD_SIZE);
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user