Fix all uninitialized variable warnings (C26495)

This commit is contained in:
Pokechu22 2021-09-03 21:43:19 -07:00
parent 525e6b2194
commit 78bfd25964
111 changed files with 638 additions and 651 deletions

View File

@ -99,7 +99,7 @@ private:
bool m_is_stretching = false;
AudioCommon::AudioStretcher m_stretcher;
AudioCommon::SurroundDecoder m_surround_decoder;
std::array<short, MAX_SAMPLES * 2> m_scratch_buffer;
std::array<short, MAX_SAMPLES * 2> m_scratch_buffer{};
WaveFileWriter m_wave_writer_dtk;
WaveFileWriter m_wave_writer_dsp;

View File

@ -53,7 +53,7 @@ class OpenALStream final : public SoundStream
{
#ifdef _WIN32
public:
OpenALStream() : m_source(0) {}
OpenALStream() = default;
~OpenALStream() override;
bool Init() override;
void SetVolume(int volume) override;
@ -68,9 +68,9 @@ private:
Common::Flag m_run_thread;
std::vector<short> m_realtime_buffer;
std::array<ALuint, OAL_BUFFERS> m_buffers;
ALuint m_source;
ALfloat m_volume;
std::array<ALuint, OAL_BUFFERS> m_buffers{};
ALuint m_source = 0;
ALfloat m_volume = 1;
#endif // _WIN32
};

View File

@ -23,7 +23,7 @@ using UnderlyingType = typename std::enable_if_t<std::is_enum<T>{}, std::underly
struct Location
{
System system;
System system{};
std::string section;
std::string key;

View File

@ -85,11 +85,11 @@ enum
namespace File
{
// FileSystem tree node/
// FileSystem tree node
struct FSTEntry
{
bool isDirectory;
u64 size; // File length, or for directories, recursive count of children
bool isDirectory = false;
u64 size = 0; // File length, or for directories, recursive count of children
std::string physicalName; // Name on disk
std::string virtualName; // Name in FST names table
std::vector<FSTEntry> children;

View File

@ -78,7 +78,7 @@ public:
bool empty() const noexcept { return size() == 0; }
private:
std::array<T, N> storage;
std::array<T, N> storage{};
int head = 0;
int tail = 0;
// Sacrifice 4 bytes for a simpler implementation. may optimize away in the future.

View File

@ -59,9 +59,9 @@ public:
}
template <typename T, std::size_t N>
bool ReadArray(std::array<T, N>& elements, size_t* num_read = nullptr)
bool ReadArray(std::array<T, N>* elements, size_t* num_read = nullptr)
{
return ReadArray(elements.data(), elements.size(), num_read);
return ReadArray(elements->data(), elements->size(), num_read);
}
template <typename T, std::size_t N>

View File

@ -153,7 +153,7 @@ private:
std::min(Common::scm_rev_git_str.size(), sizeof(ver)));
}
u32 id;
u32 id = 0;
const u16 key_t_size = sizeof(K);
const u16 value_t_size = sizeof(V);
char ver[40] = {};
@ -161,5 +161,5 @@ private:
} m_header;
File::IOFile m_file;
u32 m_num_entries;
u32 m_num_entries = 0;
};

View File

@ -14,5 +14,5 @@ public:
void Log(Common::Log::LOG_LEVELS level, const char* text) override;
private:
bool m_use_color;
bool m_use_color = false;
};

View File

@ -98,7 +98,7 @@ private:
delete next_ptr;
}
T current;
T current{};
std::atomic<ElementPtr*> next;
};

View File

@ -16,10 +16,10 @@ namespace ActionReplay
{
struct AREntry
{
AREntry() {}
AREntry() = default;
AREntry(u32 _addr, u32 _value) : cmd_addr(_addr), value(_value) {}
u32 cmd_addr;
u32 value;
u32 cmd_addr = 0;
u32 value = 0;
};
constexpr bool operator==(const AREntry& left, const AREntry& right)
{

View File

@ -64,44 +64,44 @@ public:
// These store if the relevant setting should be reset back later (true) or if it should be left
// alone on restore (false)
bool bSetEmulationSpeed;
bool bSetVolume;
std::array<bool, MAX_BBMOTES> bSetWiimoteSource;
std::array<bool, SerialInterface::MAX_SI_CHANNELS> bSetPads;
std::array<bool, ExpansionInterface::MAX_EXI_CHANNELS> bSetEXIDevice;
bool bSetEmulationSpeed = false;
bool bSetVolume = false;
std::array<bool, MAX_BBMOTES> bSetWiimoteSource{};
std::array<bool, SerialInterface::MAX_SI_CHANNELS> bSetPads{};
std::array<bool, ExpansionInterface::MAX_EXI_CHANNELS> bSetEXIDevice{};
private:
bool valid;
bool bCPUThread;
bool bJITFollowBranch;
bool bSyncGPUOnSkipIdleHack;
bool bFloatExceptions;
bool bDivideByZeroExceptions;
bool bFPRF;
bool bAccurateNaNs;
bool bMMU;
bool bLowDCBZHack;
bool bDisableICache;
bool m_EnableJIT;
bool bSyncGPU;
int iSyncGpuMaxDistance;
int iSyncGpuMinDistance;
float fSyncGpuOverclock;
bool bFastDiscSpeed;
bool bDSPHLE;
bool bHLE_BS2;
int iSelectedLanguage;
PowerPC::CPUCore cpu_core;
int Volume;
float m_EmulationSpeed;
float m_OCFactor;
bool m_OCEnable;
bool m_bt_passthrough_enabled;
bool valid = false;
bool bCPUThread = false;
bool bJITFollowBranch = false;
bool bSyncGPUOnSkipIdleHack = false;
bool bFloatExceptions = false;
bool bDivideByZeroExceptions = false;
bool bFPRF = false;
bool bAccurateNaNs = false;
bool bMMU = false;
bool bLowDCBZHack = false;
bool bDisableICache = false;
bool m_EnableJIT = false;
bool bSyncGPU = false;
int iSyncGpuMaxDistance = 0;
int iSyncGpuMinDistance = 0;
float fSyncGpuOverclock = 0;
bool bFastDiscSpeed = false;
bool bDSPHLE = false;
bool bHLE_BS2 = false;
int iSelectedLanguage = 0;
PowerPC::CPUCore cpu_core = PowerPC::CPUCore::Interpreter;
int Volume = 0;
float m_EmulationSpeed = 0;
float m_OCFactor = 0;
bool m_OCEnable = false;
bool m_bt_passthrough_enabled = false;
std::string sBackend;
std::string m_strGPUDeterminismMode;
std::array<WiimoteSource, MAX_BBMOTES> iWiimoteSource;
std::array<SerialInterface::SIDevices, SerialInterface::MAX_SI_CHANNELS> Pads;
std::array<ExpansionInterface::TEXIDevices, ExpansionInterface::MAX_EXI_CHANNELS> m_EXIDevice;
std::array<WiimoteSource, MAX_BBMOTES> iWiimoteSource{};
std::array<SerialInterface::SIDevices, SerialInterface::MAX_SI_CHANNELS> Pads{};
std::array<ExpansionInterface::TEXIDevices, ExpansionInterface::MAX_EXI_CHANNELS> m_EXIDevice{};
};
void ConfigCache::SaveConfig(const SConfig& config)

View File

@ -279,10 +279,10 @@ struct DSP_Regs
struct DSPInitOptions
{
// DSP IROM blob, which is where the DSP boots from. Embedded into the DSP.
std::array<u16, DSP_IROM_SIZE> irom_contents;
std::array<u16, DSP_IROM_SIZE> irom_contents{};
// DSP DROM blob, which contains resampling coefficients.
std::array<u16, DSP_COEF_SIZE> coef_contents;
std::array<u16, DSP_COEF_SIZE> coef_contents{};
// Core used to emulate the DSP.
// Default: JIT64.

View File

@ -100,8 +100,7 @@ static Gen::OpArg GetRegisterPointer(size_t reg)
#define STATIC_REG_ACCS
//#undef STATIC_REG_ACCS
DSPJitRegCache::DSPJitRegCache(DSPEmitter& emitter)
: m_emitter(emitter), m_is_temporary(false), m_is_merged(false)
DSPJitRegCache::DSPJitRegCache(DSPEmitter& emitter) : m_emitter(emitter), m_is_temporary(false)
{
for (X64CachedReg& xreg : m_xregs)
{
@ -188,13 +187,10 @@ DSPJitRegCache::DSPJitRegCache(DSPEmitter& emitter)
m_regs[i + DSP_REG_AXL0].shift = 0;
m_regs[i + DSP_REG_AXH0].shift = 16;
}
m_use_ctr = 0;
}
DSPJitRegCache::DSPJitRegCache(const DSPJitRegCache& cache)
: m_regs(cache.m_regs), m_xregs(cache.m_xregs), m_emitter(cache.m_emitter),
m_is_temporary(true), m_is_merged(false)
: m_regs(cache.m_regs), m_xregs(cache.m_xregs), m_emitter(cache.m_emitter), m_is_temporary(true)
{
}

View File

@ -170,14 +170,14 @@ private:
void MovToMemory(size_t reg);
void FlushMemBackedRegs();
std::array<DynamicReg, 37> m_regs;
std::array<X64CachedReg, 16> m_xregs;
std::array<DynamicReg, 37> m_regs{};
std::array<X64CachedReg, 16> m_xregs{};
DSPEmitter& m_emitter;
bool m_is_temporary;
bool m_is_merged;
bool m_is_merged = false;
int m_use_ctr;
int m_use_ctr = 0;
};
} // namespace DSP::JIT::x64

