1
0
Fork 0

Fix a bunch of error on /std:c++latest

Closes #2820
This commit is contained in:
Duncan Ogilvie 2022-01-17 10:18:54 +01:00
parent 58de91b229
commit 30ce2fe778
8 changed files with 24 additions and 24 deletions

View File

@ -19,14 +19,14 @@ protected:
unsigned char* m_Data;
BBlockArray & m_MainBlocks;
inline unsigned char* AnalysisPass::TranslateAddress(duint Address)
unsigned char* TranslateAddress(duint Address)
{
ASSERT_TRUE(ValidateAddress(Address));
return &m_Data[Address - m_VirtualStart];
}
inline bool AnalysisPass::ValidateAddress(duint Address)
bool ValidateAddress(duint Address)
{
return (Address >= m_VirtualStart && Address < m_VirtualEnd);
}

View File

@ -11,7 +11,7 @@ static bool cbDebugSetBPXTextCommon(BP_TYPE Type, int argc, char* argv[], const
BREAKPOINT bp;
if(IsArgumentsLessThan(argc, 2))
return false;
char* value = "";
const char* value = "";
if(argc > 2)
value = argv[2];

View File

@ -310,7 +310,7 @@ bool cbInstrGpa(int argc, char* argv[])
bool cbDebugSetJIT(int argc, char* argv[])
{
arch actual_arch = notfound;
char* jit_debugger_cmd = "";
const char* jit_debugger_cmd = "";
Memory<char*> oldjit(MAX_SETTING_SIZE + 1);
char path[JIT_ENTRY_DEF_SIZE];
if(!BridgeIsProcessElevated())
@ -334,7 +334,7 @@ bool cbDebugSetJIT(int argc, char* argv[])
if(!_strcmpi(argv[1], "old"))
{
jit_debugger_cmd = oldjit();
if(!BridgeSettingGet("JIT", "Old", jit_debugger_cmd))
if(!BridgeSettingGet("JIT", "Old", oldjit()))
{
dputs(QT_TRANSLATE_NOOP("DBG", "Error there is no old JIT entry stored."));
return false;
@ -375,7 +375,7 @@ bool cbDebugSetJIT(int argc, char* argv[])
{
jit_debugger_cmd = oldjit();
if(!BridgeSettingGet("JIT", "Old", jit_debugger_cmd))
if(!BridgeSettingGet("JIT", "Old", oldjit()))
{
dputs(QT_TRANSLATE_NOOP("DBG", "Error there is no old JIT entry stored."));
return false;

View File

@ -53,8 +53,8 @@ bool cbDebugTraceIntoBeyondTraceRecord(int argc, char* argv[])
{
if(argc == 1)
{
char* new_argv[] = { "tibt", "0" };
return cbDebugConditionalTrace(cbTraceIntoBeyondTraceRecordStep, false, 2, new_argv);
const char* new_argv[] = { "tibt", "0" };
return cbDebugConditionalTrace(cbTraceIntoBeyondTraceRecordStep, false, 2, (char**)new_argv);
}
else
return cbDebugConditionalTrace(cbTraceIntoBeyondTraceRecordStep, false, argc, argv);
@ -64,8 +64,8 @@ bool cbDebugTraceOverBeyondTraceRecord(int argc, char* argv[])
{
if(argc == 1)
{
char* new_argv[] = { "tobt", "0" };
return cbDebugConditionalTrace(cbTraceOverBeyondTraceRecordStep, true, 2, new_argv);
const char* new_argv[] = { "tobt", "0" };
return cbDebugConditionalTrace(cbTraceOverBeyondTraceRecordStep, true, 2, (char**)new_argv);
}
else
return cbDebugConditionalTrace(cbTraceOverBeyondTraceRecordStep, true, argc, argv);
@ -75,8 +75,8 @@ bool cbDebugTraceIntoIntoTraceRecord(int argc, char* argv[])
{
if(argc == 1)
{
char* new_argv[] = { "tiit", "0" };
return cbDebugConditionalTrace(cbTraceIntoIntoTraceRecordStep, false, 2, new_argv);
const char* new_argv[] = { "tiit", "0" };
return cbDebugConditionalTrace(cbTraceIntoIntoTraceRecordStep, false, 2, (char**)new_argv);
}
else
return cbDebugConditionalTrace(cbTraceIntoIntoTraceRecordStep, false, argc, argv);
@ -86,8 +86,8 @@ bool cbDebugTraceOverIntoTraceRecord(int argc, char* argv[])
{
if(argc == 1)
{
char* new_argv[] = { "toit", "0" };
return cbDebugConditionalTrace(cbTraceOverIntoTraceRecordStep, true, 2, new_argv);
const char* new_argv[] = { "toit", "0" };
return cbDebugConditionalTrace(cbTraceOverIntoTraceRecordStep, true, 2, (char**)new_argv);
}
else
return cbDebugConditionalTrace(cbTraceOverIntoTraceRecordStep, true, argc, argv);
@ -126,8 +126,8 @@ bool cbDebugRunToParty(int argc, char* argv[])
bool cbDebugRunToUserCode(int argc, char* argv[])
{
char* newargv[] = { "RunToParty", "0" };
return cbDebugRunToParty(2, newargv);
const char* newargv[] = { "RunToParty", "0" };
return cbDebugRunToParty(2, (char**)newargv);
}
bool cbDebugTraceSetLog(int argc, char* argv[])

View File

@ -1,6 +1,6 @@
#include "jit.h"
static bool readwritejitkey(wchar_t* jit_key_value, DWORD* jit_key_vale_size, char* key, arch arch_in, arch* arch_out, readwritejitkey_error_t* error, bool write)
static bool readwritejitkey(const wchar_t* jit_key_value, DWORD* jit_key_vale_size, const char* key, arch arch_in, arch* arch_out, readwritejitkey_error_t* error, bool write)
{
DWORD key_flags;
DWORD lRv;
@ -62,7 +62,7 @@ static bool readwritejitkey(wchar_t* jit_key_value, DWORD* jit_key_vale_size, ch
if(lRv != ERROR_SUCCESS)
return false;
lRv = RegSetValueExW(hKey, StringUtils::Utf8ToUtf16(key).c_str(), 0, REG_SZ, (BYTE*)jit_key_value, (DWORD)(*jit_key_vale_size) + 1);
lRv = RegSetValueExW(hKey, StringUtils::Utf8ToUtf16(key).c_str(), 0, REG_SZ, (const BYTE*)jit_key_value, (DWORD)(*jit_key_vale_size) + 1);
}
else
{
@ -161,7 +161,7 @@ bool dbggetdefjit(char* jit_entry)
return true;
}
bool dbgsetjit(char* jit_cmd, arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out)
bool dbgsetjit(const char* jit_cmd, arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out)
{
DWORD jit_cmd_size = (DWORD)strlen(jit_cmd) * sizeof(wchar_t);
readwritejitkey_error_t rw_error;

View File

@ -25,7 +25,7 @@ enum arch
};
bool dbggetjit(char jit_entry[JIT_ENTRY_MAX_SIZE], arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out);
bool dbgsetjit(char* jit_cmd, arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out);
bool dbgsetjit(const char* jit_cmd, arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out);
bool dbggetjitauto(bool* auto_on, arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out);
bool dbgsetjitauto(bool auto_on, arch arch_in, arch* arch_out, readwritejitkey_error_t* rw_error_out);
bool dbggetdefjit(char* jit_entry);

View File

@ -211,8 +211,8 @@ bool SymbolSourceDIA::loadSymbolsAsync()
SymbolInfo & sym = _symData[addrIndex.index];
if(prev && sym.rva == prev->rva && sym.decoratedName == prev->decoratedName && sym.undecoratedName == prev->undecoratedName)
{
sym.decoratedName.swap(String());
sym.undecoratedName.swap(String());
String().swap(sym.decoratedName);
String().swap(sym.undecoratedName);
continue;
}
prev = &sym;
@ -467,7 +467,7 @@ bool SymbolSourceDIA::findSymbolExactOrLower(duint rva, SymbolInfo & symInfo)
return true;
}
return nullptr;
return false;
}
void SymbolSourceDIA::enumSymbols(const CbEnumSymbol & cbEnum)

View File

@ -322,7 +322,7 @@ static bool isregister(const char* string)
typedef struct
{
char* name;
const char* name;
unsigned int flag;
} FLAG_NAME_VALUE_TABLE_t;