mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
Fixed some valgrind warnings.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@523 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -165,6 +165,11 @@ void StringFromFormatV(std::string* out, const char* format, va_list args)
|
||||
delete [] buf;
|
||||
buf = new char[newSize + 1];
|
||||
writtenCount = vsnprintf(buf, newSize, format, args);
|
||||
// ARGH! vsnprintf does no longer return -1 on truncation in newer libc!
|
||||
// WORKAROUND! let's fake the old behaviour (even though it's less efficient).
|
||||
// TODO: figure out why the fix causes an invalid read in strlen called from vsnprintf :(
|
||||
if (writtenCount >= (int)newSize)
|
||||
writtenCount = -1;
|
||||
newSize *= 2;
|
||||
}
|
||||
|
||||
|
@ -46,6 +46,14 @@ CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rF
|
||||
cards[_card_index] = this;
|
||||
et_this_card = CoreTiming::RegisterEvent(_rName.c_str(), FlushCallback);
|
||||
|
||||
interruptSwitch = 0;
|
||||
m_bInterruptSet = 0;
|
||||
command = 0;
|
||||
status = MC_STATUS_BUSY | MC_STATUS_UNLOCKED | MC_STATUS_READY;
|
||||
m_uPosition = 0;
|
||||
memset(programming_buffer, 0, sizeof(programming_buffer));
|
||||
formatDelay = 0;
|
||||
|
||||
nintendo_card_id = 0x00000010; // 16MBit nintendo card
|
||||
card_id = 0xc221;
|
||||
/* nintendo_card_id = 0x00000510; // 16MBit "bigben" card
|
||||
@ -71,11 +79,6 @@ CEXIMemoryCard::CEXIMemoryCard(const std::string& _rName, const std::string& _rF
|
||||
Core::DisplayMessage(StringFromFormat("Wrote memory card contents to %s", m_strFilename.c_str()), 4000);
|
||||
}
|
||||
|
||||
formatDelay = 0;
|
||||
interruptSwitch = 0;
|
||||
m_bInterruptSet = 0;
|
||||
|
||||
status = MC_STATUS_BUSY | MC_STATUS_UNLOCKED | MC_STATUS_READY;
|
||||
}
|
||||
|
||||
void CEXIMemoryCard::Flush(bool exiting)
|
||||
|
@ -40,8 +40,6 @@
|
||||
#include "../State.h"
|
||||
#include "../PowerPC/PPCAnalyst.h"
|
||||
|
||||
#define CURVERSION 0x0001
|
||||
|
||||
namespace HW
|
||||
{
|
||||
void Init()
|
||||
@ -49,7 +47,7 @@ namespace HW
|
||||
CoreTiming::Init();
|
||||
PPCAnalyst::Init();
|
||||
|
||||
Thunk_Init(); // not really hw, but this way we know it's inited first :P
|
||||
Thunk_Init(); // not really hw, but this way we know it's inited early :P
|
||||
State_Init();
|
||||
|
||||
// Init the whole Hardware
|
||||
|
@ -59,11 +59,22 @@ BEGIN_EVENT_TABLE(CCodeView, wxControl)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CCodeView::CCodeView(DebugInterface* debuginterface, wxWindow* parent, wxWindowID Id, const wxSize& Size)
|
||||
: wxControl(parent, Id, wxDefaultPosition, Size), debugger(debuginterface)
|
||||
: wxControl(parent, Id, wxDefaultPosition, Size),
|
||||
debugger(debuginterface),
|
||||
rowHeight(13),
|
||||
selection(0),
|
||||
oldSelection(0),
|
||||
selectionChanged(false),
|
||||
selecting(false),
|
||||
hasFocus(false),
|
||||
showHex(false),
|
||||
lx(-1),
|
||||
ly(-1)
|
||||
{
|
||||
rowHeight = 13;
|
||||
align = debuginterface->getInstructionSize(0);
|
||||
curAddress = debuginterface->getPC();
|
||||
selection = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,7 +46,15 @@ EVT_MENU(-1, CMemoryView::OnPopupMenu)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CMemoryView::CMemoryView(DebugInterface* debuginterface, wxWindow* parent, wxWindowID Id, const wxSize& Size)
|
||||
: wxControl(parent, Id, wxDefaultPosition, Size), debugger(debuginterface)
|
||||
: wxControl(parent, Id, wxDefaultPosition, Size),
|
||||
debugger(debuginterface),
|
||||
rowHeight(13),
|
||||
selection(0),
|
||||
oldSelection(0),
|
||||
selectionChanged(false),
|
||||
selecting(false),
|
||||
hasFocus(false),
|
||||
showHex(false)
|
||||
{
|
||||
rowHeight = 13;
|
||||
align = debuginterface->getInstructionSize(0);
|
||||
|
Reference in New Issue
Block a user