#! /bin/sh /usr/share/dpatch/dpatch-run
## sound64bits.dpatch by <jredrejo@debian.org>
##
## DP: Fixes bugs of the sound plugin when compiling in a 64 bits arch

@DPATCH@

--- squeak-vm-3.10.4.orig/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h	2009-03-17 19:07:56.000000000 +0100
+++ squeak-vm-3.10.4/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h	2009-04-27 12:37:01.000000000 +0200
@@ -1,27 +1,28 @@
 /* SoundPlugin.h - header for Sound Plugins :-) tim@sumeru.stanford.edu */
 
 /* module initialization/shutdown */
-int soundInit(void);
-int soundShutdown(void);
+sqInt soundInit(void);
+sqInt soundShutdown(void);
 
 /* sound output */
-int snd_AvailableSpace(void);
-int snd_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr, int samplesOfLeadTime);
-int snd_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int startIndex);
-int snd_PlaySilence(void);
-int snd_Start(int frameCount, int samplesPerSec, int stereo, int semaIndex);
-int snd_Stop(void);
+sqInt snd_AvailableSpace(void);
+sqInt snd_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr, sqInt samplesOfLeadTime);
+sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex);
+sqInt snd_PlaySilence(void);
+sqInt snd_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex);
+sqInt snd_Stop(void);
 
 /* sound input */
-int snd_SetRecordLevel(int level);
-int snd_StartRecording(int desiredSamplesPerSec, int stereo, int semaIndex);
-int snd_StopRecording(void);
+sqInt snd_SetRecordLevel(sqInt level);
+sqInt snd_StartRecording(sqInt desiredSamplesPerSec, sqInt stereo, sqInt semaIndex);
+sqInt snd_StopRecording(void);
 double snd_GetRecordingSampleRate(void);
-int snd_RecordSamplesIntoAtLength(int buf, int startSliceIndex, int bufferSizeInBytes);
+sqInt snd_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
 void snd_Volume(double *left, double *right);  /* johnmci@smalltalkconsulting.com Nov 6th 2000 */
 void snd_SetVolume(double left, double right); /* johnmci@smalltalkconsulting.com Nov 6th 2000 */
 
 /* mixer interface */
-int snd_GetSwitch(int id, int captureFlag, int channel);
-int snd_SetSwitch(int id, int captureFlag, int parameter);
-int snd_SetDevice(int id, char *name);
+sqInt snd_GetSwitch(sqInt id, sqInt captureFlag, sqInt channel);
+sqInt snd_SetSwitch(sqInt id, sqInt captureFlag, sqInt parameter);
+sqInt snd_SetDevice(sqInt id, char *name);
+
--- squeak-vm-3.10.4.orig/platforms/unix/plugins/SoundPlugin/sqUnixSound.c	2009-03-17 19:07:56.000000000 +0100
+++ squeak-vm-3.10.4/platforms/unix/plugins/SoundPlugin/sqUnixSound.c	2009-04-27 12:38:22.000000000 +0200
@@ -43,7 +43,7 @@
 #include "SqModule.h"
 #include "SqSound.h"
 
-extern int snd_Stop(void);
+extern sqInt snd_Stop(void);
 
 /*** module initialisation/shutdown ***/
 
@@ -52,7 +52,7 @@
 
 static struct SqSound *snd= 0;
 
-int soundInit(void)
+sqInt soundInit(void)
 {
   if (!soundModule
 #    if 0
@@ -83,7 +83,7 @@
 }
 
 
-int soundShutdown(void)
+sqInt soundShutdown(void)
 {
   if (snd) snd->snd_Stop();
   return 1;
@@ -92,44 +92,44 @@
 
 /* output */
 
-int snd_AvailableSpace(void)
+sqInt snd_AvailableSpace(void)
 {
   return snd->snd_AvailableSpace();
 }
 
-int snd_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr, int samplesOfLeadTime)
+sqInt snd_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr, sqInt samplesOfLeadTime)
 {
   return snd->snd_InsertSamplesFromLeadTime(frameCount, srcBufPtr, samplesOfLeadTime);
 }
 
-int snd_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int startIndex)
+sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex)
 {
-  return snd->snd_PlaySamplesFromAtLength(frameCount, arrayIndex, startIndex);
+  return snd->snd_PlaySamplesFromAtLength(frameCount, srcBufPtr, startIndex);
 }
 
