Removed compilation warnings, with Release x64.

This commit is contained in:
vcrom 2016-12-11 15:48:29 +00:00
parent 926e18d25c
commit 81fcbc20ce
30 changed files with 75 additions and 59 deletions

View File

@ -926,7 +926,7 @@ typedef HANDLE MicroProfileThread;
DWORD _stdcall ThreadTrampoline(void* pFunc) DWORD _stdcall ThreadTrampoline(void* pFunc)
{ {
MicroProfileThreadFunc F = (MicroProfileThreadFunc)pFunc; MicroProfileThreadFunc F = (MicroProfileThreadFunc)pFunc;
return (uint32_t)F(0); return reinterpret_cast<uintptr_t>(F(0));
} }
void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func) void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func)

View File

@ -1235,7 +1235,7 @@ void MicroProfileDrawDetailedBars(uint32_t nWidth, uint32_t nHeight, int nBaseY,
// nThreadId is 32-bit on Windows // nThreadId is 32-bit on Windows
int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04x: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04x: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) );
#else #else
int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04llx: %s%s", nThreadId, cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) ); int nStrLen = snprintf(ThreadName, sizeof(ThreadName)-1, "%04llx: %s%s", int64_t(nThreadId), cLocal, i < nNumThreadsBase ? &S.Pool[i]->ThreadName[0] : MICROPROFILE_THREAD_NAME_FROM_ID(nThreadId) );
#endif #endif
uint32_t nThreadColor = -1; uint32_t nThreadColor = -1;
if(nThreadId == nContextSwitchHoverThreadAfter || nThreadId == nContextSwitchHoverThreadBefore) if(nThreadId == nContextSwitchHoverThreadAfter || nThreadId == nContextSwitchHoverThreadBefore)
@ -1853,7 +1853,7 @@ void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight)
{ {
if(nMetaIndex < MICROPROFILE_META_MAX && S.MetaCounters[nMetaIndex].pName) if(nMetaIndex < MICROPROFILE_META_MAX && S.MetaCounters[nMetaIndex].pName)
{ {
uint32_t nStrWidth = strlen(S.MetaCounters[nMetaIndex].pName); uint32_t nStrWidth = u32(strlen(S.MetaCounters[nMetaIndex].pName));
if(S.nBars & MP_DRAW_TIMERS) if(S.nBars & MP_DRAW_TIMERS)
nWidth += 6 + (1+MICROPROFILE_TEXT_WIDTH) * (nStrWidth); nWidth += 6 + (1+MICROPROFILE_TEXT_WIDTH) * (nStrWidth);
if(S.nBars & MP_DRAW_AVERAGE) if(S.nBars & MP_DRAW_AVERAGE)
@ -1907,7 +1907,7 @@ void MicroProfileDrawBarView(uint32_t nScreenWidth, uint32_t nScreenHeight)
{ {
if(0 != (S.nBars & (MP_DRAW_META_FIRST<<i)) && S.MetaCounters[i].pName) if(0 != (S.nBars & (MP_DRAW_META_FIRST<<i)) && S.MetaCounters[i].pName)
{ {
uint32_t nBufferSize = strlen(S.MetaCounters[i].pName) + 32; size_t nBufferSize = strlen(S.MetaCounters[i].pName) + 32;
char* buffer = (char*)alloca(nBufferSize); char* buffer = (char*)alloca(nBufferSize);
if(S.nBars & MP_DRAW_TIMERS) if(S.nBars & MP_DRAW_TIMERS)
nX += MicroProfileDrawBarMetaCount(nX, nY, &S.MetaCounters[i].nCounters[0], S.MetaCounters[i].pName, nTotalHeight) + 1; nX += MicroProfileDrawBarMetaCount(nX, nY, &S.MetaCounters[i].nCounters[0], S.MetaCounters[i].pName, nTotalHeight) + 1;
@ -1991,7 +1991,7 @@ const char* MicroProfileUIMenuGroups(int nIndex, bool* bSelected)
else else
{ {
nIndex = nIndex-1; nIndex = nIndex-1;
if(nIndex < UI.GroupMenuCount) if(nIndex < int(UI.GroupMenuCount))
{ {
MicroProfileGroupMenuItem& Item = UI.GroupMenu[nIndex]; MicroProfileGroupMenuItem& Item = UI.GroupMenu[nIndex];
static char buffer[MICROPROFILE_NAME_MAX_LEN+32]; static char buffer[MICROPROFILE_NAME_MAX_LEN+32];
@ -2134,7 +2134,7 @@ const char* MicroProfileUIMenuCustom(int nIndex, bool* bSelected)
case 1: return "--"; case 1: return "--";
default: default:
nIndex -= 2; nIndex -= 2;
if(nIndex < UI.nCustomCount) if(nIndex <int( UI.nCustomCount))
{ {
return UI.Custom[nIndex].pName; return UI.Custom[nIndex].pName;
} }
@ -2184,7 +2184,7 @@ void MicroProfileUIClickGroups(int nIndex)
else else
{ {
nIndex -= 1; nIndex -= 1;
if(nIndex < UI.GroupMenuCount) if(nIndex < int(UI.GroupMenuCount))
{ {
MicroProfileGroupMenuItem& Item = UI.GroupMenu[nIndex]; MicroProfileGroupMenuItem& Item = UI.GroupMenu[nIndex];
if(Item.nIsCategory) if(Item.nIsCategory)
@ -2599,7 +2599,7 @@ void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
nOffsetY = nOffsetYBase; nOffsetY = nOffsetYBase;
float* pMs = pCustom->nFlags & MICROPROFILE_CUSTOM_BAR_SOURCE_MAX ? pTimeMax : pTimeAvg; float* pMs = pCustom->nFlags & MICROPROFILE_CUSTOM_BAR_SOURCE_MAX ? pTimeMax : pTimeAvg;
const char* pString = pCustom->nFlags & MICROPROFILE_CUSTOM_BAR_SOURCE_MAX ? "Max" : "Avg"; const char* pString = pCustom->nFlags & MICROPROFILE_CUSTOM_BAR_SOURCE_MAX ? "Max" : "Avg";
MicroProfileDrawText(nMaxOffsetX, nOffsetY, (uint32_t)-1, pString, strlen(pString)); MicroProfileDrawText(nMaxOffsetX, nOffsetY, (uint32_t)-1, pString, (uint32_t)strlen(pString));
int nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2fms", fReference); int nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2fms", fReference);
MicroProfileDrawText(nReducedWidth - (1+nSize) * (MICROPROFILE_TEXT_WIDTH+1), nOffsetY, (uint32_t)-1, Buffer, nSize); MicroProfileDrawText(nReducedWidth - (1+nSize) * (MICROPROFILE_TEXT_WIDTH+1), nOffsetY, (uint32_t)-1, Buffer, nSize);
for(uint32_t i = 0; i < nCount; ++i) for(uint32_t i = 0; i < nCount; ++i)
@ -2613,7 +2613,7 @@ void MicroProfileDrawCustom(uint32_t nWidth, uint32_t nHeight)
{ {
nOffsetY += 2*(1+MICROPROFILE_TEXT_HEIGHT); nOffsetY += 2*(1+MICROPROFILE_TEXT_HEIGHT);
const char* pString = pCustom->nFlags & MICROPROFILE_CUSTOM_STACK_SOURCE_MAX ? "Max" : "Avg"; const char* pString = pCustom->nFlags & MICROPROFILE_CUSTOM_STACK_SOURCE_MAX ? "Max" : "Avg";
MicroProfileDrawText(MICROPROFILE_CUSTOM_PADDING, nOffsetY, (uint32_t)-1, pString, strlen(pString)); MicroProfileDrawText(MICROPROFILE_CUSTOM_PADDING, nOffsetY, (uint32_t)-1, pString, (uint32_t)strlen(pString));
int nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2fms", fReference); int nSize = snprintf(Buffer, sizeof(Buffer)-1, "%6.2fms", fReference);
MicroProfileDrawText(nReducedWidth - (1+nSize) * (MICROPROFILE_TEXT_WIDTH+1), nOffsetY, (uint32_t)-1, Buffer, nSize); MicroProfileDrawText(nReducedWidth - (1+nSize) * (MICROPROFILE_TEXT_WIDTH+1), nOffsetY, (uint32_t)-1, Buffer, nSize);
nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT); nOffsetY += (1+MICROPROFILE_TEXT_HEIGHT);

View File

@ -271,7 +271,7 @@ void GraphicsSurfaceWidget::Pick(int x, int y) {
surface_picker_x_control->setValue(x); surface_picker_x_control->setValue(x);
surface_picker_y_control->setValue(y); surface_picker_y_control->setValue(y);
if (x < 0 || x >= surface_width || y < 0 || y >= surface_height) { if (x < 0 || x >= int(surface_width) || y < 0 || y >= int(surface_height)) {
surface_info_label->setText(tr("Pixel out of bounds")); surface_info_label->setText(tr("Pixel out of bounds"));
surface_info_label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); surface_info_label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
return; return;

View File

@ -116,6 +116,8 @@ QString WaitTreeWaitObject::GetResetTypeQString(Kernel::ResetType reset_type) {
return tr("sticky"); return tr("sticky");
case Kernel::ResetType::Pulse: case Kernel::ResetType::Pulse:
return tr("pulse"); return tr("pulse");
default:
UNREACHABLE();
} }
} }

View File

@ -52,5 +52,5 @@ __declspec(noinline, noreturn)
#define DEBUG_ASSERT_MSG(_a_, _desc_, ...) #define DEBUG_ASSERT_MSG(_a_, _desc_, ...)
#endif #endif
#define UNIMPLEMENTED() DEBUG_ASSERT_MSG(false, "Unimplemented code!") #define UNIMPLEMENTED() ASSERT_MSG(false, "Unimplemented code!")
#define UNIMPLEMENTED_MSG(_a_, ...) ASSERT_MSG(false, _a_, __VA_ARGS__) #define UNIMPLEMENTED_MSG(_a_, ...) ASSERT_MSG(false, _a_, __VA_ARGS__)

View File

@ -84,6 +84,7 @@ const char* GetLogClassName(Class log_class) {
case Class::Count: case Class::Count:
UNREACHABLE(); UNREACHABLE();
} }
UNREACHABLE();
} }
const char* GetLevelName(Level log_level) { const char* GetLevelName(Level log_level) {
@ -101,6 +102,7 @@ const char* GetLevelName(Level log_level) {
UNREACHABLE(); UNREACHABLE();
} }
#undef LVL #undef LVL
UNREACHABLE();
} }
Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr, Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr,

View File

@ -132,7 +132,7 @@ MICROPROFILE_DEFINE(ARM_Jit, "ARM JIT", "ARM JIT", MP_RGB(255, 64, 64));
void ARM_Dynarmic::ExecuteInstructions(int num_instructions) { void ARM_Dynarmic::ExecuteInstructions(int num_instructions) {
MICROPROFILE_SCOPE(ARM_Jit); MICROPROFILE_SCOPE(ARM_Jit);
unsigned ticks_executed = jit->Run(static_cast<unsigned>(num_instructions)); unsigned ticks_executed = unsigned(jit->Run(static_cast<unsigned>(num_instructions)));
AddTicks(ticks_executed); AddTicks(ticks_executed);
} }

View File

@ -759,7 +759,7 @@ static ThumbDecodeStatus DecodeThumbInstruction(u32 inst, u32 addr, u32* arm_ins
ThumbDecodeStatus ret = TranslateThumbInstruction(addr, inst, arm_inst, inst_size); ThumbDecodeStatus ret = TranslateThumbInstruction(addr, inst, arm_inst, inst_size);
if (ret == ThumbDecodeStatus::BRANCH) { if (ret == ThumbDecodeStatus::BRANCH) {
int inst_index; int inst_index;
int table_length = arm_instruction_trans_len; int table_length = int(arm_instruction_trans_len);
u32 tinstr = GetThumbInstruction(inst, addr); u32 tinstr = GetThumbInstruction(inst, addr);
switch ((tinstr & 0xF800) >> 11) { switch ((tinstr & 0xF800) >> 11) {
@ -849,7 +849,7 @@ static int InterpreterTranslateBlock(ARMul_State* cpu, int& bb_start, u32 addr)
ARM_INST_PTR inst_base = nullptr; ARM_INST_PTR inst_base = nullptr;
TransExtData ret = TransExtData::NON_BRANCH; TransExtData ret = TransExtData::NON_BRANCH;
int size = 0; // instruction size of basic block int size = 0; // instruction size of basic block
bb_start = trans_cache_buf_top; bb_start = (int)trans_cache_buf_top;
u32 phys_addr = addr; u32 phys_addr = addr;
u32 pc_start = cpu->Reg[15]; u32 pc_start = cpu->Reg[15];
@ -876,7 +876,7 @@ static int InterpreterTranslateSingle(ARMul_State* cpu, int& bb_start, u32 addr)
MICROPROFILE_SCOPE(DynCom_Decode); MICROPROFILE_SCOPE(DynCom_Decode);
ARM_INST_PTR inst_base = nullptr; ARM_INST_PTR inst_base = nullptr;
bb_start = trans_cache_buf_top; bb_start = int(trans_cache_buf_top);
u32 phys_addr = addr; u32 phys_addr = addr;
u32 pc_start = cpu->Reg[15]; u32 pc_start = cpu->Reg[15];

View File

@ -20,7 +20,7 @@ struct arm_inst {
unsigned int idx; unsigned int idx;
unsigned int cond; unsigned int cond;
TransExtData br; TransExtData br;
char component[0]; char* component;
}; };
struct generic_arm_inst { struct generic_arm_inst {

View File

@ -89,6 +89,8 @@ std::u16string Path::AsU16Str() const {
// TODO(yuriks): Add assert // TODO(yuriks): Add assert
LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!"); LOG_ERROR(Service_FS, "LowPathType cannot be converted to u16string!");
return {}; return {};
default:
UNREACHABLE();
} }
} }

View File

@ -947,8 +947,8 @@ static void Init(u16 port) {
WSAStartup(MAKEWORD(2, 2), &InitData); WSAStartup(MAKEWORD(2, 2), &InitData);
#endif #endif
int tmpsock = socket(PF_INET, SOCK_STREAM, 0); auto tmpsock = socket(PF_INET, SOCK_STREAM, 0);
if (tmpsock == -1) { if (int(tmpsock) == -1) {
LOG_ERROR(Debug_GDBStub, "Failed to create gdb socket"); LOG_ERROR(Debug_GDBStub, "Failed to create gdb socket");
} }
@ -974,7 +974,7 @@ static void Init(u16 port) {
sockaddr_in saddr_client; sockaddr_in saddr_client;
sockaddr* client_addr = reinterpret_cast<sockaddr*>(&saddr_client); sockaddr* client_addr = reinterpret_cast<sockaddr*>(&saddr_client);
socklen_t client_addrlen = sizeof(saddr_client); socklen_t client_addrlen = sizeof(saddr_client);
gdbserver_socket = accept(tmpsock, client_addr, &client_addrlen); gdbserver_socket = static_cast<int>(accept(tmpsock, client_addr, &client_addrlen));
if (gdbserver_socket < 0) { if (gdbserver_socket < 0) {
// In the case that we couldn't start the server for whatever reason, just start CPU // In the case that we couldn't start the server for whatever reason, just start CPU
// execution like normal. // execution like normal.

View File

@ -31,7 +31,7 @@ ResultCode ErrEula::ReceiveParameter(const Service::APT::MessageParameter& param
heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); heap_memory = std::make_shared<std::vector<u8>>(capture_info.size);
// Create a SharedMemory that directly points to this heap block. // Create a SharedMemory that directly points to this heap block.
framebuffer_memory = Kernel::SharedMemory::CreateForApplet( framebuffer_memory = Kernel::SharedMemory::CreateForApplet(
heap_memory, 0, heap_memory->size(), MemoryPermission::ReadWrite, heap_memory, 0, u32(heap_memory->size()), MemoryPermission::ReadWrite,
MemoryPermission::ReadWrite, "ErrEula Memory"); MemoryPermission::ReadWrite, "ErrEula Memory");
// Send the response message with the newly created SharedMemory // Send the response message with the newly created SharedMemory

View File

@ -39,7 +39,7 @@ ResultCode MiiSelector::ReceiveParameter(const Service::APT::MessageParameter& p
heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); heap_memory = std::make_shared<std::vector<u8>>(capture_info.size);
// Create a SharedMemory that directly points to this heap block. // Create a SharedMemory that directly points to this heap block.
framebuffer_memory = Kernel::SharedMemory::CreateForApplet( framebuffer_memory = Kernel::SharedMemory::CreateForApplet(
heap_memory, 0, heap_memory->size(), MemoryPermission::ReadWrite, heap_memory, 0, u32(heap_memory->size()), MemoryPermission::ReadWrite,
MemoryPermission::ReadWrite, "MiiSelector Memory"); MemoryPermission::ReadWrite, "MiiSelector Memory");
// Send the response message with the newly created SharedMemory // Send the response message with the newly created SharedMemory

View File

@ -42,7 +42,7 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con
heap_memory = std::make_shared<std::vector<u8>>(capture_info.size); heap_memory = std::make_shared<std::vector<u8>>(capture_info.size);
// Create a SharedMemory that directly points to this heap block. // Create a SharedMemory that directly points to this heap block.
framebuffer_memory = Kernel::SharedMemory::CreateForApplet( framebuffer_memory = Kernel::SharedMemory::CreateForApplet(
heap_memory, 0, heap_memory->size(), MemoryPermission::ReadWrite, heap_memory, 0, static_cast<u32>(heap_memory->size()), MemoryPermission::ReadWrite,
MemoryPermission::ReadWrite, "SoftwareKeyboard Memory"); MemoryPermission::ReadWrite, "SoftwareKeyboard Memory");
// Send the response message with the newly created SharedMemory // Send the response message with the newly created SharedMemory

View File

@ -100,6 +100,8 @@ public:
case HandleType::CodeSet: case HandleType::CodeSet:
case HandleType::ClientPort: case HandleType::ClientPort:
return false; return false;
default:
UNREACHABLE();
} }
} }

View File

@ -35,7 +35,7 @@ SharedPtr<SharedMemory> SharedMemory::Create(SharedPtr<Process> owner_process, u
"Not enough space in region to allocate shared memory!"); "Not enough space in region to allocate shared memory!");
shared_memory->backing_block = linheap_memory; shared_memory->backing_block = linheap_memory;
shared_memory->backing_block_offset = linheap_memory->size(); shared_memory->backing_block_offset = u32(linheap_memory->size());
// Allocate some memory from the end of the linear heap for this region. // Allocate some memory from the end of the linear heap for this region.
linheap_memory->insert(linheap_memory->end(), size, 0); linheap_memory->insert(linheap_memory->end(), size, 0);
memory_region->used += size; memory_region->used += size;

View File

@ -523,7 +523,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
ErrorSummary::OutOfResource, ErrorLevel::Permanent); ErrorSummary::OutOfResource, ErrorLevel::Permanent);
} }
u32 offset = linheap_memory->size(); u32 offset = u32(linheap_memory->size());
// Allocate some memory from the end of the linear heap for this region. // Allocate some memory from the end of the linear heap for this region.
linheap_memory->insert(linheap_memory->end(), Memory::PAGE_SIZE, 0); linheap_memory->insert(linheap_memory->end(), Memory::PAGE_SIZE, 0);
@ -531,7 +531,7 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point,
Kernel::g_current_process->linear_heap_used += Memory::PAGE_SIZE; Kernel::g_current_process->linear_heap_used += Memory::PAGE_SIZE;
tls_slots.emplace_back(0); // The page is completely available at the start tls_slots.emplace_back(0); // The page is completely available at the start
available_page = tls_slots.size() - 1; available_page = u32(tls_slots.size()) - 1;
available_slot = 0; // Use the first slot in the new page available_slot = 0; // Use the first slot in the new page
auto& vm_manager = Kernel::g_current_process->vm_manager; auto& vm_manager = Kernel::g_current_process->vm_manager;

View File

@ -211,12 +211,12 @@ void ReceiveParameter(Service::Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[2] = next_parameter.sender_id; cmd_buff[2] = next_parameter.sender_id;
cmd_buff[3] = next_parameter.signal; // Signal type cmd_buff[3] = next_parameter.signal; // Signal type
cmd_buff[4] = next_parameter.buffer.size(); // Parameter buffer size cmd_buff[4] = u32(next_parameter.buffer.size()); // Parameter buffer size
cmd_buff[5] = 0x10; cmd_buff[5] = 0x10;
cmd_buff[6] = 0; cmd_buff[6] = 0;
if (next_parameter.object != nullptr) if (next_parameter.object != nullptr)
cmd_buff[6] = Kernel::g_handle_table.Create(next_parameter.object).MoveFrom(); cmd_buff[6] = Kernel::g_handle_table.Create(next_parameter.object).MoveFrom();
cmd_buff[7] = (next_parameter.buffer.size() << 14) | 2; cmd_buff[7] = u32((next_parameter.buffer.size() << 14) | 2);
cmd_buff[8] = buffer; cmd_buff[8] = buffer;
Memory::WriteBlock(buffer, next_parameter.buffer.data(), next_parameter.buffer.size()); Memory::WriteBlock(buffer, next_parameter.buffer.data(), next_parameter.buffer.size());
@ -233,12 +233,12 @@ void GlanceParameter(Service::Interface* self) {
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
cmd_buff[2] = next_parameter.sender_id; cmd_buff[2] = next_parameter.sender_id;
cmd_buff[3] = next_parameter.signal; // Signal type cmd_buff[3] = next_parameter.signal; // Signal type
cmd_buff[4] = next_parameter.buffer.size(); // Parameter buffer size cmd_buff[4] = u32(next_parameter.buffer.size()); // Parameter buffer size
cmd_buff[5] = 0x10; cmd_buff[5] = 0x10;
cmd_buff[6] = 0; cmd_buff[6] = 0;
if (next_parameter.object != nullptr) if (next_parameter.object != nullptr)
cmd_buff[6] = Kernel::g_handle_table.Create(next_parameter.object).MoveFrom(); cmd_buff[6] = Kernel::g_handle_table.Create(next_parameter.object).MoveFrom();
cmd_buff[7] = (next_parameter.buffer.size() << 14) | 2; cmd_buff[7] = u32((next_parameter.buffer.size() << 14) | 2);
cmd_buff[8] = buffer; cmd_buff[8] = buffer;
Memory::WriteBlock(buffer, next_parameter.buffer.data(), Memory::WriteBlock(buffer, next_parameter.buffer.data(),

View File

@ -139,7 +139,7 @@ static void LoadComponent(Service::Interface* self) {
Memory::ReadBlock(buffer, component_data.data(), component_data.size()); Memory::ReadBlock(buffer, component_data.data(), component_data.size());
LOG_INFO(Service_DSP, "Firmware hash: %#" PRIx64, LOG_INFO(Service_DSP, "Firmware hash: %#" PRIx64,
Common::ComputeHash64(component_data.data(), component_data.size())); Common::ComputeHash64(component_data.data(), u32(component_data.size())));
// Some versions of the firmware have the location of DSP structures listed here. // Some versions of the firmware have the location of DSP structures listed here.
ASSERT(size > 0x37C); ASSERT(size > 0x37C);
LOG_INFO(Service_DSP, "Structures hash: %#" PRIx64, LOG_INFO(Service_DSP, "Structures hash: %#" PRIx64,

View File

@ -220,7 +220,7 @@ ResultVal<bool> Directory::SyncRequest() {
count); count);
// Number of entries actually read // Number of entries actually read
u32 read = backend->Read(entries.size(), entries.data()); u32 read = backend->Read(u32(entries.size()), entries.data());
cmd_buff[2] = read; cmd_buff[2] = read;
Memory::WriteBlock(address, entries.data(), read * sizeof(FileSys::Entry)); Memory::WriteBlock(address, entries.data(), read * sizeof(FileSys::Entry));
break; break;

View File

@ -37,7 +37,7 @@ static int enable_gyroscope_count = 0; // positive means enabled
static PadState GetCirclePadDirectionState(s16 circle_pad_x, s16 circle_pad_y) { static PadState GetCirclePadDirectionState(s16 circle_pad_x, s16 circle_pad_y) {
// 30 degree and 60 degree are angular thresholds for directions // 30 degree and 60 degree are angular thresholds for directions
constexpr float TAN30 = 0.577350269, TAN60 = 1 / TAN30; constexpr float TAN30 = 0.577350269f, TAN60 = 1 / TAN30;
// a circle pad radius greater than 40 will trigger circle pad direction // a circle pad radius greater than 40 will trigger circle pad direction
constexpr int CIRCLE_PAD_THRESHOLD_SQUARE = 40 * 40; constexpr int CIRCLE_PAD_THRESHOLD_SQUARE = 40 * 40;
PadState state; PadState state;

View File

@ -413,7 +413,7 @@ private:
*/ */
template <typename T> template <typename T>
void GetEntry(std::size_t index, T& data) const { void GetEntry(std::size_t index, T& data) const {
Memory::ReadBlock(GetField(T::TABLE_OFFSET_FIELD) + index * sizeof(T), &data, sizeof(T)); Memory::ReadBlock(static_cast<VAddr>(GetField(T::TABLE_OFFSET_FIELD) + index * sizeof(T)), &data, sizeof(T));
} }
/** /**
@ -425,7 +425,7 @@ private:
*/ */
template <typename T> template <typename T>
void SetEntry(std::size_t index, const T& data) { void SetEntry(std::size_t index, const T& data) {
Memory::WriteBlock(GetField(T::TABLE_OFFSET_FIELD) + index * sizeof(T), &data, sizeof(T)); Memory::WriteBlock(static_cast<VAddr>(GetField(T::TABLE_OFFSET_FIELD) + index * sizeof(T)), &data, sizeof(T));
} }
/** /**

View File

@ -92,7 +92,7 @@ static void StartSampling(Interface* self) {
sample_rate = static_cast<SampleRate>(cmd_buff[2] & 0xFF); sample_rate = static_cast<SampleRate>(cmd_buff[2] & 0xFF);
audio_buffer_offset = cmd_buff[3]; audio_buffer_offset = cmd_buff[3];
audio_buffer_size = cmd_buff[4]; audio_buffer_size = cmd_buff[4];
audio_buffer_loop = static_cast<bool>(cmd_buff[5] & 0xFF); audio_buffer_loop = (cmd_buff[5] & 0xFF) > 0;
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
is_sampling = true; is_sampling = true;
@ -200,7 +200,7 @@ static void GetGain(Interface* self) {
*/ */
static void SetPower(Interface* self) { static void SetPower(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
mic_power = static_cast<bool>(cmd_buff[1] & 0xFF); mic_power = (cmd_buff[1] & 0xFF) > 0;
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_MIC, "(STUBBED) called, mic_power=%u", mic_power); LOG_WARNING(Service_MIC, "(STUBBED) called, mic_power=%u", mic_power);
} }
@ -250,7 +250,7 @@ static void SetIirFilterMic(Interface* self) {
*/ */
static void SetClamp(Interface* self) { static void SetClamp(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
clamp = static_cast<bool>(cmd_buff[1] & 0xFF); clamp = (cmd_buff[1] & 0xFF) > 0;
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_MIC, "(STUBBED) called, clamp=%u", clamp); LOG_WARNING(Service_MIC, "(STUBBED) called, clamp=%u", clamp);
} }
@ -280,7 +280,7 @@ static void GetClamp(Interface* self) {
*/ */
static void SetAllowShellClosed(Interface* self) { static void SetAllowShellClosed(Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer(); u32* cmd_buff = Kernel::GetCommandBuffer();
allow_shell_closed = static_cast<bool>(cmd_buff[1] & 0xFF); allow_shell_closed = (cmd_buff[1] & 0xFF) > 0;
cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[1] = RESULT_SUCCESS.raw; // No error
LOG_WARNING(Service_MIC, "(STUBBED) called, allow_shell_closed=%u", allow_shell_closed); LOG_WARNING(Service_MIC, "(STUBBED) called, allow_shell_closed=%u", allow_shell_closed);
} }

View File

@ -392,7 +392,7 @@ void ReadBlock(const VAddr src_addr, void* dest_buffer, const size_t size) {
while (remaining_size > 0) { while (remaining_size > 0) {
const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size); const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size);
const VAddr current_vaddr = (page_index << PAGE_BITS) + page_offset; const auto current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
switch (current_page_table->attributes[page_index]) { switch (current_page_table->attributes[page_index]) {
case PageType::Unmapped: { case PageType::Unmapped: {
@ -415,7 +415,7 @@ void ReadBlock(const VAddr src_addr, void* dest_buffer, const size_t size) {
break; break;
} }
case PageType::RasterizerCachedMemory: { case PageType::RasterizerCachedMemory: {
RasterizerFlushRegion(VirtualToPhysicalAddress(current_vaddr), copy_amount); RasterizerFlushRegion(VirtualToPhysicalAddress(current_vaddr), u32(copy_amount));
std::memcpy(dest_buffer, GetPointerFromVMA(current_vaddr), copy_amount); std::memcpy(dest_buffer, GetPointerFromVMA(current_vaddr), copy_amount);
break; break;
@ -423,7 +423,7 @@ void ReadBlock(const VAddr src_addr, void* dest_buffer, const size_t size) {
case PageType::RasterizerCachedSpecial: { case PageType::RasterizerCachedSpecial: {
DEBUG_ASSERT(GetMMIOHandler(current_vaddr)); DEBUG_ASSERT(GetMMIOHandler(current_vaddr));
RasterizerFlushRegion(VirtualToPhysicalAddress(current_vaddr), copy_amount); RasterizerFlushRegion(VirtualToPhysicalAddress(current_vaddr), u32(copy_amount));
GetMMIOHandler(current_vaddr)->ReadBlock(current_vaddr, dest_buffer, copy_amount); GetMMIOHandler(current_vaddr)->ReadBlock(current_vaddr, dest_buffer, copy_amount);
break; break;
@ -462,7 +462,7 @@ void WriteBlock(const VAddr dest_addr, const void* src_buffer, const size_t size
while (remaining_size > 0) { while (remaining_size > 0) {
const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size); const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size);
const VAddr current_vaddr = (page_index << PAGE_BITS) + page_offset; const auto current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
switch (current_page_table->attributes[page_index]) { switch (current_page_table->attributes[page_index]) {
case PageType::Unmapped: { case PageType::Unmapped: {
@ -486,7 +486,7 @@ void WriteBlock(const VAddr dest_addr, const void* src_buffer, const size_t size
} }
case PageType::RasterizerCachedMemory: { case PageType::RasterizerCachedMemory: {
RasterizerFlushAndInvalidateRegion(VirtualToPhysicalAddress(current_vaddr), RasterizerFlushAndInvalidateRegion(VirtualToPhysicalAddress(current_vaddr),
copy_amount); u32(copy_amount));
std::memcpy(GetPointerFromVMA(current_vaddr), src_buffer, copy_amount); std::memcpy(GetPointerFromVMA(current_vaddr), src_buffer, copy_amount);
break; break;
@ -495,7 +495,7 @@ void WriteBlock(const VAddr dest_addr, const void* src_buffer, const size_t size
DEBUG_ASSERT(GetMMIOHandler(current_vaddr)); DEBUG_ASSERT(GetMMIOHandler(current_vaddr));
RasterizerFlushAndInvalidateRegion(VirtualToPhysicalAddress(current_vaddr), RasterizerFlushAndInvalidateRegion(VirtualToPhysicalAddress(current_vaddr),
copy_amount); u32(copy_amount));
GetMMIOHandler(current_vaddr)->WriteBlock(current_vaddr, src_buffer, copy_amount); GetMMIOHandler(current_vaddr)->WriteBlock(current_vaddr, src_buffer, copy_amount);
break; break;
@ -520,7 +520,7 @@ void ZeroBlock(const VAddr dest_addr, const size_t size) {
while (remaining_size > 0) { while (remaining_size > 0) {
const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size); const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size);
const VAddr current_vaddr = (page_index << PAGE_BITS) + page_offset; const auto current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
switch (current_page_table->attributes[page_index]) { switch (current_page_table->attributes[page_index]) {
case PageType::Unmapped: { case PageType::Unmapped: {
@ -543,7 +543,7 @@ void ZeroBlock(const VAddr dest_addr, const size_t size) {
} }
case PageType::RasterizerCachedMemory: { case PageType::RasterizerCachedMemory: {
RasterizerFlushAndInvalidateRegion(VirtualToPhysicalAddress(current_vaddr), RasterizerFlushAndInvalidateRegion(VirtualToPhysicalAddress(current_vaddr),
copy_amount); u32(copy_amount));
std::memset(GetPointerFromVMA(current_vaddr), 0, copy_amount); std::memset(GetPointerFromVMA(current_vaddr), 0, copy_amount);
break; break;
@ -552,7 +552,7 @@ void ZeroBlock(const VAddr dest_addr, const size_t size) {
DEBUG_ASSERT(GetMMIOHandler(current_vaddr)); DEBUG_ASSERT(GetMMIOHandler(current_vaddr));
RasterizerFlushAndInvalidateRegion(VirtualToPhysicalAddress(current_vaddr), RasterizerFlushAndInvalidateRegion(VirtualToPhysicalAddress(current_vaddr),
copy_amount); u32(copy_amount));
GetMMIOHandler(current_vaddr)->WriteBlock(current_vaddr, zeros.data(), copy_amount); GetMMIOHandler(current_vaddr)->WriteBlock(current_vaddr, zeros.data(), copy_amount);
break; break;
@ -574,7 +574,7 @@ void CopyBlock(VAddr dest_addr, VAddr src_addr, const size_t size) {
while (remaining_size > 0) { while (remaining_size > 0) {
const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size); const size_t copy_amount = std::min(PAGE_SIZE - page_offset, remaining_size);
const VAddr current_vaddr = (page_index << PAGE_BITS) + page_offset; const auto current_vaddr = static_cast<VAddr>((page_index << PAGE_BITS) + page_offset);
switch (current_page_table->attributes[page_index]) { switch (current_page_table->attributes[page_index]) {
case PageType::Unmapped: { case PageType::Unmapped: {
@ -598,7 +598,7 @@ void CopyBlock(VAddr dest_addr, VAddr src_addr, const size_t size) {
break; break;
} }
case PageType::RasterizerCachedMemory: { case PageType::RasterizerCachedMemory: {
RasterizerFlushRegion(VirtualToPhysicalAddress(current_vaddr), copy_amount); RasterizerFlushRegion(VirtualToPhysicalAddress(current_vaddr), u32(copy_amount));
WriteBlock(dest_addr, GetPointerFromVMA(current_vaddr), copy_amount); WriteBlock(dest_addr, GetPointerFromVMA(current_vaddr), copy_amount);
break; break;
@ -606,7 +606,7 @@ void CopyBlock(VAddr dest_addr, VAddr src_addr, const size_t size) {
case PageType::RasterizerCachedSpecial: { case PageType::RasterizerCachedSpecial: {
DEBUG_ASSERT(GetMMIOHandler(current_vaddr)); DEBUG_ASSERT(GetMMIOHandler(current_vaddr));
RasterizerFlushRegion(VirtualToPhysicalAddress(current_vaddr), copy_amount); RasterizerFlushRegion(VirtualToPhysicalAddress(current_vaddr), u32(copy_amount));
std::vector<u8> buffer(copy_amount); std::vector<u8> buffer(copy_amount);
GetMMIOHandler(current_vaddr)->ReadBlock(current_vaddr, buffer.data(), buffer.size()); GetMMIOHandler(current_vaddr)->ReadBlock(current_vaddr, buffer.data(), buffer.size());
@ -619,8 +619,8 @@ void CopyBlock(VAddr dest_addr, VAddr src_addr, const size_t size) {
page_index++; page_index++;
page_offset = 0; page_offset = 0;
dest_addr += copy_amount; dest_addr += static_cast<VAddr>(copy_amount);
src_addr += copy_amount; src_addr += static_cast<VAddr>(copy_amount);
remaining_size -= copy_amount; remaining_size -= copy_amount;
} }
} }

View File

@ -681,6 +681,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
case ColorModifier::OneMinusSourceBlue: case ColorModifier::OneMinusSourceBlue:
return (Math::Vec3<u8>(255, 255, 255) - values.bbb()).Cast<u8>(); return (Math::Vec3<u8>(255, 255, 255) - values.bbb()).Cast<u8>();
default:
UNREACHABLE();
} }
}; };
@ -710,6 +712,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
case AlphaModifier::OneMinusSourceBlue: case AlphaModifier::OneMinusSourceBlue:
return 255 - values.b(); return 255 - values.b();
default:
UNREACHABLE();
} }
}; };
@ -1253,6 +1257,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader
case Regs::LogicOp::OrInverted: case Regs::LogicOp::OrInverted:
return ~src | dest; return ~src | dest;
default:
UNREACHABLE();
} }
}; };

View File

@ -738,7 +738,7 @@ bool RasterizerOpenGL::AccelerateDisplayTransfer(const GPU::Regs::DisplayTransfe
// Adjust the source rectangle to take into account parts of the input lines being cropped // Adjust the source rectangle to take into account parts of the input lines being cropped
if (config.input_width > config.output_width) { if (config.input_width > config.output_width) {
src_rect.right -= (config.input_width - config.output_width) * src_surface->res_scale_width; src_rect.right -= int((config.input_width - config.output_width) * src_surface->res_scale_width);
} }
// Require destination surface to have same resolution scale as source to preserve scaling // Require destination surface to have same resolution scale as source to preserve scaling

View File

@ -76,7 +76,7 @@ union PicaShaderConfig {
} }
state.fog_mode = regs.fog_mode; state.fog_mode = regs.fog_mode;
state.fog_flip = regs.fog_flip; state.fog_flip = regs.fog_flip.ToBool();
state.combiner_buffer_input = regs.tev_combiner_buffer_input.update_mask_rgb.Value() | state.combiner_buffer_input = regs.tev_combiner_buffer_input.update_mask_rgb.Value() |
regs.tev_combiner_buffer_input.update_mask_a.Value() << 4; regs.tev_combiner_buffer_input.update_mask_a.Value() << 4;

View File

@ -121,7 +121,7 @@ void ShaderSetup::Run(UnitState<false>& state, const InputVertex& input, int num
// Setup input register table // Setup input register table
const auto& attribute_register_map = config.input_register_map; const auto& attribute_register_map = config.input_register_map;
for (unsigned i = 0; i < num_attributes; i++) for (unsigned i = 0; i < (unsigned)num_attributes; i++)
state.registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i]; state.registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i];
state.conditional_code[0] = false; state.conditional_code[0] = false;
@ -148,7 +148,7 @@ DebugData<true> ShaderSetup::ProduceDebugInfo(const InputVertex& input, int num_
// Setup input register table // Setup input register table
boost::fill(state.registers.input, Math::Vec4<float24>::AssignToAll(float24::Zero())); boost::fill(state.registers.input, Math::Vec4<float24>::AssignToAll(float24::Zero()));
const auto& attribute_register_map = config.input_register_map; const auto& attribute_register_map = config.input_register_map;
for (unsigned i = 0; i < num_attributes; i++) for (unsigned i = 0; i < (unsigned)num_attributes; i++)
state.registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i]; state.registers.input[attribute_register_map.GetRegisterForAttribute(i)] = input.attr[i];
state.conditional_code[0] = false; state.conditional_code[0] = false;

View File

@ -535,6 +535,8 @@ void RunInterpreter(const ShaderSetup& setup, UnitState<Debug>& state, unsigned
case flow_control.JustY: case flow_control.JustY:
return results[1]; return results[1];
default:
UNREACHABLE();
} }
}; };

View File

@ -338,8 +338,8 @@ void JitShader::Compile_EvaluateCondition(Instruction instr) {
} }
void JitShader::Compile_UniformCondition(Instruction instr) { void JitShader::Compile_UniformCondition(Instruction instr) {
int offset = const auto offset =
ShaderSetup::UniformOffset(RegisterType::BoolUniform, instr.flow_control.bool_uniform_id); (int)ShaderSetup::UniformOffset(RegisterType::BoolUniform, instr.flow_control.bool_uniform_id);
CMP(sizeof(bool) * 8, MDisp(SETUP, offset), Imm8(0)); CMP(sizeof(bool) * 8, MDisp(SETUP, offset), Imm8(0));
} }
@ -722,7 +722,7 @@ void JitShader::Compile_LOOP(Instruction instr) {
// The Y (LOOPCOUNT_REG) and Z (LOOPINC) component are kept multiplied by 16 (Left shifted by // The Y (LOOPCOUNT_REG) and Z (LOOPINC) component are kept multiplied by 16 (Left shifted by
// 4 bits) to be used as an offset into the 16-byte vector registers later // 4 bits) to be used as an offset into the 16-byte vector registers later
int offset = int offset =
ShaderSetup::UniformOffset(RegisterType::IntUniform, instr.flow_control.int_uniform_id); (int)ShaderSetup::UniformOffset(RegisterType::IntUniform, instr.flow_control.int_uniform_id);
MOV(32, R(LOOPCOUNT), MDisp(SETUP, offset)); MOV(32, R(LOOPCOUNT), MDisp(SETUP, offset));
MOV(32, R(LOOPCOUNT_REG), R(LOOPCOUNT)); MOV(32, R(LOOPCOUNT_REG), R(LOOPCOUNT));
SHR(32, R(LOOPCOUNT_REG), Imm8(4)); SHR(32, R(LOOPCOUNT_REG), Imm8(4));