fix some warnings

This commit is contained in:
Megamouse 2019-08-10 13:47:25 +02:00
parent efcb46658b
commit 0559e929d4
8 changed files with 11 additions and 10 deletions

View File

@ -318,7 +318,7 @@ std::shared_ptr<ds3_pad_handler::ds3_device> ds3_pad_handler::get_device(const s
int pad_number = std::stoi(padId.substr(pos + 9));
if (pad_number > 0 && pad_number <= controllers.size())
return controllers[pad_number - 1];
return controllers[static_cast<size_t>(pad_number) - 1];
return nullptr;
}

View File

@ -106,7 +106,7 @@ class ds3_pad_handler final : public PadHandlerBase
std::string device = {};
hid_device *handle = nullptr;
pad_config* config{ nullptr };
u8 buf[64];
u8 buf[64]{ 0 };
u8 large_motor = 0;
u8 small_motor = 0;
u8 status = DS3Status::Disconnected;

View File

@ -1,4 +1,4 @@
#include "save_data_dialog.h"
#include "save_data_dialog.h"
#include "save_data_list_dialog.h"
#include <Emu/IdManager.h>

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "stdafx.h"
#include "Emu/Memory/vm.h"

View File

@ -14,7 +14,7 @@ constexpr auto qstr = QString::fromStdString;
//Show up the savedata list, either to choose one to save/load or to manage saves.
//I suggest to use function callbacks to give save data list or get save data entry. (Not implemented or stubbed)
save_data_list_dialog::save_data_list_dialog(const std::vector<SaveDataEntry>& entries, s32 focusedEntry, u32 op, vm::ptr<CellSaveDataListSet> listSet, QWidget* parent)
: QDialog(parent), m_save_entries(entries), m_entry(selection_code::new_save), m_entry_label(nullptr)
: QDialog(parent), m_save_entries(entries), m_entry(selection_code::new_save), m_entry_label(nullptr), m_sort_column(0), m_sort_ascending(true)
{
if (op >= 8)
{

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
// I just want the struct for the save data.
#include "stdafx.h"
@ -35,9 +35,9 @@ private:
void UpdateList(void);
s32 m_entry;
QLabel* m_entry_label;
QLabel* m_entry_label = nullptr;
QTableWidget* m_list;
QTableWidget* m_list = nullptr;
std::vector<SaveDataEntry> m_save_entries;
std::shared_ptr<gui_settings> m_gui_settings;

View File

@ -25,7 +25,8 @@ namespace
constexpr auto qstr = QString::fromStdString;
inline std::string sstr(const QString& _in) { return _in.toStdString(); }
QString FormatTimestamp(u64 time) {
QString FormatTimestamp(u64 time)
{
QDateTime dateTime;
dateTime.setTime_t(time);
return dateTime.toString("yyyy-MM-dd HH:mm:ss");

View File

@ -135,5 +135,5 @@ private:
// holds internal controller state change
XINPUT_STATE state;
DWORD result;
DWORD result{ 0 };
};