From 01ffaab3e0e34fa949c75017b5d55323099354f7 Mon Sep 17 00:00:00 2001 From: scribam Date: Tue, 12 Sep 2017 23:42:00 +0200 Subject: [PATCH] Silent some compiler warnings --- rpcs3/Emu/Cell/Modules/cellSysutil.cpp | 13 +++++-------- rpcs3/Emu/Cell/Modules/cellSysutil.h | 2 +- rpcs3/ds4_pad_handler.cpp | 2 ++ rpcs3/evdev_joystick_handler.cpp | 14 ++++++-------- rpcs3/pad_thread.cpp | 3 ++- rpcs3/rpcs3qt/log_frame.cpp | 2 +- rpcs3/xinput_pad_handler.cpp | 2 ++ 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp index f62396bf6e..fb29397124 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.cpp @@ -100,11 +100,8 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } -// For test -enum systemparam_id_name : s32 {}; - template <> -void fmt_class_string::format(std::string& out, u64 arg) +void fmt_class_string::format(std::string& out, u64 arg) { format_enum(out, arg, [](auto value) { @@ -133,13 +130,13 @@ void fmt_class_string::format(std::string& out, u64 arg) }); } -s32 cellSysutilGetSystemParamInt(systemparam_id_name id, vm::ptr value) +s32 cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr value) { cellSysutil.warning("cellSysutilGetSystemParamInt(id=0x%x(%s), value=*0x%x)", id, id, value); // TODO: load this information from config (preferably "sys/" group) - switch(id) + switch (id) { case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG: *value = g_cfg.sys.language; @@ -208,13 +205,13 @@ s32 cellSysutilGetSystemParamInt(systemparam_id_name id, vm::ptr value) return CELL_OK; } -s32 cellSysutilGetSystemParamString(systemparam_id_name id, vm::ptr buf, u32 bufsize) +s32 cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr buf, u32 bufsize) { cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, id, buf, bufsize); memset(buf.get_ptr(), 0, bufsize); - switch(id) + switch (id) { case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME: memcpy(buf.get_ptr(), "Unknown", 8); // for example diff --git a/rpcs3/Emu/Cell/Modules/cellSysutil.h b/rpcs3/Emu/Cell/Modules/cellSysutil.h index 037290604c..74c59b2739 100644 --- a/rpcs3/Emu/Cell/Modules/cellSysutil.h +++ b/rpcs3/Emu/Cell/Modules/cellSysutil.h @@ -14,7 +14,7 @@ enum }; // Parameter IDs -enum +enum CellSysutilParamId: s32 { // Integers CELL_SYSUTIL_SYSTEMPARAM_ID_LANG = 0x0111, diff --git a/rpcs3/ds4_pad_handler.cpp b/rpcs3/ds4_pad_handler.cpp index aa00f46da1..19269946d3 100644 --- a/rpcs3/ds4_pad_handler.cpp +++ b/rpcs3/ds4_pad_handler.cpp @@ -621,6 +621,8 @@ bool ds4_pad_handler::bindPadToDevice(std::shared_ptr pad, const std::strin pad->m_vibrateMotors.emplace_back(false, 0); bindings.emplace_back(device_id, pad); + + return true; } void ds4_pad_handler::ThreadProc() diff --git a/rpcs3/evdev_joystick_handler.cpp b/rpcs3/evdev_joystick_handler.cpp index f4a250211a..a2b0710150 100644 --- a/rpcs3/evdev_joystick_handler.cpp +++ b/rpcs3/evdev_joystick_handler.cpp @@ -120,7 +120,7 @@ bool evdev_joystick_handler::try_open_dev(u32 index) pads[index]->m_port_status |= CELL_PAD_STATUS_CONNECTED; int buttons=0; - for (int i=BTN_JOYSTICK; i evdev_joystick_handler::ListDevices() { int fd = open(("/dev/input/" + et.name).c_str(), O_RDONLY|O_NONBLOCK); struct libevdev *dev = NULL; - int rc = 1; - rc = libevdev_new_from_fd(fd, &dev); + int rc = libevdev_new_from_fd(fd, &dev); if (rc < 0) { // If it's just a bad file descriptor, don't bother logging, but otherwise, log it. @@ -243,8 +242,7 @@ bool evdev_joystick_handler::bindPadToDevice(std::shared_ptr pad, const std { int fd = open(("/dev/input/" + et.name).c_str(), O_RDONLY|O_NONBLOCK); struct libevdev *dev = NULL; - int rc = 1; - rc = libevdev_new_from_fd(fd, &dev); + int rc = libevdev_new_from_fd(fd, &dev); if (rc < 0) { // If it's just a bad file descriptor, don't bother logging, but otherwise, log it. @@ -415,7 +413,7 @@ void evdev_joystick_handler::ThreadProc() } else { - int code = -1; + int code; if (source_axis == EVDEV_DPAD_HAT_AXIS_X) { code = evt.value > 0 ? CELL_PAD_CTRL_RIGHT : CELL_PAD_CTRL_LEFT; diff --git a/rpcs3/pad_thread.cpp b/rpcs3/pad_thread.cpp index f84f69d3ec..37c701d0d5 100644 --- a/rpcs3/pad_thread.cpp +++ b/rpcs3/pad_thread.cpp @@ -96,7 +96,8 @@ void pad_thread::Init(const u32 max_connect) thread = std::make_shared(&pad_thread::ThreadFunc, this); } -void pad_thread::SetRumble(const u32 pad, u8 largeMotor, bool smallMotor) { +void pad_thread::SetRumble(const u32 pad, u8 largeMotor, bool smallMotor) +{ if (pad > m_pads.size()) return; diff --git a/rpcs3/rpcs3qt/log_frame.cpp b/rpcs3/rpcs3qt/log_frame.cpp index e0b029a3b4..7761735c7c 100644 --- a/rpcs3/rpcs3qt/log_frame.cpp +++ b/rpcs3/rpcs3qt/log_frame.cpp @@ -1,6 +1,6 @@ #include "log_frame.h" -#include +#include "stdafx.h" #include "rpcs3_version.h" #include "Utilities/sysinfo.h" diff --git a/rpcs3/xinput_pad_handler.cpp b/rpcs3/xinput_pad_handler.cpp index 3876357845..322516e9a0 100644 --- a/rpcs3/xinput_pad_handler.cpp +++ b/rpcs3/xinput_pad_handler.cpp @@ -282,6 +282,8 @@ bool xinput_pad_handler::bindPadToDevice(std::shared_ptr pad, const std::st pad->m_vibrateMotors.emplace_back(false, 0); bindings.emplace_back(device_number, pad); + + return true; } #endif