plugin API: use const char* insead of char*

I hope it doesn't change the ABI

v2: fix GSnull/zzogl/zerogs
v3: duplicated code on windows...
This commit is contained in:
Gregory Hainaut 2015-11-06 23:25:55 +01:00
parent 6180515212
commit abb4cb4810
9 changed files with 12 additions and 12 deletions

View File

@ -241,7 +241,7 @@ extern "C" {
// basic funcs // basic funcs
s32 CALLBACK GSinit(); s32 CALLBACK GSinit();
s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread); s32 CALLBACK GSopen(void *pDsp, const char *Title, int multithread);
void CALLBACK GSclose(); void CALLBACK GSclose();
void CALLBACK GSshutdown(); void CALLBACK GSshutdown();
void CALLBACK GSsetSettingsDir( const char* dir ); void CALLBACK GSsetSettingsDir( const char* dir );
@ -572,7 +572,7 @@ typedef void (CALLBACK* _PS2EsetEmuVersion)(const char* emuId, u32 version); //
// GS // GS
// NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs // NOTE: GSreadFIFOX/GSwriteCSR functions CANNOT use XMM/MMX regs
// If you want to use them, need to save and restore current ones // If you want to use them, need to save and restore current ones
typedef s32 (CALLBACK* _GSopen)(void *pDsp, char *Title, int multithread); typedef s32 (CALLBACK* _GSopen)(void *pDsp, const char *Title, int multithread);
typedef s32 (CALLBACK* _GSopen2)( void *pDsp, u32 flags ); typedef s32 (CALLBACK* _GSopen2)( void *pDsp, u32 flags );
typedef void (CALLBACK* _GSvsync)(int field); typedef void (CALLBACK* _GSvsync)(int field);
typedef void (CALLBACK* _GSgifTransfer)(const u32 *pMem, u32 size); typedef void (CALLBACK* _GSgifTransfer)(const u32 *pMem, u32 size);

View File

@ -179,7 +179,7 @@ EXPORT_C GSclose()
} }
} }
static int _GSopen(void** dsp, char* title, GSRendererType renderer, int threads = -1) static int _GSopen(void** dsp, const char* title, GSRendererType renderer, int threads = -1)
{ {
GSDevice* dev = NULL; GSDevice* dev = NULL;
@ -528,7 +528,7 @@ EXPORT_C_(int) GSopen2(void** dsp, uint32 flags)
} }
stored_toggle_state = toggle_state; stored_toggle_state = toggle_state;
int retval = _GSopen(dsp, NULL, renderer); int retval = _GSopen(dsp, "", renderer);
if (s_gs != NULL) if (s_gs != NULL)
s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios s_gs->SetAspectRatio(0); // PCSX2 manages the aspect ratios
@ -538,7 +538,7 @@ EXPORT_C_(int) GSopen2(void** dsp, uint32 flags)
return retval; return retval;
} }
EXPORT_C_(int) GSopen(void** dsp, char* title, int mt) EXPORT_C_(int) GSopen(void** dsp, const char* title, int mt)
{ {
/* /*
if(!XInitThreads()) return -1; if(!XInitThreads()) return -1;

View File

@ -121,7 +121,7 @@ EXPORT_C_(void) GSshutdown()
GSLog::Close(); GSLog::Close();
} }
EXPORT_C_(s32) GSopen(void *pDsp, char *Title, int multithread) EXPORT_C_(s32) GSopen(void *pDsp, const char *Title, int multithread)
{ {
int err = 0; int err = 0;
GSLog::WriteLn("GS open."); GSLog::WriteLn("GS open.");

View File

@ -20,7 +20,7 @@ Display *display;
int screen; int screen;
GtkScrolledWindow *win; GtkScrolledWindow *win;
int GSOpenWindow(void *pDsp, char *Title) int GSOpenWindow(void *pDsp, const char *Title)
{ {
display = XOpenDisplay(0); display = XOpenDisplay(0);
screen = DefaultScreen(display); screen = DefaultScreen(display);

View File

@ -20,7 +20,7 @@
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/keysym.h> #include <X11/keysym.h>
extern int GSOpenWindow(void *pDsp, char *Title); extern int GSOpenWindow(void *pDsp, const char *Title);
extern int GSOpenWindow2(void *pDsp, u32 flags); extern int GSOpenWindow2(void *pDsp, u32 flags);
extern void GSCloseWindow(); extern void GSCloseWindow();
extern void GSProcessMessages(); extern void GSProcessMessages();

View File

@ -34,7 +34,7 @@ LRESULT CALLBACK MsgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return 0; return 0;
} }
int GSOpenWindow(void *pDsp, char *Title) int GSOpenWindow(void *pDsp, const char *Title)
{ {
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L, WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
GetModuleHandle(NULL), NULL, NULL, NULL, NULL, GetModuleHandle(NULL), NULL, NULL, NULL, NULL,

View File

@ -18,7 +18,7 @@
#include <windows.h> #include <windows.h>
#include <windowsx.h> #include <windowsx.h>
extern int GSOpenWindow(void *pDsp, char *Title); extern int GSOpenWindow(void *pDsp, const char *Title);
extern void GSCloseWindow(); extern void GSCloseWindow();
extern void GSProcessMessages(); extern void GSProcessMessages();
extern void HandleKeyEvent(keyEvent *ev); extern void HandleKeyEvent(keyEvent *ev);

View File

@ -358,7 +358,7 @@ LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
return DefWindowProc( hWnd, msg, wParam, lParam ); return DefWindowProc( hWnd, msg, wParam, lParam );
} }
s32 CALLBACK GSopen(void *pDsp, char *Title, int multithread) { s32 CALLBACK GSopen(void *pDsp, const char *Title, int multithread) {
g_GSMultiThreaded = multithread; g_GSMultiThreaded = multithread;

View File

@ -282,7 +282,7 @@ __forceinline void InitMisc()
ResetRegs(); ResetRegs();
} }
EXPORT_C_(s32) GSopen(void *pDsp, char *Title, int multithread) EXPORT_C_(s32) GSopen(void *pDsp, const char *Title, int multithread)
{ {
FUNCLOG FUNCLOG