From cfaa0f2ecde8a641b0e64e2e8a2ad220fdc86324 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 1 Sep 2008 16:04:20 +0000 Subject: [PATCH] Fixed a bunch of compile warnings on Mac OS X --- src/audio/SDL_audiocvt.c | 3 ++- src/audio/macosx/SDL_coreaudio.c | 1 - src/audio/macrom/SDL_romaudio.c | 2 ++ src/video/cocoa/SDL_cocoaevents.m | 1 + src/video/cocoa/SDL_cocoaopengl.m | 1 + src/video/x11/SDL_x11events.c | 2 +- src/video/x11/SDL_x11video.h | 2 +- 7 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 71708a06b..8610f9636 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -1622,7 +1622,6 @@ int SDL_BuildWindowedSinc(SDL_AudioCVT * cvt, SDL_AudioFormat format, unsigned int m) { - float fScale; /* scale factor for fixed point */ float *fSinc; /* floating point sinc buffer, to be converted to fixed point */ float fc; /* cutoff frequency */ float two_pi_fc, two_pi_over_m, four_pi_over_m, m_over_two; @@ -1708,6 +1707,8 @@ SDL_BuildWindowedSinc(SDL_AudioCVT * cvt, SDL_AudioFormat format, /* Clean up */ #undef convert_fixed SDL_stack_free(fSinc); + + return 0; } /* This is used to reduce the resampling ratio */ diff --git a/src/audio/macosx/SDL_coreaudio.c b/src/audio/macosx/SDL_coreaudio.c index db975957d..29cff78c7 100644 --- a/src/audio/macosx/SDL_coreaudio.c +++ b/src/audio/macosx/SDL_coreaudio.c @@ -418,7 +418,6 @@ prepare_audiounit(_THIS, const char *devname, int iscapture, AURenderCallbackStruct callback; ComponentDescription desc; Component comp = NULL; - int use_system_device = 0; UInt32 enableIO = 0; const AudioUnitElement output_bus = 0; const AudioUnitElement input_bus = 1; diff --git a/src/audio/macrom/SDL_romaudio.c b/src/audio/macrom/SDL_romaudio.c index 86bc7fd7a..a77b7cf1c 100644 --- a/src/audio/macrom/SDL_romaudio.c +++ b/src/audio/macrom/SDL_romaudio.c @@ -89,6 +89,7 @@ mix_buffer(SDL_AudioDevice * audio, UInt8 * buffer) DecrementAtomic((SInt32 *) & need_to_mix); } +#ifndef __MACOSX__ static void SNDMGR_LockDevice(_THIS) { @@ -114,6 +115,7 @@ SNDMGR_UnlockDevice(_THIS) mix_buffer(this, buffer[fill_me]); } } +#endif // __MACOSX__ static void callBackProc(SndChannel * chan, SndCommand * cmd_passed) diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m index 090982678..b0c3b795a 100644 --- a/src/video/cocoa/SDL_cocoaevents.m +++ b/src/video/cocoa/SDL_cocoaevents.m @@ -22,6 +22,7 @@ #include "SDL_config.h" #include "SDL_cocoavideo.h" +#include "../../events/SDL_events_c.h" /* setAppleMenu disappeared from the headers in 10.4 */ #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index 9c914039d..aeb167f7d 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -27,6 +27,7 @@ #if SDL_VIDEO_OPENGL_CGL #include +#include #include "SDL_loadso.h" #include "SDL_opengl.h" diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 4c0478184..c43c344ca 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -201,7 +201,7 @@ X11_DispatchEvent(_THIS) #ifdef X_HAVE_UTF8_STRING if (data->ic) { Xutf8LookupString(data->ic, &xevent.xkey, text, sizeof(text), - &keysym, status); + &keysym, &status); } #else XLookupString(&xevent.xkey, text, sizeof(text), &keysym, NULL); diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 6526f707c..16ec1bd2b 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -69,7 +69,7 @@ typedef struct SDL_VideoData int numwindows; SDL_WindowData **windowlist; int windowlistlength; - int *mouse; + int mouse; int keyboard; Atom WM_DELETE_WINDOW; SDL_scancode key_layout[256];