From 8553b0f27b50ef6b78e043c349a0c3a983293d4b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 30 Aug 2014 17:01:19 -0400 Subject: [PATCH] DolphinWX: Clean up brace placements --- Source/Core/DolphinWX/ARCodeAddEdit.h | 3 ++- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 3 ++- Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp | 6 ++++-- Source/Core/DolphinWX/Debugger/JitWindow.cpp | 6 ++++-- Source/Core/DolphinWX/Debugger/RegisterView.h | 7 +++++-- Source/Core/DolphinWX/FrameTools.cpp | 3 ++- Source/Core/DolphinWX/GLInterface/AGL.cpp | 12 +++++++----- Source/Core/DolphinWX/GLInterface/GLX.cpp | 2 ++ Source/Core/DolphinWX/GLInterface/WGL.cpp | 15 +++++++++++---- Source/Core/DolphinWX/GLInterface/X11_Util.cpp | 15 ++++++++------- Source/Core/DolphinWX/Main.cpp | 3 ++- Source/Core/DolphinWX/PatchAddEdit.h | 3 ++- Source/Core/DolphinWX/X11Utils.cpp | 8 +++++++- 13 files changed, 58 insertions(+), 28 deletions(-) diff --git a/Source/Core/DolphinWX/ARCodeAddEdit.h b/Source/Core/DolphinWX/ARCodeAddEdit.h index d2ebbe505c..d7ccf4f01f 100644 --- a/Source/Core/DolphinWX/ARCodeAddEdit.h +++ b/Source/Core/DolphinWX/ARCodeAddEdit.h @@ -35,7 +35,8 @@ class CARCodeAddEdit : public wxDialog wxSpinButton *EntrySelection; wxTextCtrl *EditCheatCode; - enum { + enum + { ID_EDITCHEAT_NAME_TEXT = 4550, ID_EDITCHEAT_NAME, ID_ENTRY_SELECT, diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 9f3c081c16..a83413587d 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -377,7 +377,8 @@ void CCodeWindow::NotifyMapLoaded() void CCodeWindow::OnSymbolListChange(wxCommandEvent& event) { int index = symbols->GetSelection(); - if (index >= 0) { + if (index >= 0) + { Symbol* pSymbol = static_cast(symbols->GetClientData(index)); if (pSymbol != nullptr) { diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp index 9e606c4016..b2a9ac7ea2 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -234,7 +234,8 @@ void DSPDebuggerLLE::UpdateSymbolMap() void DSPDebuggerLLE::OnSymbolListChange(wxCommandEvent& event) { int index = m_SymbolList->GetSelection(); - if (index >= 0) { + if (index >= 0) + { Symbol* pSymbol = static_cast(m_SymbolList->GetClientData(index)); if (pSymbol != nullptr) { @@ -275,7 +276,8 @@ bool DSPDebuggerLLE::JumpToAddress(u16 addr) { // Center on valid instruction in IRAM/IROM int new_line = DSPSymbols::Addr2Line(addr); - if (new_line >= 0) { + if (new_line >= 0) + { m_CodeView->Center(new_line); return true; } diff --git a/Source/Core/DolphinWX/Debugger/JitWindow.cpp b/Source/Core/DolphinWX/Debugger/JitWindow.cpp index 4013bf7465..8aa983d830 100644 --- a/Source/Core/DolphinWX/Debugger/JitWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/JitWindow.cpp @@ -75,7 +75,8 @@ CJitWindow::CJitWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos, sizerBig->Fit(this); } -void CJitWindow::OnRefresh(wxCommandEvent& /*event*/) { +void CJitWindow::OnRefresh(wxCommandEvent& /*event*/) +{ block_list->Update(); } @@ -212,7 +213,8 @@ void CJitWindow::OnHostMessage(wxCommandEvent& event) // JitBlockList //================ -enum { +enum +{ COLUMN_ADDRESS, COLUMN_PPCSIZE, COLUMN_X86SIZE, diff --git a/Source/Core/DolphinWX/Debugger/RegisterView.h b/Source/Core/DolphinWX/Debugger/RegisterView.h index dd97caa329..7e2d1c40cf 100644 --- a/Source/Core/DolphinWX/Debugger/RegisterView.h +++ b/Source/Core/DolphinWX/Debugger/RegisterView.h @@ -32,12 +32,14 @@ class wxWindow; class CRegTable : public wxGridTableBase { - enum { + enum + { NUM_SPECIALS = 11, }; public: - CRegTable() { + CRegTable() + { memset(m_CachedRegs, 0, sizeof(m_CachedRegs)); memset(m_CachedSpecialRegs, 0, sizeof(m_CachedSpecialRegs)); memset(m_CachedFRegs, 0, sizeof(m_CachedFRegs)); @@ -45,6 +47,7 @@ public: memset(m_CachedSpecialRegHasChanged, 0, sizeof(m_CachedSpecialRegHasChanged)); memset(m_CachedFRegHasChanged, 0, sizeof(m_CachedFRegHasChanged)); } + int GetNumberCols() override { return 5; } int GetNumberRows() override { return 32 + NUM_SPECIALS; } bool IsEmptyCell(int row, int col) override { return row > 31 && col > 2; } diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 99f59601d4..ea1192c65a 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -126,7 +126,8 @@ void CFrame::CreateMenu() drives = cdio_get_devices(); // Windows Limitation of 24 character drives - for (unsigned int i = 0; i < drives.size() && i < 24; i++) { + for (unsigned int i = 0; i < drives.size() && i < 24; i++) + { externalDrive->Append(IDM_DRIVE1 + i, StrToWxStr(drives[i])); } diff --git a/Source/Core/DolphinWX/GLInterface/AGL.cpp b/Source/Core/DolphinWX/GLInterface/AGL.cpp index c82ea0bc2c..c79732159d 100644 --- a/Source/Core/DolphinWX/GLInterface/AGL.cpp +++ b/Source/Core/DolphinWX/GLInterface/AGL.cpp @@ -39,20 +39,22 @@ bool cInterfaceAGL::Create(void *window_handle) NSOpenGLPixelFormatAttribute attr[] = { NSOpenGLPFADoubleBuffer, NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, NSOpenGLPFAAccelerated, 0 }; NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: attr]; - if (fmt == nil) { + if (fmt == nil) + { ERROR_LOG(VIDEO, "failed to create pixel format"); return false; } - cocoaCtx = [[NSOpenGLContext alloc] - initWithFormat: fmt shareContext: nil]; + cocoaCtx = [[NSOpenGLContext alloc] initWithFormat: fmt shareContext: nil]; [fmt release]; - if (cocoaCtx == nil) { + if (cocoaCtx == nil) + { ERROR_LOG(VIDEO, "failed to create context"); return false; } - if (cocoaWin == nil) { + if (cocoaWin == nil) + { ERROR_LOG(VIDEO, "failed to create window"); return false; } diff --git a/Source/Core/DolphinWX/GLInterface/GLX.cpp b/Source/Core/DolphinWX/GLInterface/GLX.cpp index b7741835ca..fa457eccfc 100644 --- a/Source/Core/DolphinWX/GLInterface/GLX.cpp +++ b/Source/Core/DolphinWX/GLInterface/GLX.cpp @@ -84,7 +84,9 @@ bool cInterfaceGLX::Create(void *window_handle) } } else + { NOTICE_LOG(VIDEO, "Got double buffered visual!"); + } // Create a GLX context. ctx = glXCreateContext(dpy, vi, nullptr, GL_TRUE); diff --git a/Source/Core/DolphinWX/GLInterface/WGL.cpp b/Source/Core/DolphinWX/GLInterface/WGL.cpp index 89a6a381b1..d33c5b5176 100644 --- a/Source/Core/DolphinWX/GLInterface/WGL.cpp +++ b/Source/Core/DolphinWX/GLInterface/WGL.cpp @@ -104,19 +104,26 @@ bool cInterfaceWGL::Create(void *window_handle) int PixelFormat; // Holds The Results After Searching For A Match - if (!(hDC = GetDC(window_handle_reified))) { + if (!(hDC = GetDC(window_handle_reified))) + { PanicAlert("(1) Can't create an OpenGL Device context. Fail."); return false; } - if (!(PixelFormat = ChoosePixelFormat(hDC, &pfd))) { + + if (!(PixelFormat = ChoosePixelFormat(hDC, &pfd))) + { PanicAlert("(2) Can't find a suitable PixelFormat."); return false; } - if (!SetPixelFormat(hDC, PixelFormat, &pfd)) { + + if (!SetPixelFormat(hDC, PixelFormat, &pfd)) + { PanicAlert("(3) Can't set the PixelFormat."); return false; } - if (!(hRC = wglCreateContext(hDC))) { + + if (!(hRC = wglCreateContext(hDC))) + { PanicAlert("(4) Can't create an OpenGL rendering context."); return false; } diff --git a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp b/Source/Core/DolphinWX/GLInterface/X11_Util.cpp index 9a2c568569..e2f2bbadd6 100644 --- a/Source/Core/DolphinWX/GLInterface/X11_Util.cpp +++ b/Source/Core/DolphinWX/GLInterface/X11_Util.cpp @@ -60,13 +60,14 @@ void cX11Window::XEventThread() for (int num_events = XPending(dpy); num_events > 0; num_events--) { XNextEvent(dpy, &event); - switch (event.type) { - case ConfigureNotify: - XResizeWindow(dpy, win, event.xconfigure.width, event.xconfigure.height); - GLInterface->SetBackBufferDimensions(event.xconfigure.width, event.xconfigure.height); - break; - default: - break; + switch (event.type) + { + case ConfigureNotify: + XResizeWindow(dpy, win, event.xconfigure.width, event.xconfigure.height); + GLInterface->SetBackBufferDimensions(event.xconfigure.width, event.xconfigure.height); + break; + default: + break; } } Common::SleepCurrentThread(20); diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index 8b855302b3..31855d7d0d 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -111,7 +111,8 @@ CFrame* main_frame = nullptr; #ifdef WIN32 //Has no error handling. //I think that if an error occurs here there's no way to handle it anyway. -LONG WINAPI MyUnhandledExceptionFilter(LPEXCEPTION_POINTERS e) { +LONG WINAPI MyUnhandledExceptionFilter(LPEXCEPTION_POINTERS e) +{ //EnterCriticalSection(&g_uefcs); File::IOFile file("exceptioninfo.txt", "a"); diff --git a/Source/Core/DolphinWX/PatchAddEdit.h b/Source/Core/DolphinWX/PatchAddEdit.h index 7763bc4619..0e3fe27d27 100644 --- a/Source/Core/DolphinWX/PatchAddEdit.h +++ b/Source/Core/DolphinWX/PatchAddEdit.h @@ -44,7 +44,8 @@ class CPatchAddEdit : public wxDialog wxButton *EntryRemove; wxStaticBoxSizer* sbEntry; - enum { + enum + { ID_EDITPATCH_NAME_TEXT = 4500, ID_EDITPATCH_NAME, ID_EDITPATCH_OFFSET_TEXT, diff --git a/Source/Core/DolphinWX/X11Utils.cpp b/Source/Core/DolphinWX/X11Utils.cpp index 0072a740cd..924b85f0ed 100644 --- a/Source/Core/DolphinWX/X11Utils.cpp +++ b/Source/Core/DolphinWX/X11Utils.cpp @@ -87,7 +87,7 @@ XRRConfiguration::XRRConfiguration(Display *_dpy, Window _win) int XRRMajorVersion, XRRMinorVersion; if (!XRRQueryVersion(dpy, &XRRMajorVersion, &XRRMinorVersion) || - (XRRMajorVersion < 1 || (XRRMajorVersion == 1 && XRRMinorVersion < 3))) + (XRRMajorVersion < 1 || (XRRMajorVersion == 1 && XRRMinorVersion < 3))) { WARN_LOG(VIDEO, "XRRExtension not supported."); bValid = false; @@ -148,8 +148,10 @@ void XRRConfiguration::Update() fullHeight = fb_height; } else + { sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(), "%m[^:]: %ux%u", &output_name, &fullWidth, &fullHeight); + } for (int i = 0; i < screenResources->noutput; i++) { @@ -262,7 +264,9 @@ void XRRConfiguration::AddResolutions(std::vector& resos) if (output_info && output_info->crtc && output_info->connection == RR_Connected) { for (int j = 0; j < output_info->nmode; j++) + { for (int k = 0; k < screenResources->nmode; k++) + { if (output_info->modes[j] == screenResources->modes[k].id) { const std::string strRes = @@ -274,6 +278,8 @@ void XRRConfiguration::AddResolutions(std::vector& resos) resos.push_back(strRes); } } + } + } } if (output_info) XRRFreeOutputInfo(output_info);