comparison src/audio/windib/SDL_dibaudio.c @ 1456:84de7511f79f

Fixed a bunch of 64-bit compatibility problems
author Sam Lantinga <slouken@libsdl.org>
date Wed, 01 Mar 2006 09:43:47 +0000
parents bb6839704ed6
children 782fd950bd46 c121d94672cb a1b03ba2fcd0
comparison
equal deleted inserted replaced
1455:f487bb150acc 1456:84de7511f79f
97 Audio_Available, Audio_CreateDevice 97 Audio_Available, Audio_CreateDevice
98 }; 98 };
99 99
100 100
101 /* The Win32 callback for filling the WAVE device */ 101 /* The Win32 callback for filling the WAVE device */
102 static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, 102 static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
103 DWORD dwParam1, DWORD dwParam2) 103 DWORD dwParam1, DWORD dwParam2)
104 { 104 {
105 SDL_AudioDevice *this = (SDL_AudioDevice *)dwInstance; 105 SDL_AudioDevice *this = (SDL_AudioDevice *)dwInstance;
106 106
107 /* Only service "buffer done playing" messages */ 107 /* Only service "buffer done playing" messages */
116 #endif 116 #endif
117 } 117 }
118 118
119 static void SetMMerror(char *function, MMRESULT code) 119 static void SetMMerror(char *function, MMRESULT code)
120 { 120 {
121 int len; 121 size_t len;
122 char errbuf[MAXERRORLENGTH]; 122 char errbuf[MAXERRORLENGTH];
123 #ifdef _WIN32_WCE 123 #ifdef _WIN32_WCE
124 wchar_t werrbuf[MAXERRORLENGTH]; 124 wchar_t werrbuf[MAXERRORLENGTH];
125 #endif 125 #endif
126 126
130 #ifdef _WIN32_WCE 130 #ifdef _WIN32_WCE
131 /* UNICODE version */ 131 /* UNICODE version */
132 waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH-len); 132 waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH-len);
133 WideCharToMultiByte(CP_ACP,0,werrbuf,-1,errbuf+len,MAXERRORLENGTH-len,NULL,NULL); 133 WideCharToMultiByte(CP_ACP,0,werrbuf,-1,errbuf+len,MAXERRORLENGTH-len,NULL,NULL);
134 #else 134 #else
135 waveOutGetErrorText(code, errbuf+len, MAXERRORLENGTH-len); 135 waveOutGetErrorText(code, errbuf+len, (UINT)(MAXERRORLENGTH-len));
136 #endif 136 #endif
137 137
138 SDL_SetError("%s",errbuf); 138 SDL_SetError("%s",errbuf);
139 } 139 }
140 140
264 /* Update the fragment size as size in bytes */ 264 /* Update the fragment size as size in bytes */
265 SDL_CalculateAudioSpec(spec); 265 SDL_CalculateAudioSpec(spec);
266 266
267 /* Open the audio device */ 267 /* Open the audio device */
268 result = waveOutOpen(&sound, WAVE_MAPPER, &waveformat, 268 result = waveOutOpen(&sound, WAVE_MAPPER, &waveformat,
269 (DWORD)FillSound, (DWORD)this, CALLBACK_FUNCTION); 269 (DWORD_PTR)FillSound, (DWORD_PTR)this, CALLBACK_FUNCTION);
270 if ( result != MMSYSERR_NOERROR ) { 270 if ( result != MMSYSERR_NOERROR ) {
271 SetMMerror("waveOutOpen()", result); 271 SetMMerror("waveOutOpen()", result);
272 return(-1); 272 return(-1);
273 } 273 }
274 274