mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
warnings and code formatting
This commit is contained in:
@ -193,10 +193,12 @@ public:
|
||||
void DoPointer(T*& x, T* const base)
|
||||
{
|
||||
// pointers can be more than 2^31 apart, but you're using this function wrong if you need that much range
|
||||
s32 offset = x - base;
|
||||
ptrdiff_t offset = x - base;
|
||||
Do(offset);
|
||||
if (mode == MODE_READ)
|
||||
{
|
||||
x = base + offset;
|
||||
}
|
||||
}
|
||||
|
||||
// Let's pretend std::list doesn't exist!
|
||||
|
@ -404,26 +404,30 @@ std::string UriEncode(const std::string & sSrc)
|
||||
|
||||
std::string UTF16ToUTF8(const std::wstring& input)
|
||||
{
|
||||
auto const size = WideCharToMultiByte(CP_UTF8, 0, input.data(), input.size(), nullptr, 0, nullptr, nullptr);
|
||||
auto const size = WideCharToMultiByte(CP_UTF8, 0, input.data(), (int)input.size(), nullptr, 0, nullptr, nullptr);
|
||||
|
||||
std::string output;
|
||||
output.resize(size);
|
||||
|
||||
if (size == 0 || size != WideCharToMultiByte(CP_UTF8, 0, input.data(), input.size(), &output[0], output.size(), nullptr, nullptr))
|
||||
if (size == 0 || size != WideCharToMultiByte(CP_UTF8, 0, input.data(), (int)input.size(), &output[0], (int)output.size(), nullptr, nullptr))
|
||||
{
|
||||
output.clear();
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
std::wstring CPToUTF16(u32 code_page, const std::string& input)
|
||||
{
|
||||
auto const size = MultiByteToWideChar(code_page, 0, input.data(), input.size(), nullptr, 0);
|
||||
auto const size = MultiByteToWideChar(code_page, 0, input.data(), (int)input.size(), nullptr, 0);
|
||||
|
||||
std::wstring output;
|
||||
output.resize(size);
|
||||
|
||||
if (size == 0 || size != MultiByteToWideChar(code_page, 0, input.data(), input.size(), &output[0], output.size()))
|
||||
if (size == 0 || size != MultiByteToWideChar(code_page, 0, input.data(), (int)input.size(), &output[0], (int)output.size()))
|
||||
{
|
||||
output.clear();
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ unsigned int create_item(SSysConfEntry &item, SysconfType type, const std::strin
|
||||
{
|
||||
item.offset = offset;
|
||||
item.type = type;
|
||||
item.nameLength = name.length();
|
||||
item.nameLength = (u8)(name.length());
|
||||
strncpy(item.name, name.c_str(), 32);
|
||||
item.dataLength = data_length;
|
||||
item.data = new u8[data_length];
|
||||
|
Reference in New Issue
Block a user