-int snd_PlaySilence(void)
+sqInt snd_PlaySilence(void)
 {
   return snd->snd_PlaySilence();
 }
 
-int snd_Start(int frameCount, int samplesPerSec, int stereo, int semaIndex)
+sqInt snd_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex)
 {
   return snd->snd_Start(frameCount, samplesPerSec, stereo, semaIndex);
 }
 
-int snd_Stop(void)
+sqInt snd_Stop(void)
 {
   return snd->snd_Stop();
 }
 
 /* input */
 
-int snd_StartRecording(int desiredSamplesPerSec, int stereo, int semaIndex)
+sqInt snd_StartRecording(sqInt desiredSamplesPerSec, sqInt stereo, sqInt semaIndex)
 {
   return snd->snd_StartRecording(desiredSamplesPerSec, stereo, semaIndex);
 }
 
-int snd_StopRecording(void)
+sqInt snd_StopRecording(void)
 {
   return snd->snd_StopRecording();
 }
@@ -139,16 +139,16 @@
   return snd->snd_GetRecordingSampleRate();
 }
 
-int snd_RecordSamplesIntoAtLength(int buf, int startSliceIndex, int bufferSizeInBytes)
+sqInt snd_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   return snd->snd_RecordSamplesIntoAtLength(buf, startSliceIndex, bufferSizeInBytes);
 }
 
 /* mixer */
 
-void snd_Volume(double *left, double *right)			{	 snd->snd_Volume(left, right); }
-void snd_SetVolume(double left, double right)			{	 snd->snd_SetVolume(left, right); }
-int  snd_SetRecordLevel(int level)				{ return snd->snd_SetRecordLevel(level); }
-int  snd_GetSwitch(int id, int captureFlag, int channel)	{ return snd->snd_GetSwitch(id, captureFlag, channel); }
-int  snd_SetSwitch(int id, int captureFlag, int parameter)	{ return snd->snd_SetSwitch(id, captureFlag, parameter); }
-int  snd_SetDevice(int id, char *name)				{ return snd->snd_SetDevice(id, name); }
+void snd_Volume(double *left, double *right)			  { snd->snd_Volume(left, right); }
+void snd_SetVolume(double left, double right)			  { snd->snd_SetVolume(left, right); }
+sqInt snd_SetRecordLevel(sqInt level)				  { return snd->snd_SetRecordLevel(level); }
+sqInt snd_GetSwitch(sqInt id, sqInt captureFlag, sqInt channel)	  { return snd->snd_GetSwitch(id, captureFlag, channel); }
+sqInt snd_SetSwitch(sqInt id, sqInt captureFlag, sqInt parameter) { return snd->snd_SetSwitch(id, captureFlag, parameter); }
+sqInt snd_SetDevice(sqInt id, char *name)			  { return snd->snd_SetDevice(id, name); }
--- squeak-vm-3.10.4.orig/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c	2009-03-17 19:07:57.000000000 +0100
+++ squeak-vm-3.10.4/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c	2009-04-27 12:39:25.000000000 +0200
@@ -195,13 +195,13 @@
 #endif
 }
 
-static sqInt  sound_InsertSamplesFromLeadTime(sqInt frameCount, sqInt srcBufPtr, sqInt samplesOfLeadTime)	FAIL(frameCount)
+static sqInt  sound_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr, sqInt samplesOfLeadTime)	FAIL(frameCount)
 
