From fb1d7d39827f6f94fb53b4ce1b93ffbb6136b476 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 30 Aug 2014 22:35:18 +0400 Subject: [PATCH] Some warnings fixed --- rpcs3/Emu/Audio/AudioDumper.cpp | 4 ++-- rpcs3/Emu/Audio/AudioDumper.h | 2 +- rpcs3/Emu/Cell/SPUThread.cpp | 14 +++++++------- rpcs3/Emu/FS/VFS.cpp | 4 ++-- rpcs3/Emu/FS/vfsDevice.cpp | 18 +++++++++--------- rpcs3/Emu/Io/MouseHandler.h | 6 +++--- rpcs3/Emu/RSX/RSXThread.cpp | 10 +++++----- rpcs3/Emu/SysCalls/Modules/cellAdec.cpp | 2 +- rpcs3/Emu/SysCalls/Modules/cellAudio.cpp | 8 ++++---- rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp | 6 +++--- rpcs3/Emu/SysCalls/lv2/sys_cond.cpp | 4 ++-- rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp | 6 +++--- rpcs3/Emu/SysCalls/lv2/sys_lwcond.cpp | 4 ++-- rpcs3/Emu/SysCalls/lv2/sys_lwmutex.cpp | 2 +- rpcs3/Emu/SysCalls/lv2/sys_memory.cpp | 4 ++-- rpcs3/Emu/SysCalls/lv2/sys_memory.h | 2 +- rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp | 8 ++++---- rpcs3/Emu/SysCalls/lv2/sys_rwlock.h | 8 ++++---- rpcs3/Emu/SysCalls/lv2/sys_spu.cpp | 12 ++++++------ rpcs3/Emu/SysCalls/lv2/sys_vm.cpp | 4 ++-- rpcs3/Loader/ELF64.h | 2 +- 21 files changed, 65 insertions(+), 65 deletions(-) diff --git a/rpcs3/Emu/Audio/AudioDumper.cpp b/rpcs3/Emu/Audio/AudioDumper.cpp index 3187c3b4be..0e51fd4a42 100644 --- a/rpcs3/Emu/Audio/AudioDumper.cpp +++ b/rpcs3/Emu/Audio/AudioDumper.cpp @@ -34,8 +34,8 @@ size_t AudioDumper::WriteData(const void* buffer, size_t size) if (!do_save) return size; // ignore empty data #endif size_t ret = m_output.Write(buffer, size); - m_header.Size += ret; - m_header.RIFF.Size += ret; + m_header.Size += (u32)ret; + m_header.RIFF.Size += (u32)ret; return ret; } diff --git a/rpcs3/Emu/Audio/AudioDumper.h b/rpcs3/Emu/Audio/AudioDumper.h index d3a6080ba4..ebf0f1db25 100644 --- a/rpcs3/Emu/Audio/AudioDumper.h +++ b/rpcs3/Emu/Audio/AudioDumper.h @@ -67,5 +67,5 @@ public: void WriteHeader(); size_t WriteData(const void* buffer, size_t size); void Finalize(); - const u8 GetCh() const { return m_header.FMT.NumChannels; } + const u8 GetCh() const { return (u8)m_header.FMT.NumChannels; } }; diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index 71485213af..a44f95fdb0 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -155,11 +155,11 @@ void SPUThread::WriteSNR(bool number, u32 value) { if (cfg.value & ((u64)1 << (u64)number)) { - SPU.SNR[number].PushUncond_OR(value); // logical OR + SPU.SNR[number ? 1 : 0].PushUncond_OR(value); // logical OR } else { - SPU.SNR[number].PushUncond(value); // overwrite + SPU.SNR[number ? 1 : 0].PushUncond(value); // overwrite } } @@ -282,7 +282,7 @@ void SPUThread::ListCmd(u32 lsa, u64 ea, u16 tag, u16 size, u32 cmd, MFCReg& MFC for (u32 i = 0; i < list_size; i++) { - mem_ptr_t rec(dmac.ls_offset + list_addr + i * 8); + mem_ptr_t rec((u32)dmac.ls_offset + list_addr + i * 8); u32 size = rec->ts; if (size < 16 && size != 1 && size != 2 && size != 4 && size != 8) @@ -446,7 +446,7 @@ void SPUThread::EnqMfcCmd(MFCReg& MFCArgs) changed, mask, op, cmd, lsa, ea, tag, size); SPUDisAsm dis_asm(CPUDisAsm_InterpreterMode); - for (s32 i = PC; i < PC + 4 * 7; i += 4) + for (s32 i = (s32)PC; i < (s32)PC + 4 * 7; i += 4) { dis_asm.dump_pc = i; dis_asm.offset = Memory.GetMemFromAddr(dmac.ls_offset); @@ -1013,9 +1013,9 @@ void SPUThread::StopAndSignal(u32 code) eq->events.pop(event); eq->owner.unlock(tid); SPU.In_MBox.PushUncond(CELL_OK); - SPU.In_MBox.PushUncond(event.data1); - SPU.In_MBox.PushUncond(event.data2); - SPU.In_MBox.PushUncond(event.data3); + SPU.In_MBox.PushUncond((u32)event.data1); + SPU.In_MBox.PushUncond((u32)event.data2); + SPU.In_MBox.PushUncond((u32)event.data3); return; } case SMR_FAILED: break; diff --git a/rpcs3/Emu/FS/VFS.cpp b/rpcs3/Emu/FS/VFS.cpp index 518ec6b6bd..7007955899 100644 --- a/rpcs3/Emu/FS/VFS.cpp +++ b/rpcs3/Emu/FS/VFS.cpp @@ -328,8 +328,8 @@ void VFS::SaveLoadDevices(std::vector& res, bool is_load) } else { - count = res.size(); - entries_count.SaveValue(res.size()); + count = (int)res.size(); + entries_count.SaveValue(count); } for(int i=0; i arr0 = fmt::rSplit(path0.GetFullPath(), DL); std::vector arr1 = fmt::rSplit(local_path, DL); - const u32 lim = std::min(arr0.size(), arr1.size()); + const u32 lim = (u32)std::min(arr0.size(), arr1.size()); u32 ret = 0; - for(u32 i=0; i= 0; --i) + for(int i = (int)path.length() - 1, dir = 0; i >= 0; --i) { if(path[i] == '\\' || path[i] == '/' || i == 0) { @@ -109,9 +109,9 @@ std::string vfsDevice::GetRoot(const std::string& path) //return fmt::ToUTF8(wxFileName(fmt::FromUTF8(path), wxPATH_UNIX).GetPath()); if(path.empty()) return ""; - u32 first_dir = path.length() - 1; + u32 first_dir = (u32)path.length() - 1; - for(int i = path.length() - 1, dir = 0, li = path.length() - 1; i >= 0 && dir < 2; --i) + for(int i = (int)path.length() - 1, dir = 0, li = (int)path.length() - 1; i >= 0 && dir < 2; --i) { if(path[i] == '\\' || path[i] == '/' || i == 0) { @@ -139,9 +139,9 @@ std::string vfsDevice::GetRootPs3(const std::string& path) static const std::string home = "/dev_hdd0/game/"; u32 last_dir = 0; - u32 first_dir = path.length() - 1; + u32 first_dir = (u32)path.length() - 1; - for(int i = path.length() - 1, dir = 0; i >= 0; --i) + for(int i = (int)path.length() - 1, dir = 0; i >= 0; --i) { if(path[i] == '\\' || path[i] == '/' || i == 0) { diff --git a/rpcs3/Emu/Io/MouseHandler.h b/rpcs3/Emu/Io/MouseHandler.h index e21e0d0902..a2aeeede32 100644 --- a/rpcs3/Emu/Io/MouseHandler.h +++ b/rpcs3/Emu/Io/MouseHandler.h @@ -107,7 +107,7 @@ public: void Button(u8 button, bool pressed) { - for(u64 p=0; p < m_mice.size(); ++p) + for(u32 p=0; p < (u32)m_mice.size(); ++p) { if (m_info.status[p] == CELL_MOUSE_STATUS_CONNECTED) { @@ -121,7 +121,7 @@ public: void Scroll(const s8 rotation) { - for(u64 p=0; p < m_mice.size(); ++p) + for(u32 p=0; p < (u32)m_mice.size(); ++p) { if (m_info.status[p] == CELL_MOUSE_STATUS_CONNECTED) { @@ -134,7 +134,7 @@ public: void Move(const s16 x_pos_new, const s16 y_pos_new) { - for(u64 p=0; p< m_mice.size(); ++p) + for(u32 p=0; p < (u32)m_mice.size(); ++p) { if (m_info.status[p] == CELL_MOUSE_STATUS_CONNECTED) { diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 50d2c050da..762c10740d 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -45,8 +45,8 @@ u32 GetAddress(u32 offset, u8 location) { switch(location) { - case CELL_GCM_LOCATION_LOCAL: return Memory.RSXFBMem.GetStartAddr() + offset; - case CELL_GCM_LOCATION_MAIN: return Memory.RSXIOMem.RealAddr(Memory.RSXIOMem.GetStartAddr() + offset); // TODO: Error Check? + case CELL_GCM_LOCATION_LOCAL: return (u32)Memory.RSXFBMem.GetStartAddr() + offset; + case CELL_GCM_LOCATION_MAIN: return (u32)Memory.RSXIOMem.RealAddr(Memory.RSXIOMem.GetStartAddr() + offset); // TODO: Error Check? } LOG_ERROR(RSX, "GetAddress(offset=0x%x, location=0x%x)", location); @@ -881,7 +881,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const { case 0: { - int pos = m_indexed_array.m_data.size(); + int pos = (int)m_indexed_array.m_data.size(); m_indexed_array.m_data.resize(m_indexed_array.m_data.size() + 4); index = Memory.Read32(m_indexed_array.m_addr + i * 4); *(u32*)&m_indexed_array.m_data[pos] = index; @@ -891,7 +891,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const case 1: { - int pos = m_indexed_array.m_data.size(); + int pos = (int)m_indexed_array.m_data.size(); m_indexed_array.m_data.resize(m_indexed_array.m_data.size() + 2); index = Memory.Read16(m_indexed_array.m_addr + i * 2); //LOG_WARNING(RSX, "index 2: %d", index); @@ -1568,7 +1568,7 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const case NV4097_SET_POLYGON_STIPPLE_PATTERN: { - for (size_t i = 0; i < 32; i++) + for (u32 i = 0; i < 32; i++) { m_polygon_stipple_pattern[i] = ARGS(i); } diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index 7fcf739465..7a5c5831cc 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -800,7 +800,7 @@ int cellAdecGetPcmItem(u32 handle, mem32_t pcmItem_ptr) pcm->startAddr = 0x00000312; // invalid address (no output) pcm->size = af.size; pcm->status = CELL_OK; - pcm->auInfo.pts.lower = af.pts; + pcm->auInfo.pts.lower = (u32)af.pts; pcm->auInfo.pts.upper = af.pts >> 32; pcm->auInfo.size = af.auSize; pcm->auInfo.startAddr = af.auAddr; diff --git a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp index 2b089fca0b..0797bccc30 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAudio.cpp @@ -39,9 +39,9 @@ int cellAudioInit() m_config.counter = 0; // alloc memory - m_config.m_buffer = Memory.Alloc(128 * 1024 * m_config.AUDIO_PORT_COUNT, 1024); + m_config.m_buffer = (u32)Memory.Alloc(128 * 1024 * m_config.AUDIO_PORT_COUNT, 1024); memset(Memory + m_config.m_buffer, 0, 128 * 1024 * m_config.AUDIO_PORT_COUNT); - m_config.m_indexes = Memory.Alloc(sizeof(u64) * m_config.AUDIO_PORT_COUNT, 16); + m_config.m_indexes = (u32)Memory.Alloc(sizeof(u64) * m_config.AUDIO_PORT_COUNT, 16); memset(Memory + m_config.m_indexes, 0, sizeof(u64) * m_config.AUDIO_PORT_COUNT); thread t("Audio Thread", []() @@ -527,8 +527,8 @@ int cellAudioPortOpen(mem_ptr_t audioParam, mem32_t portNum) { AudioPortConfig& port = m_config.m_ports[i]; - port.channel = audioParam->nChannel; - port.block = audioParam->nBlock; + port.channel = (u8)audioParam->nChannel; + port.block = (u8)audioParam->nBlock; port.attr = audioParam->attr; if (port.attr & CELL_AUDIO_PORTATTR_INITLEVEL) { diff --git a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp index a96b65f061..d529dd3e7b 100644 --- a/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp +++ b/rpcs3/Emu/SysCalls/lv2/lv2Fs.cpp @@ -546,11 +546,11 @@ s32 cellFsStReadInit(u32 fd, mem_ptr_t ringbuf) fs_config.m_ring_buffer = *ringbuf; if(ringbuf->ringbuf_size < 0x40000000) // If the size is less than 1MB - fs_config.m_alloc_mem_size = ((ringbuf->ringbuf_size + 64 * 1024 - 1) / (64 * 1024)) * (64 * 1024); - fs_config.m_alloc_mem_size = ((ringbuf->ringbuf_size + 1024 * 1024 - 1) / (1024 * 1024)) * (1024 * 1024); + fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 64 * 1024 - 1) / (64 * 1024)) * (64 * 1024); + fs_config.m_alloc_mem_size = (((u32)ringbuf->ringbuf_size + 1024 * 1024 - 1) / (1024 * 1024)) * (1024 * 1024); // alloc memory - fs_config.m_buffer = Memory.Alloc(fs_config.m_alloc_mem_size, 1024); + fs_config.m_buffer = (u32)Memory.Alloc(fs_config.m_alloc_mem_size, 1024); memset(Memory + fs_config.m_buffer, 0, fs_config.m_alloc_mem_size); fs_config.m_fs_status = CELL_FS_ST_INITIALIZED; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_cond.cpp b/rpcs3/Emu/SysCalls/lv2/sys_cond.cpp index ab7fdbecec..c9e52b5755 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_cond.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_cond.cpp @@ -182,8 +182,8 @@ s32 sys_cond_wait(u32 cond_id, u64 timeout) mutex->recursive = 0; mutex->m_mutex.unlock(tid, mutex->protocol == SYS_SYNC_PRIORITY ? mutex->m_queue.pop_prio() : mutex->m_queue.pop()); - u32 counter = 0; - const u32 max_counter = timeout ? (timeout / 1000) : ~0; + u64 counter = 0; + const u64 max_counter = timeout ? (timeout / 1000) : ~0ull; while (true) { diff --git a/rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp b/rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp index 2e5a0e479f..550420d13a 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_event_flag.cpp @@ -148,8 +148,8 @@ s32 sys_event_flag_wait(u32 eflag_id, u64 bitptn, u32 mode, mem64_t result, u64 } } - u32 counter = 0; - const u32 max_counter = timeout ? (timeout / 1000) : ~0; + u64 counter = 0; + const u64 max_counter = timeout ? (timeout / 1000) : ~0; while (true) { @@ -337,7 +337,7 @@ s32 sys_event_flag_cancel(u32 eflag_id, mem32_t num) return CELL_OK; } - if (num.GetAddr()) num = tids.size(); + if (num.GetAddr()) num = (u32)tids.size(); return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_lwcond.cpp b/rpcs3/Emu/SysCalls/lv2/sys_lwcond.cpp index 4e368f9ed7..79bb73ea62 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_lwcond.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_lwcond.cpp @@ -177,8 +177,8 @@ s32 sys_lwcond_wait(mem_ptr_t lwcond, u64 timeout) (u32)lwcond->lwcond_queue, (u32)mutex->sleep_queue); } - u32 counter = 0; - const u32 max_counter = timeout ? (timeout / 1000) : ~0; + u64 counter = 0; + const u64 max_counter = timeout ? (timeout / 1000) : ~0; while (true) { diff --git a/rpcs3/Emu/SysCalls/lv2/sys_lwmutex.cpp b/rpcs3/Emu/SysCalls/lv2/sys_lwmutex.cpp index 6324423055..24d7ea6b40 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_lwmutex.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_lwmutex.cpp @@ -128,7 +128,7 @@ u32 SleepQueue::pop_prio() // SYS_SYNC_PRIORITY { if (list.size()) { - u32 highest_prio = ~0; + u64 highest_prio = ~0ull; u32 sel = 0; for (u32 i = 0; i < list.size(); i++) { diff --git a/rpcs3/Emu/SysCalls/lv2/sys_memory.cpp b/rpcs3/Emu/SysCalls/lv2/sys_memory.cpp index 0c78a868cf..e27723d1e6 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_memory.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_memory.cpp @@ -17,12 +17,12 @@ s32 sys_memory_allocate(u32 size, u32 flags, u32 alloc_addr_addr) { case SYS_MEMORY_PAGE_SIZE_1M: if(size & 0xfffff) return CELL_EALIGN; - addr = Memory.Alloc(size, 0x100000); + addr = (u32)Memory.Alloc(size, 0x100000); break; case SYS_MEMORY_PAGE_SIZE_64K: if(size & 0xffff) return CELL_EALIGN; - addr = Memory.Alloc(size, 0x10000); + addr = (u32)Memory.Alloc(size, 0x10000); break; default: return CELL_EINVAL; diff --git a/rpcs3/Emu/SysCalls/lv2/sys_memory.h b/rpcs3/Emu/SysCalls/lv2/sys_memory.h index 940882a29a..522c3328fe 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_memory.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_memory.h @@ -32,7 +32,7 @@ struct sys_page_attr_t struct MemoryContainerInfo { - u64 addr; + u32 addr; u32 size; MemoryContainerInfo(u64 addr, u32 size) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp b/rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp index 187349b5a2..910777857c 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_rwlock.cpp @@ -65,8 +65,8 @@ s32 sys_rwlock_rlock(u32 rw_lock_id, u64 timeout) if (rw->rlock_trylock(tid)) return CELL_OK; - u32 counter = 0; - const u32 max_counter = timeout ? (timeout / 1000) : 20000; + u64 counter = 0; + const u64 max_counter = timeout ? (timeout / 1000) : 20000; do { if (Emu.IsStopped()) @@ -128,8 +128,8 @@ s32 sys_rwlock_wlock(u32 rw_lock_id, u64 timeout) if (rw->wlock_trylock(tid, true)) return CELL_OK; - u32 counter = 0; - const u32 max_counter = timeout ? (timeout / 1000) : 20000; + u64 counter = 0; + const u64 max_counter = timeout ? (timeout / 1000) : 20000; do { if (Emu.IsStopped()) diff --git a/rpcs3/Emu/SysCalls/lv2/sys_rwlock.h b/rpcs3/Emu/SysCalls/lv2/sys_rwlock.h index 0ca4a41dff..9f9fa0ed35 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_rwlock.h +++ b/rpcs3/Emu/SysCalls/lv2/sys_rwlock.h @@ -51,7 +51,7 @@ struct RWLock { std::lock_guard lock(m_lock); - for (u32 i = rlock_list.size() - 1; ~i; i--) + for (u32 i = (u32)rlock_list.size() - 1; ~i; i--) { if (rlock_list[i] == tid) { @@ -70,7 +70,7 @@ struct RWLock { return false; // deadlock } - for (u32 i = rlock_list.size() - 1; ~i; i--) + for (u32 i = (u32)rlock_list.size() - 1; ~i; i--) { if (rlock_list[i] == tid) { @@ -90,7 +90,7 @@ struct RWLock { return false; // do not enqueue } - for (u32 i = wlock_queue.size() - 1; ~i; i--) + for (u32 i = (u32)wlock_queue.size() - 1; ~i; i--) { if (wlock_queue[i] == tid) { @@ -117,7 +117,7 @@ struct RWLock { return false; // do not enqueue } - for (u32 i = wlock_queue.size() - 1; ~i; i--) + for (u32 i = (u32)wlock_queue.size() - 1; ~i; i--) { if (wlock_queue[i] == tid) { diff --git a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp index be21717207..146d461b67 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_spu.cpp @@ -16,7 +16,7 @@ u32 LoadSpuImage(vfsStream& stream, u32& spu_ep) ELFLoader l(stream); l.LoadInfo(); const u32 alloc_size = 256 * 1024; - u32 spu_offset = Memory.MainMem.AllocAlign(alloc_size); + u32 spu_offset = (u32)Memory.MainMem.AllocAlign(alloc_size); l.LoadData(spu_offset); spu_ep = l.GetEntry(); return spu_offset; @@ -518,9 +518,9 @@ s32 sys_spu_thread_write_ls(u32 id, u32 address, u64 value, u32 type) switch (type) { - case 1: (*(SPUThread*)thr).WriteLS8(address, value); return CELL_OK; - case 2: (*(SPUThread*)thr).WriteLS16(address, value); return CELL_OK; - case 4: (*(SPUThread*)thr).WriteLS32(address, value); return CELL_OK; + case 1: (*(SPUThread*)thr).WriteLS8(address, (u8)value); return CELL_OK; + case 2: (*(SPUThread*)thr).WriteLS16(address, (u16)value); return CELL_OK; + case 4: (*(SPUThread*)thr).WriteLS32(address, (u32)value); return CELL_OK; case 8: (*(SPUThread*)thr).WriteLS64(address, value); return CELL_OK; default: return CELL_EINVAL; } @@ -631,7 +631,7 @@ s32 sys_spu_thread_write_snr(u32 id, u32 number, u32 value) return CELL_EINVAL; } - (*(SPUThread*)thr).WriteSNR(number, value); + (*(SPUThread*)thr).WriteSNR(number ? true : false, value); return CELL_OK; } @@ -1054,6 +1054,6 @@ s32 sys_raw_spu_get_spu_cfg(u32 id, mem32_t value) return CELL_ESRCH; } - value = t->cfg.value; + value = (u32)t->cfg.value; return CELL_OK; } diff --git a/rpcs3/Emu/SysCalls/lv2/sys_vm.cpp b/rpcs3/Emu/SysCalls/lv2/sys_vm.cpp index 9fd3e39b2d..ca3b145b77 100644 --- a/rpcs3/Emu/SysCalls/lv2/sys_vm.cpp +++ b/rpcs3/Emu/SysCalls/lv2/sys_vm.cpp @@ -33,11 +33,11 @@ s32 sys_vm_memory_map(u32 vsize, u32 psize, u32 cid, u64 flag, u64 policy, u32 a switch(flag) { case SYS_MEMORY_PAGE_SIZE_1M: - new_addr = Memory.Alloc(psize, 0x100000); + new_addr = (u32)Memory.Alloc(psize, 0x100000); break; case SYS_MEMORY_PAGE_SIZE_64K: - new_addr = Memory.Alloc(psize, 0x10000); + new_addr = (u32)Memory.Alloc(psize, 0x10000); break; default: return CELL_EINVAL; diff --git a/rpcs3/Loader/ELF64.h b/rpcs3/Loader/ELF64.h index 2a98b9bbb8..7843b9f569 100644 --- a/rpcs3/Loader/ELF64.h +++ b/rpcs3/Loader/ELF64.h @@ -31,7 +31,7 @@ struct Elf64_Ehdr void Show(); bool CheckMagic() const { return e_magic == 0x7F454C46; } - u32 GetEntry() const { return e_entry; } + u64 GetEntry() const { return e_entry; } }; struct Elf64_Shdr