From e5af257b6f8c744dca936f0c468f2ccf185205df Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Tue, 22 Jan 2019 16:09:38 +1100 Subject: [PATCH] fix a few errors with very old compilers --- src/Audio.c | 6 +++--- src/Graphics.c | 2 +- src/Launcher.c | 2 +- src/Window.c | 6 +++--- src/freetype/ftstdlib.h | 7 ------- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/Audio.c b/src/Audio.c index 44419b35f..cbea1a4da 100644 --- a/src/Audio.c +++ b/src/Audio.c @@ -175,7 +175,7 @@ static void Soundboard_Init(struct Soundboard* board, const String* boardName, S } } -struct Sound* Soundboard_PickRandom(struct Soundboard* board, uint8_t type) { +static struct Sound* Soundboard_PickRandom(struct Soundboard* board, uint8_t type) { String name; struct SoundGroup* group; int idx; @@ -438,7 +438,7 @@ cleanup: static void Music_RunLoop(void) { const static String ogg = String_FromConst(".ogg"); char pathBuffer[FILENAME_SIZE]; - String path = String_FromArray(pathBuffer); + String path; uint16_t musicFiles[MUSIC_MAX_FILES]; String file; @@ -461,7 +461,7 @@ static void Music_RunLoop(void) { idx = Random_Range(&rnd, 0, count); file = StringsBuffer_UNSAFE_Get(&files, musicFiles[idx]); - path.length = 0; + String_InitArray(path, pathBuffer); String_Format1(&path, "audio/%s", &file); Platform_Log1("playing music file: %s", &file); diff --git a/src/Graphics.c b/src/Graphics.c index 88bb70abe..04f9f7bf1 100644 --- a/src/Graphics.c +++ b/src/Graphics.c @@ -1046,7 +1046,7 @@ static void GL_CheckVboSupport(void) { glBufferSubData = (FUNC_GLBUFFERSUBDATA)GLContext_GetAddress("glBufferSubDataARB"); #endif } else { - Logger_Abort("Only OpenGL 1.1 supported.\r\n\r\n" \ + Logger_Abort("Only OpenGL 1.1 supported.\n\n" \ "Compile the game with CC_BUILD_GL11, or ask on the classicube forums for it"); } } diff --git a/src/Launcher.c b/src/Launcher.c index 59ce8f8f2..0b66d5efe 100644 --- a/src/Launcher.c +++ b/src/Launcher.c @@ -603,7 +603,7 @@ static void Launcher_ApplyUpdate(void) { ReturnCode res; /* Can't use WriteLine, want \n as actual newline not code page 437 */ - res = Stream_WriteAllTo(&scriptPath, UPDATE_SCRIPT, sizeof(UPDATE_SCRIPT) - 1); + res = Stream_WriteAllTo(&scriptPath, (const uint8_t*)UPDATE_SCRIPT, sizeof(UPDATE_SCRIPT) - 1); if (res) { Logger_Warn(res, "saving update script"); return; } res = Platform_MarkExecutable(&scriptPath); diff --git a/src/Window.c b/src/Window.c index bbe91d401..7594b6024 100644 --- a/src/Window.c +++ b/src/Window.c @@ -1863,7 +1863,7 @@ static void Window_UpdateWindowState(void) { Event_RaiseVoid(&WindowEvents.Resized); } -OSStatus Window_ProcessKeyboardEvent(EventHandlerCallRef inCaller, EventRef inEvent, void* userData) { +static OSStatus Window_ProcessKeyboardEvent(EventHandlerCallRef inCaller, EventRef inEvent, void* userData) { UInt32 kind, code; Key key; char charCode, raw; @@ -1922,7 +1922,7 @@ OSStatus Window_ProcessKeyboardEvent(EventHandlerCallRef inCaller, EventRef inEv return eventNotHandledErr; } -OSStatus Window_ProcessWindowEvent(EventHandlerCallRef inCaller, EventRef inEvent, void* userData) { +static OSStatus Window_ProcessWindowEvent(EventHandlerCallRef inCaller, EventRef inEvent, void* userData) { int width, height; switch (GetEventKind(inEvent)) { @@ -1958,7 +1958,7 @@ OSStatus Window_ProcessWindowEvent(EventHandlerCallRef inCaller, EventRef inEven return eventNotHandledErr; } -OSStatus Window_ProcessMouseEvent(EventHandlerCallRef inCaller, EventRef inEvent, void* userData) { +static OSStatus Window_ProcessMouseEvent(EventHandlerCallRef inCaller, EventRef inEvent, void* userData) { HIPoint pt; Point2D mousePos; UInt32 kind; diff --git a/src/freetype/ftstdlib.h b/src/freetype/ftstdlib.h index 7a5d7248a..ba6eedf50 100644 --- a/src/freetype/ftstdlib.h +++ b/src/freetype/ftstdlib.h @@ -129,13 +129,6 @@ #define ft_longjmp longjmp #define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */ - - /* the following is only used for debugging purposes, i.e., if */ - /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */ - -#include - - #endif /* FTSTDLIB_H_ */