View File

@ -15,7 +15,7 @@ namespace Dolphin_Debugger
struct CallstackEntry
{
std::string Name;
u32 vAddress;
u32 vAddress = 0;
};
bool GetCallstack(std::vector<CallstackEntry>& output);

View File

@ -9,7 +9,7 @@
#include "Common/CommonTypes.h"
#include "Common/IOFile.h"
CDump::CDump(const std::string& filename) : m_pData(nullptr)
CDump::CDump(const std::string& filename)
{
File::IOFile pStream(filename, "rb");
if (pStream)

View File

@ -27,9 +27,9 @@ private:
STRUCTUR_SIZE = 0x2BC
};
u8* m_pData;
u8* m_pData = nullptr;
size_t m_size;
size_t m_size = 0;
u32 Read32(u32 _pos);
};

View File

@ -131,7 +131,7 @@ public:
u32 GetImportsNameTable() const;
private:
RSOHeader m_header;
RSOHeader m_header{};
std::string m_name;
u32 m_address = 0;
};

View File

@ -22,8 +22,8 @@ struct CPMemory
{
TVtxDesc vtxDesc;
std::array<VAT, CP_NUM_VAT_REG> vtxAttr;
std::array<u32, CP_NUM_ARRAYS> arrayBases;
std::array<u32, CP_NUM_ARRAYS> arrayStrides;
std::array<u32, CP_NUM_ARRAYS> arrayBases{};
std::array<u32, CP_NUM_ARRAYS> arrayStrides{};
};
void LoadCPReg(u32 subCmd, u32 value, CPMemory& cpMem);

View File

@ -120,19 +120,19 @@ bool FifoDataFile::Save(const std::string& filename)
PadFile(m_Frames.size() * sizeof(FileFrameInfo), file);
u64 bpMemOffset = file.Tell();
file.WriteArray(m_BPMem, BP_MEM_SIZE);
file.WriteArray(m_BPMem);
u64 cpMemOffset = file.Tell();
file.WriteArray(m_CPMem, CP_MEM_SIZE);
file.WriteArray(m_CPMem);
u64 xfMemOffset = file.Tell();
file.WriteArray(m_XFMem, XF_MEM_SIZE);
file.WriteArray(m_XFMem);
u64 xfRegsOffset = file.Tell();
file.WriteArray(m_XFRegs, XF_REGS_SIZE);
file.WriteArray(m_XFRegs);
u64 texMemOffset = file.Tell();
file.WriteArray(m_TexMem, TEX_MEM_SIZE);
file.WriteArray(m_TexMem);
// Write header
FileHeader header;
@ -285,27 +285,27 @@ std::unique_ptr<FifoDataFile> FifoDataFile::Load(const std::string& filename, bo
u32 size = std::min<u32>(BP_MEM_SIZE, header.bpMemSize);
file.Seek(header.bpMemOffset, SEEK_SET);
file.ReadArray(dataFile->m_BPMem, size);
file.ReadArray(&dataFile->m_BPMem);
size = std::min<u32>(CP_MEM_SIZE, header.cpMemSize);
file.Seek(header.cpMemOffset, SEEK_SET);
file.ReadArray(dataFile->m_CPMem, size);
file.ReadArray(&dataFile->m_CPMem);
size = std::min<u32>(XF_MEM_SIZE, header.xfMemSize);
file.Seek(header.xfMemOffset, SEEK_SET);
file.ReadArray(dataFile->m_XFMem, size);
file.ReadArray(&dataFile->m_XFMem);
size = std::min<u32>(XF_REGS_SIZE, header.xfRegsSize);
file.Seek(header.xfRegsOffset, SEEK_SET);
file.ReadArray(dataFile->m_XFRegs, size);
file.ReadArray(&dataFile->m_XFRegs);
// Texture memory saving was added in version 4.
std::memset(dataFile->m_TexMem, 0, TEX_MEM_SIZE);
dataFile->m_TexMem.fill(0);
if (dataFile->m_Version >= 4)
{
size = std::min<u32>(TEX_MEM_SIZE, header.texMemSize);
file.Seek(header.texMemOffset, SEEK_SET);
file.ReadArray(dataFile->m_TexMem, size);
file.ReadArray(&dataFile->m_TexMem);
}
if (!file.IsGood())

View File

@ -3,6 +3,7 @@
#pragma once
#include <array>
#include <memory>
#include <string>
#include <vector>
@ -25,18 +26,18 @@ struct MemoryUpdate
TMEM = 0x08,
};
u32 fifoPosition;
u32 address;
u32 fifoPosition = 0;
u32 address = 0;
std::vector<u8> data;
Type type;
Type type{};
};
struct FifoFrameInfo
{
std::vector<u8> fifoData;
u32 fifoStart;
u32 fifoEnd;
u32 fifoStart = 0;
u32 fifoEnd = 0;
// Must be sorted by fifoPosition
std::vector<MemoryUpdate> memoryUpdates;
@ -63,11 +64,11 @@ public:
bool HasBrokenEFBCopies() const;
bool ShouldGenerateFakeVIUpdates() const;
u32* GetBPMem() { return m_BPMem; }
u32* GetCPMem() { return m_CPMem; }
u32* GetXFMem() { return m_XFMem; }
u32* GetXFRegs() { return m_XFRegs; }
u8* GetTexMem() { return m_TexMem; }
u32* GetBPMem() { return m_BPMem.data(); }
u32* GetCPMem() { return m_CPMem.data(); }
u32* GetXFMem() { return m_XFMem.data(); }
u32* GetXFRegs() { return m_XFRegs.data(); }
u8* GetTexMem() { return m_TexMem.data(); }
u32 GetRamSizeReal() { return m_ram_size_real; }
u32 GetExRamSizeReal() { return m_exram_size_real; }
@ -93,13 +94,13 @@ private:
static void ReadMemoryUpdates(u64 fileOffset, u32 numUpdates,
std::vector<MemoryUpdate>& memUpdates, File::IOFile& file);
u32 m_BPMem[BP_MEM_SIZE];
u32 m_CPMem[CP_MEM_SIZE];
u32 m_XFMem[XF_MEM_SIZE];
u32 m_XFRegs[XF_REGS_SIZE];
u8 m_TexMem[TEX_MEM_SIZE];
u32 m_ram_size_real;
u32 m_exram_size_real;
std::array<u32, BP_MEM_SIZE> m_BPMem{};
std::array<u32, CP_MEM_SIZE> m_CPMem{};
std::array<u32, XF_MEM_SIZE> m_XFMem{};
std::array<u32, XF_REGS_SIZE> m_XFRegs{};
std::array<u8, TEX_MEM_SIZE> m_TexMem{};
u32 m_ram_size_real = 0;
u32 m_exram_size_real = 0;
u32 m_Flags = 0;
u32 m_Version = 0;

View File

@ -354,8 +354,8 @@ struct SmallBlockAccessors : Accessors
}
private:
u8** alloc_base;
u32 size;
u8** alloc_base = nullptr;
u32 size = 0;
};
struct NullAccessors : Accessors

View File