-static sqInt  sound_PlaySamplesFromAtLength(sqInt frameCount, sqInt arrayIndex, sqInt startIndex)
+static sqInt  sound_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex)
 {
   if (output_handle)
     {
-      void *samples= (void *)arrayIndex + startIndex * output_channels * 2;
+      void *samples= srcBufPtr + startIndex * output_channels * 2;
       int   count=   snd_pcm_writei(output_handle, samples, frameCount);
       if (count < frameCount / 2)
 	{
@@ -298,11 +298,11 @@
   return (double)input_rate;
 }
 
-static sqInt sound_RecordSamplesIntoAtLength(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
+static sqInt sound_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   if (input_handle)
     {
-      void *samples=    (void *)buf + (startSliceIndex * 2);
+      void *samples=    buf + (startSliceIndex * 2);
       int   frameCount= ((bufferSizeInBytes / 2) - startSliceIndex) / input_channels;
       int   count=      snd_pcm_readi(input_handle, samples, frameCount);
       if (count < 0)
--- squeak-vm-3.10.4.orig/platforms/unix/vm-sound-MacOSX/sqUnixSoundMacOSX.c	2009-03-17 19:07:56.000000000 +0100
+++ squeak-vm-3.10.4/platforms/unix/vm-sound-MacOSX/sqUnixSoundMacOSX.c	2009-04-27 12:39:59.000000000 +0200
@@ -640,7 +640,7 @@
 // Note: this is only used when the "sound quick start" preference is
 // enabled in the image.
 // 
-static sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, sqInt srcBufPtr, sqInt framesOfLeadTime)
+static sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr, sqInt framesOfLeadTime)
 {
   Stream *s= output;
 
@@ -711,9 +711,13 @@
 
       if ((frontFrames + backFrames) >= (frameCount / 2))
 	{
-	  mixFrames((short *)frontData, (short *)pointerForOop(srcBufPtr), frontFrames);
+	  // FIXME - why pointerForOop() here? Removed it but cannot test -dtl
+	  // mixFrames((short *)frontData, (short *)pointerForOop(srcBufPtr), frontFrames);
+	  mixFrames((short *)frontData, (short *)srcBufPtr, frontFrames);
 	  srcBufPtr += frontFrames * SqueakFrameSize;
-	  mixFrames((short *)backData,  (short *)pointerForOop(srcBufPtr), backFrames);
+	  // FIXME - why pointerForOop() here? Removed it but cannot test -dtl
+	  // mixFrames((short *)backData,  (short *)pointerForOop(srcBufPtr), backFrames);
+	  mixFrames((short *)backData,  (short *)srcBufPtr, backFrames);
 	  framesDone= frontFrames + backFrames;
 	}
       return framesDone;
@@ -727,7 +731,7 @@
 // play (exactly) frameCount of samples (and no less, since the result is
 // ignored).
 // 
-static sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, sqInt arrayIndex, sqInt startIndex)
+static sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex)
 {
   if (output)
     {
@@ -735,7 +739,9 @@
       if (Buffer_free(output->buffer) >= byteCount)
 	{
 	  Buffer_write(output->buffer,
-		       pointerForOop(arrayIndex) + (startIndex * SqueakFrameSize),
+	  	       // FIXME - why pointerForOop() here? Removed it but cannot test -dtl
+		       // pointerForOop(arrayIndex) + (startIndex * SqueakFrameSize),
+		       srcBufPtr + (startIndex * SqueakFrameSize),
 		       byteCount);
 	  return frameCount;
 	}
@@ -857,7 +863,7 @@
 }
 
 
-static sqInt sound_RecordSamplesIntoAtLength(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
+static sqInt sound_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   if (input)
     {
@@ -865,8 +871,11 @@
 	{
 	  int    start= startSliceIndex * SqueakFrameSize / 2;
 	  UInt32 count= min(input->cvtBufSize, bufferSizeInBytes - start);
-	  if (kAudioHardwareNoError == AudioConverterFillBuffer(input->converter, bufferDataProc, input,
-								&count, pointerForOop(buf) + start))
+	  // FIXME - why pointerForOop() here? Removed it but cannot test -dtl
+	  //if (kAudioHardwareNoError == AudioConverterFillBuffer(input->converter, bufferDataProc, input,
+	  //	&count, pointerForOop(buf) + start))
+	  if (kAudioHardwareNoError == AudioConverterFillBuffer(input->converter,
+					bufferDataProc, input, &count, buf + start))
 	    return count / (SqueakFrameSize / 2) / input->channels;
 	}
       return 0;
--- squeak-vm-3.10.4.orig/platforms/unix/vm-sound-NAS/sqUnixSoundNAS.c	2009-03-17 19:07:56.000000000 +0100
+++ squeak-vm-3.10.4/platforms/unix/vm-sound-NAS/sqUnixSoundNAS.c	2009-04-27 12:40:32.000000000 +0200
@@ -102,13 +102,13 @@
 static AuFlowID flow;          /* the NAS flow being used */
 static int semaIndex;          /* the semaphore to signal Squeak with */
 static int stereo;             /* whether Squeak sees stereo or not */
-static int bytesAvail;         /* current number of bytes that may be written
+static sqInt bytesAvail;       /* current number of bytes that may be written
 				  or read from the server */
 static int sampleRate;         /* the sample rate of the device.
 				  Currently not accurate. */
 
 
-static int sound_AvailableSpace(void) 
+static sqInt sound_AvailableSpace(void) 
 {
   if(server == NULL)
     return 0;
@@ -116,8 +116,8 @@
   return bytesAvail;
 }
 
-static int sound_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr,
-				  int samplesOfLeadTime)
+static sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr,
+				  sqInt samplesOfLeadTime)
 {
   /* not possible, I don't think using NAS */
   success(false);
@@ -125,7 +125,7 @@
 }
 
 
-static int sound_Stop(void)
+static sqInt sound_Stop(void)
 {
   if(server != NULL) {
     aioDisable(AuServerConnectionNumber(server));
@@ -141,15 +141,15 @@
      
 
      
-static int sound_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int startIndex)
+static sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex)
 {
   int bytesToPlay;
   int framesToPlay;
-  char *buf;   /* buffer to play from; it may not be arrayIndex if a
+  char *buf;   /* buffer to play from; it may not be srcBufPtr if a
                   conversion is necessary */
 
-  dprintf("PlaySamples(frameCount=%d, arrayIndex=%d, startIndex=%d\n",
-	  frameCount, arrayIndex, startIndex);
+  dprintf("PlaySamples(frameCount=%d, srcBufPtr=%d, startIndex=%d\n",
+	  frameCount, srcBufPtr, startIndex);
   
   /* figure out how much to play */
   bytesToPlay = frameCount * bytesPerPlayFrame();
@@ -163,7 +163,7 @@
      ignored */
   if(stereo)
     {
-      buf= (char *) (arrayIndex + 4*startIndex);
+      buf= (char *) (srcBufPtr+ 4*startIndex);
     }
   else
     {
@@ -183,7 +183,7 @@
 
       for(i=0; i<frameCount; i++)
 	{
-	  sbuf[i]= ((short *) (arrayIndex + 4*startIndex)) [2*i];
+	  sbuf[i]= ((short *) (srcBufPtr + 4*startIndex)) [2*i];
 	}
     }
       
@@ -281,7 +281,7 @@
   aioHandle(fd, handleAudioEvents, flags & AIO_RW);
 }
 
-static int sound_PlaySilence(void) 
+static sqInt sound_PlaySilence(void) 
 {
      return 0;
 }
@@ -319,7 +319,7 @@
   return AuNone;
 }
 
-static int sound_Start(int frameCount, int samplesPerSec, int stereo0, int semaIndex0)
+static sqInt sound_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo0, sqInt semaIndex0)
 {
   AuElement elements[2];  /* first is a client element, second is
 			     a device output element */
@@ -415,7 +415,7 @@
    XXX this routine is almost identical to snd_Start().  The two should
    be factored into a single function!
 */
-static int sound_StartRecording(int desiredSamplesPerSec, int stereo0, int semaIndex0)
+static sqInt sound_StartRecording(sqInt desiredSamplesPerSec, sqInt stereo0, sqInt semaIndex0)
 {
   AuElement elements[2];  /* elements for the NAS flow to assemble:
    			        element 0 = physical input
@@ -508,7 +508,7 @@
 }
 
 
-static int sound_StopRecording(void) 
+static sqInt sound_StopRecording(void) 
 {
      return sound_Stop();
 }
@@ -521,8 +521,8 @@
 }
 
      
-static int sound_RecordSamplesIntoAtLength(int buf, int startSliceIndex,
-				  int bufferSizeInBytes)
+static sqInt sound_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex,
+				  sqInt bufferSizeInBytes)
 {
   int bytesToRead;
   int sliceSize= (stereo ? 4 : 2);   /* a "slice" seems to be a "frame": one sample from each channel */
@@ -566,7 +566,7 @@
 
 
 /* mixer settings */
-static int sound_SetRecordLevel(int level) 
+static sqInt sound_SetRecordLevel(sqInt level) 
 {
   return level;
 }
--- squeak-vm-3.10.4.orig/platforms/unix/vm-sound-null/sqUnixSoundNull.c	2009-03-17 19:07:56.000000000 +0100
+++ squeak-vm-3.10.4/platforms/unix/vm-sound-null/sqUnixSoundNull.c	2009-04-27 12:40:57.000000000 +0200
@@ -44,7 +44,7 @@
 
 /* output */
 static sqInt  sound_AvailableSpace(void)									FAIL(8192)
-static sqInt  sound_InsertSamplesFromLeadTime(sqInt frameCount, sqInt srcBufPtr, sqInt samplesOfLeadTime)	FAIL(frameCount)
+static sqInt  sound_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr, sqInt samplesOfLeadTime)	FAIL(frameCount)
 static sqInt  sound_PlaySamplesFromAtLength(sqInt frameCount, sqInt arrayIndex, sqInt startIndex)		FAIL(8192)
 static sqInt  sound_PlaySilence(void)										FAIL(8192)
 static sqInt  sound_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex)			FAIL(1)
