From 5b23182793f788dfa201f69f4200a099688782f9 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Wed, 24 Jun 2015 11:48:21 +0200 Subject: [PATCH 1/3] Common: drop GEKKO define Afaict, it was used to build parts of Dolphin with DSPSpy, but that's been broken forever, so lets clean up a little bit. --- Source/Core/Common/CommonFuncs.h | 4 +--- Source/Core/Common/CommonTypes.h | 37 +++++++++----------------------- Source/Core/Common/Logging/Log.h | 8 ------- Source/Core/Common/MsgHandler.h | 14 ------------ 4 files changed, 11 insertions(+), 52 deletions(-) diff --git a/Source/Core/Common/CommonFuncs.h b/Source/Core/Common/CommonFuncs.h index ba398ff51d..52ce71a540 100644 --- a/Source/Core/Common/CommonFuncs.h +++ b/Source/Core/Common/CommonFuncs.h @@ -45,9 +45,7 @@ struct ArraySizeImpl : public std::extent #endif // go to debugger mode - #ifdef GEKKO - #define Crash() - #elif defined _M_X86 + #ifdef _M_X86 #define Crash() {asm ("int $3");} #else #define Crash() { exit(1); } diff --git a/Source/Core/Common/CommonTypes.h b/Source/Core/Common/CommonTypes.h index 442b202ac2..6dde328fcd 100644 --- a/Source/Core/Common/CommonTypes.h +++ b/Source/Core/Common/CommonTypes.h @@ -12,36 +12,19 @@ #include #ifdef _WIN32 - #include - -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; - -typedef int8_t s8; -typedef int16_t s16; -typedef int32_t s32; -typedef int64_t s64; - #else - -#ifndef GEKKO - -typedef uint8_t u8; -typedef uint16_t u16; -typedef uint32_t u32; -typedef uint64_t u64; - -typedef int8_t s8; -typedef int16_t s16; -typedef int32_t s32; -typedef int64_t s64; - -#endif // For using Windows lock code #define TCHAR char #define LONG int +#endif -#endif // _WIN32 +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; +typedef uint64_t u64; + +typedef int8_t s8; +typedef int16_t s16; +typedef int32_t s32; +typedef int64_t s64; diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index 7f86270ce3..41763776fe 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -87,15 +87,11 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, #endif // loglevel #endif // logging -#ifdef GEKKO -#define GENERIC_LOG(t, v, ...) -#else // Let the compiler optimize this out #define GENERIC_LOG(t, v, ...) { \ if (v <= MAX_LOGLEVEL) \ GenericLog(v, t, __FILE__, __LINE__, __VA_ARGS__); \ } -#endif #define ERROR_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__) } while (0) #define WARN_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__) } while (0) @@ -130,7 +126,6 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, #define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_) -#ifndef GEKKO #ifdef _WIN32 #define _assert_msg_(_t_, _a_, _fmt_, ...) \ if (!(_a_)) {\ @@ -144,6 +139,3 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, Crash(); \ } #endif // WIN32 -#else // GEKKO -#define _assert_msg_(_t_, _a_, _fmt_, ...) -#endif diff --git a/Source/Core/Common/MsgHandler.h b/Source/Core/Common/MsgHandler.h index 45a28f8df3..bf080c5a81 100644 --- a/Source/Core/Common/MsgHandler.h +++ b/Source/Core/Common/MsgHandler.h @@ -29,7 +29,6 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...) ; void SetEnableAlert(bool enable); -#ifndef GEKKO #ifdef _WIN32 #define SuccessAlert(format, ...) MsgAlert(false, INFORMATION, format, __VA_ARGS__) #define PanicAlert(format, ...) MsgAlert(false, WARNING, format, __VA_ARGS__) @@ -55,16 +54,3 @@ void SetEnableAlert(bool enable); #define AskYesNoT(format, ...) MsgAlert(true, QUESTION, format, ##__VA_ARGS__) #define CriticalAlertT(format, ...) MsgAlert(false, CRITICAL, format, ##__VA_ARGS__) #endif -#else -// GEKKO - #define SuccessAlert(format, ...) ; - #define PanicAlert(format, ...) ; - #define PanicYesNo(format, ...) ; - #define AskYesNo(format, ...) ; - #define CriticalAlert(format, ...) ; - #define SuccessAlertT(format, ...) ; - #define PanicAlertT(format, ...) ; - #define PanicYesNoT(format, ...) ; - #define AskYesNoT(format, ...) ; - #define CriticalAlertT(format, ...) ; -#endif From 83ab721939c588652ba4761be05faaa75977ced3 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Wed, 24 Jun 2015 14:43:35 +0200 Subject: [PATCH 2/3] Fix -Wformat-extra-args warning --- Source/Core/VideoBackends/OGL/Render.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 6ae102305e..d650153fe9 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -590,7 +590,7 @@ Renderer::Renderer() g_ogl_config.gl_renderer, g_ogl_config.gl_version), 5000); - WARN_LOG(VIDEO,"Missing OGL Extensions: %s%s%s%s%s%s%s%s%s%s%s%s", + WARN_LOG(VIDEO,"Missing OGL Extensions: %s%s%s%s%s%s%s%s%s%s%s%s%s", g_ActiveConfig.backend_info.bSupportsDualSourceBlend ? "" : "DualSourceBlend ", g_ActiveConfig.backend_info.bSupportsPrimitiveRestart ? "" : "PrimitiveRestart ", g_ActiveConfig.backend_info.bSupportsEarlyZ ? "" : "EarlyZ ", From a725c0642564157a24c6246194843411eb0c3bf5 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Wed, 24 Jun 2015 15:16:55 +0200 Subject: [PATCH 3/3] Logging: trigger _assert_() in release builds --- Source/Core/Common/Logging/Log.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Source/Core/Common/Logging/Log.h b/Source/Core/Common/Logging/Log.h index 41763776fe..23fd6fca10 100644 --- a/Source/Core/Common/Logging/Log.h +++ b/Source/Core/Common/Logging/Log.h @@ -99,14 +99,6 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, #define INFO_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__) } while (0) #define DEBUG_LOG(t,...) do { GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__) } while (0) -#define _dbg_assert_(_t_, _a_) \ - if (MAX_LOGLEVEL >= LogTypes::LOG_LEVELS::LDEBUG && !(_a_)) {\ - ERROR_LOG(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \ - __LINE__, __FILE__, __TIME__); \ - if (!PanicYesNo("*** Assertion (see log)***\n")) \ - Crash(); \ - } - #ifdef _WIN32 #define _dbg_assert_msg_(_t_, _a_, _msg_, ...)\ if (MAX_LOGLEVEL >= LogTypes::LOG_LEVELS::LDEBUG && !(_a_)) {\ @@ -123,9 +115,6 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, } #endif - -#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_) - #ifdef _WIN32 #define _assert_msg_(_t_, _a_, _fmt_, ...) \ if (!(_a_)) {\ @@ -139,3 +128,11 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, Crash(); \ } #endif // WIN32 + +#define _assert_(_a_) \ + _assert_msg_(MASTER_LOG, _a_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \ + __LINE__, __FILE__, __TIME__) + +#define _dbg_assert_(_t_, _a_) \ + if (MAX_LOGLEVEL >= LogTypes::LOG_LEVELS::LDEBUG) \ + _assert_(_a_)