sdl2-compat: Fix more int/void changings

From 10f26c01b90a325fba7c4f1abb27559c6607f26f Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Thu, 9 Feb 2023 20:10:03 +0100
Subject: [PATCH] Fix more int/void changings

---
 src/sdl2_compat.c | 30 ++++++++++++++++++++++++++++++
 src/sdl3_syms.h   | 20 ++++++++++----------
 2 files changed, 40 insertions(+), 10 deletions(-)

diff --git a/src/sdl2_compat.c b/src/sdl2_compat.c
index a0b8a07..d6cbeec 100644
--- a/src/sdl2_compat.c
+++ b/src/sdl2_compat.c
@@ -4444,6 +4444,36 @@ SDL_GL_SwapWindow(SDL_Window *window)
     (void) SDL3_GL_SwapWindow(window);
 }
 
+DECLSPEC void SDLCALL 
+SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect)
+{
+    SDL3_GetSurfaceClipRect(surface, rect);
+}
+
+DECLSPEC void SDLCALL 
+SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index)
+{
+    SDL3_SetGamepadPlayerIndex(gamecontroller, player_index);
+}
+
+DECLSPEC void SDLCALL 
+SDL_AudioStreamClear(SDL_AudioStream *stream)
+{
+    SDL3_ClearAudioStream(stream);
+}
+
+DECLSPEC void SDLCALL
+SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID)
+{
+    SDL3_GetJoystickGUIDString(guid, pszGUID, cbGUID);
+}
+
+DECLSPEC void SDLCALL 
+SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID)
+{
+    SDL3_GUIDToString(guid, pszGUID, cbGUID);
+}
+
 /* SDL3 split this into getter/setter functions. */
 DECLSPEC Uint8 SDLCALL
 SDL_EventState(Uint32 type, int state)