@ -82,24 +82,24 @@ protected:
};
// 32 * 5 because 32 samples per millisecond, for max 5 milliseconds.
int m_samples_left[32 * 5];
int m_samples_right[32 * 5];
int m_samples_surround[32 * 5];
int m_samples_auxA_left[32 * 5];
int m_samples_auxA_right[32 * 5];
int m_samples_auxA_surround[32 * 5];
int m_samples_auxB_left[32 * 5];
int m_samples_auxB_right[32 * 5];
int m_samples_auxB_surround[32 * 5];
int m_samples_left[32 * 5]{};
int m_samples_right[32 * 5]{};
int m_samples_surround[32 * 5]{};
int m_samples_auxA_left[32 * 5]{};
int m_samples_auxA_right[32 * 5]{};
int m_samples_auxA_surround[32 * 5]{};
int m_samples_auxB_left[32 * 5]{};
int m_samples_auxB_right[32 * 5]{};
int m_samples_auxB_surround[32 * 5]{};
u16 m_cmdlist[512];
u16 m_cmdlist[512]{};
u32 m_cmdlist_size = 0;
// Table of coefficients for polyphase sample rate conversion.
// The coefficients aren't always available (they are part of the DSP DROM)
// so we also need to know if they are valid or not.
std::optional<u32> m_coeffs_checksum = std::nullopt;
std::array<s16, 0x800> m_coeffs;
std::array<s16, 0x800> m_coeffs{};
u16 m_compressor_pos = 0;

View File

@ -21,27 +21,27 @@ public:
protected:
// Additional AUX buffers
int m_samples_auxC_left[32 * 3];
int m_samples_auxC_right[32 * 3];
int m_samples_auxC_surround[32 * 3];
int m_samples_auxC_left[32 * 3]{};
int m_samples_auxC_right[32 * 3]{};
int m_samples_auxC_surround[32 * 3]{};
// Wiimote buffers
int m_samples_wm0[6 * 3];
int m_samples_aux0[6 * 3];
int m_samples_wm1[6 * 3];
int m_samples_aux1[6 * 3];
int m_samples_wm2[6 * 3];
int m_samples_aux2[6 * 3];
int m_samples_wm3[6 * 3];
int m_samples_aux3[6 * 3];
int m_samples_wm0[6 * 3]{};
int m_samples_aux0[6 * 3]{};
int m_samples_wm1[6 * 3]{};
int m_samples_aux1[6 * 3]{};
int m_samples_wm2[6 * 3]{};
int m_samples_aux2[6 * 3]{};
int m_samples_wm3[6 * 3]{};
int m_samples_aux3[6 * 3]{};
// Are we implementing an old version of AXWii which still has updates?
bool m_old_axwii;
bool m_old_axwii = false;
// Last volume values for MAIN and AUX. Used to generate volume ramps to
// interpolate nicely between old and new volume values.
u16 m_last_main_volume;
u16 m_last_aux_volumes[3];
u16 m_last_main_volume = 0;
u16 m_last_aux_volumes[3]{};
// If needed, extract the updates related fields from a PB. We need to
// reinject them afterwards so that the correct PB typs is written to RAM.

View File

@ -37,26 +37,26 @@ namespace DVDThread
{
struct ReadRequest
{
bool copy_to_ram;
u32 output_address;
u64 dvd_offset;
u32 length;
DiscIO::Partition partition;
bool copy_to_ram = false;
u32 output_address = 0;
u64 dvd_offset = 0;
u32 length = 0;
DiscIO::Partition partition{};
// This determines which code DVDInterface will run to reply
// to the emulated software. We can't use callbacks,
// because function pointers can't be stored in savestates.
DVDInterface::ReplyType reply_type;
DVDInterface::ReplyType reply_type = DVDInterface::ReplyType::NoReply;
// IDs are used to uniquely identify a request. They must not be
// identical to IDs of any other requests that currently exist, but
// it's fine to re-use IDs of requests that have existed in the past.
u64 id;
u64 id = 0;
// Only used for logging
u64 time_started_ticks;
u64 realtime_started_us;
u64 realtime_done_us;
u64 time_started_ticks = 0;
u64 realtime_started_us = 0;
u64 realtime_done_us = 0;
};
using ReadResult = std::pair<ReadRequest, std::vector<u8>>;

View File

@ -65,7 +65,7 @@ public:
// For savestates. storing it here seemed cleaner than requiring each implementation to report its
// type. I know this class is set up like an interface, but no code requires it to be strictly
// such.
TEXIDevices m_device_type;
TEXIDevices m_device_type = TEXIDevices::EXIDEVICE_NONE;
private:
// Byte transfer function for this device

View File

@ -404,8 +404,8 @@ private:
defined(__OpenBSD__) || defined(__NetBSD__) || defined(__HAIKU__)
sf::UdpSocket m_sf_socket;
sf::IpAddress m_sf_recipient_ip;
char m_in_frame[9004];
char m_out_frame[9004];
char m_in_frame[9004]{};
char m_out_frame[9004]{};
std::thread m_read_thread;
Common::Flag m_read_enabled;
Common::Flag m_read_thread_shutdown;

View File

@ -25,7 +25,7 @@ public:
DEntry m_gci_header;
std::vector<GCMBlock> m_save_data;
std::vector<u16> m_used_blocks;
bool m_dirty;
bool m_dirty = false;
std::string m_filename;
};
} // namespace Memcard

View File

@ -82,7 +82,7 @@ private:
struct GCMemcardAnimationFrameRGBA8
{
std::vector<u32> image_data;
u8 delay;
u8 delay = 0;
};
// size of a single memory card block in bytes

View File

@ -23,10 +23,8 @@ public:
virtual void ClearAll() = 0;
virtual void DoState(PointerWrap& p) = 0;
u32 GetCardId() const { return m_nintendo_card_id; }
bool IsAddressInBounds(u32 address) const { return address <= (m_memory_card_size - 1); }
protected:
int m_card_index;
u16 m_nintendo_card_id;
u32 m_memory_card_size;
};

View File

@ -31,6 +31,8 @@ public:
void DoState(PointerWrap& p) override;
private:
bool IsAddressInBounds(u32 address) const { return address <= (m_memory_card_size - 1); }
std::string m_filename;
std::unique_ptr<u8[]> m_memcard_data;
std::unique_ptr<u8[]> m_flush_buffer;
@ -38,4 +40,5 @@ private:
std::mutex m_flush_mutex;
Common::Event m_flush_trigger;
Common::Flag m_dirty;
u32 m_memory_card_size;
};

View File

@ -96,9 +96,9 @@ union USIChannelIn_Lo
// SI Channel
struct SSIChannel
{
USIChannelOut out;
USIChannelIn_Hi in_hi;
USIChannelIn_Lo in_lo;
USIChannelOut out{};
USIChannelIn_Hi in_hi{};
USIChannelIn_Lo in_lo{};
std::unique_ptr<ISIDevice> device;
bool has_recent_device_change = false;

View File

@ -60,7 +60,7 @@ private:
GBASockServer m_sock_server;
NextAction m_next_action = NextAction::SendCommand;
EBufferCommands m_last_cmd;
EBufferCommands m_last_cmd = EBufferCommands::CMD_STATUS;
u64 m_timestamp_sent = 0;
};
} // namespace SerialInterface

View File

@ -91,8 +91,9 @@ public:
File = 1,
Directory = 2,
};
u8 mode, attributes;
Type type;
u8 mode = 0;
u8 attributes = 0;
Type type{};
/// File name relative to the title data directory.
std::string path;
// Only valid for regular (i.e. non-directory) files.

View File

@ -49,7 +49,7 @@ public:
virtual u32 GetDataSize() const = 0;
u8* data_ptr;
u8* data_ptr = nullptr;
};
std::unique_ptr<DataReportManipulator> MakeDataReportManipulator(InputReportID rpt_id,

View File

@ -94,7 +94,7 @@ void CameraLogic::Update(const Common::Matrix44& transform, Common::Vec2 field_o
struct CameraPoint
{
IRBasic::IRObject position;
u8 size;
u8 size = 0;
};
std::array<CameraPoint, leds.size()> camera_points;

View File

@ -155,10 +155,10 @@ private:
int BusRead(u8 slave_addr, u8 addr, int count, u8* data_out) override;
int BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in) override;
Register m_reg_data;
Register m_reg_data{};
// When disabled the camera does not respond on the bus.
// Change is triggered by wiimote report 0x13.
bool m_is_enabled;
bool m_is_enabled = false;
};
} // namespace WiimoteEmu

View File

