Fix some warnings

This commit is contained in:
Nekotekina 2019-12-10 19:17:03 +03:00
parent 73236efe58
commit 69e81da57b
3 changed files with 10 additions and 7 deletions

View File

@ -1323,8 +1323,8 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context)
{
const auto& spu = static_cast<spu_thread&>(*cpu);
const u64 type = spu.offset < RAW_SPU_BASE_ADDR ?
SYS_MEMORY_PAGE_FAULT_TYPE_SPU_THREAD :
const u64 type = spu.offset < RAW_SPU_BASE_ADDR ?
SYS_MEMORY_PAGE_FAULT_TYPE_SPU_THREAD :
SYS_MEMORY_PAGE_FAULT_TYPE_RAW_SPU;
data2 = (type << 32) | spu.lv2_id;
@ -1807,7 +1807,8 @@ void thread_ctrl::_wait_for(u64 usec, bool alert /* true */)
timeout.it_interval.tv_sec = 0;
timeout.it_interval.tv_nsec = 0;
timerfd_settime(_this->m_timer, 0, &timeout, NULL);
read(_this->m_timer, &missed, sizeof(missed));
if (read(_this->m_timer, &missed, sizeof(missed)) != sizeof(missed))
LOG_ERROR(GENERAL, "timerfd: read() failed");
return;
}
#endif

View File

@ -129,6 +129,10 @@ void fmt_class_string<CellSysutilParamId>::format(std::string& out, u64 arg)
case CELL_SYSUTIL_SYSTEMPARAM_ID_MAGNETOMETER: return "ID_MAGNETOMETER";
case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME: return "ID_NICKNAME";
case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME: return "ID_CURRENT_USERNAME";
case CELL_SYSUTIL_SYSTEMPARAM_ID_x1008: return "ID_x1008";
case CELL_SYSUTIL_SYSTEMPARAM_ID_x1011: return "ID_x1011";
case CELL_SYSUTIL_SYSTEMPARAM_ID_x1012: return "ID_x1012";
case CELL_SYSUTIL_SYSTEMPARAM_ID_x1024: return "ID_x1024";
}
return unknown;
@ -143,7 +147,7 @@ s32 sysutil_check_name_string(const char* src, s32 minlen, s32 maxlen)
if (g_ps3_process_info.sdk_ver > 0x36FFFF)
{
// Limit null terminator boundary to before buffer max size
lastpos = std::max(maxlen - 1, 0);
lastpos = std::max(maxlen - 1, 0);
}
else
{
@ -307,7 +311,7 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr<char>
case CELL_SYSUTIL_SYSTEMPARAM_ID_CURRENT_USERNAME:
{
const fs::file username(vfs::get(fmt::format("/dev_hdd0/home/%08u/localusername", Emu.GetUsrId())));
if (!username)
{
cellSysutil.error("cellSysutilGetSystemParamString(): Username for user %08u doesn't exist. Did you delete the username file?", Emu.GetUsrId());

View File

@ -39,8 +39,6 @@ else()
add_compile_options(-Wno-attributes)
add_compile_options(-Wno-enum-compare)
add_compile_options(-Wno-comment)
add_compile_options(-Wno-overloaded-virtual)
add_compile_options(-Wno-missing-braces)
add_compile_options(-Wno-sign-compare)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")