From f40e89444200d24b3a064bc06439882a4c795bf8 Mon Sep 17 00:00:00 2001 From: Cekis Date: Thu, 7 Oct 2021 17:30:45 -0400 Subject: [PATCH] Check Point: compiling to about 11% before first error. --- .gitignore | 36 +++++++++---------- CMakeLists.txt | 2 +- engine/CMakeLists.txt | 1 - .../AuctionTransferGameAPI/Base/Archive.cpp | 2 +- .../sharedDebug/src/linux/DebugHelp.cpp | 8 ++--- .../src/shared/FormattedString.h | 4 +-- .../sharedFoundation/src/shared/Misc.h | 4 +-- .../src/shared/PathSearch.cpp | 4 +-- .../platform/utils/Base/BlockAllocator.h | 4 +-- .../utils/Base/linux/BlockAllocator.cpp | 22 ++++++------ .../CSAssist/utils/Base/BlockAllocator.h | 4 +-- .../utils/Base/linux/BlockAllocator.cpp | 22 ++++++------ .../ChatAPI/utils/Base/BlockAllocator.h | 4 +-- .../utils/Base/linux/BlockAllocator.cpp | 22 ++++++------ .../crypto/src/shared/original/misc.cpp | 4 +-- 15 files changed, 71 insertions(+), 72 deletions(-) mode change 100644 => 100755 .gitignore diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 6bf76060..63c5d360 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index fbb41059..e3594347 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index fe0160f6..22d393a1 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -1,4 +1,3 @@ -add_subdirectory(client) add_subdirectory(server) add_subdirectory(shared) diff --git a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/Archive.cpp b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/Archive.cpp index 5385a1b6..848166b9 100755 --- a/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/Archive.cpp +++ b/engine/server/application/CentralServer/src/shared/AuctionTransferGameAPI/Base/Archive.cpp @@ -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); } diff --git a/engine/shared/library/sharedDebug/src/linux/DebugHelp.cpp b/engine/shared/library/sharedDebug/src/linux/DebugHelp.cpp index c1639ebd..cbd271ab 100755 --- a/engine/shared/library/sharedDebug/src/linux/DebugHelp.cpp +++ b/engine/shared/library/sharedDebug/src/linux/DebugHelp.cpp @@ -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(info.dli_fbase)) - addrOffset = reinterpret_cast(info.dli_fbase); + if (progAddr < reinterpret_cast(info.dli_fbase)) + addrOffset = reinterpret_cast(info.dli_fbase); const void *testAddr = reinterpret_cast(progAddr+addrOffset); if (testAddr >= addr) { @@ -509,12 +509,12 @@ static bool stabSearch(Stab const *stab, unsigned int stabSize, char const *stab if (reinterpret_cast(stab->n_value) > info.dli_fbase) funcBase = reinterpret_cast(stab->n_value); else - funcBase = reinterpret_cast(reinterpret_cast(info.dli_fbase)+stab->n_value); + funcBase = reinterpret_cast(reinterpret_cast(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(addr)-reinterpret_cast(funcBase)) + if (stab->n_value < reinterpret_cast(addr)-reinterpret_cast(funcBase)) foundSrcLine = stab->n_desc; else { diff --git a/engine/shared/library/sharedFoundation/src/shared/FormattedString.h b/engine/shared/library/sharedFoundation/src/shared/FormattedString.h index d778be27..93ac6db6 100755 --- a/engine/shared/library/sharedFoundation/src/shared/FormattedString.h +++ b/engine/shared/library/sharedFoundation/src/shared/FormattedString.h @@ -39,7 +39,7 @@ inline FormattedString::FormattedString() } //----------------------------------------------------------------------------- -template +template inline char const * FormattedString::sprintf(char const * const format, ...) { char const * result = nullptr; @@ -55,7 +55,7 @@ inline char const * FormattedString::sprintf(char const * const form } // ---------------------------------------------------------------------- -template +template inline char const * FormattedString::vsprintf(char const * const format, va_list const & va) { // Format the string diff --git a/engine/shared/library/sharedFoundation/src/shared/Misc.h b/engine/shared/library/sharedFoundation/src/shared/Misc.h index 1c29b6ed..4cbcd9dc 100755 --- a/engine/shared/library/sharedFoundation/src/shared/Misc.h +++ b/engine/shared/library/sharedFoundation/src/shared/Misc.h @@ -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(length)); + return memmove(destination, source, static_cast(length)); } // ---------------------------------------------------------------------- diff --git a/engine/shared/library/sharedPathfinding/src/shared/PathSearch.cpp b/engine/shared/library/sharedPathfinding/src/shared/PathSearch.cpp index e09a5cab..5787b985 100755 --- a/engine/shared/library/sharedPathfinding/src/shared/PathSearch.cpp +++ b/engine/shared/library/sharedPathfinding/src/shared/PathSearch.cpp @@ -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); diff --git a/external/3rd/library/platform/utils/Base/BlockAllocator.h b/external/3rd/library/platform/utils/Base/BlockAllocator.h index bbfbf273..860d389d 100755 --- a/external/3rd/library/platform/utils/Base/BlockAllocator.h +++ b/external/3rd/library/platform/utils/Base/BlockAllocator.h @@ -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]; diff --git a/external/3rd/library/platform/utils/Base/linux/BlockAllocator.cpp b/external/3rd/library/platform/utils/Base/linux/BlockAllocator.cpp index 29d91074..7a6dfd31 100755 --- a/external/3rd/library/platform/utils/Base/linux/BlockAllocator.cpp +++ b/external/3rd/library/platform/utils/Base/linux/BlockAllocator.cpp @@ -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); } diff --git a/external/3rd/library/soePlatform/CSAssist/utils/Base/BlockAllocator.h b/external/3rd/library/soePlatform/CSAssist/utils/Base/BlockAllocator.h index bbfbf273..860d389d 100755 --- a/external/3rd/library/soePlatform/CSAssist/utils/Base/BlockAllocator.h +++ b/external/3rd/library/soePlatform/CSAssist/utils/Base/BlockAllocator.h @@ -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]; diff --git a/external/3rd/library/soePlatform/CSAssist/utils/Base/linux/BlockAllocator.cpp b/external/3rd/library/soePlatform/CSAssist/utils/Base/linux/BlockAllocator.cpp index 29d91074..7a6dfd31 100755 --- a/external/3rd/library/soePlatform/CSAssist/utils/Base/linux/BlockAllocator.cpp +++ b/external/3rd/library/soePlatform/CSAssist/utils/Base/linux/BlockAllocator.cpp @@ -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); } diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Base/BlockAllocator.h b/external/3rd/library/soePlatform/ChatAPI/utils/Base/BlockAllocator.h index bbfbf273..860d389d 100755 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Base/BlockAllocator.h +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Base/BlockAllocator.h @@ -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]; diff --git a/external/3rd/library/soePlatform/ChatAPI/utils/Base/linux/BlockAllocator.cpp b/external/3rd/library/soePlatform/ChatAPI/utils/Base/linux/BlockAllocator.cpp index 29d91074..7a6dfd31 100755 --- a/external/3rd/library/soePlatform/ChatAPI/utils/Base/linux/BlockAllocator.cpp +++ b/external/3rd/library/soePlatform/ChatAPI/utils/Base/linux/BlockAllocator.cpp @@ -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); } diff --git a/external/ours/library/crypto/src/shared/original/misc.cpp b/external/ours/library/crypto/src/shared/original/misc.cpp index 5e49edfc..60ad240a 100755 --- a/external/ours/library/crypto/src/shared/original/misc.cpp +++ b/external/ours/library/crypto/src/shared/original/misc.cpp @@ -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 {