@ -79,10 +79,6 @@ Common::Quaternion ComplementaryFilter(const Common::Quaternion& gyroscope,
}
}
IMUCursorState::IMUCursorState() : rotation{Common::Quaternion::Identity()}
{
}
void EmulateShake(PositionalState* state, ControllerEmu::Shake* const shake_group,
float time_elapsed)
{

View File

@ -23,27 +23,25 @@ using MathUtil::GRAVITY_ACCELERATION;
struct PositionalState
{
// meters
Common::Vec3 position;
Common::Vec3 position{};
// meters/second
Common::Vec3 velocity;
Common::Vec3 velocity{};
// meters/second^2
Common::Vec3 acceleration;
Common::Vec3 acceleration{};
};
struct RotationalState
{
// radians
Common::Vec3 angle;
Common::Vec3 angle{};
// radians/second
Common::Vec3 angular_velocity;
Common::Vec3 angular_velocity{};
};
struct IMUCursorState
{
IMUCursorState();
// Rotation of world around device.
Common::Quaternion rotation;
Common::Quaternion rotation = Common::Quaternion::Identity();
float recentered_pitch = {};
};
@ -51,6 +49,7 @@ struct IMUCursorState
// Contains both positional and rotational state.
struct MotionState : PositionalState, RotationalState
{
MotionState() = default;
};
// Note that 'gyroscope' is rotation of world around device.

View File

@ -112,10 +112,10 @@ private:
ControllerEmu::SettingValue<double> m_hit_strength_setting;
// Holds previous user input state to watch for "new" hits.
u8 m_prev_pad_input;
u8 m_prev_pad_input = 0;
// Holds new drum pad hits that still need velocity data to be sent.
u8 m_new_pad_hits;
u8 m_new_pad_hits = 0;
// Holds how many more frames to send each drum-pad bit.
std::array<u8, 6> m_pad_remaining_frames;
std::array<u8, 6> m_pad_remaining_frames{};
};
} // namespace WiimoteEmu

View File

@ -64,11 +64,11 @@ private:
int BusRead(u8 slave_addr, u8 addr, int count, u8* data_out) override;
int BusWrite(u8 slave_addr, u8 addr, int count, const u8* data_in) override;
Register reg_data;
Register reg_data{};
// TODO: What actions reset this state?
// Is this actually in the register somewhere?
ADPCMState adpcm_state;
ADPCMState adpcm_state{};
ControllerEmu::SettingValue<double> m_speaker_pan_setting;
};

View File

@ -232,8 +232,8 @@ public:
void LoadDefaults(const ControllerInterface& ciface) override;
private:
std::array<ControllerEmu::Buttons*, NUM_HOTKEY_GROUPS> m_keys;
std::array<ControllerEmu::ControlGroup*, NUM_HOTKEY_GROUPS> m_hotkey_groups;
std::array<ControllerEmu::Buttons*, NUM_HOTKEY_GROUPS> m_keys{};
std::array<ControllerEmu::ControlGroup*, NUM_HOTKEY_GROUPS> m_hotkey_groups{};
};
namespace HotkeyManagerEmu

View File

@ -110,12 +110,9 @@ private:
struct ExecutingCommandInfo
{
ExecutingCommandInfo() {}
ExecutingCommandInfo(u32 request_address)
: m_request_address(request_address), m_copy_diimmbuf(false)
{
}
u32 m_request_address;
bool m_copy_diimmbuf;
ExecutingCommandInfo(u32 request_address) : m_request_address(request_address) {}
u32 m_request_address = 0;
bool m_copy_diimmbuf = false;
};
friend class ::CBoot;

View File

@ -377,9 +377,9 @@ private:
struct OpenedContent
{
bool m_opened = false;
u64 m_fd;
u64 m_fd = 0;
u64 m_title_id = 0;
ES::Content m_content;
ES::Content m_content{};
u32 m_uid = 0;
};

View File

@ -237,8 +237,8 @@ private:
void DoState(PointerWrap& p);
bool in_use = false;
ObjectType type;
ObjectSubType subtype;
ObjectType type{};
ObjectSubType subtype{};
std::vector<u8> data;
u32 misc_data = 0;
u32 owner_mask = 0;

View File

@ -137,7 +137,7 @@ private:
};
#pragma pack(pop)
ConfigData m_data;
ConfigData m_data{};
};
} // namespace Net
} // namespace IOS::HLE

View File

@ -65,18 +65,18 @@ enum SSL_IOCTL
struct WII_SSL
{
mbedtls_ssl_context ctx;
mbedtls_ssl_config config;
mbedtls_ssl_session session;
mbedtls_entropy_context entropy;
mbedtls_ctr_drbg_context ctr_drbg;
mbedtls_x509_crt cacert;
mbedtls_x509_crt clicert;
mbedtls_pk_context pk;
mbedtls_ssl_context ctx{};
mbedtls_ssl_config config{};
mbedtls_ssl_session session{};
mbedtls_entropy_context entropy{};
mbedtls_ctr_drbg_context ctr_drbg{};
mbedtls_x509_crt cacert{};
mbedtls_x509_crt clicert{};
mbedtls_pk_context pk{};
int sockfd = -1;
int hostfd = -1;
std::string hostname;
bool active;
bool active = false;
};
class NetSSLDevice : public Device

View File

@ -233,10 +233,10 @@ public:
struct PollCommand
{
u32 request_addr;
u32 buffer_out;
u32 request_addr = 0;
u32 buffer_out = 0;
std::vector<pollfd_t> wii_fds;
s64 timeout;
s64 timeout = 0;
};
static s32 GetNetErrorCode(s32 ret, std::string_view caller, bool is_rw);
@ -292,7 +292,7 @@ private:
void UpdatePollCommands();
std::unordered_map<s32, WiiSocket> WiiSockets;
s32 errno_last;
s32 errno_last = 0;
std::vector<PollCommand> pending_polls;
std::chrono::time_point<std::chrono::high_resolution_clock> last_time =
std::chrono::high_resolution_clock::now();

View File

@ -159,7 +159,7 @@ private:
u32 m_block_length = 0;
u32 m_bus_width = 0;
std::array<u32, 0x200 / sizeof(u32)> m_registers;
std::array<u32, 0x200 / sizeof(u32)> m_registers{};
File::IOFile m_card;
};

View File

@ -50,20 +50,20 @@ private:
std::string m_device_name;
mbedtls_aes_context m_aes_ctx;
mbedtls_aes_context m_aes_ctx{};
u8 m_aes_key[0x10] = {};
u8 m_aes_iv[0x10] = {};
ES::TMDReader m_tmd;
std::string m_base_extract_path;
u64 m_current_title_id;
u64 m_current_title_id = 0;
std::string m_current_title_id_str;
u16 m_current_group_id;
u16 m_current_group_id = 0;
std::string m_current_group_id_str;
u64 m_import_title_id;
u64 m_import_title_id = 0;
std::string m_import_title_id_str;
u16 m_import_group_id;
u16 m_import_group_id = 0;
std::string m_import_group_id_str;
// Set on IMPORT_TITLE_INIT when the next profile application should not delete

View File

