From 96b412ebb81791d8f0f14343f65e775796c5e111 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Wed, 25 Oct 2017 00:44:42 +0100 Subject: [PATCH] pcsx2|common|gsnull: Remove GSprintf API It's not really used, and the OSD uses a different API. The specified calling convention (stdcall) is also incorrect since variadic functions are caller-clean, not callee-clean. The compilers ignore the stdcall and just use cdecl (I think), though it does trigger a -Wcast-calling-convention on clang. --- common/include/PS2Edefs.h | 3 --- pcsx2/PluginManager.cpp | 13 ------------- pcsx2/gui/GlobalCommands.cpp | 2 +- plugins/GSnull/GS.cpp | 13 ------------- plugins/GSnull/Windows/GS.def | 1 - 5 files changed, 1 insertion(+), 31 deletions(-) diff --git a/common/include/PS2Edefs.h b/common/include/PS2Edefs.h index 65b5c50fb6..cebcf1b2e0 100644 --- a/common/include/PS2Edefs.h +++ b/common/include/PS2Edefs.h @@ -265,7 +265,6 @@ void CALLBACK GSchangeSaveState(int, const char *filename); void CALLBACK GSmakeSnapshot(char *path); void CALLBACK GSmakeSnapshot2(char *pathname, int *snapdone, int savejpg); void CALLBACK GSirqCallback(void (*callback)()); -void CALLBACK GSprintf(int timeout, char *fmt, ...); void CALLBACK GSsetBaseMem(void *); void CALLBACK GSsetGameCRC(int crc, int gameoptions); @@ -588,7 +587,6 @@ typedef void(CALLBACK *_GSinitReadFIFO2)(u64 *pMem, int qwc); typedef void(CALLBACK *_GSchangeSaveState)(int, const char *filename); typedef void(CALLBACK *_GSgetTitleInfo2)(char *dest, size_t length); typedef void(CALLBACK *_GSirqCallback)(void (*callback)()); -typedef void(CALLBACK *_GSprintf)(int timeout, char *fmt, ...); typedef void(CALLBACK *_GSsetBaseMem)(void *); typedef void(CALLBACK *_GSsetGameCRC)(int, int); typedef void(CALLBACK *_GSsetFrameSkip)(int frameskip); @@ -750,7 +748,6 @@ extern _GSgetTitleInfo2 GSgetTitleInfo2; extern _GSmakeSnapshot GSmakeSnapshot; extern _GSmakeSnapshot2 GSmakeSnapshot2; extern _GSirqCallback GSirqCallback; -extern _GSprintf GSprintf; extern _GSsetBaseMem GSsetBaseMem; extern _GSsetGameCRC GSsetGameCRC; extern _GSsetFrameSkip GSsetFrameSkip; diff --git a/pcsx2/PluginManager.cpp b/pcsx2/PluginManager.cpp index 021f1a9d7f..d822d6c449 100644 --- a/pcsx2/PluginManager.cpp +++ b/pcsx2/PluginManager.cpp @@ -174,7 +174,6 @@ _GSgetTitleInfo2 GSgetTitleInfo2; _GSmakeSnapshot GSmakeSnapshot; _GSmakeSnapshot2 GSmakeSnapshot2; _GSirqCallback GSirqCallback; -_GSprintf GSprintf; _GSsetBaseMem GSsetBaseMem; _GSsetGameCRC GSsetGameCRC; _GSsetFrameSkip GSsetFrameSkip; @@ -192,17 +191,6 @@ static void CALLBACK GS_setFrameSkip(int frameskip) {} static void CALLBACK GS_setVsync(int enabled) {} static void CALLBACK GS_setExclusive(int isExcl) {} static void CALLBACK GS_changeSaveState( int, const char* filename ) {} -static void CALLBACK GS_printf(int timeout, char *fmt, ...) -{ - va_list list; - char msg[512]; - - va_start(list, fmt); - vsprintf(msg, fmt, list); - va_end(list); - - Console.WriteLn(msg); -} void CALLBACK GS_getTitleInfo2( char* dest, size_t length ) { @@ -410,7 +398,6 @@ static const LegacyApi_ReqMethod s_MethMessReq_GS[] = { "GSmakeSnapshot", (vMeth**)&GSmakeSnapshot, (vMeth*)GS_makeSnapshot }, { "GSirqCallback", (vMeth**)&GSirqCallback, (vMeth*)GS_irqCallback }, - { "GSprintf", (vMeth**)&GSprintf, (vMeth*)GS_printf }, { "GSsetBaseMem", (vMeth**)&GSsetBaseMem, NULL }, { "GSwriteCSR", (vMeth**)&GSwriteCSR, NULL }, { "GSsetGameCRC", (vMeth**)&GSsetGameCRC, (vMeth*)GS_setGameCRC }, diff --git a/pcsx2/gui/GlobalCommands.cpp b/pcsx2/gui/GlobalCommands.cpp index 30a1c84ed6..ad9d9c3070 100644 --- a/pcsx2/gui/GlobalCommands.cpp +++ b/pcsx2/gui/GlobalCommands.cpp @@ -372,7 +372,7 @@ namespace Implementations // FIXME: Some of the trace logs will require recompiler resets to be activated properly. #ifdef PCSX2_DEVBUILD SetTraceConfig().Enabled = !EmuConfig.Trace.Enabled; - GSprintf(10, const_cast(EmuConfig.Trace.Enabled ? "Logging Enabled." : "Logging Disabled.")); + Console.WriteLn(EmuConfig.Trace.Enabled ? "Logging Enabled." : "Logging Disabled."); #endif } diff --git a/plugins/GSnull/GS.cpp b/plugins/GSnull/GS.cpp index 052f5561a7..2b026a8e7f 100644 --- a/plugins/GSnull/GS.cpp +++ b/plugins/GSnull/GS.cpp @@ -82,19 +82,6 @@ PS2EgetLibVersion2(u32 type) return (version << 16) | (revision << 8) | build; } -EXPORT_C_(void) -GSprintf(int timeout, char *fmt, ...) -{ - va_list list; - char msg[512]; - - va_start(list, fmt); - vsprintf(msg, fmt, list); - va_end(list); - - GSLog::Print("GSprintf:%s", msg); -} - // basic funcs EXPORT_C_(void) GSsetSettingsDir(const char *dir) diff --git a/plugins/GSnull/Windows/GS.def b/plugins/GSnull/Windows/GS.def index ad89477abc..ed123aa204 100644 --- a/plugins/GSnull/Windows/GS.def +++ b/plugins/GSnull/Windows/GS.def @@ -25,7 +25,6 @@ EXPORTS GSmakeSnapshot @20 GSmakeSnapshot2 @21 GSirqCallback @22 - GSprintf @23 GSsetBaseMem @24 GSsetGameCRC @25 GSsetFrameSkip @26