Fixed compile errors on C++20

This commit is contained in:
INeedBots
2020-12-09 13:13:34 -06:00
parent 7d8050a7c6
commit eeb70a7da4
24 changed files with 64 additions and 64 deletions

View File

@ -18,7 +18,7 @@ namespace Utils
{
if (this->tokenString.empty())
{
this->tokenString.append(reinterpret_cast<uint8_t*>("\0"), 1);
this->tokenString.append(reinterpret_cast<uint8_t*>(const_cast<char *>("\0")), 1);
}
else
{
@ -31,7 +31,7 @@ namespace Utils
if (!i)
{
// Prepend here, as /dev/urandom says so ;) https://github.com/IW4x/iw4x-client-node/wikis/technical-information#incrementing-the-token
this->tokenString = std::basic_string<uint8_t>(reinterpret_cast<uint8_t*>("\0"), 1) + this->tokenString;
this->tokenString = std::basic_string<uint8_t>(reinterpret_cast<uint8_t*>(const_cast<char*>("\0")), 1) + this->tokenString;
break;
}
}

View File

@ -2,9 +2,9 @@
namespace Utils
{
Library::Library(const std::string& buffer, bool _freeOnDestroy) : module(nullptr), freeOnDestroy(_freeOnDestroy)
Library::Library(const std::string& buffer, bool _freeOnDestroy) : _module(nullptr), freeOnDestroy(_freeOnDestroy)
{
this->module = LoadLibraryExA(buffer.data(), nullptr, 0);
this->_module = LoadLibraryExA(buffer.data(), nullptr, 0);
}
Library::~Library()
@ -22,7 +22,7 @@ namespace Utils
HMODULE Library::getModule()
{
return this->module;
return this->_module;
}
void Library::free()
@ -32,6 +32,6 @@ namespace Utils
FreeLibrary(this->getModule());
}
this->module = nullptr;
this->_module = nullptr;
}
}

View File

@ -5,7 +5,7 @@ namespace Utils
class Library
{
public:
Library() : module(nullptr), freeOnDestroy(false) {};
Library() : _module(nullptr), freeOnDestroy(false) {};
Library(const std::string& buffer, bool freeOnDestroy = true);
~Library();
@ -26,7 +26,7 @@ namespace Utils
void free();
private:
HMODULE module;
HMODULE _module;
bool freeOnDestroy;
};
}

View File

@ -149,7 +149,7 @@ namespace Utils
std::string FormatBandwidth(size_t bytes, int milliseconds)
{
static char* sizes[] =
static const char* sizes[] =
{
"B",
"KB",

View File

@ -13,7 +13,7 @@ namespace Utils
VAProvider() : currentBuffer(0) {}
~VAProvider() {}
char* get(const char* format, va_list ap)
const char* get(const char* format, va_list ap)
{
++this->currentBuffer %= ARRAYSIZE(this->stringPool);
auto entry = &this->stringPool[this->currentBuffer];

View File

@ -15,7 +15,7 @@ namespace Utils
bool IsWineEnvironment();
unsigned long GetParentProcessId();
size_t GetModuleSize(HMODULE module);
size_t GetModuleSize(HMODULE);
void* GetThreadStartAddress(HANDLE hThread);
HMODULE GetNTDLL();