mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Linux: Tons of warning cleanup plus workaround a nasty crash problem in StatusBarMessage.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4234 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
+3
-2
@@ -25,6 +25,7 @@ warnings = [
|
||||
'pointer-arith',
|
||||
'packed',
|
||||
'no-conversion',
|
||||
# 'no-unused-result', (need a newer gcc for this?)
|
||||
]
|
||||
compileFlags = [
|
||||
'-fno-exceptions',
|
||||
@@ -175,7 +176,7 @@ if not env['verbose']:
|
||||
env['SHLINKCOMSTR'] = "Linking shared $TARGET"
|
||||
env['RANLIBCOMSTR'] = "Indexing $TARGET"
|
||||
|
||||
# build falvuor
|
||||
# build flavor
|
||||
flavour = ARGUMENTS.get('flavor')
|
||||
if (flavour == 'debug'):
|
||||
compileFlags.append('-g')
|
||||
@@ -200,7 +201,7 @@ if env['lint']:
|
||||
warnings.append('float-equal')
|
||||
|
||||
# add the warnings to the compile flags
|
||||
compileFlags += [ '-W' + warning for warning in warnings ]
|
||||
compileFlags += [ ('-W' + warning) for warning in warnings ]
|
||||
|
||||
env['CCFLAGS'] = compileFlags
|
||||
if sys.platform == 'win32':
|
||||
|
||||
@@ -91,20 +91,18 @@ u32 CWII_IPC_HLE_Device_usb_kbd::Update()
|
||||
u8 Modifiers = 0x00;
|
||||
u8 PressedKeys[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
bool GotEvent = false;
|
||||
int i, j;
|
||||
|
||||
j = 0;
|
||||
for (i = 0; i < 256; i++)
|
||||
int num_pressed_keys = 0;
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
bool KeyPressedNow = IsKeyPressed(i);
|
||||
bool KeyPressedBefore = m_OldKeyBuffer[i];
|
||||
u8 KeyCode;
|
||||
u8 KeyCode = 0;
|
||||
|
||||
if (KeyPressedNow ^ KeyPressedBefore)
|
||||
{
|
||||
if (KeyPressedNow)
|
||||
{
|
||||
switch(m_KeyboardLayout)
|
||||
switch (m_KeyboardLayout)
|
||||
{
|
||||
case KBD_LAYOUT_QWERTY:
|
||||
KeyCode = m_KeyCodesQWERTY[i];
|
||||
@@ -115,13 +113,14 @@ u32 CWII_IPC_HLE_Device_usb_kbd::Update()
|
||||
break;
|
||||
}
|
||||
|
||||
if(KeyCode == 0x00)
|
||||
if (KeyCode == 0x00)
|
||||
continue;
|
||||
|
||||
PressedKeys[j] = KeyCode;
|
||||
PressedKeys[num_pressed_keys] = KeyCode;
|
||||
|
||||
j++;
|
||||
if(j == 6) break;
|
||||
num_pressed_keys++;
|
||||
if (num_pressed_keys == 6)
|
||||
break;
|
||||
}
|
||||
|
||||
GotEvent = true;
|
||||
@@ -151,7 +150,7 @@ u32 CWII_IPC_HLE_Device_usb_kbd::Update()
|
||||
// TODO: modifiers for non-Windows platforms
|
||||
#endif
|
||||
|
||||
if(Modifiers ^ m_OldModifiers)
|
||||
if (Modifiers ^ m_OldModifiers)
|
||||
{
|
||||
GotEvent = true;
|
||||
m_OldModifiers = Modifiers;
|
||||
|
||||
@@ -228,11 +228,10 @@ void EndRecordingInput()
|
||||
// TODO
|
||||
header.uniqueID = 0;
|
||||
header.numRerecords = 0;
|
||||
header.author;
|
||||
header.videoPlugin;
|
||||
header.audioPlugin;
|
||||
header.padPlugin;
|
||||
|
||||
// header.author;
|
||||
// header.videoPlugin;
|
||||
// header.audioPlugin;
|
||||
// header.padPlugin;
|
||||
|
||||
fwrite(&header, sizeof(DTMHeader), 1, g_recordfd);
|
||||
|
||||
|
||||
@@ -47,9 +47,6 @@
|
||||
// Create the plugin manager class
|
||||
CPluginManager CPluginManager::m_Instance;
|
||||
|
||||
|
||||
|
||||
|
||||
// The Plugin Manager Class
|
||||
// ------------
|
||||
|
||||
|
||||
@@ -433,7 +433,7 @@ void STACKALIGN Jit64::Jit(u32 em_address)
|
||||
}
|
||||
|
||||
|
||||
const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitBlock *b)
|
||||
const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBlock *b)
|
||||
{
|
||||
if (em_address == 0)
|
||||
PanicAlert("ERROR : Trying to compile at 0. LR=%08x", LR);
|
||||
@@ -449,8 +449,8 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buffer, JitB
|
||||
|
||||
//Analyze the block, collect all instructions it is made of (including inlining,
|
||||
//if that is enabled), reorder instructions for optimal performance, and join joinable instructions.
|
||||
PPCAnalyst::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, code_buffer);
|
||||
PPCAnalyst::CodeOp *ops = code_buffer->codebuffer;
|
||||
PPCAnalyst::Flatten(em_address, &size, &js.st, &js.gpa, &js.fpa, code_buf);
|
||||
PPCAnalyst::CodeOp *ops = code_buf->codebuffer;
|
||||
|
||||
const u8 *start = AlignCode4(); //TODO: Test if this or AlignCode16 make a difference from GetCodePtr
|
||||
b->checkedEntry = start;
|
||||
|
||||
@@ -136,7 +136,6 @@
|
||||
int a = inst.RA;
|
||||
int b = inst.RB;
|
||||
int crf = inst.CRFD;
|
||||
int shift = crf * 4;
|
||||
|
||||
bool merge_branch = false;
|
||||
int test_crf = js.next_inst.BI >> 2;
|
||||
|
||||
@@ -315,7 +315,7 @@ void LoadStateCallback(u64 userdata, int cyclesLate)
|
||||
buffer = new u8[sz];
|
||||
|
||||
int x;
|
||||
if ((x = (int)fread(buffer, 1, sz, f)) != sz)
|
||||
if ((x = (int)fread(buffer, 1, sz, f)) != (int)sz)
|
||||
PanicAlert("wtf? %d %d", x, sz);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ void StopTrace()
|
||||
}
|
||||
|
||||
static int stateSize = 32*4;// + 32*16 + 6*4;
|
||||
static u64 tb;
|
||||
|
||||
int SyncTrace()
|
||||
{
|
||||
|
||||
@@ -73,8 +73,7 @@ void AnalyzeRange(int start_addr, int end_addr)
|
||||
|
||||
// This may not be 100% accurate in case of jump tables!
|
||||
// It could get desynced, which would be bad. We'll see if that's an issue.
|
||||
int addr = start_addr;
|
||||
while (addr < end_addr)
|
||||
for (int addr = start_addr; addr < end_addr;)
|
||||
{
|
||||
UDSPInstruction inst = dsp_imem_read(addr);
|
||||
const DSPOPCTemplate *opcode = GetOpTemplate(inst);
|
||||
|
||||
@@ -79,7 +79,6 @@ DSPDisassembler::~DSPDisassembler()
|
||||
bool DSPDisassembler::Disassemble(int start_pc, const std::vector<u16> &code, int base_addr, std::string &text)
|
||||
{
|
||||
const char *tmp1 = "tmp1.bin";
|
||||
const char *tmp2 = "tmp.txt";
|
||||
|
||||
// First we have to dump the code to a bin file.
|
||||
FILE *f = fopen(tmp1, "wb");
|
||||
|
||||
@@ -220,8 +220,6 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
||||
int src, dst, srcAddr;
|
||||
};
|
||||
|
||||
// branch branches[256]; // TODO: This is not being used
|
||||
int numBranches = 0;
|
||||
// TODO: Add any drawing code here...
|
||||
int width = rc.width;
|
||||
int numRows = (rc.height / rowHeight) / 2 + 2;
|
||||
@@ -292,8 +290,8 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
|
||||
if (debugger->isAlive())
|
||||
{
|
||||
char dis[256] = {0};
|
||||
u32 mem = debugger->readExtraMemory(memory, address);
|
||||
float flt = *(float *)(&mem);
|
||||
u32 mem_data = debugger->readExtraMemory(memory, address);
|
||||
float flt = *(float *)(&mem_data);
|
||||
sprintf(dis, "f: %f", flt);
|
||||
char desc[256] = "";
|
||||
|
||||
|
||||
@@ -154,11 +154,11 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
|
||||
wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name)
|
||||
: wxPanel((wxWindow*)parent, id, position, size, style, name)
|
||||
, Parent(parent)
|
||||
, codeview(NULL)
|
||||
, m_RegisterWindow(NULL)
|
||||
, m_BreakpointWindow(NULL)
|
||||
, m_MemoryWindow(NULL)
|
||||
, m_JitWindow(NULL)
|
||||
, codeview(NULL)
|
||||
{
|
||||
InitBitmaps();
|
||||
|
||||
@@ -536,7 +536,7 @@ void CCodeWindow::CreateMenuOptions(wxMenuBar * _pMenuBar, wxMenu* _pMenu)
|
||||
, wxITEM_CHECK);
|
||||
automaticstart->Check(bAutomaticStart);
|
||||
|
||||
wxMenuItem* pFontPicker = _pMenu->Append(IDM_FONTPICKER, _T("&Font..."), wxEmptyString, wxITEM_NORMAL);
|
||||
_pMenu->Append(IDM_FONTPICKER, _T("&Font..."), wxEmptyString, wxITEM_NORMAL);
|
||||
}
|
||||
|
||||
// CPU Mode and JIT Menu
|
||||
|
||||
@@ -60,10 +60,10 @@ public:
|
||||
|
||||
private:
|
||||
u32 m_CachedRegs[32];
|
||||
u32 m_CachedSpecialRegs[6];
|
||||
u32 m_CachedSpecialRegs[NUM_SPECIALS];
|
||||
double m_CachedFRegs[32][2];
|
||||
bool m_CachedRegHasChanged[32];
|
||||
bool m_CachedSpecialRegHasChanged[6];
|
||||
bool m_CachedSpecialRegHasChanged[NUM_SPECIALS];
|
||||
bool m_CachedFRegHasChanged[32][2];
|
||||
|
||||
DECLARE_NO_COPY_CLASS(CRegTable);
|
||||
|
||||
@@ -112,7 +112,7 @@ CBannerLoaderGC::GetName(std::string _rName[])
|
||||
{
|
||||
DVDBanner2* pBanner = (DVDBanner2*)m_pBannerFile;
|
||||
|
||||
u32 languageID = SConfig::GetInstance().m_InterfaceLanguage;
|
||||
// u32 languageID = SConfig::GetInstance().m_InterfaceLanguage;
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
char tempBuffer[65] = {0};
|
||||
|
||||
@@ -184,7 +184,7 @@ bool Scrub(const char* filename, CompressCB callback, void* arg)
|
||||
if (i % (numClusters / 1000) == 0)
|
||||
{
|
||||
char temp[512];
|
||||
sprintf(temp, "DiscScrubber: %lu/%lu (%s)", i, numClusters, m_FreeTable[i] ? "Free" : "Used");
|
||||
sprintf(temp, "DiscScrubber: %u/%u (%s)", i, numClusters, m_FreeTable[i] ? "Free" : "Used");
|
||||
callback(temp, (float)i / (float)numClusters, arg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,8 +119,8 @@ namespace DiscIO
|
||||
|
||||
bool DriveReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *out_ptr)
|
||||
{
|
||||
u32 NotUsed;
|
||||
#ifdef _WIN32
|
||||
u32 NotUsed;
|
||||
u64 offset = m_blocksize * block_num;
|
||||
LONG off_low = (LONG)offset & 0xFFFFFFFF;
|
||||
LONG off_high = (LONG)(offset >> 32);
|
||||
|
||||
@@ -630,7 +630,10 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||
case IDM_UPDATESTATUSBAR:
|
||||
if (m_pStatusBar != NULL)
|
||||
{
|
||||
// Linux doesn't like it since the message isn't coming from the GUI thread. We need to change this to post a message to the Frame.
|
||||
#ifdef _WIN32
|
||||
m_pStatusBar->SetStatusText(event.GetString(), event.GetInt());
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class CFrame : public wxFrame
|
||||
void PostEvent(wxCommandEvent& event);
|
||||
void PostMenuEvent(wxMenuEvent& event);
|
||||
void PostUpdateUIEvent(wxUpdateUIEvent& event);
|
||||
void StatusBarMessage(char * Text, ...);
|
||||
void StatusBarMessage(const char * Text, ...);
|
||||
void ClearStatusBar();
|
||||
void OnCustomHostMessage(int Id);
|
||||
|
||||
|
||||
@@ -707,7 +707,8 @@ void CFrame::ClearStatusBar()
|
||||
{
|
||||
if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxT(""),0);
|
||||
}
|
||||
void CFrame::StatusBarMessage(char * Text, ...)
|
||||
|
||||
void CFrame::StatusBarMessage(const char * Text, ...)
|
||||
{
|
||||
const int MAX_BYTES = 1024*10;
|
||||
char Str[MAX_BYTES];
|
||||
|
||||
@@ -30,10 +30,10 @@ struct ProjectionHack
|
||||
{
|
||||
}
|
||||
|
||||
ProjectionHack(bool enabled, float value)
|
||||
ProjectionHack(bool new_enabled, float new_value)
|
||||
{
|
||||
ProjectionHack::enabled = enabled;
|
||||
ProjectionHack::value = value;
|
||||
enabled = new_enabled;
|
||||
value = new_value;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -50,4 +50,4 @@ bool Projection_GetHack0();
|
||||
ProjectionHack Projection_GetHack1();
|
||||
ProjectionHack Projection_GetHack2();
|
||||
bool Projection_GetFreeLook();
|
||||
bool Projection_GetWidescreen();
|
||||
bool Projection_GetWidescreen();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user