From 0a576c750836fa053df3234a5f958e7006411a93 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Tue, 8 Sep 2009 21:16:05 +0000 Subject: [PATCH] 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 --- SConstruct | 5 +- .../Core/Src/IPC_HLE/WII_IPC_HLE_Usb_Kbd.cpp | 21 +++-- Source/Core/Core/Src/OnFrame.cpp | 9 +- Source/Core/Core/Src/PluginManager.cpp | 3 - Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 6 +- .../Core/Src/PowerPC/Jit64/Jit_Integer.cpp | 1 - Source/Core/Core/Src/State.cpp | 2 +- Source/Core/Core/Src/Tracer.cpp | 1 - Source/Core/DSPCore/Src/DSPAnalyzer.cpp | 3 +- Source/Core/DSPCore/Src/disassemble.cpp | 1 - .../Core/DebuggerUICommon/Src/MemoryView.cpp | 6 +- Source/Core/DebuggerWX/Src/CodeWindow.cpp | 4 +- Source/Core/DebuggerWX/Src/RegisterView.h | 4 +- Source/Core/DiscIO/Src/BannerLoaderGC.cpp | 2 +- Source/Core/DiscIO/Src/DiscScrubber.cpp | 2 +- Source/Core/DiscIO/Src/DriveBlob.cpp | 2 +- Source/Core/DolphinWX/Src/Frame.cpp | 3 + Source/Core/DolphinWX/Src/Frame.h | 2 +- Source/Core/DolphinWX/Src/FrameTools.cpp | 3 +- Source/Core/VideoCommon/Src/GlobalControl.h | 8 +- .../VideoCommon/Src/VertexLoader_Normal.cpp | 6 +- .../Src/VertexLoader_TextCoord.cpp | 4 +- Source/Core/VideoCommon/Src/VideoCommon.h | 4 +- Source/DSPTool/Src/main.cpp | 16 ++-- .../Plugin_DSP_LLE/Src/Logging/Logging.cpp | 89 +++++++++---------- .../Plugin_VideoOGL/Src/TextureConverter.cpp | 2 +- .../Plugin_Wiimote/Src/EmuDefinitions.h | 1 + .../Plugin_Wiimote/Src/EmuDynamics.cpp | 5 +- .../Plugin_Wiimote/Src/wiimote_real.cpp | 2 +- 29 files changed, 107 insertions(+), 110 deletions(-) diff --git a/SConstruct b/SConstruct index 5d9165a8b7..c9eb8353d2 100644 --- a/SConstruct +++ b/SConstruct @@ -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': diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Usb_Kbd.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Usb_Kbd.cpp index 2a2dccf628..a39a5f4a18 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Usb_Kbd.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Usb_Kbd.cpp @@ -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; diff --git a/Source/Core/Core/Src/OnFrame.cpp b/Source/Core/Core/Src/OnFrame.cpp index 4f4cf62e9b..75e1f511ee 100644 --- a/Source/Core/Core/Src/OnFrame.cpp +++ b/Source/Core/Core/Src/OnFrame.cpp @@ -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); diff --git a/Source/Core/Core/Src/PluginManager.cpp b/Source/Core/Core/Src/PluginManager.cpp index 64f94f646b..3a606e821c 100644 --- a/Source/Core/Core/Src/PluginManager.cpp +++ b/Source/Core/Core/Src/PluginManager.cpp @@ -47,9 +47,6 @@ // Create the plugin manager class CPluginManager CPluginManager::m_Instance; - - - // The Plugin Manager Class // ------------ diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 15b1820a27..c6c82fc08c 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -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; diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp index 7857bc3aca..8b4a6c6a1c 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp @@ -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; diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index ac31fff4bd..d405f783e8 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -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); } diff --git a/Source/Core/Core/Src/Tracer.cpp b/Source/Core/Core/Src/Tracer.cpp index a0a027567c..7d4e9280ff 100644 --- a/Source/Core/Core/Src/Tracer.cpp +++ b/Source/Core/Core/Src/Tracer.cpp @@ -58,7 +58,6 @@ void StopTrace() } static int stateSize = 32*4;// + 32*16 + 6*4; -static u64 tb; int SyncTrace() { diff --git a/Source/Core/DSPCore/Src/DSPAnalyzer.cpp b/Source/Core/DSPCore/Src/DSPAnalyzer.cpp index ea447e596d..dedf35ce2b 100644 --- a/Source/Core/DSPCore/Src/DSPAnalyzer.cpp +++ b/Source/Core/DSPCore/Src/DSPAnalyzer.cpp @@ -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); diff --git a/Source/Core/DSPCore/Src/disassemble.cpp b/Source/Core/DSPCore/Src/disassemble.cpp index 0351326f9b..bcc2b5b1d8 100644 --- a/Source/Core/DSPCore/Src/disassemble.cpp +++ b/Source/Core/DSPCore/Src/disassemble.cpp @@ -79,7 +79,6 @@ DSPDisassembler::~DSPDisassembler() bool DSPDisassembler::Disassemble(int start_pc, const std::vector &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"); diff --git a/Source/Core/DebuggerUICommon/Src/MemoryView.cpp b/Source/Core/DebuggerUICommon/Src/MemoryView.cpp index 1f16e6c9b7..9d555706b7 100644 --- a/Source/Core/DebuggerUICommon/Src/MemoryView.cpp +++ b/Source/Core/DebuggerUICommon/Src/MemoryView.cpp @@ -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] = ""; diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index b3777dd11d..a27d7767fc 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -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 diff --git a/Source/Core/DebuggerWX/Src/RegisterView.h b/Source/Core/DebuggerWX/Src/RegisterView.h index e41ab97cc4..d83052e279 100644 --- a/Source/Core/DebuggerWX/Src/RegisterView.h +++ b/Source/Core/DebuggerWX/Src/RegisterView.h @@ -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); diff --git a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp index 2270c91ce0..104249cbeb 100644 --- a/Source/Core/DiscIO/Src/BannerLoaderGC.cpp +++ b/Source/Core/DiscIO/Src/BannerLoaderGC.cpp @@ -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}; diff --git a/Source/Core/DiscIO/Src/DiscScrubber.cpp b/Source/Core/DiscIO/Src/DiscScrubber.cpp index e04e997d17..c1b3f3b5d2 100644 --- a/Source/Core/DiscIO/Src/DiscScrubber.cpp +++ b/Source/Core/DiscIO/Src/DiscScrubber.cpp @@ -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); } } diff --git a/Source/Core/DiscIO/Src/DriveBlob.cpp b/Source/Core/DiscIO/Src/DriveBlob.cpp index 58a2d84be7..5b5bdacecb 100644 --- a/Source/Core/DiscIO/Src/DriveBlob.cpp +++ b/Source/Core/DiscIO/Src/DriveBlob.cpp @@ -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); diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 3f81754795..e4a9a338f9 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -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; } diff --git a/Source/Core/DolphinWX/Src/Frame.h b/Source/Core/DolphinWX/Src/Frame.h index 8c5f702519..acae295594 100644 --- a/Source/Core/DolphinWX/Src/Frame.h +++ b/Source/Core/DolphinWX/Src/Frame.h @@ -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); diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index fdaf6712f0..54971dcf53 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -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]; diff --git a/Source/Core/VideoCommon/Src/GlobalControl.h b/Source/Core/VideoCommon/Src/GlobalControl.h index 3c0fc72c00..da6a7fc1d7 100644 --- a/Source/Core/VideoCommon/Src/GlobalControl.h +++ b/Source/Core/VideoCommon/Src/GlobalControl.h @@ -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(); \ No newline at end of file +bool Projection_GetWidescreen(); diff --git a/Source/Core/VideoCommon/Src/VertexLoader_Normal.cpp b/Source/Core/VideoCommon/Src/VertexLoader_Normal.cpp index e5d2cc8327..f0affd3ceb 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader_Normal.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoader_Normal.cpp @@ -21,9 +21,9 @@ #include "VertexLoader_Normal.h" #include "NativeVertexWriter.h" -#define LOG_NORM8() PRIM_LOG("norm: %f %f %f, ", ((s8*)VertexManager::s_pCurBufferPointer)[-3]/127.0f, ((s8*)VertexManager::s_pCurBufferPointer)[-2]/127.0f, ((s8*)VertexManager::s_pCurBufferPointer)[-1]/127.0f); -#define LOG_NORM16() PRIM_LOG("norm: %f %f %f, ", ((s16*)VertexManager::s_pCurBufferPointer)[-3]/32767.0f, ((s16*)VertexManager::s_pCurBufferPointer)[-2]/32767.0f, ((s16*)VertexManager::s_pCurBufferPointer)[-1]/32767.0f); -#define LOG_NORMF() PRIM_LOG("norm: %f %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[-3], ((float*)VertexManager::s_pCurBufferPointer)[-2], ((float*)VertexManager::s_pCurBufferPointer)[-1]); +#define LOG_NORM8() // PRIM_LOG("norm: %f %f %f, ", ((s8*)VertexManager::s_pCurBufferPointer)[-3]/127.0f, ((s8*)VertexManager::s_pCurBufferPointer)[-2]/127.0f, ((s8*)VertexManager::s_pCurBufferPointer)[-1]/127.0f); +#define LOG_NORM16() // PRIM_LOG("norm: %f %f %f, ", ((s16*)VertexManager::s_pCurBufferPointer)[-3]/32767.0f, ((s16*)VertexManager::s_pCurBufferPointer)[-2]/32767.0f, ((s16*)VertexManager::s_pCurBufferPointer)[-1]/32767.0f); +#define LOG_NORMF() // PRIM_LOG("norm: %f %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[-3], ((float*)VertexManager::s_pCurBufferPointer)[-2], ((float*)VertexManager::s_pCurBufferPointer)[-1]); VertexLoader_Normal::Set VertexLoader_Normal::m_Table[NUM_NRM_TYPE][NUM_NRM_INDICES][NUM_NRM_ELEMENTS][NUM_NRM_FORMAT]; diff --git a/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp b/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp index 3739bb18c7..00f4a31667 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoader_TextCoord.cpp @@ -24,8 +24,8 @@ #include "VertexLoader_Position.h" #include "NativeVertexWriter.h" -#define LOG_TEX1() PRIM_LOG("tex: %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0]); -#define LOG_TEX2() PRIM_LOG("tex: %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0], ((float*)VertexManager::s_pCurBufferPointer)[1]); +#define LOG_TEX1() // PRIM_LOG("tex: %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0]); +#define LOG_TEX2() // PRIM_LOG("tex: %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0], ((float*)VertexManager::s_pCurBufferPointer)[1]); extern int tcIndex; extern float tcScale[8]; diff --git a/Source/Core/VideoCommon/Src/VideoCommon.h b/Source/Core/VideoCommon/Src/VideoCommon.h index 26ea26b86b..d1203b86c9 100644 --- a/Source/Core/VideoCommon/Src/VideoCommon.h +++ b/Source/Core/VideoCommon/Src/VideoCommon.h @@ -129,7 +129,9 @@ struct TargetRectangle : public MathUtil::Rectangle #define PRIM_LOG(...) {DEBUG_LOG(VIDEO, ##__VA_ARGS__)} #endif -#define LOG_VTX() DEBUG_LOG(VIDEO, "vtx: %f %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0], ((float*)VertexManager::s_pCurBufferPointer)[1], ((float*)VertexManager::s_pCurBufferPointer)[2]); +// #define LOG_VTX() DEBUG_LOG(VIDEO, "vtx: %f %f %f, ", ((float*)VertexManager::s_pCurBufferPointer)[0], ((float*)VertexManager::s_pCurBufferPointer)[1], ((float*)VertexManager::s_pCurBufferPointer)[2]); + +#define LOG_VTX() #endif // _VIDEOCOMMON_H diff --git a/Source/DSPTool/Src/main.cpp b/Source/DSPTool/Src/main.cpp index 78ab58085b..1a937804c6 100644 --- a/Source/DSPTool/Src/main.cpp +++ b/Source/DSPTool/Src/main.cpp @@ -395,7 +395,7 @@ int main(int argc, const char *argv[]) codes = new std::vector[lines]; - for(int i = 0; i < lines; i++) + for (int i = 0; i < lines; i++) { if (!File::ReadFileToString(true, files[i].c_str(), currentSource)) { @@ -404,14 +404,15 @@ int main(int argc, const char *argv[]) } else { - if(!Assemble(currentSource.c_str(), codes[i], force)) + if (!Assemble(currentSource.c_str(), codes[i], force)) { printf("Assemble: Assembly of %s failed due to errors\n", files[i].c_str()); lines--; } - if(outputSize) - printf("%s: %d\n", files[i].c_str(), codes[i].size()); + if (outputSize) { + printf("%s: %d\n", files[i].c_str(), (int)codes[i].size()); + } } } @@ -425,13 +426,14 @@ int main(int argc, const char *argv[]) { std::vector code; - if(!Assemble(source.c_str(), code, force)) { + if (!Assemble(source.c_str(), code, force)) { printf("Assemble: Assembly failed due to errors\n"); return 1; } - if(outputSize) - printf("%s: %d\n", input_name.c_str(), code.size()); + if (outputSize) { + printf("%s: %d\n", input_name.c_str(), (int)code.size()); + } if (!output_name.empty()) { diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/Logging/Logging.cpp b/Source/Plugins/Plugin_DSP_LLE/Src/Logging/Logging.cpp index 49cf314c8f..c6611e5c8c 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/Logging/Logging.cpp +++ b/Source/Plugins/Plugin_DSP_LLE/Src/Logging/Logging.cpp @@ -31,68 +31,65 @@ // Externals extern u32 m_addressPBs; -float ratioFactor; -int globaliSize; -short globalpBuffer; -u32 gLastBlock; +static float ratioFactor; +static u32 gLastBlock; // Vectors and other things -std::vector gloopPos(64); -std::vector gsampleEnd(64); -std::vector gsamplePos(64); -std::vector gratio(64); -std::vector gratiohi(64); -std::vector gratiolo(64); -std::vector gfrac(64); -std::vector gcoef(64); +static std::vector gloopPos(64); +static std::vector gsampleEnd(64); +static std::vector gsamplePos(64); +static std::vector gratio(64); +static std::vector gratiohi(64); +static std::vector gratiolo(64); +static std::vector gfrac(64); +static std::vector gcoef(64); // PBSampleRateConverter mixer -std::vector gvolume_left(64); -std::vector gvolume_right(64); -std::vector gmixer_control(64); -std::vector gcur_volume(64); -std::vector gcur_volume_delta(64); +static std::vector gvolume_left(64); +static std::vector gvolume_right(64); +static std::vector gmixer_control(64); +static std::vector gcur_volume(64); +static std::vector gcur_volume_delta(64); -std::vector gaudioFormat(64); -std::vector glooping(64); -std::vector gsrc_type(64); -std::vector gis_stream(64); +static std::vector gaudioFormat(64); +static std::vector glooping(64); +static std::vector gsrc_type(64); +static std::vector gis_stream(64); // loop - std::vector gloop1(64); -std::vector gloop2(64); -std::vector gloop3(64); -std::vector gadloop1(64); -std::vector gadloop2(64); -std::vector gadloop3(64); +static std::vector gloop1(64); +static std::vector gloop2(64); +static std::vector gloop3(64); +static std::vector gadloop1(64); +static std::vector gadloop2(64); +static std::vector gadloop3(64); // updates -std::vector gupdates1(64); -std::vector gupdates2(64); -std::vector gupdates3(64); -std::vector gupdates4(64); -std::vector gupdates5(64); -std::vector gupdates_addr(64); +static std::vector gupdates1(64); +static std::vector gupdates2(64); +static std::vector gupdates3(64); +static std::vector gupdates4(64); +static std::vector gupdates5(64); +static std::vector gupdates_addr(64); // Other things -std::vector Jump(64); // this is 1 or 0 -std::vector musicLength(64); -std::vector< std::vector > vector1(64, std::vector(100,0)); -std::vector numberRunning(64); +static std::vector Jump(64); // this is 1 or 0 +static std::vector musicLength(64); +static std::vector< std::vector > vector1(64, std::vector(100,0)); +static std::vector numberRunning(64); -int j = 0; -int k = 0; -s64 l = 0; -int iupd = 0; -bool iupdonce = false; -std::vector viupd(15); // the length of the update frequency bar -int vectorLength = 15; // the length of the playback history bar and how long +static int j = 0; +static int k = 0; +static s64 l = 0; +static bool iupdonce = false; +static std::vector viupd(15); // the length of the update frequency bar +static int vectorLength = 15; // the length of the playback history bar and how long // old blocks are shown -std::vector vector62(vectorLength); -std::vector vector63(vectorLength); +static std::vector vector62(vectorLength); +static std::vector vector63(vectorLength); int ReadOutPBs(AXParamBlock * _pPBs, int _num); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp index ea71400182..d1522a5cf0 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp @@ -127,7 +127,7 @@ FRAGMENTSHADER &GetOrCreateEncodingShader(u32 format) if (!PixelShaderCache::CompilePixelShader(s_encodingPrograms[format], shader)) { const char* error = cgGetLastListing(g_cgcontext); - ERROR_LOG(VIDEO, "Failed to create encoding fragment program"); + ERROR_LOG(VIDEO, "Failed to create encoding fragment program:\n%s", error); } } diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h b/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h index 40c7a43377..ed4d2beb76 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuDefinitions.h @@ -194,6 +194,7 @@ struct SDot int Size; // Size of the IR dot (0-15) int Order; // Increasing order from low to higher x-axis values }; + struct SIR { SDot Dot[4]; diff --git a/Source/Plugins/Plugin_Wiimote/Src/EmuDynamics.cpp b/Source/Plugins/Plugin_Wiimote/Src/EmuDynamics.cpp index af2a6efa69..aecb029955 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/EmuDynamics.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/EmuDynamics.cpp @@ -276,7 +276,7 @@ void IRData2Dots(u8 *Data) void ReorderIRDots() { // Create a shortcut - struct SDot* Dot = g_Wiimote_kbd.IR.Dot; + SDot* Dot = g_Wiimote_kbd.IR.Dot; // Variables int i, j, order; @@ -285,6 +285,7 @@ void ReorderIRDots() for (i = 0; i < 4; ++i) Dot[i].Order = 0; + // is this just a weird filter+sort? for (order = 1; order < 5; ++order) { i = 0; @@ -353,4 +354,4 @@ std::string CCData2Values(u8 *Data) (Data[2] & 0x1f)); } -} // WiiMoteEmu \ No newline at end of file +} // WiiMoteEmu diff --git a/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp b/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp index 10b695ede6..049425462e 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/wiimote_real.cpp @@ -212,10 +212,10 @@ private: u16 m_channelID; CEventQueue m_EventReadQueue; // Read from Wiimote CEventQueue m_EventWriteQueue; // Write to Wiimote - Common::CriticalSection* m_pCriticalSection; bool m_LastReportValid; SEvent m_LastReport; wiimote_t* m_pWiiMote; // This is g_WiiMotesFromWiiUse[] + Common::CriticalSection* m_pCriticalSection; // Send queued data to the core void SendEvent(SEvent& _rEvent)