diff --git a/src/sdl3_syms.h b/src/sdl3_syms.h
index b31dbbf..3fa255c 100644
--- a/src/sdl3_syms.h
+++ b/src/sdl3_syms.h
@@ -200,7 +200,7 @@ SDL3_SYM(void,DelHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,
 SDL3_SYM_PASSTHROUGH(void,ClearHints,(void),(),)
 SDL3_SYM_RENAMED(const char*,JoystickName,GetJoystickName,(SDL_Joystick *a),(a),return)
 SDL3_SYM_RENAMED(SDL_JoystickGUID,JoystickGetGUID,GetJoystickGUID,(SDL_Joystick *a),(a),return)
-SDL3_SYM_RENAMED(void,JoystickGetGUIDString,GetJoystickGUIDString,(SDL_JoystickGUID a, char *b, int c),(a,b,c),)
+SDL3_SYM(int,GetJoystickGUIDString,(SDL_JoystickGUID a, char *b, int c),(a,b,c),return)
 SDL3_SYM_RENAMED(SDL_JoystickGUID,JoystickGetGUIDFromString,GetJoystickGUIDFromString,(const char *a),(a),return)
 SDL3_SYM_RENAMED(SDL_bool,JoystickGetAttached,JoystickConnected,(SDL_Joystick *a),(a),return)
 SDL3_SYM(SDL_JoystickID,GetJoystickInstanceID,(SDL_Joystick *a),(a),return)
@@ -280,7 +280,7 @@ SDL3_SYM(void,DestroyPixelFormat,(SDL_PixelFormat *a),(a),)
 SDL3_SYM_RENAMED(SDL_Palette*,AllocPalette,CreatePalette,(int a),(a),return)
 SDL3_SYM_PASSTHROUGH(int,SetPixelFormatPalette,(SDL_PixelFormat *a, SDL_Palette *b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(int,SetPaletteColors,(SDL_Palette *a, const SDL_Color *b, int c, int d),(a,b,c,d),return)
-SDL3_SYM(,DestroyPalette,(SDL_Palette *a),(a),)
+SDL3_SYM(void,DestroyPalette,(SDL_Palette *a),(a),)
 SDL3_SYM_PASSTHROUGH(Uint32,MapRGB,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
 SDL3_SYM_PASSTHROUGH(Uint32,MapRGBA,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return)
 SDL3_SYM_PASSTHROUGH(void,GetRGB,(Uint32 a, const SDL_PixelFormat *b, Uint8 *c, Uint8 *d, Uint8 *e),(a,b,c,d,e),)
@@ -328,8 +328,8 @@ SDL3_SYM_PASSTHROUGH(int,GetRenderDrawBlendMode,(SDL_Renderer *a, SDL_BlendMode
 SDL3_SYM_PASSTHROUGH(int,RenderClear,(SDL_Renderer *a),(a),return)
 SDL3_SYM_PASSTHROUGH(int,RenderReadPixels,(SDL_Renderer *a, const SDL_Rect *b, Uint32 c, void *d, int e),(a,b,c,d,e),return)
 SDL3_SYM(int,RenderPresent,(SDL_Renderer *a),(a),return)
-SDL3_SYM(,DestroyTexture,(SDL_Texture *a),(a),)
-SDL3_SYM(,DestroyRenderer,(SDL_Renderer *a),(a),)
+SDL3_SYM(void,DestroyTexture,(SDL_Texture *a),(a),)
+SDL3_SYM(void,DestroyRenderer,(SDL_Renderer *a),(a),)
 SDL3_SYM_PASSTHROUGH(int,GL_BindTexture,(SDL_Texture *a, float *b, float *c),(a,b,c),return)
 SDL3_SYM_PASSTHROUGH(int,GL_UnbindTexture,(SDL_Texture *a),(a),return)
 SDL3_SYM(SDL_RWops*,RWFromFile,(const char *a, const char *b),(a,b),return)
@@ -441,7 +441,7 @@ SDL3_SYM_PASSTHROUGH(int,GetSurfaceAlphaMod,(SDL_Surface *a, Uint8 *b),(a,b),ret
 SDL3_SYM_PASSTHROUGH(int,SetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(int,GetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode *b),(a,b),return)
 SDL3_SYM_RENAMED(SDL_bool,SetClipRect,SetSurfaceClipRect,(SDL_Surface *a, const SDL_Rect *b),(a,b),return)
-SDL3_SYM_RENAMED(void,GetClipRect,GetSurfaceClipRect,(SDL_Surface *a, SDL_Rect *b),(a,b),)
+SDL3_SYM(int,GetSurfaceClipRect,(SDL_Surface *a, SDL_Rect *b),(a,b),return)
 SDL3_SYM(SDL_Surface*,ConvertSurface,(SDL_Surface *a, const SDL_PixelFormat *b),(a,b),return)
 SDL3_SYM(SDL_Surface*,ConvertSurfaceFormat,(SDL_Surface *a, Uint32 b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(int,ConvertPixels,(int a, int b, Uint32 c, const void *d, int e, Uint32 f, void *g, int h),(a,b,c,d,e,f,g,h),return)
@@ -472,7 +472,7 @@ SDL3_SYM_PASSTHROUGH(int,GetNumTouchDevices,(void),(),return)
 SDL3_SYM_PASSTHROUGH(SDL_TouchID,GetTouchDevice,(int a),(a),return)
 SDL3_SYM_PASSTHROUGH(int,GetNumTouchFingers,(SDL_TouchID a),(a),return)
 SDL3_SYM_PASSTHROUGH(SDL_Finger*,GetTouchFinger,(SDL_TouchID a, int b),(a,b),return)
-SDL3_SYM(void,GetVersion,(SDL_version *a),(a),)
+SDL3_SYM(int,GetVersion,(SDL_version *a),(a),return)
 SDL3_SYM_PASSTHROUGH(const char*,GetRevision,(void),(),return)
 SDL3_SYM_PASSTHROUGH(int,GetNumVideoDrivers,(void),(),return)
 SDL3_SYM_PASSTHROUGH(const char*,GetVideoDriver,(int a),(a),return)
@@ -514,7 +514,7 @@ SDL3_SYM_PASSTHROUGH(int,UpdateWindowSurface,(SDL_Window *a),(a),return)
 SDL3_SYM_PASSTHROUGH(int,UpdateWindowSurfaceRects,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return)
 SDL3_SYM(int,SetWindowGrab,(SDL_Window *a, SDL_bool b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(SDL_bool,GetWindowGrab,(SDL_Window *a),(a),return)
-SDL3_SYM(,DestroyWindow,(SDL_Window *a),(a),)
+SDL3_SYM(void,DestroyWindow,(SDL_Window *a),(a),)
 SDL3_SYM_RENAMED(SDL_bool,IsScreenSaverEnabled,ScreenSaverEnabled,(void),(),return)
 SDL3_SYM(int,EnableScreenSaver,(void),(),return)
 SDL3_SYM(int,DisableScreenSaver,(void),(),return)
@@ -602,7 +602,7 @@ SDL3_SYM_PASSTHROUGH(int,GetNumAllocations,(void),(),return)
 SDL3_SYM_RENAMED(SDL_AudioStream*,NewAudioStream,CreateAudioStream,(const SDL_AudioFormat a, const Uint8 b, const int c, const SDL_AudioFormat d, const Uint8 e, const int f),(a,b,c,d,e,f),return)
 SDL3_SYM_RENAMED(int,AudioStreamPut,PutAudioStreamData,(SDL_AudioStream *a, const void *b, int c),(a,b,c),return)
 SDL3_SYM_RENAMED(int,AudioStreamGet,GetAudioStreamData,(SDL_AudioStream *a, void *b, int c),(a,b,c),return)
-SDL3_SYM_RENAMED(void,AudioStreamClear,ClearAudioStream,(SDL_AudioStream *a),(a),)
+SDL3_SYM(int,ClearAudioStream,(SDL_AudioStream *a),(a),return)
 SDL3_SYM_RENAMED(int,AudioStreamAvailable,GetAudioStreamAvailable,(SDL_AudioStream *a),(a),return)
 SDL3_SYM_RENAMED(void,FreeAudioStream,DestroyAudioStream,(SDL_AudioStream *a),(a),)
 SDL3_SYM_RENAMED(int,AudioStreamFlush,FlushAudioStream,(SDL_AudioStream *a),(a),return)
@@ -697,7 +697,7 @@ SDL3_SYM_PASSTHROUGH(wchar_t*,wcsstr,(const wchar_t *a, const wchar_t *b),(a,b),
 SDL3_SYM_PASSTHROUGH(int,wcsncmp,(const wchar_t *a, const wchar_t *b, size_t c),(a,b,c),return)
 SDL3_SYM_RENAMED(SDL_GameControllerType,GameControllerGetType,GetGamepadType,(SDL_GameController *a),(a),return)
 SDL3_SYM_RENAMED(SDL_GameController*,GameControllerFromPlayerIndex,GetGamepadFromPlayerIndex,(int a),(a),return)
-SDL3_SYM_RENAMED(void,GameControllerSetPlayerIndex,SetGamepadPlayerIndex,(SDL_GameController *a, int b),(a,b),)
+SDL3_SYM(int,SetGamepadPlayerIndex,(SDL_GameController *a, int b),(a,b),return)
 SDL3_SYM_RENAMED(SDL_Joystick*,JoystickFromPlayerIndex,GetJoystickFromPlayerIndex,(int a),(a),return)
 SDL3_SYM(int,SetJoystickPlayerIndex,(SDL_Joystick *a, int b),(a,b),return)
 SDL3_SYM_PASSTHROUGH(int,SetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode b),(a,b),return)
@@ -843,7 +843,7 @@ SDL3_SYM_RENAMED(const char*,GameControllerPath,GetGamepadPath,(SDL_GameControll
 SDL3_SYM_RENAMED(const char*,JoystickPath,GetJoystickPath,(SDL_Joystick *a),(a),return)
 SDL3_SYM_RENAMED(Uint16,GameControllerGetFirmwareVersion,GetGamepadFirmwareVersion,(SDL_GameController *a),(a),return)
 SDL3_SYM_RENAMED(Uint16,JoystickGetFirmwareVersion,GetJoystickFirmwareVersion,(SDL_Joystick *a),(a),return)
-SDL3_SYM_PASSTHROUGH(void,GUIDToString,(SDL_GUID a, char *b, int c),(a,b,c),)
+SDL3_SYM(int,GUIDToString,(SDL_GUID a, char *b, int c),(a,b,c),return)
 SDL3_SYM_PASSTHROUGH(SDL_GUID,GUIDFromString,(const char *a),(a),return)
 SDL3_SYM_PASSTHROUGH(SDL_bool,HasLSX,(void),(),return)
 SDL3_SYM_PASSTHROUGH(SDL_bool,HasLASX,(void),(),return)