@ -84,10 +84,10 @@ private:
struct FileDescriptor
{
bool in_use;
bool in_use = false;
std::string path;
int mode;
size_t position;
int mode = 0;
size_t position = 0;
File::IOFile file;
bool Open();

View File

@ -82,11 +82,11 @@ public:
class Player
{
public:
PlayerId pid;
PlayerId pid{};
std::string name;
std::string revision;
u32 ping;
SyncIdentifierComparison game_status;
u32 ping = 0;
SyncIdentifierComparison game_status = SyncIdentifierComparison::Unknown;
bool IsHost() const { return pid == 1; }
};
@ -153,7 +153,7 @@ protected:
struct AsyncQueueEntry
{
sf::Packet packet;
u8 channel_id;
u8 channel_id = 0;
};
void ClearBuffers();

View File

@ -28,84 +28,84 @@ namespace NetPlay
{
struct NetSettings
{
bool m_CPUthread;
PowerPC::CPUCore m_CPUcore;
bool m_EnableCheats;
int m_SelectedLanguage;
bool m_OverrideRegionSettings;
bool m_DSPHLE;
bool m_DSPEnableJIT;
bool m_WriteToMemcard;
bool m_RAMOverrideEnable;
u32 m_Mem1Size;
u32 m_Mem2Size;
DiscIO::Region m_FallbackRegion;
bool m_AllowSDWrites;
bool m_CopyWiiSave;
bool m_OCEnable;
float m_OCFactor;
std::array<ExpansionInterface::TEXIDevices, 3> m_EXIDevice;
bool m_CPUthread = false;
PowerPC::CPUCore m_CPUcore{};
bool m_EnableCheats = false;
int m_SelectedLanguage = 0;
bool m_OverrideRegionSettings = false;
bool m_DSPHLE = false;
bool m_DSPEnableJIT = false;
bool m_WriteToMemcard = false;
bool m_RAMOverrideEnable = false;
u32 m_Mem1Size = 0;
u32 m_Mem2Size = 0;
DiscIO::Region m_FallbackRegion{};
bool m_AllowSDWrites = false;
bool m_CopyWiiSave = false;
bool m_OCEnable = false;
float m_OCFactor = 0;
std::array<ExpansionInterface::TEXIDevices, 3> m_EXIDevice{};
std::array<u32, Config::SYSCONF_SETTINGS.size()> m_SYSCONFSettings;
std::array<u32, Config::SYSCONF_SETTINGS.size()> m_SYSCONFSettings{};
bool m_EFBAccessEnable;
bool m_BBoxEnable;
bool m_ForceProgressive;
bool m_EFBToTextureEnable;
bool m_XFBToTextureEnable;
bool m_DisableCopyToVRAM;
bool m_ImmediateXFBEnable;
bool m_EFBEmulateFormatChanges;
int m_SafeTextureCacheColorSamples;
bool m_PerfQueriesEnable;
bool m_FloatExceptions;
bool m_DivideByZeroExceptions;
bool m_FPRF;
bool m_AccurateNaNs;
bool m_DisableICache;
bool m_SyncOnSkipIdle;
bool m_SyncGPU;
int m_SyncGpuMaxDistance;
int m_SyncGpuMinDistance;
float m_SyncGpuOverclock;
bool m_JITFollowBranch;
bool m_FastDiscSpeed;
bool m_MMU;
bool m_Fastmem;
bool m_SkipIPL;
bool m_LoadIPLDump;
bool m_VertexRounding;
int m_InternalResolution;
bool m_EFBScaledCopy;
bool m_FastDepthCalc;
bool m_EnablePixelLighting;
bool m_WidescreenHack;
bool m_ForceFiltering;
int m_MaxAnisotropy;
bool m_ForceTrueColor;
bool m_DisableCopyFilter;
bool m_DisableFog;
bool m_ArbitraryMipmapDetection;
float m_ArbitraryMipmapDetectionThreshold;
bool m_EnableGPUTextureDecoding;
bool m_DeferEFBCopies;
int m_EFBAccessTileSize;
bool m_EFBAccessDeferInvalidation;
bool m_EFBAccessEnable = false;
bool m_BBoxEnable = false;
bool m_ForceProgressive = false;
bool m_EFBToTextureEnable = false;
bool m_XFBToTextureEnable = false;
bool m_DisableCopyToVRAM = false;
bool m_ImmediateXFBEnable = false;
bool m_EFBEmulateFormatChanges = false;
int m_SafeTextureCacheColorSamples = 0;
bool m_PerfQueriesEnable = false;
bool m_FloatExceptions = false;
bool m_DivideByZeroExceptions = false;
bool m_FPRF = false;
bool m_AccurateNaNs = false;
bool m_DisableICache = false;
bool m_SyncOnSkipIdle = false;
bool m_SyncGPU = false;
int m_SyncGpuMaxDistance = 0;
int m_SyncGpuMinDistance = 0;
float m_SyncGpuOverclock = 0;
bool m_JITFollowBranch = false;
bool m_FastDiscSpeed = false;
bool m_MMU = false;
bool m_Fastmem = false;
bool m_SkipIPL = false;
bool m_LoadIPLDump = false;
bool m_VertexRounding = false;
int m_InternalResolution = 0;
bool m_EFBScaledCopy = false;
bool m_FastDepthCalc = false;
bool m_EnablePixelLighting = false;
bool m_WidescreenHack = false;
bool m_ForceFiltering = false;
int m_MaxAnisotropy = 0;
bool m_ForceTrueColor = false;
bool m_DisableCopyFilter = false;
bool m_DisableFog = false;
bool m_ArbitraryMipmapDetection = false;
float m_ArbitraryMipmapDetectionThreshold = 0;
bool m_EnableGPUTextureDecoding = false;
bool m_DeferEFBCopies = false;
int m_EFBAccessTileSize = 0;
bool m_EFBAccessDeferInvalidation = false;
bool m_StrictSettingsSync;
bool m_SyncSaveData;
bool m_SyncCodes;
bool m_StrictSettingsSync = false;
bool m_SyncSaveData = false;
bool m_SyncCodes = false;
std::string m_SaveDataRegion;
bool m_SyncAllWiiSaves;
std::array<int, 4> m_WiimoteExtension;
bool m_GolfMode;
bool m_UseFMA;
bool m_HideRemoteGBAs;
bool m_SyncAllWiiSaves = false;
std::array<int, 4> m_WiimoteExtension{};
bool m_GolfMode = false;
bool m_UseFMA = false;
bool m_HideRemoteGBAs = false;
// These aren't sent over the network directly
bool m_IsHosting;
bool m_HostInputAuthority;
std::array<std::string, 4> m_GBARomPaths;
bool m_IsHosting = false;
bool m_HostInputAuthority = false;
std::array<std::string, 4> m_GBARomPaths{};
};
struct NetTraversalConfig
@ -226,7 +226,7 @@ enum : u8
struct WiimoteInput
{
u8 report_id;
u8 report_id = 0;
std::vector<u8> data;
};
using PlayerId = u8;
@ -235,19 +235,19 @@ using PadIndex = s8;
using PadMappingArray = std::array<PlayerId, 4>;
struct GBAConfig
{
bool enabled;
bool has_rom;
bool enabled = false;
bool has_rom = false;
std::string title;
std::array<u8, 20> hash;
std::array<u8, 20> hash{};
};
using GBAConfigArray = std::array<GBAConfig, 4>;
struct PadDetails
{
std::string player_name;
bool is_local;
int local_pad;
bool hide_gba;
std::string player_name{};
bool is_local = false;
int local_pad = 0;
bool hide_gba = false;
};
std::string GetPlayerMappingString(PlayerId pid, const PadMappingArray& pad_map,

View File

@ -80,16 +80,16 @@ private:
class Client
{
public:
PlayerId pid;
PlayerId pid{};
std::string name;
std::string revision;
SyncIdentifierComparison game_status;
bool has_ipl_dump;
bool has_hardware_fma;
SyncIdentifierComparison game_status = SyncIdentifierComparison::Unknown;
bool has_ipl_dump = false;
bool has_hardware_fma = false;
ENetPeer* socket;
u32 ping;
u32 current_game;
ENetPeer* socket = nullptr;
u32 ping = 0;
u32 current_game = 0;
Common::QoSSession qos_session;
@ -106,16 +106,16 @@ private:
struct AsyncQueueEntry
{
sf::Packet packet;
PlayerId target_pid;
TargetMode target_mode;
u8 channel_id;
PlayerId target_pid{};
TargetMode target_mode{};
u8 channel_id = 0;
};
struct ChunkedDataQueueEntry
{
sf::Packet packet;
PlayerId target_pid;
TargetMode target_mode;
PlayerId target_pid{};
TargetMode target_mode{};
std::string title;
};
@ -171,7 +171,7 @@ private:
std::map<PlayerId, Client> m_players;
std::unordered_map<u32, std::vector<std::pair<PlayerId, u64>>> m_timebase_by_frame;
bool m_desync_detected;
bool m_desync_detected = false;
struct
{
@ -191,7 +191,7 @@ private:
Common::Event m_chunked_data_event;
Common::Event m_chunked_data_complete_event;
std::thread m_chunked_data_thread;
u32 m_next_chunked_data_id;
u32 m_next_chunked_data_id = 0;
std::unordered_map<u32, unsigned int> m_chunked_data_complete_count;
bool m_abort_chunked_data = false;

View File

@ -266,9 +266,9 @@ private:
Jit64AsmRoutineManager asm_routines{*this};
bool m_enable_blr_optimization;
bool m_cleanup_after_stackfault;
u8* m_stack;
bool m_enable_blr_optimization = false;
bool m_cleanup_after_stackfault = false;
u8* m_stack = nullptr;
HyoutaUtilities::RangeSizeSet<u8*> m_free_ranges_near;
HyoutaUtilities::RangeSizeSet<u8*> m_free_ranges_far;

View File

@ -134,9 +134,9 @@ protected:
FarCodeCache m_far_code;
// Backed up when we switch to far code.
u8* m_near_code;
u8* m_near_code_end;
bool m_near_code_write_failed;
u8* m_near_code = nullptr;
u8* m_near_code_end = nullptr;
bool m_near_code_write_failed = false;
std::unordered_map<u8*, TrampolineInfo> m_back_patch_info;
std::unordered_map<u8*, u8*> m_exception_handler_at_loc;

View File

@ -205,5 +205,5 @@ private:
// This array is indexed with the masked PC and likely holds the correct block id.
// This is used as a fast cache of block_map used in the assembly dispatcher.
std::array<JitBlock*, FAST_BLOCK_MAP_ELEMENTS> fast_block_map; // start_addr & mask -> number
std::array<JitBlock*, FAST_BLOCK_MAP_ELEMENTS> fast_block_map{}; // start_addr & mask -> number
};

View File

@ -24,29 +24,29 @@ namespace PPCAnalyst
struct CodeOp // 16B
{
UGeckoInstruction inst;
GekkoOPInfo* opinfo;
u32 address;
u32 branchTo; // if UINT32_MAX, not a branch
GekkoOPInfo* opinfo = nullptr;
u32 address = 0;
u32 branchTo = 0; // if UINT32_MAX, not a branch
BitSet32 regsOut;
BitSet32 regsIn;
BitSet32 fregsIn;
s8 fregOut;
bool isBranchTarget;
bool branchUsesCtr;
bool branchIsIdleLoop;
bool wantsCR0;
bool wantsCR1;
bool wantsFPRF;
bool wantsCA;
bool wantsCAInFlags;
bool outputCR0;
bool outputCR1;
bool outputFPRF;
bool outputCA;
bool canEndBlock;
bool canCauseException;
bool skipLRStack;
bool skip; // followed BL-s for example
s8 fregOut = 0;
bool isBranchTarget = false;
bool branchUsesCtr = false;
bool branchIsIdleLoop = false;
bool wantsCR0 = false;
bool wantsCR1 = false;
bool wantsFPRF = false;
bool wantsCA = false;
bool wantsCAInFlags = false;
bool outputCR0 = false;
bool outputCR1 = false;
bool outputFPRF = false;
bool outputCA = false;
bool canEndBlock = false;
bool canCauseException = false;
bool skipLRStack = false;
bool skip = false; // followed BL-s for example
// which registers are still needed after this instruction in this block
BitSet32 fprInUse;
BitSet32 gprInUse;
@ -138,23 +138,24 @@ using CodeBuffer = std::vector<CodeOp>;
struct CodeBlock
{
// Beginning PPC address.
u32 m_address;
u32 m_address = 0;
// Number of instructions
// Gives us the size of the block.
u32 m_num_instructions;
u32 m_num_instructions = 0;
// Some basic statistics about the block.
BlockStats* m_stats;
BlockStats* m_stats = nullptr;
// Register statistics about the block.
BlockRegStats *m_gpa, *m_fpa;
BlockRegStats* m_gpa = nullptr;
BlockRegStats* m_fpa = nullptr;
// Are we a broken block?
bool m_broken;
bool m_broken = false;
// Did we have a memory_exception?
bool m_memory_exception;
bool m_memory_exception = false;
// Which GQRs this block uses, if any.
BitSet8 m_gqr_used;

View File

@ -87,10 +87,6 @@ constexpr std::array<u32, 128> s_way_from_plru = [] {
}();
} // Anonymous namespace
InstructionCache::InstructionCache()
{
}
void InstructionCache::Reset()
{
valid.fill(0);

View File

@ -21,16 +21,16 @@ constexpr u32 ICACHE_VMEM_BIT = 0x20000000;
struct InstructionCache
{
std::array<std::array<std::array<u32, ICACHE_BLOCK_SIZE>, ICACHE_WAYS>, ICACHE_SETS> data;
std::array<std::array<u32, ICACHE_WAYS>, ICACHE_SETS> tags;
std::array<u32, ICACHE_SETS> plru;
std::array<u32, ICACHE_SETS> valid;
std::array<std::array<std::array<u32, ICACHE_BLOCK_SIZE>, ICACHE_WAYS>, ICACHE_SETS> data{};
std::array<std::array<u32, ICACHE_WAYS>, ICACHE_SETS> tags{};
std::array<u32, ICACHE_SETS> plru{};
std::array<u32, ICACHE_SETS> valid{};
std::array<u8, 1 << 20> lookup_table;
std::array<u8, 1 << 21> lookup_table_ex;
std::array<u8, 1 << 20> lookup_table_vmem;
std::array<u8, 1 << 20> lookup_table{};
std::array<u8, 1 << 21> lookup_table_ex{};
std::array<u8, 1 << 20> lookup_table_vmem{};
InstructionCache();
InstructionCache() = default;
u32 ReadInstruction(u32 addr);
void Invalidate(u32 addr);
void Init();

View File

@ -113,14 +113,14 @@ static_assert(std::is_standard_layout<PairedSingle>(), "PairedSingle must be sta
// Unfortunately not all of those fit in 520 bytes, but we can fit most of ps and all of the rest.
struct PowerPCState
{
u32 pc; // program counter
u32 npc;
u32 pc = 0; // program counter
u32 npc = 0;
// gather pipe pointer for JIT access
u8* gather_pipe_ptr;
u8* gather_pipe_base_ptr;
u8* gather_pipe_ptr = nullptr;
u8* gather_pipe_base_ptr = nullptr;
u32 gpr[32]; // General purpose registers. r1 = stack pointer.
u32 gpr[32]{}; // General purpose registers. r1 = stack pointer.
#ifndef _M_X86_64
// The paired singles are strange : PS0 is stored in the full 64 bits of each FPR
@ -129,25 +129,25 @@ struct PowerPCState
alignas(16) PairedSingle ps[32];
#endif
ConditionRegister cr;
ConditionRegister cr{};
UReg_MSR msr; // machine state register
UReg_FPSCR fpscr; // floating point flags/status bits
// Exception management.
u32 Exceptions;
u32 Exceptions = 0;
// Downcount for determining when we need to do timing
// This isn't quite the right location for it, but it is here to accelerate the ARM JIT
// This variable should be inside of the CoreTiming namespace if we wanted to be correct.
int downcount;
int downcount = 0;
// XER, reformatted into byte fields for easier access.
u8 xer_ca;
u8 xer_so_ov; // format: (SO << 1) | OV
u8 xer_ca = 0;
u8 xer_so_ov = 0; // format: (SO << 1) | OV
// The Broadway CPU implements bits 16-23 of the XER register... even though it doesn't support
// lscbx
u16 xer_stringctrl;
u16 xer_stringctrl = 0;
#if _M_X86_64
// This member exists only for the purpose of an assertion that its offset <= 0x100.
@ -156,19 +156,19 @@ struct PowerPCState
alignas(16) PairedSingle ps[32];
#endif
u32 sr[16]; // Segment registers.
u32 sr[16]{}; // Segment registers.
// special purpose registers - controls quantizers, DMA, and lots of other misc extensions.
// also for power management, but we don't care about that.
u32 spr[1024];
u32 spr[1024]{};
// Storage for the stack pointer of the BLR optimization.
u8* stored_stack_pointer;
u8* stored_stack_pointer = nullptr;
std::array<std::array<TLBEntry, TLB_SIZE / TLB_WAYS>, NUM_TLBS> tlb;
u32 pagetable_base;
u32 pagetable_hashmask;
u32 pagetable_base = 0;
u32 pagetable_hashmask = 0;
InstructionCache iCache;

View File

@ -28,9 +28,9 @@ struct BlockStat
struct ProfileStats
{
std::vector<BlockStat> block_stats;
u64 cost_sum;
u64 timecost_sum;
u64 countsPerSec;
u64 cost_sum = 0;
u64 timecost_sum = 0;
u64 countsPerSec = 0;
};
} // namespace Profiler

View File

@ -298,10 +298,10 @@ static std::map<double, int> GetSavedStates()
struct CompressAndDumpState_args
{
std::vector<u8>* buffer_vector;
std::mutex* buffer_mutex;
std::vector<u8>* buffer_vector = nullptr;
std::mutex* buffer_mutex = nullptr;
std::string filename;
bool wait;
bool wait = false;
};
static void CompressAndDumpState(CompressAndDumpState_args save_args)

View File

@ -13,18 +13,18 @@ namespace NetPlay
{
struct SyncIdentifier
{
u64 dol_elf_size;
u64 dol_elf_size = 0;
std::string game_id;
u16 revision;
u8 disc_number;
bool is_datel;
u16 revision = 0;
u8 disc_number = 0;
bool is_datel = false;
// This hash is intended to be (but is not guaranteed to be):
// 1. Identical for discs with no differences that affect netplay/TAS sync
// 2. Different for discs with differences that affect netplay/TAS sync
// 3. Much faster than hashing the entire disc
// The way the hash is calculated may change with updates to Dolphin.
std::array<u8, 20> sync_hash;
std::array<u8, 20> sync_hash{};
bool operator==(const SyncIdentifier& s) const
{

View File

@ -173,17 +173,17 @@ struct CompressThreadState
struct CompressParameters
{
std::vector<u8> data;
u32 block_number;
u64 inpos;
std::vector<u8> data{};
u32 block_number = 0;
u64 inpos = 0;
};
struct OutputParameters
{
std::vector<u8> data;
u32 block_number;
bool compressed;
u64 inpos;
std::vector<u8> data{};
u32 block_number = 0;
bool compressed = false;
u64 inpos = 0;
};
static ConversionResultCode SetUpCompressThreadState(CompressThreadState* state)

View File

@ -132,14 +132,14 @@ private:
std::vector<u8> m_apploader;
std::vector<u8> m_fst_data;
std::array<u8, VolumeWii::AES_KEY_SIZE> m_key;
std::array<u8, VolumeWii::AES_KEY_SIZE> m_key{};
std::string m_root_directory;
bool m_is_wii = false;
// GameCube has no shift, Wii has 2 bit shift
u32 m_address_shift = 0;
u64 m_data_size;
u64 m_data_size = 0;
};
class DirectoryBlobReader : public BlobReader

View File

@ -46,7 +46,7 @@ private:
bool ParsePartitionData(const Partition& partition);
void ParseFileSystemData(u64 partition_data_offset, const FileInfo& directory);
const Volume* m_disc;
const Volume* m_disc = nullptr;
std::vector<u8> m_free_table;
u64 m_file_size = 0;

View File

@ -43,7 +43,7 @@ private:
static constexpr size_t LFG_K = 521;
static constexpr size_t LFG_J = 32;
std::array<u32, LFG_K> m_buffer;
std::array<u32, LFG_K> m_buffer{};
size_t m_position_bytes = 0;
};

View File

@ -78,7 +78,7 @@ private:
struct PotentialMatch
{
u64 size;
u64 size = 0;
Hashes<std::vector<u8>> hashes;
};
@ -87,9 +87,9 @@ private:
std::vector<PotentialMatch> ScanDatfile(const std::vector<u8>& data, const std::string& system);
std::string m_game_id;
u16 m_revision;
u8 m_disc_number;
u64 m_size;
u16 m_revision = 0;
u8 m_disc_number = 0;
u64 m_size = 0;
std::future<std::vector<PotentialMatch>> m_future;
Result m_result;
@ -173,8 +173,8 @@ private:
Hashes<bool> m_hashes_to_calculate{};
bool m_calculating_any_hash = false;
unsigned long m_crc32_context = 0;
mbedtls_md5_context m_md5_context;
mbedtls_sha1_context m_sha1_context;
mbedtls_md5_context m_md5_context{};
mbedtls_sha1_context m_sha1_context{};
u64 m_excess_bytes = 0;
std::vector<u8> m_data;

View File

@ -122,7 +122,7 @@ private:
Common::Lazy<std::vector<u8>> h3_table;
Common::Lazy<std::unique_ptr<FileSystem>> file_system;
Common::Lazy<u64> data_offset;
u32 type;
u32 type = 0;
};
std::unique_ptr<BlobReader> m_reader;
@ -131,7 +131,7 @@ private:
bool m_encrypted;
mutable u64 m_last_decrypted_block;
mutable u8 m_last_decrypted_block_data[BLOCK_DATA_SIZE];
mutable u8 m_last_decrypted_block_data[BLOCK_DATA_SIZE]{};
};
} // namespace DiscIO

View File

@ -168,7 +168,10 @@ private:
bool is_partition;
u8 partition_data_index;
DataEntry(size_t index_) : index(static_cast<u32>(index_)), is_partition(false) {}
DataEntry(size_t index_)
: index(static_cast<u32>(index_)), is_partition(false), partition_data_index(0)
{
}
DataEntry(size_t index_, size_t partition_data_index_)
: index(static_cast<u32>(index_)), is_partition(true),
partition_data_index(static_cast<u8>(partition_data_index_))
@ -281,11 +284,11 @@ private:
struct CompressParameters
{
std::vector<u8> data;
const DataEntry* data_entry;
u64 data_offset;
u64 bytes_read;
size_t group_index;
std::vector<u8> data{};
const DataEntry* data_entry = nullptr;
u64 data_offset = 0;
u64 bytes_read = 0;
size_t group_index = 0;
};
struct WIAOutputParametersEntry
@ -312,8 +315,8 @@ private:
struct OutputParameters
{
std::vector<OutputParametersEntry> entries;
u64 bytes_read;
size_t group_index;
u64 bytes_read = 0;
size_t group_index = 0;
};
static bool PadTo4(File::IOFile* file, u64* bytes_written);

View File

@ -141,7 +141,7 @@ private:
u32 m_rvz_packed_size;
u32 m_size = 0;
bool m_junk;
bool m_junk = false;
LaggedFibonacciGenerator m_lfg;
};
@ -178,7 +178,7 @@ public:
private:
std::vector<u8> m_buffer;
size_t m_bytes_written;
size_t m_bytes_written = 0;
mbedtls_sha1_context m_sha1_context;
};
@ -244,7 +244,7 @@ private:
void ExpandBuffer(size_t bytes_to_add);
ZSTD_CStream* m_stream;
ZSTD_outBuffer m_out_buffer;
ZSTD_outBuffer m_out_buffer{};
std::vector<u8> m_buffer;
};

View File

@ -50,7 +50,7 @@ public:
private:
BlobReader* m_blob;
std::unique_ptr<std::array<u8, VolumeWii::GROUP_TOTAL_SIZE>> m_cache;
u64 m_cached_offset;
u64 m_cached_offset = 0;
};
} // namespace DiscIO

View File

@ -52,7 +52,7 @@ private:
u32 AddInteger(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row);
u32 AddFloat(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row);
QCheckBox* m_checkbox;
QCheckBox* m_checkbox = nullptr;
std::vector<QSlider*> m_sliders;
std::vector<QLineEdit*> m_value_boxes;

View File

@ -207,7 +207,7 @@ public:
private:
std::function<ControlState()> m_state_evaluator;
bool m_should_paint_state_indicator;
bool m_should_paint_state_indicator = false;
};
IOWindow::IOWindow(MappingWidget* parent, ControllerEmu::EmulatedController* controller,

View File

@ -35,10 +35,10 @@
struct CodeViewBranch
{
u32 src_addr;
u32 dst_addr;
u32 src_addr = 0;
u32 dst_addr = 0;
u32 indentation = 0;
bool is_link;
bool is_link = false;
};
constexpr u32 WIDTH_PER_BRANCH_ARROW = 16;

View File

@ -21,7 +21,7 @@ protected:
private:
const TASInputWindow* m_parent;
int m_frame_turbo_started;
int m_turbo_press_frames;
int m_turbo_total_frames;
int m_frame_turbo_started = 0;
int m_turbo_press_frames = 0;
int m_turbo_total_frames = 0;
};

