[Vm-dev] Suspicious typing in Cog VM

Aleksej Saushev asau at inbox.ru
Wed Dec 8 08:30:19 UTC 2010


  Hello!

Types are inconsistent along the source, does Cog VM work on LP64 platforms?

I need this to make it build on NetBSD/i386:

--- platforms/unix/plugins/SoundPlugin/sqUnixSound.c.orig	2010-12-07 17:40:51.000000000 +0000
+++ platforms/unix/plugins/SoundPlugin/sqUnixSound.c
@@ -99,12 +99,12 @@ int 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 *arrayIndex, sqInt startIndex)
 {
   return snd->snd_PlaySamplesFromAtLength(frameCount, arrayIndex, startIndex);
 }
@@ -141,7 +141,7 @@ double snd_GetRecordingSampleRate(void)
   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);
 }
@@ -150,7 +150,7 @@ int snd_RecordSamplesIntoAtLength(int bu
 
 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); }
+void snd_SetRecordLevel(sqInt 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); }
--- src/vm/gcc3x-cointerp.c.orig	2010-12-07 18:00:09.000000000 +0000
+++ src/vm/gcc3x-cointerp.c
@@ -975,7 +975,7 @@ sqInt quickPrimitiveInstVarIndexFor(sqIn
 sqInt rawHeaderOf(sqInt methodPointer);
 void rawHeaderOfput(sqInt methodOop, void *cogMethod);
 sqInt readableFormat(sqInt imageVersion);
-sqInt readImageFromFileHeapSizeStartingAt(sqImageFile  f, sqInt desiredHeapSize, squeakFileOffsetType  imageOffset);
+sqInt readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squeakFileOffsetType imageOffset);
 sqInt remap(sqInt oop);
 static sqInt removeFirstLinkOfList(sqInt aList);
 EXPORT(sqInt) removeGCRoot(sqInt *varLoc);
@@ -37959,7 +37959,7 @@ readableFormat(sqInt imageVersion) {
  */
 
 sqInt
-readImageFromFileHeapSizeStartingAt(sqImageFile  f, sqInt desiredHeapSize, squeakFileOffsetType  imageOffset) {
+readImageFromFileHeapSizeStartingAt(sqImageFile  f, usqInt desiredHeapSize, squeakFileOffsetType  imageOffset) {
 DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt anObject;
     sqInt aValue;



-- 
HE CE3OH...


More information about the Vm-dev mailing list