Fixed 64-bit warnings

This commit is contained in:
Sam Lantinga 2014-03-09 12:27:31 -07:00
parent e58ee5403b
commit 1fe7b27a96

View file

@ -98,12 +98,12 @@ FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
static int static int
SetMMerror(char *function, MMRESULT code) SetMMerror(char *function, MMRESULT code)
{ {
size_t len; int len;
char errbuf[MAXERRORLENGTH]; char errbuf[MAXERRORLENGTH];
wchar_t werrbuf[MAXERRORLENGTH]; wchar_t werrbuf[MAXERRORLENGTH];
SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function); SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
len = SDL_strlen(errbuf); len = SDL_static_cast(int, SDL_strlen(errbuf));
waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH - len); waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH - len);
WideCharToMultiByte(CP_ACP, 0, werrbuf, -1, errbuf + len, WideCharToMultiByte(CP_ACP, 0, werrbuf, -1, errbuf + len,
@ -196,7 +196,7 @@ WINMM_CloseDevice(_THIS)
} }
static SDL_bool static SDL_bool
PrepWaveFormat(_THIS, UINT_PTR devId, WAVEFORMATEX *pfmt, const int iscapture) PrepWaveFormat(_THIS, UINT devId, WAVEFORMATEX *pfmt, const int iscapture)
{ {
SDL_zerop(pfmt); SDL_zerop(pfmt);
@ -226,13 +226,13 @@ WINMM_OpenDevice(_THIS, const char *devname, int iscapture)
int valid_datatype = 0; int valid_datatype = 0;
MMRESULT result; MMRESULT result;
WAVEFORMATEX waveformat; WAVEFORMATEX waveformat;
UINT_PTR devId = WAVE_MAPPER; /* WAVE_MAPPER == choose system's default */ UINT devId = WAVE_MAPPER; /* WAVE_MAPPER == choose system's default */
char *utf8 = NULL; char *utf8 = NULL;
int i; UINT i;
if (devname != NULL) { /* specific device requested? */ if (devname != NULL) { /* specific device requested? */
if (iscapture) { if (iscapture) {
const int devcount = (int) waveInGetNumDevs(); const UINT devcount = waveInGetNumDevs();
WAVEINCAPS caps; WAVEINCAPS caps;
for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) { for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) {
result = waveInGetDevCaps(i, &caps, sizeof (caps)); result = waveInGetDevCaps(i, &caps, sizeof (caps));
@ -241,11 +241,11 @@ WINMM_OpenDevice(_THIS, const char *devname, int iscapture)
else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL) else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL)
continue; continue;
else if (SDL_strcmp(devname, utf8) == 0) else if (SDL_strcmp(devname, utf8) == 0)
devId = (UINT_PTR) i; devId = i;
SDL_free(utf8); SDL_free(utf8);
} }
} else { } else {
const int devcount = (int) waveOutGetNumDevs(); const UINT devcount = waveOutGetNumDevs();
WAVEOUTCAPS caps; WAVEOUTCAPS caps;
for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) { for (i = 0; (i < devcount) && (devId == WAVE_MAPPER); i++) {
result = waveOutGetDevCaps(i, &caps, sizeof (caps)); result = waveOutGetDevCaps(i, &caps, sizeof (caps));
@ -254,7 +254,7 @@ WINMM_OpenDevice(_THIS, const char *devname, int iscapture)
else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL) else if ((utf8 = WIN_StringToUTF8(caps.szPname)) == NULL)
continue; continue;
else if (SDL_strcmp(devname, utf8) == 0) else if (SDL_strcmp(devname, utf8) == 0)
devId = (UINT_PTR) i; devId = i;
SDL_free(utf8); SDL_free(utf8);
} }
} }