View File

@ -58,9 +58,7 @@ std::optional<std::string> ControlReference::SetExpression(std::string expr)
return parse_result.description;
}
ControlReference::ControlReference() : range(1), m_parsed_expression(nullptr)
{
}
ControlReference::ControlReference() = default;
ControlReference::~ControlReference() = default;

View File

@ -41,13 +41,14 @@ public:
// Returns a human-readable error description when the given expression is invalid.
std::optional<std::string> SetExpression(std::string expr);
ControlState range;
ControlState range = 1;
protected:
ControlReference();
std::string m_expression;
std::unique_ptr<ciface::ExpressionParser::Expression> m_parsed_expression;
ciface::ExpressionParser::ParseStatus m_parse_status;
ciface::ExpressionParser::ParseStatus m_parse_status =
ciface::ExpressionParser::ParseStatus::EmptyExpression;
};
template <>

View File

@ -181,7 +181,7 @@ public:
static ParseResult MakeSuccessfulResult(std::unique_ptr<Expression>&& expr);
static ParseResult MakeErrorResult(Token token, std::string description);
ParseStatus status;
ParseStatus status = ParseStatus::EmptyExpression;
std::unique_ptr<Expression> expr;
// Used for parse errors:

View File

@ -174,7 +174,7 @@ protected:
void AddCombinedInput(std::string name, const std::pair<std::string, std::string>& inputs);
private:
int m_id;
int m_id = 0;
std::vector<Input*> m_inputs;
std::vector<Output*> m_outputs;
};
@ -216,10 +216,10 @@ public:
struct InputDetection
{
std::shared_ptr<Device> device;
Device::Input* input;
Device::Input* input = nullptr;
Clock::time_point press_time;
std::optional<Clock::time_point> release_time;
ControlState smoothness;
ControlState smoothness = 0;
};
Device::Input* FindInput(std::string_view name, const Device* def_dev) const;

