Merge pull request #1268 from PCSX2/coverity-uninitialized-members

Coverity uninitialized members
This commit is contained in:
Gregory Hainaut 2016-04-03 11:19:37 +02:00
commit 5bdadbc089
16 changed files with 113 additions and 80 deletions

View File

@ -53,6 +53,8 @@ public:
// x86 CPU Capabilities Section (all boolean flags!)
// ----------------------------------------------------------------------------
union {
struct {
u32 hasFloatingPointUnit :1;
u32 hasVirtual8086ModeEnhancements :1;
u32 hasDebuggingExtensions :1;
@ -96,17 +98,17 @@ public:
// AMD-specific CPU Features
u32 hasAMD64BitArchitecture :1;
u32 hasStreamingSIMD4ExtensionsA :1;
};
u32 AllCapabilities;
};
// Core Counts!
u32 PhysicalCores;
u32 LogicalCores;
public:
x86capabilities()
{
isIdentified = false;
VendorID = x86Vendor_Unknown;
}
x86capabilities();
void Identify();
void CountCores();

View File

@ -172,12 +172,12 @@ void Threading::pxThread::_pt_callback_cleanup( void* handle )
Threading::pxThread::pxThread( const wxString& name )
: m_name( name )
, m_thread()
, m_native_id(0)
, m_native_handle(0)
, m_detached(true) // start out with m_thread in detached/invalid state
, m_running(false)
{
m_detached = true; // start out with m_thread in detached/invalid state
m_running = false;
m_native_id = 0;
m_native_handle = 0;
}
// This destructor performs basic "last chance" cleanup, which is a blocking join

View File

@ -24,6 +24,26 @@ __aligned16 x86capabilities x86caps;
// Recompiled code buffer for SSE and MXCSR feature testing.
static __pagealigned u8 targetFXSAVE[512];
x86capabilities::x86capabilities() :
isIdentified(false),
VendorID(x86Vendor_Unknown),
FamilyID(0),
Model(0),
TypeID(0),
StepID(0),
Flags(0),
Flags2(0),
EFlags(0),
EFlags2(0),
SEFlag(0),
AllCapabilities(0),
PhysicalCores(0),
LogicalCores(0)
{
memzero(VendorName);
memzero(FamilyName);
}
// Warning! We've had problems with the MXCSR detection code causing stack corruption in
// MSVC PGO builds. The problem was fixed when I moved the MXCSR code to this function, and
// moved the recSSE[] array to a global static (it was local to cpudetectInit). Commented

View File

