From 81631d8452477d4e3cbf5ac7ae180bc5da768fae Mon Sep 17 00:00:00 2001 From: hrydgard Date: Fri, 6 Feb 2009 18:04:24 +0000 Subject: [PATCH] Nothing important, just cleaning my dev folder. (mostly formatting changes, removed a superfluous strlen from logging in ogl plugin) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2126 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/CPUDetect.h | 5 ---- Source/Core/Common/Src/MathUtil.h | 1 - Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 8 ------ Source/Core/DolphinWX/Src/AboutDolphin.cpp | 2 +- Source/Core/DolphinWX/Src/Main.cpp | 4 +-- Source/Core/DolphinWX/Src/MainNoGUI.cpp | 2 +- .../Plugins/Plugin_VideoOGL/Src/BPStructs.cpp | 4 +-- .../Plugins/Plugin_VideoOGL/Src/Globals.cpp | 25 ++++++++++++------- 8 files changed, 22 insertions(+), 29 deletions(-) diff --git a/Source/Core/Common/Src/CPUDetect.h b/Source/Core/Common/Src/CPUDetect.h index 810f1eef2d..312bcdecec 100644 --- a/Source/Core/Common/Src/CPUDetect.h +++ b/Source/Core/Common/Src/CPUDetect.h @@ -56,11 +56,6 @@ struct CPUInfo std::string Summarize(); }; - extern CPUInfo cpu_info; -inline void DetectCPU() {cpu_info.Detect();} - - #endif - diff --git a/Source/Core/Common/Src/MathUtil.h b/Source/Core/Common/Src/MathUtil.h index b42c4553ff..a841a6dc6b 100644 --- a/Source/Core/Common/Src/MathUtil.h +++ b/Source/Core/Common/Src/MathUtil.h @@ -31,5 +31,4 @@ void SaveSSEState(); void LoadSSEState(); void LoadDefaultSSEState(); - #endif diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index 01ff3c763b..6bcb6d0672 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -238,14 +238,6 @@ namespace CPUCompare } Interpreter::_interpreterInstruction instr = GetInterpreterOp(inst); ABI_CallFunctionC((void*)instr, inst.hex); - // This was added in revision 1954, I don't know what it does. MegaMan would hang if this was enabled. - /* - if (js.isLastInstruction) - { - MOV(32, R(EAX), M(&NPC)); - WriteRfiExitDestInEAX(); - } - */ } void Jit64::unknown_instruction(UGeckoInstruction inst) diff --git a/Source/Core/DolphinWX/Src/AboutDolphin.cpp b/Source/Core/DolphinWX/Src/AboutDolphin.cpp index 50a11891cb..7f6165f008 100644 --- a/Source/Core/DolphinWX/Src/AboutDolphin.cpp +++ b/Source/Core/DolphinWX/Src/AboutDolphin.cpp @@ -14,13 +14,13 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ + #include "Common.h" #include "AboutDolphin.h" #include "svnrev.h" #include "CPUDetect.h" #include "../resources/dolphin_logo.cpp" - BEGIN_EVENT_TABLE(AboutDolphin, wxDialog) EVT_CLOSE(AboutDolphin::OnClose) EVT_BUTTON(ID_CLOSE, AboutDolphin::CloseClick) diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index da74ce9e6d..d0d009b665 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -102,8 +102,8 @@ bool DolphinApp::OnInit() bool LoadElf = false; wxString ElfFile; // Detect CPU info and write it to the cpu_info struct - DetectCPU(); - // + cpu_info.Detect(); + #if defined _DEBUG && defined _WIN32 int tmpflag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); tmpflag |= _CRTDBG_DELAY_FREE_MEM_DF; diff --git a/Source/Core/DolphinWX/Src/MainNoGUI.cpp b/Source/Core/DolphinWX/Src/MainNoGUI.cpp index 19682b8fce..97a8039555 100644 --- a/Source/Core/DolphinWX/Src/MainNoGUI.cpp +++ b/Source/Core/DolphinWX/Src/MainNoGUI.cpp @@ -196,7 +196,7 @@ int main(int argc, char* argv[]) std::string bootFile(args_info.inputs[0]); updateMainFrameEvent.Init(); - DetectCPU(); + cpu_info.Detect(); BootManager::BootCore(bootFile); while (PowerPC::state != PowerPC::CPU_POWERDOWN) { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp index 2d82ce2051..c7b29e6f12 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/BPStructs.cpp @@ -79,8 +79,8 @@ void BPWritten(int addr, int changes, int newval) glEnable(GL_CULL_FACE); glFrontFace(bpmem.genMode.cullmode == 2 ? GL_CCW : GL_CW); } - else if(glIsEnabled(GL_CULL_FACE) == GL_TRUE) - glDisable(GL_CULL_FACE); + else if (glIsEnabled(GL_CULL_FACE) == GL_TRUE) + glDisable(GL_CULL_FACE); PixelShaderManager::SetGenModeChanged(); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp index 60089ede60..ac4387c3ae 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp @@ -51,6 +51,7 @@ void CloseConsole() } +////////////////////////////////////////////////////////////////////////////////////////// // Write logs // The log file handle @@ -62,12 +63,15 @@ bool LocalLogFile = true; #ifdef LOGGING void __Log(const char *fmt, ...) { - char* Msg = (char*)alloca(strlen(fmt)+512); + int len = strlen(fmt); + if (!len) + return; + char* Msg = (char*)alloca(len + 512); va_list ap; - va_start( ap, fmt ); - vsnprintf( Msg, strlen(fmt)+512, fmt, ap ); - va_end( ap ); + va_start(ap, fmt); + vsnprintf(Msg, len + 512, fmt, ap); + va_end(ap); g_VideoInitialize.pLog(Msg, FALSE); @@ -85,15 +89,18 @@ void __Log(const char *fmt, ...) void __Log(int type, const char *fmt, ...) { - char* Msg = (char*)alloca(strlen(fmt)+512); + int len = strlen(fmt); + if (!len) + return; + char* Msg = (char*)alloca(len + 512); va_list ap; - va_start( ap, fmt ); - vsnprintf( Msg, strlen(fmt)+512, fmt, ap ); - va_end( ap ); + va_start(ap, fmt); + vsnprintf(Msg, len + 512, fmt, ap); + va_end(ap); g_VideoInitialize.pLog(Msg, FALSE); Console::Print(Msg); } -#endif +#endif