From ed60e3a7d4110441982abbbf5e8fc0655b0e5138 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 19 Jun 2007 05:53:56 +0000 Subject: [PATCH] Fixes for compiling with Visual C++ 8.0 Express Edition --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402369 --- VisualC.zip | Bin 42747 -> 42763 bytes src/SDL_compat.c | 2 +- src/audio/SDL_audio.c | 2 +- src/audio/SDL_audiocvt.c | 4 ++++ src/audio/SDL_mixer.c | 8 ++++---- src/video/SDL_renderer_sw.c | 1 - src/video/SDL_video.c | 4 ---- src/video/win32/SDL_win32events.c | 4 ++-- 8 files changed, 12 insertions(+), 13 deletions(-) diff --git a/VisualC.zip b/VisualC.zip index 3e1ea49a8a5ee2de91dd2b5ff651cf0957fdc1e3..3325dae716914c2a6e3783afe84a293f28dd7490 100644 GIT binary patch delta 3206 zcmZvfc{o&UAICW}m>G;+LqqmGYQ!)qX^4;rDUwFXk|;}-9y66>$$m3qUna7PETJqF zkH?mfNQo3hjiSj`JnvYZ_vw1C_gvRG*XQ^BeSh~k_x;!R{Oo~lKZDSgW-vI4ZT-4Z z+pnE~mXQ4B6>vz-JK&IQAe`+Bj2-&d5wh+$EG@kHe;i;p6;nyoLhznrnWBW&>RJ(O zY)fDmA%o~*+1GCXA$P;H|Qko*hx2R~NqCmHwT&l2tRgjmll?PEsfLt7p8OOmh0Yrd$d9c3n0&V z50t9j)W(Vk>4#q@U!?^|_YtM*aRJL^^&Jhj3^KDY%Z+!c+pLN@CL8(RiEtM+>Zyzc z%ZT5%l8L;v+r=@7tjZk73q8lY_vk_6Ys2jGFS&OGBN`uA6m%E&HG+xQugCypxG5Wg9-{uh$Z`$wEZN@(v%eJ6(3HM*qcEy&*N{jMY$;d+COY(F5r1CNdxSqM{Gv zN+U&To)m?Y8V!_m?>fXaVsZjgt+1zmsxn!BWVppFNp$bUs+gsr&lbRKo)UIQ*i-(4 z_QkAEImVMWmxa~#q*DqR{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fB2qT78wUXVfNfnJC1C%Va6(CtV2C`G|Te;r@|g#c|t?YjXK P1Q@3X(`Uu){b>9LW9PwY diff --git a/src/SDL_compat.c b/src/SDL_compat.c index a29a1a7c..937e9e10 100644 --- a/src/SDL_compat.c +++ b/src/SDL_compat.c @@ -243,7 +243,7 @@ SDL_CompatEventFilter(void *userdata, SDL_Event * event) case SDL_TEXTINPUT: { /* FIXME: Generate an old style key repeat event if needed */ - printf("TEXTINPUT: '%s'\n", event->text.text); + //printf("TEXTINPUT: '%s'\n", event->text.text); break; } case SDL_MOUSEWHEEL: diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index f14c65d7..d4236ec2 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -555,7 +555,7 @@ prepare_audiospec(const SDL_AudioSpec * orig, SDL_AudioSpec * prepared) switch (orig->channels) { case 0:{ const char *env = SDL_getenv("SDL_AUDIO_CHANNELS"); - if ((!env) || ((prepared->channels = SDL_atoi(env)) == 0)) { + if ((!env) || ((prepared->channels = (Uint8)SDL_atoi(env)) == 0)) { prepared->channels = 2; /* a reasonable default */ } break; diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index fe5669b5..c5235bda 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -1177,7 +1177,9 @@ SDL_RateSLOW(SDL_AudioCVT * cvt, SDL_AudioFormat format) case 32: { /* !!! FIXME: need 32-bit converter here! */ +#ifdef DEBUG_CONVERT fprintf(stderr, "FIXME: need 32-bit converter here!\n"); +#endif } } } else { @@ -1214,7 +1216,9 @@ SDL_RateSLOW(SDL_AudioCVT * cvt, SDL_AudioFormat format) case 32: { /* !!! FIXME: need 32-bit converter here! */ +#ifdef DEBUG_CONVERT fprintf(stderr, "FIXME: need 32-bit converter here!\n"); +#endif } } } diff --git a/src/audio/SDL_mixer.c b/src/audio/SDL_mixer.c index 64257b6a..c9ac6577 100644 --- a/src/audio/SDL_mixer.c +++ b/src/audio/SDL_mixer.c @@ -303,8 +303,8 @@ SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, float src1, src2; double dst_sample; /* !!! FIXME: are these right? */ - const double max_audioval = 3.40282347e+38F; - const double min_audioval = -3.40282347e+38F; + const double max_audioval = 3.402823466e+38F; + const double min_audioval = -3.402823466e+38F; len /= 4; while (len--) { @@ -332,8 +332,8 @@ SDL_MixAudioFormat(Uint8 * dst, const Uint8 * src, SDL_AudioFormat format, float src1, src2; double dst_sample; /* !!! FIXME: are these right? */ - const double max_audioval = 3.40282347e+38F; - const double min_audioval = -3.40282347e+38F; + const double max_audioval = 3.402823466e+38F; + const double min_audioval = -3.402823466e+38F; len /= 4; while (len--) { diff --git a/src/video/SDL_renderer_sw.c b/src/video/SDL_renderer_sw.c index 27c61108..65513672 100644 --- a/src/video/SDL_renderer_sw.c +++ b/src/video/SDL_renderer_sw.c @@ -347,7 +347,6 @@ SW_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { texture->driverdata = SDL_SW_CreateYUVTexture(texture); } else { - SDL_Surface *surface; int bpp; Uint32 Rmask, Gmask, Bmask, Amask; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 926a5b9d..e3373aa3 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -939,7 +939,6 @@ void SDL_SetWindowTitle(SDL_WindowID windowID, const char *title) { SDL_Window *window = SDL_GetWindowFromID(windowID); - const char *last_title; if (!window || title == window->title) { return; @@ -1852,7 +1851,6 @@ int SDL_GetTextureAlphaMod(SDL_TextureID textureID, Uint8 * alpha) { SDL_Texture *texture = SDL_GetTextureFromID(textureID); - SDL_Renderer *renderer; if (!texture) { return -1; @@ -1886,7 +1884,6 @@ int SDL_GetTextureBlendMode(SDL_TextureID textureID, int *blendMode) { SDL_Texture *texture = SDL_GetTextureFromID(textureID); - SDL_Renderer *renderer; if (!texture) { return -1; @@ -1920,7 +1917,6 @@ int SDL_GetTextureScaleMode(SDL_TextureID textureID, int *scaleMode) { SDL_Texture *texture = SDL_GetTextureFromID(textureID); - SDL_Renderer *renderer; if (!texture) { return -1; diff --git a/src/video/win32/SDL_win32events.c b/src/video/win32/SDL_win32events.c index 100ab5c7..a5d8b768 100644 --- a/src/video/win32/SDL_win32events.c +++ b/src/video/win32/SDL_win32events.c @@ -590,12 +590,12 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_XBUTTONDOWN: xbuttonval = GET_XBUTTON_WPARAM(wParam); - button = SDL_BUTTON_WHEELDOWN + xbuttonval; + button = SDL_BUTTON_RIGHT + xbuttonval; state = SDL_PRESSED; break; case WM_XBUTTONUP: xbuttonval = GET_XBUTTON_WPARAM(wParam); - button = SDL_BUTTON_WHEELDOWN + xbuttonval; + button = SDL_BUTTON_RIGHT + xbuttonval; state = SDL_RELEASED; break; default: