Bug 688997 - Use correct waveOutProc declaration to avoid pointer truncation on x64. r=cpearce
authorMatthew Gregan <kinetik@flim.org>
Sun, 25 Sep 2011 13:46:06 +1300
changeset 77562 2cd423eb039255187d493e179e33bcfca60550e9
parent 77561 dbde35bf04e94142be687c99b026bfe31a811fa0
child 77563 606bfc565805dc2c9bcb9125dfc258ca942a0457
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerscpearce
bugs688997
milestone9.0a1
Bug 688997 - Use correct waveOutProc declaration to avoid pointer truncation on x64. r=cpearce
media/libsydneyaudio/src/sydney_audio_waveapi.c
--- a/media/libsydneyaudio/src/sydney_audio_waveapi.c
+++ b/media/libsydneyaudio/src/sydney_audio_waveapi.c
@@ -126,18 +126,18 @@ struct sa_stream {
 int allocateBlocks(int size, int count, WAVEHDR** blocks);
 int freeBlocks(WAVEHDR* blocks);
 int openAudio(sa_stream_t *s);
 int closeAudio(sa_stream_t * s);
 int writeBlock(sa_stream_t *s, WAVEHDR* current);
 int writeAudio(sa_stream_t *s, LPSTR data, int bytes);
 int getSAErrorCode(int waveErrorCode);
 
-void CALLBACK waveOutProc(HWAVEOUT hWaveOut, UINT uMsg, 
-    DWORD dwInstance, DWORD dwParam1, DWORD dwParam2);
+void CALLBACK waveOutProc(HWAVEOUT hWaveOut, UINT uMsg, DWORD_PTR dwInstance,
+                          DWORD_PTR dwParam1, DWORD_PTR dwParam2);
 
 /** Normal way to open a PCM device */
 int sa_stream_create_pcm(sa_stream_t **s, 
                          const char *client_name, 
                          sa_mode_t mode, 
                          sa_pcm_format_t format, 
                          unsigned int rate, 
                          unsigned int nchannels) {
@@ -611,23 +611,21 @@ int writeAudio(sa_stream_t *s, LPSTR dat
     current->dwUser = 0;
   }
   return SA_SUCCESS;
 }
 
 /**
  * \brief - audio callback function called when next WAVE header is played by audio device
  */
-void CALLBACK waveOutProc(
-    HWAVEOUT hWaveOut, 
-    UINT uMsg, 
-    DWORD dwInstance,  
-    DWORD dwParam1,    
-    DWORD dwParam2     
-)
+void CALLBACK waveOutProc(HWAVEOUT hWaveOut, 
+                          UINT uMsg,
+                          DWORD_PTR dwInstance,
+                          DWORD_PTR dwParam1,
+                          DWORD_PTR dwParam2)
 {
     /*
      * pointer to free block counter
      */
     sa_stream_t* handle = (sa_stream_t*)dwInstance;
     /*
      * ignore calls that occur due to openining and closing the
      * device.