@@ -53,7 +53,7 @@
 static sqInt  sound_StartRecording(sqInt desiredSamplesPerSec, sqInt stereo, sqInt semaIndex)			FAIL(0)
 static sqInt  sound_StopRecording(void)										FAIL(0)
 static double sound_GetRecordingSampleRate(void)								FAIL(0)
-static sqInt  sound_RecordSamplesIntoAtLength(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)	FAIL(0)
+static sqInt  sound_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)	FAIL(0)
 /* mixer */
 static void   sound_Volume(double *left, double *right)								{ return; }
 static void   sound_SetVolume(double left, double right)							{ return; }
--- squeak-vm-3.10.4.orig/platforms/unix/vm-sound-OSS/sqUnixSoundOSS.c	2009-03-17 19:07:56.000000000 +0100
+++ squeak-vm-3.10.4/platforms/unix/vm-sound-OSS/sqUnixSoundOSS.c	2009-04-27 12:41:14.000000000 +0200
@@ -744,16 +744,16 @@
 }
 
 
-static sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, sqInt srcBufPtr, sqInt samplesOfLeadTime)
+static sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, void *srcBufPtr, sqInt samplesOfLeadTime)
 {
   return success(false);
 }
 
 
-static sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, sqInt arrayIndex, sqInt startIndex)
+static sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex)
 {
   assert(out->write != 0);
-  return out->write(out, pointerForOop(arrayIndex) + startIndex * out->sq.bpf, frameCount);
+  return out->write(out, srcBufPtr + startIndex * out->sq.bpf, frameCount);
 }
 
 
