Silent some compiler warnings

This commit is contained in:
scribam 2017-09-12 23:42:00 +02:00 committed by Ivan
parent d5fb7180d0
commit 01ffaab3e0
7 changed files with 19 additions and 19 deletions

View File

@ -100,11 +100,8 @@ void fmt_class_string<CellSysutilLang>::format(std::string& out, u64 arg)
}); });
} }
// For test
enum systemparam_id_name : s32 {};
template <> template <>
void fmt_class_string<systemparam_id_name>::format(std::string& out, u64 arg) void fmt_class_string<CellSysutilParamId>::format(std::string& out, u64 arg)
{ {
format_enum(out, arg, [](auto value) format_enum(out, arg, [](auto value)
{ {
@ -133,13 +130,13 @@ void fmt_class_string<systemparam_id_name>::format(std::string& out, u64 arg)
}); });
} }
s32 cellSysutilGetSystemParamInt(systemparam_id_name id, vm::ptr<s32> value) s32 cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr<s32> value)
{ {
cellSysutil.warning("cellSysutilGetSystemParamInt(id=0x%x(%s), value=*0x%x)", id, id, value); cellSysutil.warning("cellSysutilGetSystemParamInt(id=0x%x(%s), value=*0x%x)", id, id, value);
// TODO: load this information from config (preferably "sys/" group) // TODO: load this information from config (preferably "sys/" group)
switch(id) switch (id)
{ {
case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG: case CELL_SYSUTIL_SYSTEMPARAM_ID_LANG:
*value = g_cfg.sys.language; *value = g_cfg.sys.language;
@ -208,13 +205,13 @@ s32 cellSysutilGetSystemParamInt(systemparam_id_name id, vm::ptr<s32> value)
return CELL_OK; return CELL_OK;
} }
s32 cellSysutilGetSystemParamString(systemparam_id_name id, vm::ptr<char> buf, u32 bufsize) s32 cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr<char> buf, u32 bufsize)
{ {
cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, id, buf, bufsize); cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, id, buf, bufsize);
memset(buf.get_ptr(), 0, bufsize); memset(buf.get_ptr(), 0, bufsize);
switch(id) switch (id)
{ {
case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME: case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME:
memcpy(buf.get_ptr(), "Unknown", 8); // for example memcpy(buf.get_ptr(), "Unknown", 8); // for example

View File

@ -14,7 +14,7 @@ enum
}; };
// Parameter IDs // Parameter IDs
enum enum CellSysutilParamId: s32
{ {
// Integers // Integers
CELL_SYSUTIL_SYSTEMPARAM_ID_LANG = 0x0111, CELL_SYSUTIL_SYSTEMPARAM_ID_LANG = 0x0111,

View File

@ -621,6 +621,8 @@ bool ds4_pad_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std::strin
pad->m_vibrateMotors.emplace_back(false, 0); pad->m_vibrateMotors.emplace_back(false, 0);
bindings.emplace_back(device_id, pad); bindings.emplace_back(device_id, pad);
return true;
} }
void ds4_pad_handler::ThreadProc() void ds4_pad_handler::ThreadProc()

View File

@ -120,7 +120,7 @@ bool evdev_joystick_handler::try_open_dev(u32 index)
pads[index]->m_port_status |= CELL_PAD_STATUS_CONNECTED; pads[index]->m_port_status |= CELL_PAD_STATUS_CONNECTED;
int buttons=0; int buttons=0;
for (int i=BTN_JOYSTICK; i<KEY_MAX; i++) for (u32 i=BTN_JOYSTICK; i<KEY_MAX; i++)
if (libevdev_has_event_code(dev, EV_KEY, i)) if (libevdev_has_event_code(dev, EV_KEY, i))
{ {
LOG_NOTICE(GENERAL, "Joystick #%d has button %d as %d", index, i, buttons); LOG_NOTICE(GENERAL, "Joystick #%d has button %d as %d", index, i, buttons);
@ -128,7 +128,7 @@ bool evdev_joystick_handler::try_open_dev(u32 index)
} }
int axes=0; int axes=0;
for (int i=ABS_X; i<=ABS_RZ; i++) for (u32 i=ABS_X; i<=ABS_RZ; i++)
{ {
if (libevdev_has_event_code(dev, EV_ABS, i)) if (libevdev_has_event_code(dev, EV_ABS, i))
@ -144,7 +144,7 @@ bool evdev_joystick_handler::try_open_dev(u32 index)
} }
} }
for (int i=ABS_HAT0X; i<=ABS_HAT3Y; i+=2) for (u32 i=ABS_HAT0X; i<=ABS_HAT3Y; i+=2)
if (libevdev_has_event_code(dev, EV_ABS, i) || if (libevdev_has_event_code(dev, EV_ABS, i) ||
libevdev_has_event_code(dev, EV_ABS, i+1)) libevdev_has_event_code(dev, EV_ABS, i+1))
{ {
@ -204,8 +204,7 @@ std::vector<std::string> evdev_joystick_handler::ListDevices()
{ {
int fd = open(("/dev/input/" + et.name).c_str(), O_RDONLY|O_NONBLOCK); int fd = open(("/dev/input/" + et.name).c_str(), O_RDONLY|O_NONBLOCK);
struct libevdev *dev = NULL; struct libevdev *dev = NULL;
int rc = 1; int rc = libevdev_new_from_fd(fd, &dev);
rc = libevdev_new_from_fd(fd, &dev);
if (rc < 0) if (rc < 0)
{ {
// If it's just a bad file descriptor, don't bother logging, but otherwise, log it. // 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> pad, const std
{ {
int fd = open(("/dev/input/" + et.name).c_str(), O_RDONLY|O_NONBLOCK); int fd = open(("/dev/input/" + et.name).c_str(), O_RDONLY|O_NONBLOCK);
struct libevdev *dev = NULL; struct libevdev *dev = NULL;
int rc = 1; int rc = libevdev_new_from_fd(fd, &dev);
rc = libevdev_new_from_fd(fd, &dev);
if (rc < 0) if (rc < 0)
{ {
// If it's just a bad file descriptor, don't bother logging, but otherwise, log it. // 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 else
{ {
int code = -1; int code;
if (source_axis == EVDEV_DPAD_HAT_AXIS_X) if (source_axis == EVDEV_DPAD_HAT_AXIS_X)
{ {
code = evt.value > 0 ? CELL_PAD_CTRL_RIGHT : CELL_PAD_CTRL_LEFT; code = evt.value > 0 ? CELL_PAD_CTRL_RIGHT : CELL_PAD_CTRL_LEFT;

View File

@ -96,7 +96,8 @@ void pad_thread::Init(const u32 max_connect)
thread = std::make_shared<std::thread>(&pad_thread::ThreadFunc, this); thread = std::make_shared<std::thread>(&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()) if (pad > m_pads.size())
return; return;

View File

@ -1,6 +1,6 @@
#include "log_frame.h" #include "log_frame.h"
#include <stdafx.h> #include "stdafx.h"
#include "rpcs3_version.h" #include "rpcs3_version.h"
#include "Utilities/sysinfo.h" #include "Utilities/sysinfo.h"

View File

@ -282,6 +282,8 @@ bool xinput_pad_handler::bindPadToDevice(std::shared_ptr<Pad> pad, const std::st
pad->m_vibrateMotors.emplace_back(false, 0); pad->m_vibrateMotors.emplace_back(false, 0);
bindings.emplace_back(device_number, pad); bindings.emplace_back(device_number, pad);
return true;
} }
#endif #endif