Fixed compile errors on C++20
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ namespace Utils
|
||||
|
||||
std::string FormatBandwidth(size_t bytes, int milliseconds)
|
||||
{
|
||||
static char* sizes[] =
|
||||
static const char* sizes[] =
|
||||
{
|
||||
"B",
|
||||
"KB",
|
||||
|
@ -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];
|
||||
|
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user