@ -108,7 +108,8 @@ private:
class DisassemblyMacro: public DisassemblyEntry
{
public:
DisassemblyMacro(DebugInterface* _cpu, u32 _address): cpu(_cpu), address(_address) { };
DisassemblyMacro(DebugInterface* _cpu, u32 _address):
cpu(_cpu), type(MACRO_LI), name(), immediate(0), address(_address), numOpcodes(0), rt(0), dataSize(0) { };
virtual ~DisassemblyMacro() { };
void setMacroLi(u32 _immediate, u8 _rt);

View File

@ -367,9 +367,11 @@ bool MipsCheckImmediate(const char* Source, DebugInterface* cpu, int& dest, int&
return true;
}
CMipsInstruction::CMipsInstruction(DebugInterface* cpu)
CMipsInstruction::CMipsInstruction(DebugInterface* cpu) :
Opcode(), NoCheckError(false), Loaded(false), RamPos(0),
registers(), immediateType(MIPS_NOIMMEDIATE), immediate(),
vfpuSize(0), encoding(0), error()
{
Loaded = false;
this->cpu = cpu;
}

View File

@ -166,7 +166,7 @@ struct Gif_Path {
GIF_PATH_STATE state; // Path State
Gif_Path_MTVU mtvu; // Must be last for saved states
Gif_Path() {}
Gif_Path() { Reset(); }
~Gif_Path() { _aligned_free(buffer); }
void Init(GIF_PATH _idx, u32 _buffSize, u32 _buffSafeZone) {
@ -423,7 +423,7 @@ struct Gif_Unit {
tGIF_STAT& stat;
GIF_TRANSFER_TYPE lastTranType; // Last Transfer Type
Gif_Unit() : stat(gifRegs.stat) {
Gif_Unit() : gsSIGNAL(), gsFINISH(), stat(gifRegs.stat), lastTranType(GIF_TRANS_INVALID) {
gifPath[0].Init(GIF_PATH_1, _1mb*9, _1mb + _1kb);
gifPath[1].Init(GIF_PATH_2, _1mb*9, _1mb + _1kb);
gifPath[2].Init(GIF_PATH_3, _1mb*9, _1mb + _1kb);

View File

@ -832,6 +832,11 @@ static void PS2E_CALLBACK pcsx2_OSD_WriteLn( int icon, const char* msg )
// ---------------------------------------------------------------------------------
// PluginStatus_t Implementations
// ---------------------------------------------------------------------------------
SysCorePlugins::SysCorePlugins() :
m_mcdPlugin(NULL), m_SettingsFolder(), m_LogFolder(), m_mtx_PluginStatus(), m_mcdOpen(false)
{
}
SysCorePlugins::PluginStatus_t::PluginStatus_t( PluginsEnum_t _pid, const wxString& srcfile )
: Filename( srcfile )
{
@ -971,10 +976,6 @@ void SysCorePlugins::PluginStatus_t::BindOptional( PluginsEnum_t pid )
// SysCorePlugins Implementations
// =====================================================================================
SysCorePlugins::SysCorePlugins()
{
}
SysCorePlugins::~SysCorePlugins() throw()
{
try

View File

@ -156,10 +156,9 @@ void SysExecEvent::PostResult() const
// --------------------------------------------------------------------------------------
// pxEvtQueue Implementations
// --------------------------------------------------------------------------------------
pxEvtQueue::pxEvtQueue()
pxEvtQueue::pxEvtQueue() :
m_OwnerThreadId(), m_Quitting(false), m_qpc_Start(0)
{
m_Quitting = false;
m_qpc_Start = 0;
}
// Puts the event queue into Shutdown mode, which does *not* immediately stop nor cancel

View File

@ -143,6 +143,7 @@ wxString FileMcd_GetDefaultName(uint slot)
FileMemoryCard::FileMemoryCard()
{
memset8<0xff>( m_effeffs );
m_chkaddr = 0;
}
void FileMemoryCard::Open()

View File

@ -240,6 +240,7 @@ protected:
public:
microRegAlloc(int _index) {
index = _index;
reset();
}
// Fully resets the regalloc by clearing all cached data

View File

@ -382,6 +382,9 @@ GSCapture::GSCapture()
{
m_out_dir = theApp.GetConfig("capture_out_dir", "/tmp/GSdx_Capture");
m_threads = theApp.GetConfig("capture_threads", 4);
#ifdef __linux__
m_compression_level = theApp.GetConfig("png_compression_level", Z_BEST_SPEED);
#endif
}
GSCapture::~GSCapture()
@ -488,14 +491,9 @@ bool GSCapture::BeginCapture(float fps, GSVector2i recomendedResolution, float a
m_size.x = theApp.GetConfig("capture_resx", 1280);
m_size.y = theApp.GetConfig("capture_resy", 1024);
m_compression_level = theApp.GetConfig("png_compression_level", Z_BEST_SPEED);
#ifdef __linux__
for(int i = 0; i < m_threads; i++) {
m_workers.push_back(new GSPng::Worker());
}
#endif
#endif
m_capturing = true;

View File

@ -40,6 +40,7 @@ GSRendererOGL::GSRendererOGL()
UserHacks_safe_fbmask = theApp.GetConfig("UserHacks_safe_fbmask", false);
m_prim_overlap = PRIM_OVERLAP_UNKNOW;
m_unsafe_fbmask = false;
if (!theApp.GetConfig("UserHacks", 0)) {
UserHacks_TCOffset = 0;

View File

@ -275,7 +275,12 @@ GSTextureOGL::GSTextureOGL(int type, int w, int h, int format, GLuint fbo_read)
m_int_alignment = 0;
m_int_shift = 0;
break;
default:
m_int_format = 0;
m_int_type = 0;
m_int_alignment = 0;
m_int_shift = 0;
ASSERT(0);
}

View File

@ -139,6 +139,8 @@ GamepadConfiguration::GamepadConfiguration(int pad, wxWindow *parent) : wxFrame(
wxCommandEventHandler(GamepadConfiguration::OnCheckboxChange)
);
#endif
repopulate();
}
/**

View File

@ -38,7 +38,7 @@ class GamepadConfiguration : public wxFrame
wxCheckBox *m_cb_rumble, *m_cb_hack_sixaxis_usb, *m_cb_hack_sixaxis_pressure;
wxSlider *m_sl_rumble_intensity, *m_sl_joystick_sensibility;
wxButton *m_bt_ok, *m_bt_cancel;
wxStaticText *m_lbl_rumble_intensity, *m_lbl_joystick_sensibility;
wxStaticText *m_lbl_rumble_intensity;
int m_pad_id;
u32 m_init_rumble_intensity, m_init_joystick_sensibility;