View File

@ -177,9 +177,6 @@ Joystick::Joystick(const LPDIRECTINPUTDEVICE8 device) : m_device(device)
InitForceFeedback(m_device, num_ff_axes);
}
// Zero inputs:
m_state_in = {};
// Set hats to center:
// "The center position is normally reported as -1" -MSDN
std::fill(std::begin(m_state_in.rgdwPOV), std::end(m_state_in.rgdwPOV), -1);

View File

@ -70,7 +70,7 @@ public:
private:
const LPDIRECTINPUTDEVICE8 m_device;
DIJOYSTATE m_state_in;
DIJOYSTATE m_state_in{};
bool m_buffered;
};

View File

@ -22,10 +22,10 @@ class KeyboardMouse : public Core::Device
private:
struct State
{
BYTE keyboard[256];
BYTE keyboard[256]{};
// Old smoothed relative mouse movement.
DIMOUSESTATE2 mouse;
DIMOUSESTATE2 mouse{};
// Normalized mouse cursor position.
Common::TVec2<ControlState> cursor;

View File

@ -191,7 +191,7 @@ struct Server
std::string m_description;
std::string m_address;
u16 m_port;
std::array<Proto::MessageType::PortInfo, Proto::PORT_COUNT> m_port_info;
std::array<Proto::MessageType::PortInfo, Proto::PORT_COUNT> m_port_info{};
sf::UdpSocket m_socket;
SteadyClock::time_point m_disconnect_time = SteadyClock::now();
};