@@ -822,7 +822,7 @@
 }
 
 
-static sqInt sound_RecordSamplesIntoAtLength(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
+static sqInt sound_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   /*PRINTF(("record %d %d %d\n", buf, startSliceIndex, bufferSizeInBytes));*/
 
@@ -848,7 +848,7 @@
       frameCount= min(frameCount, framesAvail);
       /*PRINTF(("<%d", frameCount * in->hw.bpf));*/
       return in->read(in,
-		      pointerForOop(buf) + startSliceIndex * 2,
+		      buf + startSliceIndex * 2,
 		      frameCount)
 	* in->sq.channels;
     }
--- squeak-vm-3.10.4.orig/platforms/unix/vm-sound-Sun/sqUnixSoundSun.c	2009-03-17 19:07:56.000000000 +0100
+++ squeak-vm-3.10.4/platforms/unix/vm-sound-Sun/sqUnixSoundSun.c	2009-04-27 12:41:31.000000000 +0200
@@ -54,12 +54,12 @@
 # define PRINTF(ARGS)
 #endif
 
-static int sound_Stop(void);
+static sqInt sound_Stop(void);
 
 static int auFd=	       -1;   /* open on /dev/dsp */
-static int fmtStereo=		0;   /* whether we are playing in stereo or not */
-static int auPlaySemaIndex=	0;   /* an index to signal when new data may be played */
-static int auBufBytes=		0;   /*  buffer size to use for playback.
+static sqInt fmtStereo=		0;   /* whether we are playing in stereo or not */
+static sqInt auPlaySemaIndex=	0;   /* an index to signal when new data may be played */
+static sqInt auBufBytes=	0;   /*  buffer size to use for playback.
 					 unfortunately, this bears no relationship to
 					 whatever the kernel and soundcard are using  */
 static int auBuffersPlayed=	0;
@@ -77,7 +77,7 @@
 /*** exported sound output functions ***/
 
 
-static int sound_Stop(void)
+static sqInt sound_Stop(void)
 {
   if (auFd == -1) return;
 
@@ -89,7 +89,7 @@
 }
 
 
-static int sound_Start(int frameCount, int samplesPerSec, int stereo, int semaIndex)
+static sqInt sound_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex)
 {
   int bytesPerFrame=	(stereo ? 4 : 2);
   int bufferBytes=	((frameCount * bytesPerFrame) / 8) * 8;
@@ -138,7 +138,7 @@
 }
 
 