View File

@ -30,16 +30,16 @@ enum PadButton
struct GCPadStatus
{
u16 button; // Or-ed PAD_BUTTON_* and PAD_TRIGGER_* bits
u8 stickX; // 0 <= stickX <= 255
u8 stickY; // 0 <= stickY <= 255
u8 substickX; // 0 <= substickX <= 255
u8 substickY; // 0 <= substickY <= 255
u8 triggerLeft; // 0 <= triggerLeft <= 255
u8 triggerRight; // 0 <= triggerRight <= 255
u8 analogA; // 0 <= analogA <= 255
u8 analogB; // 0 <= analogB <= 255
bool isConnected{true};
u16 button = 0; // Or-ed PAD_BUTTON_* and PAD_TRIGGER_* bits
u8 stickX = 0; // 0 <= stickX <= 255
u8 stickY = 0; // 0 <= stickY <= 255
u8 substickX = 0; // 0 <= substickX <= 255
u8 substickY = 0; // 0 <= substickY <= 255
u8 triggerLeft = 0; // 0 <= triggerLeft <= 255
u8 triggerRight = 0; // 0 <= triggerRight <= 255
u8 analogA = 0; // 0 <= analogA <= 255
u8 analogB = 0; // 0 <= analogB <= 255
bool isConnected = true;
static const u8 MAIN_STICK_CENTER_X = 0x80;
static const u8 MAIN_STICK_CENTER_Y = 0x80;

View File

@ -23,11 +23,11 @@ struct NetPlaySession
std::string game_id;
std::string version;
int player_count;
int port;
int player_count = 0;
int port = 0;
bool has_password;
bool in_game;
bool has_password = false;
bool in_game = false;
bool EncryptID(std::string_view password);
std::optional<std::string> DecryptID(std::string_view password) const;

View File

@ -49,7 +49,7 @@ struct TodoList
struct DownloadOp
{
Manifest::Filename filename;
Manifest::Hash hash;
Manifest::Hash hash{};
};
std::vector<DownloadOp> to_download;
@ -57,14 +57,14 @@ struct TodoList
{
Manifest::Filename filename;
std::optional<Manifest::Hash> old_hash;
Manifest::Hash new_hash;
Manifest::Hash new_hash{};
};
std::vector<UpdateOp> to_update;
struct DeleteOp
{
Manifest::Filename filename;
Manifest::Hash old_hash;
Manifest::Hash old_hash{};
};
std::vector<DeleteOp> to_delete;

View File

@ -26,7 +26,7 @@ private:
struct ActiveQuery
{
ComPtr<ID3D11Query> query;
PerfQueryGroup query_type;
PerfQueryGroup query_type{};
};
void WeakFlush();

View File

@ -34,7 +34,7 @@ private:
ComPtr<ID3D12Resource> m_gpu_buffer;
ComPtr<ID3D12Resource> m_readback_buffer;
StreamBuffer m_upload_buffer;
DescriptorHandle m_gpu_descriptor;
DescriptorHandle m_gpu_descriptor{};
};
} // namespace DX12

View File

@ -66,7 +66,7 @@ private:
u32 m_descriptor_increment_size = 0;
u32 m_current_offset = 0;
D3D12_CPU_DESCRIPTOR_HANDLE m_heap_base_cpu;
D3D12_CPU_DESCRIPTOR_HANDLE m_heap_base_cpu{};
std::unordered_map<SamplerState::StorageType, D3D12_CPU_DESCRIPTOR_HANDLE> m_sampler_map;
};

View File

@ -59,7 +59,7 @@ struct PipelineProgramKeyHash
struct PipelineProgram
{
PipelineProgramKey key;
PipelineProgramKey key{};
SHADER shader;
std::atomic_size_t reference_count{1};
bool binary_retrieved = false;

View File

@ -25,6 +25,6 @@ protected:
void SetFormat(u8 attributeIndex, u8 primitiveType);
void ParseVertex(const PortableVertexDeclaration& vdec, int index);
InputVertexData m_vertex;
InputVertexData m_vertex{};
SetupUnit m_setup_unit;
};

View File

@ -8,12 +8,12 @@
class SetupUnit
{
u8 m_PrimType;
int m_VertexCounter;
u8 m_PrimType = 0;
int m_VertexCounter = 0;
OutputVertexData m_Vertices[3];
OutputVertexData* m_VertPointer[3];
OutputVertexData* m_VertWritePointer;
OutputVertexData* m_VertPointer[3]{};
OutputVertexData* m_VertWritePointer{};
void SetupQuad();
void SetupTriangle();

View File

@ -11,7 +11,7 @@ class Vec3
public:
float x, y, z;
Vec3() {}
Vec3() = default;
explicit Vec3(float f) { x = y = z = f; }
explicit Vec3(const float* f)
{

View File

@ -120,7 +120,7 @@ private:
u64 m_completed_fence_counter = 0;
std::array<FrameResources, NUM_COMMAND_BUFFERS> m_frame_resources;
u32 m_current_frame;
u32 m_current_frame = 0;
// Threaded command buffer execution
// Semaphore determines when a command buffer can be queued

View File

@ -86,7 +86,7 @@ private:
struct SwapChainImage
{
VkImage image;
VkImage image{};
std::unique_ptr<VKTexture> texture;
std::unique_ptr<VKFramebuffer> framebuffer;
};

View File

@ -607,19 +607,19 @@ class VertexLoaderBase;
// STATE_TO_SAVE
struct CPState final
{
u32 array_bases[CP_NUM_ARRAYS];
u32 array_strides[CP_NUM_ARRAYS];
TMatrixIndexA matrix_index_a;
TMatrixIndexB matrix_index_b;
u32 array_bases[CP_NUM_ARRAYS]{};
u32 array_strides[CP_NUM_ARRAYS]{};
TMatrixIndexA matrix_index_a{};
TMatrixIndexB matrix_index_b{};
TVtxDesc vtx_desc;
// Most games only use the first VtxAttr and simply reconfigure it all the time as needed.
VAT vtx_attr[CP_NUM_VAT_REG];
VAT vtx_attr[CP_NUM_VAT_REG]{};
// Attributes that actually belong to VertexLoaderManager:
BitSet32 attr_dirty;
bool bases_dirty;
VertexLoaderBase* vertex_loaders[CP_NUM_VAT_REG];
int last_id;
BitSet32 attr_dirty{};
bool bases_dirty = false;
VertexLoaderBase* vertex_loaders[CP_NUM_VAT_REG]{};
int last_id = 0;
};
class PointerWrap;

View File

@ -20,8 +20,8 @@ struct SCPFifoStruct
// fifo registers
std::atomic<u32> CPBase;
std::atomic<u32> CPEnd;
u32 CPHiWatermark;
u32 CPLoWatermark;
u32 CPHiWatermark = 0;
u32 CPLoWatermark = 0;
std::atomic<u32> CPReadWriteDistance;
std::atomic<u32> CPWritePointer;
std::atomic<u32> CPReadPointer;

View File

@ -30,10 +30,10 @@ public:
struct FrameData
{
const u8* data;
int width;
int height;
int stride;
const u8* data = nullptr;
int width = 0;
int height = 0;
int stride = 0;
FrameState state;
};

Some files were not shown because too many files have changed in this diff Show More