-static int sound_AvailableSpace(void)
+static sqInt sound_AvailableSpace(void)
 {
   struct audio_info info;
 
@@ -153,9 +153,9 @@
 }
 
 
-static int sound_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int startIndex)
+static sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, void *srcBufPtr, sqInt startIndex)
 {
-  short *src= (short *) (arrayIndex + 4*startIndex);
+  short *src= (short *) (srcBufPtr + 4*startIndex);
   short buf[2*frameCount];
   int i;
   int bytes;
@@ -197,35 +197,35 @@
 }
 
 
-static int sound_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr,
-				  int samplesOfLeadTime)
+static sqInt sound_InsertSamplesFromLeadTime(sqint frameCount, void *srcBufPtr,
+				  sqInt samplesOfLeadTime)
 {
   return 0;
 }
 
 
-static int sound_PlaySilence(void)
+static sqInt sound_PlaySilence(void)
 {
      return 0;
 }
 
 
 /** recording not supported **/
-static int sound_SetRecordLevel(int level)
+static sqInt sound_SetRecordLevel(sqInt level)
 {
   success(false);
   return;
 }
 
 
-static int sound_StartRecording(int desiredSamplesPerSec, int stereo, int semaIndex)
+static sqInt sound_StartRecording(sqInt desiredSamplesPerSec, sqInt stereo, sqInt semaIndex)
 {
   success(false);
   return;
 }
 
 
-static int sound_StopRecording(void)
+static sqInt sound_StopRecording(void)
 {
   return;
 }
@@ -238,7 +238,7 @@
 }
 
 
-static int sound_RecordSamplesIntoAtLength(int buf, int startSliceIndex, int bufferSizeInBytes)
+static sqInt sound_RecordSamplesIntoAtLength(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   success(false);
   return 0;
--- squeak-vm-3.10.4.orig/platforms/unix/vm/SqSound.h	2009-03-17 19:07:56.000000000 +0100
+++ squeak-vm-3.10.4/platforms/unix/vm/SqSound.h	2009-04-27 12:43:25.000000000 +0200
@@ -12,8 +12,8 @@
   int    version;
   /* output */
   sqInt  (*snd_AvailableSpace)(void);
-  sqInt  (*snd_InsertSamplesFromLeadTime)(sqInt frameCount, sqInt srcBufPtr, sqInt samplesOfLeadTime);
-  sqInt  (*snd_PlaySamplesFromAtLength)(sqInt frameCount, sqInt arrayIndex, sqInt startIndex);
+  sqInt  (*snd_InsertSamplesFromLeadTime)(sqInt frameCount, void *srcBufPtr, sqInt samplesOfLeadTime);
+  sqInt  (*snd_PlaySamplesFromAtLength)(sqInt frameCount, void *srcBufPtr, sqInt startIndex);
   sqInt  (*snd_PlaySilence)(void);
   sqInt  (*snd_Start)(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex);
   sqInt  (*snd_Stop)(void);
@@ -21,17 +21,16 @@
   sqInt  (*snd_StartRecording)(sqInt desiredSamplesPerSec, sqInt stereo, sqInt semaIndex);
   sqInt  (*snd_StopRecording)(void);
   double (*snd_GetRecordingSampleRate)(void);
-  sqInt  (*snd_RecordSamplesIntoAtLength)(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
+  sqInt  (*snd_RecordSamplesIntoAtLength)(void *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
   /* mixer */
   void   (*snd_Volume)(double *left, double *right);
   void   (*snd_SetVolume)(double left, double right);
   sqInt  (*snd_SetRecordLevel)(sqInt level);
-  int    (*snd_GetSwitch)(int id, int captureFlag, int channel);
-  int    (*snd_SetSwitch)(int id, int captureFlag, int parameter);
-  int    (*snd_SetDevice)(int id, char *name);
+  sqInt    (*snd_GetSwitch)(sqInt id, sqInt captureFlag, sqInt channel);
+  sqInt    (*snd_SetSwitch)(sqInt id, sqInt captureFlag, sqInt parameter);
+  sqInt    (*snd_SetDevice)(sqInt id, char *name);
 };
 
-
 #define SqSoundDefine(NAME)			\
 static struct SqSound sound_##NAME##_itf= {	\
   SqSoundVersion,				\
