[commit] r2158 - 64bit work merging from V5 Macintosh Cocoa Squeak VM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[commit] r2158 - 64bit work merging from V5 Macintosh Cocoa Squeak VM

commits-3
 
Author: johnmci
Date: 2010-03-28 18:16:36 -0700 (Sun, 28 Mar 2010)
New Revision: 2158

Modified:
   trunk/platforms/Cross/plugins/DropPlugin/DropPlugin.h
   trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
   trunk/platforms/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h
   trunk/platforms/Cross/plugins/SecurityPlugin/SecurityPlugin.h
   trunk/platforms/Cross/plugins/SocketPlugin/SocketPlugin.h
   trunk/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h
   trunk/platforms/Cross/plugins/SqueakFFIPrims/sqFFI.h
   trunk/platforms/Cross/plugins/UUIDPlugin/UUIDPlugin.h
   trunk/platforms/Cross/vm/sq.h
   trunk/platforms/Cross/vm/sqNamedPrims.c
   trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.c
   trunk/platforms/Mac OS/plugins/SoundPlugin/sqUnixSoundMacOSXJMM.c
   trunk/platforms/Mac OS/plugins/UUIDPlugin/sqMacUUID.c
   trunk/platforms/Mac OS/vm/sqMacMain.c
   trunk/platforms/Mac OS/vm/sqMacNSPluginUILogic2.c
   trunk/platforms/Mac OS/vm/sqMacTime.c
   trunk/platforms/Mac OS/vm/sqMacWindowUniversal.c
   trunk/platforms/Mac OS/vm/sqPlatformSpecific.h
Log:
64bit work merging from V5 Macintosh Cocoa Squeak VM
microsecond & utc clock udates

DropPlugin.h, sqFilePlubinBasic.h,hostWindowPlugin.h,SecurityPlugin.h,
SoundPlugin  64bit work

SocketPlugin.h
add IPV6 declares

sqFFI.h
missing pushBoolean define

sq.h
Add ioMicroSeconds,ioUtcWithOffset
Add EventTypeComplex
readImageFromFileHeapSizeStartingAt desriredHeapSize 32bit clean
id ->indexNumber to make Objective-C routines happy (id is type not identifier)

sqNamedPrims.c
64bit work

sqMacUnixInterfaceSound.c
sqUnixSoundMacOSX.c
64bit work, but this is removed in V5 64bit work anyway.

sqMacUUID.c
64bit work, but this is replaced by unix code in V5 64bit work anyway

sqMacMain.c
Mac Carbon 4.2.4b1

sqMacNSPluginUILogic2.c
move sq.h to avoid issues with undefined usqInt

sqMacTime.c
add utc primitive

sqMacWindowUniversal.c
ioShowDisplayOnWindow char *

sqPlatformSpecific.h
Add microsecond and utc stuff


Modified: trunk/platforms/Cross/plugins/DropPlugin/DropPlugin.h
===================================================================
--- trunk/platforms/Cross/plugins/DropPlugin/DropPlugin.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/plugins/DropPlugin/DropPlugin.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -1,13 +1,12 @@
 /* drop support primitives */
 
 /* module initialization/shutdown */
-int dropInit(void);
-int dropShutdown(void);
+sqInt dropInit(void);
+sqInt dropShutdown(void);
 
-char* dropRequestFileName(int dropIndex); /* return name of file or NULL if error */
+char* dropRequestFileName(sqInt dropIndex); /* return name of file or NULL if error */
 /* note: dropRequestFileHandle needs to bypass plugin security checks when implemented */
-int dropRequestFileHandle(int dropIndex); /* return READ-ONLY file handle OOP or nilObject if error */
-int sqSecFileAccessCallback(void *);
-void sqSetNumberOfDropFiles(int numberOfFiles);
-void sqSetFileInformation(int dropIndex, void *dropFile);
-void sqDragTriggerData(char *aByteArray, int dataLength, char *aFormat, int formatLength);
+sqInt dropRequestFileHandle(sqInt dropIndex); /* return READ-ONLY file handle OOP or nilObject if error */
+sqInt sqSecFileAccessCallback(void *);
+void sqSetNumberOfDropFiles(sqInt numberOfFiles);
+void sqSetFileInformation(sqInt dropIndex, void *dropFile);void sqDragTriggerData(char *aByteArray, sqInt dataLength, char *aFormat, sqInt formatLength);

Modified: trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c
===================================================================
--- trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -166,7 +166,7 @@
    Should be called once at startup time.
  */
 #if VM_PROXY_MINOR > 6
- thisSession = interpreterProxy->getThisSessionID();
+ thisSession = (int) interpreterProxy->getThisSessionID();
 #else
  thisSession = ioLowResMSecs() + time(NULL);
  if (thisSession == 0) thisSession = 1; /* don't use 0 */

Modified: trunk/platforms/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h
===================================================================
--- trunk/platforms/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/plugins/HostWindowPlugin/HostWindowPlugin.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -4,52 +4,53 @@
  * windowHandles etc are expected to be SmallInteger valid values
  * windowHandle 1 is the traditional main window */
 
-/* closeWindow: arg is int windowIndex. Fail (return 0) if anything goes wrong
+/* closeWindow: arg is sqInt windowIndex. Fail (return 0) if anything goes wrong
  * - typically the windowIndex invalid or similar */
-extern int closeWindow(int index);
+extern sqInt closeWindow(sqInt index);
 
-/* createWindow: takes int width, height and origin x/y plus a char* list of
- * as yet undefined attributes. Returns an int window index or 0 for failure
+/* createWindow: takes sqInt width, height and origin x/y plus a char* list of
+ * as yet undefined attributes. Returns an sqInt window index or 0 for failure
  * Failure may occur because of an inability to add the window, too many
  * windows already extant (platform dependant), the specified size being
  * unreasonable etc. */
-extern int createWindowWidthheightoriginXyattrlength(int w, int h, int x, int y,
-char * list, int attributeListLength);
+extern sqInt createWindowWidthheightoriginXyattrlength(sqInt w, sqInt h, sqInt x, sqInt y,
+char * list, sqInt attributeListLength);
 
-/* ioShowDisplayOnWindow: similar to ioShowDisplay but adds the int windowIndex
+/* ioShowDisplayOnWindow: similar to ioShowDisplay but adds the sqInt windowIndex
  * Return true if ok, false if not, but not currently checked */
-extern int ioShowDisplayOnWindow( unsigned* dispBitsIndex, int width, int
-height, int depth, int affectedL, int affectedR, int affectedT, int affectedB,
-int windowIndex);
+extern sqInt ioShowDisplayOnWindow( unsigned char* dispBitsIndex, sqInt width, sqInt
+height, sqInt depth, sqInt affectedL, sqInt affectedR, sqInt affectedT, sqInt affectedB,
+sqInt windowIndex);
 
-/* ioSizeOfWindow: arg is int windowIndex. Return the size of the specified
+/* ioSizeOfWindow: arg is sqInt windowIndex. Return the size of the specified
  * window in (width<<16 || height) format like ioScreenSize.
  * Return -1 for failure - typically invalid windowIndex
  * -1 is chosen since itwould correspond to a window size of 64k@64k which
  * I hope is unlikely for some time to come */
-extern int ioSizeOfWindow(int windowIndex);
+extern sqInt ioSizeOfWindow(sqInt windowIndex);
 
-/* ioSizeOfWindowSetxy: args are int windowIndex, int w & h for the
+/* ioSizeOfWindowSetxy: args are sqInt windowIndex, sqInt w & h for the
  * width / height to make the window. Return the actual size the OS
  * produced in (width<<16 || height) format or -1 for failure as above. */
-extern int ioSizeOfWindowSetxy(int windowIndex, int w, int h);
+extern sqInt ioSizeOfWindowSetxy(sqInt windowIndex, sqInt w, sqInt h);
 
-/* ioPositionOfWindow: arg is int windowIndex. Return the pos of the specified
+/* ioPositionOfWindow: arg is sqInt windowIndex. Return the pos of the specified
  * window in (left<<16 || top) format like ioScreenSize.
- * Return -1 (as above) for failure - typically invalid windowIndex */
-extern int ioPositionOfWindow(int windowIndex);
+ * Return -1 (as above) for failure - tpyically invalid windowIndex */
+extern sqInt ioPositionOfWindow(sqInt windowIndex);
 
-/* ioPositionOfWindowSetxy: args are int windowIndex, int x & y for the
+/* ioPositionOfWindowSetxy: args are sqInt windowIndex, sqInt x & y for the
  * origin x/y for the window. Return the actual origin the OS
  * produced in (left<<16 || top) format or -1 for failure, as above */
-extern int ioPositionOfWindowSetxy(int windowIndex, int x, int y);
+extern sqInt ioPositionOfWindowSetxy(sqInt windowIndex, sqInt x, sqInt y);
 
-/* ioSetTitleOfWindow: args are int windowIndex, char* newTitle and
- * int size of new title. Fail with -1 if windowIndex is invalid, string is too
- * long for platform etc. Leave previous title in place on failure */
-extern int ioSetTitleOfWindow(int windowIndex, char * newTitle, int sizeOfTitle);
+/* ioSetTitleOfWindow: args are sqInt windowIndex, char* newTitle and
+ * sqInt size of new title. Fail with -1 if windowIndex is invalid, string is too
+long for platform etc. Leave previous title in place on failure */
+sqInt ioSetTitleOfWindow(sqInt windowIndex, char * newTitle, sqInt sizeOfTitle);
 
-/* ioCloseAllWindows: intended for VM shutdown.
+/* ioCloseAllWindows: sqIntended for VM shutdown.
  * Close all the windows that appear to be open.
- * No useful return value since we're getting out of Dodge anyway. */
-extern int ioCloseAllWindows(void);
+ * No useful return value since we're getting out of Dodge anyway.
+ */
+extern sqInt ioCloseAllWindows(void);

Modified: trunk/platforms/Cross/plugins/SecurityPlugin/SecurityPlugin.h
===================================================================
--- trunk/platforms/Cross/plugins/SecurityPlugin/SecurityPlugin.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/plugins/SecurityPlugin/SecurityPlugin.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -1,31 +1,31 @@
 /* security plugin header file */
 
 /* image writing */
-int ioDisableImageWrite(void);
-int ioCanWriteImage(void);
+sqInt ioDisableImageWrite(void);
+sqInt ioCanWriteImage(void);
 
 /* untrusted and secure directory locations */
 char *ioGetSecureUserDirectory(void);
 char *ioGetUntrustedUserDirectory(void);
 
 /* following must be called by the VM before interpret() */
-int ioInitSecurity(void);
-int ioCanListenOnPort(int s, int port);
-int ioCanConnectToPort(int netAddr, int port);
-int ioCanCreateSocketOfType(int netType, int socketType);
-int ioCanCreateSocketOfType(int netType, int socketType);
-int ioCanConnectToPort(int netAddr, int port);
-int ioDisableSocketAccess(void);
-int ioHasSocketAccess(void);
-int ioCanCreatePathOfSize(char* pathString, int pathStringLength);
-int ioCanDeleteFileOfSize(char* pathString, int pathStringLength);
-int ioCanDeletePathOfSize(char* pathString, int pathStringLength);
-int ioCanGetFileTypeOfSize(char* pathString, int pathStringLength);
-int ioCanListPathOfSize(char* pathString, int pathStringLength);
-int ioCanOpenAsyncFileOfSizeWritable(char* pathString, int pathStringLength, int writeFlag);
-int ioCanOpenFileOfSizeWritable(char* pathString, int pathStringLength, int writeFlag);
-int ioCanRenameFileOfSize(char* pathString, int pathStringLength);
-int ioCanRenameImage(void);
-int ioCanSetFileTypeOfSize(char* pathString, int pathStringLength);
-int ioDisableFileAccess(void);
-int ioHasFileAccess(void);
+sqInt ioInitSecurity(void);
+sqInt ioCanListenOnPort(sqInt s, sqInt port);
+sqInt ioCanConnectToPort(sqInt netAddr, sqInt port);
+sqInt ioCanCreateSocketOfType(sqInt netType, sqInt socketType);
+sqInt ioCanCreateSocketOfType(sqInt netType, sqInt socketType);
+sqInt ioCanConnectToPort(sqInt netAddr, sqInt port);
+sqInt ioDisableSocketAccess(void);
+sqInt ioHasSocketAccess(void);
+sqInt ioCanCreatePathOfSize(char* pathString, sqInt pathStringLength);
+sqInt ioCanDeleteFileOfSize(char* pathString, sqInt pathStringLength);
+sqInt ioCanDeletePathOfSize(char* pathString, sqInt pathStringLength);
+sqInt ioCanGetFileTypeOfSize(char* pathString, sqInt pathStringLength);
+sqInt ioCanListPathOfSize(char* pathString, sqInt pathStringLength);
+sqInt ioCanOpenAsyncFileOfSizeWritable(char* pathString, sqInt pathStringLength, sqInt writeFlag);
+sqInt ioCanOpenFileOfSizeWritable(char* pathString, sqInt pathStringLength, sqInt writeFlag);
+sqInt ioCanRenameFileOfSize(char* pathString, sqInt pathStringLength);
+sqInt ioCanRenameImage(void);
+sqInt ioCanSetFileTypeOfSize(char* pathString, sqInt pathStringLength);
+sqInt ioDisableFileAccess(void);
+sqInt ioHasFileAccess(void);

Modified: trunk/platforms/Cross/plugins/SocketPlugin/SocketPlugin.h
===================================================================
--- trunk/platforms/Cross/plugins/SocketPlugin/SocketPlugin.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/plugins/SocketPlugin/SocketPlugin.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -52,3 +52,34 @@
 /* tpr 4/12/06 add declarations for two new socket routines */
 void sqSocketBindToPort(SocketPtr s, int addr, int port);
 void sqSocketSetReusable(SocketPtr s);
+
+void  sqResolverGetAddressInfoHostSizeServiceSizeFlagsFamilyTypeProtocol(char *hostName, sqInt hostSize, char *servName, sqInt servSize,
+ sqInt flags, sqInt family, sqInt type, sqInt protocol);
+sqInt sqResolverGetAddressInfoSize(void);
+void  sqResolverGetAddressInfoResultSize(char *addr, sqInt addrSize);
+sqInt sqResolverGetAddressInfoFamily(void);
+sqInt sqResolverGetAddressInfoType(void);
+sqInt sqResolverGetAddressInfoProtocol(void);
+sqInt sqResolverGetAddressInfoNext(void);
+
+sqInt sqSocketAddressSizeGetPort(char *addr, sqInt addrSize);
+void  sqSocketAddressSizeSetPort(char *addr, sqInt addrSize, sqInt port);
+
+void  sqResolverGetNameInfoSizeFlags(char *addr, sqInt addrSize, sqInt flags);
+sqInt sqResolverGetNameInfoHostSize(void);
+void  sqResolverGetNameInfoHostResultSize(char *name, sqInt nameSize);
+sqInt sqResolverGetNameInfoServiceSize(void);
+void  sqResolverGetNameInfoServiceResultSize(char *name, sqInt nameSize);
+
+sqInt sqResolverHostNameSize(void);
+void  sqResolverHostNameResultSize(char *name, sqInt nameSize);
+
+void  sqSocketBindToAddressSize(SocketPtr s, char *addr, sqInt addrSize);
+void  sqSocketListenBacklog(SocketPtr s, sqInt backlogSize);
+void  sqSocketConnectToAddressSize(SocketPtr s, char *addr, sqInt addrSize);
+
+sqInt sqSocketLocalAddressSize(SocketPtr s);
+void  sqSocketLocalAddressResultSize(SocketPtr s, char *addr, int addrSize);
+sqInt sqSocketRemoteAddressSize(SocketPtr s);
+void  sqSocketRemoteAddressResultSize(SocketPtr s, char *addr, int addrSize);
+

Modified: trunk/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h
===================================================================
--- trunk/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/plugins/SoundPlugin/SoundPlugin.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -1,27 +1,27 @@
 /* SoundPlugin.h - header for Sound Plugins :-) [hidden email] */
 
 /* 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, usqInt * srcBufPtr, sqInt samplesOfLeadTime);
+sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, usqInt* arrayIndex, 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);
+void 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);
-void snd_Volume(double *left, double *right);  /* [hidden email] Nov 6th 2000 */
-void snd_SetVolume(double left, double right); /* [hidden email] Nov 6th 2000 */
+sqInt snd_RecordSamplesIntoAtLength(usqInt * buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
+void snd_Volume(double *left, double *right); //[hidden email] Nov 6th 2000
+void snd_SetVolume(double left, double right);//[hidden email] 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 identifier, sqInt captureFlag, sqInt channel);
+sqInt snd_SetSwitch(sqInt identifier, sqInt captureFlag, sqInt parameter);
+sqInt snd_SetDevice(sqInt identifier, char *name);

Modified: trunk/platforms/Cross/plugins/SqueakFFIPrims/sqFFI.h
===================================================================
--- trunk/platforms/Cross/plugins/SqueakFFIPrims/sqFFI.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/plugins/SqueakFFIPrims/sqFFI.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -85,6 +85,7 @@
 int ffiPushUnsignedShort(int value);
 int ffiPushSignedInt(int value);
 int ffiPushUnsignedInt(int value);
+int ffiPushBool(int value);
 
 /* 64bit integer loads */
 int ffiPushSignedLongLong(int lowWord, int highWord);

Modified: trunk/platforms/Cross/plugins/UUIDPlugin/UUIDPlugin.h
===================================================================
--- trunk/platforms/Cross/plugins/UUIDPlugin/UUIDPlugin.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/plugins/UUIDPlugin/UUIDPlugin.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -2,6 +2,6 @@
 
 typedef char sqUUID[16];
 
-int MakeUUID(sqUUID location);
-int sqUUIDInit();
-int sqUUIDShutdown();
+sqInt MakeUUID(sqUUID location);
+sqInt sqUUIDInit(void);
+sqInt sqUUIDShutdown(void);

Modified: trunk/platforms/Cross/vm/sq.h
===================================================================
--- trunk/platforms/Cross/vm/sq.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/vm/sq.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -112,6 +112,8 @@
 sqInt ioMSecs(void);
 /* deprecated out ofexistence sqInt ioLowResMSecs(void); */
 sqInt ioMicroMSecs(void);
+sqLong ioMicroSeconds(void); /* primitiveMicrosecondClock */
+sqInt ioUtcWithOffset(sqLong*, int*); /* primitiveUtcWithOffset */
 
 #define ioMSecs() ((1000 * clock()) / CLOCKS_PER_SEC)
 
@@ -214,6 +216,7 @@
 #define EventTypeDragDropFiles 3
 #define EventTypeMenu 4
 #define EventTypeWindow 5
+#define EventTypeComplex 6
 
 /* Keypress state for keyboard events. */
 #define EventKeyChar 0
@@ -325,6 +328,29 @@
 #define WindowEventPaint 5 /* window area (in value1-4) needs updating. Some platforms do not need to send this, do not rely on it in image */
 #define WindowEventStinks 6 /* this window stinks (just to see if people read this stuff) */
 
+typedef struct sqComplexEvent
+ {
+ int type; /* type of event;  EventTypeComplex */
+ unsigned int timeStamp; /* time stamp */
+ /* the interpretation of the following fields depend on the type  of the event */
+ int action;        /* one of ComplexEventXXX (see below) */
+ usqInt objectPointer; /* used to point to object */
+ int unused1; /*  */
+ int unused2; /*  */
+ int unused3; /*  */
+ int windowIndex; /* host window structure */
+ } sqComplexEvent;
+
+#define ComplexEventTypeTouchsDown 1 /*  */
+#define ComplexEventTypeTouchsUp 2 /*  */
+#define ComplexEventTypeTouchsMoved 3 /*  */
+#define ComplexEventTypeTouchsStationary 4 /*  */
+#define ComplexEventTypeTouchsCancelled 5 /*  */
+#define ComplexEventTypeAccelerationData 6 /*  */
+#define ComplexEventTypeLocationData 7 /*  */
+#define ComplexEventTypeApplicationData 8 /*  */
+
+
 /* Set an asynchronous input semaphore index for events. */
 sqInt ioSetInputSemaphore(sqInt semaIndex);
 /* Retrieve the next input event from the OS. */
@@ -346,7 +372,7 @@
 
 /* Save/restore. */
 /* Read the image from the given file starting at the given image offset */
-sqInt readImageFromFileHeapSizeStartingAt(sqImageFile f, sqInt desiredHeapSize, squeakFileOffsetType imageOffset);
+sqInt readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squeakFileOffsetType imageOffset);
 /* NOTE: The following is obsolete - it is only provided for compatibility */
 #define readImageFromFileHeapSize(f, s) readImageFromFileHeapSizeStartingAt(f,s,0)
 
@@ -375,8 +401,8 @@
 sqInt stopProfiling(void);
 
 /* System attributes. */
-sqInt attributeSize(sqInt id);
-sqInt getAttributeIntoLength(sqInt id, sqInt byteArrayIndex, sqInt length);
+sqInt attributeSize(sqInt indexNumber);
+sqInt getAttributeIntoLength(sqInt indexNumber, sqInt byteArrayIndex, sqInt length);
 
 /*** Pluggable primitive support. ***/
 

Modified: trunk/platforms/Cross/vm/sqNamedPrims.c
===================================================================
--- trunk/platforms/Cross/vm/sqNamedPrims.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Cross/vm/sqNamedPrims.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -33,7 +33,7 @@
 typedef struct ModuleEntry {
  struct ModuleEntry *next;
  void *handle;
- int ffiLoaded;
+ sqInt ffiLoaded;
  char name[1];
 } ModuleEntry;
 
@@ -54,7 +54,7 @@
  return NULL;
 }
 
-static ModuleEntry *addToModuleList(char *pluginName, void* handle, int ffiFlag)
+static ModuleEntry *addToModuleList(char *pluginName, void* handle, sqInt ffiFlag)
 {
  ModuleEntry *module;
 
@@ -72,7 +72,7 @@
  Remove the given entry from the list of loaded modules.
  Do NOT free it yet.
 */
-static int removeFromList(ModuleEntry *entry)
+static sqInt removeFromList(ModuleEntry *entry)
 {
  ModuleEntry *prevModule;
 
@@ -116,7 +116,7 @@
 static void *findInternalFunctionIn(char *functionName, char *pluginName)
 {
   char *function, *plugin;
-  int listIndex, index;
+  sqInt listIndex, index;
   sqExport *exports;
 
   dprintf(("Looking (internally) for %s in %s ... ", functionName, (pluginName ? pluginName : "<intrinsic>")));
@@ -168,7 +168,7 @@
  b) initialiseModule (if defined) and check it's return
  as well.
 */
-static int callInitializersIn(ModuleEntry *module)
+static sqInt callInitializersIn(ModuleEntry *module)
 {
  void *init0;
  void *init1;
@@ -226,7 +226,7 @@
  If anything goes wrong make sure the module is unloaded
  (WITHOUT calling shutdownModule()) and return NULL.
 */
-static ModuleEntry *findAndLoadModule(char *pluginName, int ffiLoad)
+static ModuleEntry *findAndLoadModule(char *pluginName, sqInt ffiLoad)
 {
  void *handle;
  ModuleEntry *module;
@@ -265,7 +265,7 @@
  Look if the given module is already loaded.
  If so, return it's handle, otherwise try to load it.
 */
-static ModuleEntry *findOrLoadModule(char *pluginName, int ffiLoad)
+static ModuleEntry *findOrLoadModule(char *pluginName, sqInt ffiLoad)
 {
  ModuleEntry *module;
 
@@ -313,11 +313,11 @@
 void *ioLoadExternalFunctionOfLengthFromModuleOfLength(sqInt functionNameIndex, sqInt functionNameLength,
        sqInt moduleNameIndex,   sqInt moduleNameLength)
 {
- char *functionNamePointer= pointerForOop(functionNameIndex);
- char *moduleNamePointer= pointerForOop(moduleNameIndex);
+ char *functionNamePointer= pointerForOop((usqInt)functionNameIndex);
+ char *moduleNamePointer= pointerForOop((usqInt)moduleNameIndex);
  char functionName[256];
  char moduleName[256];
- int i;
+ sqInt i;
 
  if(functionNameLength > 255 || moduleNameLength > 255)
  return 0; /* can't cope with those */
@@ -335,9 +335,9 @@
 */
 void *ioLoadSymbolOfLengthFromModule(sqInt functionNameIndex, sqInt functionNameLength, void *moduleHandle)
 {
- char *functionNamePointer= pointerForOop(functionNameIndex);
+ char *functionNamePointer= pointerForOop((usqInt)functionNameIndex);
  char functionName[256];
- int i;
+ sqInt i;
 
  if(functionNameLength > 255)
  return 0; /* can't cope with those */
@@ -358,9 +358,9 @@
 void *ioLoadModuleOfLength(sqInt moduleNameIndex, sqInt moduleNameLength)
 {
  ModuleEntry *module;
- char *moduleNamePointer= pointerForOop(moduleNameIndex);
+ char *moduleNamePointer= pointerForOop((usqInt)moduleNameIndex);
  char moduleName[256];
- int i;
+ sqInt i;
 
  if(moduleNameLength > 255) return 0; /* can't cope with those */
  for(i=0; i< moduleNameLength; i++)
@@ -376,7 +376,7 @@
 /* shutdownModule:
  Call the shutdown mechanism from the specified module.
 */
-static int shutdownModule(ModuleEntry *module)
+static sqInt shutdownModule(ModuleEntry *module)
 {
  void* fn;
 
@@ -384,7 +384,7 @@
 
  /* load the actual function */
  fn = findFunctionIn("shutdownModule", module);
- if(fn) return ((int (*) (void)) fn) ();
+ if(fn) return ((sqInt (*) (void)) fn) ();
  return 1;
 }
 
@@ -428,7 +428,7 @@
  void *fn = findFunctionIn("moduleUnloaded", temp);
  if(fn) {
  /* call it */
- ((int (*) (char *))fn)(entry->name);
+ ((sqInt (*) (char *))fn)(entry->name);
  }
  }
  temp = temp->next;
@@ -446,9 +446,9 @@
 */
 sqInt ioUnloadModuleOfLength(sqInt moduleNameIndex, sqInt moduleNameLength)
 {
- char *moduleNamePointer= pointerForOop(moduleNameIndex);
+ char *moduleNamePointer= pointerForOop((usqInt) moduleNameIndex);
  char moduleName[256];
- int i;
+ sqInt i;
 
  if(moduleNameLength > 255) return 0; /* can't cope with those */
  for(i=0; i< moduleNameLength; i++)
@@ -463,7 +463,7 @@
 
 char *ioListBuiltinModule(sqInt moduleIndex)
 {
-  int index, listIndex;
+  sqInt index, listIndex;
   char *function;
   char *plugin;
   sqExport *exports;
@@ -495,7 +495,7 @@
 }
 
 char *ioListLoadedModule(sqInt moduleIndex) {
- int index = 1;
+ sqInt index = 1;
 
  ModuleEntry *entry;
  entry = firstModule;

Modified: trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.c
===================================================================
--- trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Mac OS/plugins/SoundPlugin/sqMacUnixInterfaceSound.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -14,15 +14,15 @@
 #include "SqModule.h"
 #include "SqSound.h"
 
-extern int sound_Stop(void);
+extern sqInt sound_Stop(void);
 
-int soundInit(void)
+sqInt soundInit(void)
 {
   return 1;
 }
 
 
-int soundShutdown(void)
+sqInt soundShutdown(void)
 {
   sound_StopRecording();
   return 1;
@@ -31,44 +31,44 @@
 
 /* output */
 
-int snd_AvailableSpace(void)
+sqInt snd_AvailableSpace(void)
 {
   return sound_AvailableSpace();
 }
 
-int snd_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr, int samplesOfLeadTime)
+sqInt snd_InsertSamplesFromLeadTime(sqInt frameCount, usqInt* srcBufPtr, sqInt samplesOfLeadTime)
 {
   return sound_InsertSamplesFromLeadTime(frameCount, srcBufPtr, samplesOfLeadTime);
 }
 
-int snd_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int startIndex)
+sqInt snd_PlaySamplesFromAtLength(sqInt frameCount, usqInt* arrayIndex, sqInt startIndex)
 {
   return sound_PlaySamplesFromAtLength(frameCount, arrayIndex, startIndex);
 }
 
-int snd_PlaySilence(void)
+sqInt snd_PlaySilence(void)
 {
   return sound_PlaySilence();
 }
 
-int snd_Start(int frameCount, int samplesPerSec, int stereo, int semaIndex)
+sqInt snd_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex)
 {
   return sound_Start(frameCount, samplesPerSec, stereo, semaIndex);
 }
 
-int snd_Stop(void)
+sqInt snd_Stop(void)
 {
   return sound_Stop();
 }
 
 /* input */
 
-int snd_StartRecording(int desiredSamplesPerSec, int stereo, int semaIndex)
+sqInt snd_StartRecording(sqInt desiredSamplesPerSec, sqInt stereo, sqInt semaIndex)
 {
   return sound_StartRecording(desiredSamplesPerSec, stereo, semaIndex);
 }
 
-int snd_StopRecording(void)
+sqInt snd_StopRecording(void)
 {
   return sound_StopRecording();
 }
@@ -78,7 +78,7 @@
   return sound_GetRecordingSampleRate();
 }
 
-int snd_RecordSamplesIntoAtLength(int buf, int startSliceIndex, int bufferSizeInBytes)
+sqInt snd_RecordSamplesIntoAtLength(usqInt *buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   return sound_RecordSamplesIntoAtLength(buf, startSliceIndex, bufferSizeInBytes);
 }
@@ -89,5 +89,5 @@
  sound_Volume(left, right); }
 void snd_SetVolume(double left, double right) {
  sound_SetVolume(left, right); }
-int  snd_SetRecordLevel(int level) {
- return sound_SetRecordLevel(level); }
\ No newline at end of file
+void  snd_SetRecordLevel(sqInt level) {
+ sound_SetRecordLevel(level); }
\ No newline at end of file

Modified: trunk/platforms/Mac OS/plugins/SoundPlugin/sqUnixSoundMacOSXJMM.c
===================================================================
--- trunk/platforms/Mac OS/plugins/SoundPlugin/sqUnixSoundMacOSXJMM.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Mac OS/plugins/SoundPlugin/sqUnixSoundMacOSXJMM.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -68,11 +68,6 @@
 
 #define SqueakFrameSize 4 // guaranteed (see class SoundPlayer)
 #define DeviceFrameSize 8 // ditto (<CoreAudio/AudioHardware.h>, para 9)
-int min(int i, int j);
-int max(int i, int j);
-
- inline int min(int i, int j) { return (i < j) ? i : j; }
- inline int max(int i, int j) { return (i > j) ? i : j; }
 
 char empty[256] = { 0 };
 
@@ -82,10 +77,10 @@
 #if (!TESTING)
 # include "sq.h"
 #else
-   int noSoundMixer= 0;
-   inline int signalSemaphoreWithIndex(int sema) { return 0; }
-   inline int success(int flag) { return 0; }
-   inline int primitiveFail(void) { return -1; }
+   sqInt noSoundMixer= 0;
+   inline sqInt signalSemaphoreWithIndex(sqInt sema) { return 0; }
+   inline sqInt success(sqInt flag) { return 0; }
+   inline sqInt primitiveFail(void) { return -1; }
 #endif
 
 #if (DEBUG)
@@ -119,7 +114,12 @@
   va_end(ap);
 }
 
+sqInt min(sqInt i, sqInt j);
+sqInt max(sqInt i, sqInt j);
 
+inline sqInt min(sqInt i, sqInt j) { return (i < j) ? i : j; }
+inline sqInt max(sqInt i, sqInt j) { return (i > j) ? i : j; }
+
 // Apple error codes are really (rather contrived) 4-byte chars with
 // (almost) meaningful content.
 //
@@ -127,14 +127,14 @@
  char *str4(UInt32 chars)
 {
   static char str[5];
-  *(int *)&str= chars;
+  *(sqInt *)&str= chars;
   str[4]= '\0';
   return str;
 }
 
-int checkError(OSStatus err, char *op, char *param);
+sqInt checkError(OSStatus err, char *op, char *param);
 
- inline int checkError(OSStatus err, char *op, char *param)
+ inline sqInt checkError(OSStatus err, char *op, char *param)
 {
   if (kAudioHardwareNoError != noErr)
     {
@@ -153,18 +153,18 @@
 typedef struct
 {
   char *data;
-  int   size; // capacity
-  int   avail; // available data (not available space)
-  int   iptr; // next position to write
-  int   optr; // next position to read
+  sqInt   size; // capacity
+  sqInt   avail; // available data (not available space)
+  sqInt   iptr; // next position to write
+  sqInt   optr; // next position to read
 } Buffer;
 
 
 // allocate a new, empty buffer
 //
-Buffer *Buffer_new(int size);
+Buffer *Buffer_new(sqInt size);
 
-Buffer *Buffer_new(int size)
+Buffer *Buffer_new(sqInt size)
 {
   Buffer *b= (Buffer *)malloc(sizeof(Buffer));
   if (!b)
@@ -195,18 +195,18 @@
 
 // answer how many bytes are available for reading
 //
-inline int Buffer_avail(Buffer *b);
+inline sqInt Buffer_avail(Buffer *b);
 
-inline int Buffer_avail(Buffer *b)
+inline sqInt Buffer_avail(Buffer *b)
 {
   return b->avail;
 }
 
 // answer how many bytes can be written
 //
-inline int Buffer_free(Buffer *b);
+inline sqInt Buffer_free(Buffer *b);
 
-inline int Buffer_free(Buffer *b)
+inline sqInt Buffer_free(Buffer *b)
 {
   return b->size - Buffer_avail(b);
 }
@@ -214,13 +214,13 @@
 // set outputs to address and size of zero (empty), one (contiguous) or two
 // (wrapped, fragmented) populated regions in the buffer
 //
-inline int Buffer_getOutputPointers(Buffer *b, char **p1, int *n1, char **p2, int *n2);
+inline sqInt Buffer_getOutputPointers(Buffer *b, char **p1, sqInt *n1, char **p2, sqInt *n2);
 
-inline int Buffer_getOutputPointers(Buffer *b, char **p1, int *n1, char **p2, int *n2)
+inline sqInt Buffer_getOutputPointers(Buffer *b, char **p1, sqInt *n1, char **p2, sqInt *n2)
 {
-  int optr=     b->optr;
-  int avail=    Buffer_avail(b);
-  int headroom= b->size - optr;
+  sqInt optr=     b->optr;
+  sqInt avail=    Buffer_avail(b);
+  sqInt headroom= b->size - optr;
   if (avail == 0)
     {
       *p1= *p2= 0;
@@ -244,13 +244,13 @@
 // set the output to the current read position and answer the amount of
 // data at that location
 //
-inline int Buffer_getOutputPointer(Buffer *b, char **ptr);
+inline sqInt Buffer_getOutputPointer(Buffer *b, char **ptr);
 
-inline int Buffer_getOutputPointer(Buffer *b, char **ptr)
+inline sqInt Buffer_getOutputPointer(Buffer *b, char **ptr)
 {
-  int optr=     b->optr;
-  int avail=    Buffer_avail(b);
-  int headroom= b->size - optr;
+  sqInt optr=     b->optr;
+  sqInt avail=    Buffer_avail(b);
+  sqInt headroom= b->size - optr;
   if (headroom < avail) avail= headroom;
   assert((optr + avail) <= b->size);
   *ptr= b->data + optr;
@@ -260,13 +260,13 @@
 // set the output to the current write location and answer the number of
 // bytes that can be written to that location
 //
-inline int Buffer_getInputPointer(Buffer *b, char **ptr);
+inline sqInt Buffer_getInputPointer(Buffer *b, char **ptr);
 
-inline int Buffer_getInputPointer(Buffer *b, char **ptr)
+inline sqInt Buffer_getInputPointer(Buffer *b, char **ptr)
 {
-  int iptr=     b->iptr;
-  int nfree=    Buffer_free(b);
-  int headroom= b->size - iptr;
+  sqInt iptr=     b->iptr;
+  sqInt nfree=    Buffer_free(b);
+  sqInt headroom= b->size - iptr;
   if (headroom < nfree) nfree= headroom;
   assert((iptr + nfree) <= b->size);
   *ptr= b->data + iptr;
@@ -275,12 +275,12 @@
 
 // increment the output pointer over a contiguous section of buffer
 //
-inline void Buffer_advanceOutputPointer(Buffer *b, int size);
+inline void Buffer_advanceOutputPointer(Buffer *b, sqInt size);
 
-inline void Buffer_advanceOutputPointer(Buffer *b, int size)
+inline void Buffer_advanceOutputPointer(Buffer *b, sqInt size)
 {
-  int optr=  b->optr;
-  int avail= b->avail;
+  sqInt optr=  b->optr;
+  sqInt avail= b->avail;
   optr+=  size;
   avail-= size;
   assert(optr <= b->size);
@@ -292,12 +292,12 @@
 
 // advance the input pointer over a contiguous section of buffer
 //
-inline void Buffer_advanceInputPointer(Buffer *b, int size);
+inline void Buffer_advanceInputPointer(Buffer *b, sqInt size);
 
-inline void Buffer_advanceInputPointer(Buffer *b, int size)
+inline void Buffer_advanceInputPointer(Buffer *b, sqInt size)
 {
-  int iptr= b->iptr;
-  int nfree= Buffer_free(b);
+  sqInt iptr= b->iptr;
+  sqInt nfree= Buffer_free(b);
   nfree -= size;
   assert(nfree >= 0);
   iptr += size;
@@ -310,12 +310,12 @@
 // clear the given number of bytes at the input position and advance the
 // input pointer past them
 //
-inline void Buffer_prefill(Buffer *b, int bytes);
+inline void Buffer_prefill(Buffer *b, sqInt bytes);
 
-inline void Buffer_prefill(Buffer *b, int bytes)
+inline void Buffer_prefill(Buffer *b, sqInt bytes)
 {
   char *ptr;
-  int   size= Buffer_getInputPointer(b, &ptr);
+  sqInt   size= Buffer_getInputPointer(b, &ptr);
   assert(bytes <= size);
   memset(ptr, 0, size);
   Buffer_advanceInputPointer(b, bytes);
@@ -324,14 +324,14 @@
 // write at most nbytes from buf into the buffer, wrapping in the middle if
 // necessary.  answer the actual number of bytes written.
 //
-inline int Buffer_write(Buffer *b, char *buf, int nbytes);
+inline sqInt Buffer_write(Buffer *b, char *buf, sqInt nbytes);
 
-inline int Buffer_write(Buffer *b, char *buf, int nbytes)
+inline sqInt Buffer_write(Buffer *b, char *buf, sqInt nbytes)
 {
-  int iptr= b->iptr;
-  int bytesToCopy= min(nbytes, Buffer_free(b));
-  int headroom= b->size - iptr;
-  int bytesCopied= 0;
+  sqInt iptr= b->iptr;
+  sqInt bytesToCopy= min(nbytes, Buffer_free(b));
+  sqInt headroom= b->size - iptr;
+  sqInt bytesCopied= 0;
 
   if (bytesToCopy >= headroom)
     {
@@ -352,14 +352,14 @@
   return bytesCopied;
 }
 
-inline int Buffer_writeRecheck(Buffer *b, char *buf, int nbytes);
+inline sqInt Buffer_writeRecheck(Buffer *b, char *buf, sqInt nbytes);
 
-inline int Buffer_writeRecheck(Buffer *b, char *buf, int nbytes)
+inline sqInt Buffer_writeRecheck(Buffer *b, char *buf, sqInt nbytes)
 {
-  int iptr= b->iptr;
-  int bytesToCopy= min(nbytes, Buffer_free(b));
-  int headroom= b->size - iptr;
-  int bytesCopied= 0;
+  sqInt iptr= b->iptr;
+  sqInt bytesToCopy= min(nbytes, Buffer_free(b));
+  sqInt headroom= b->size - iptr;
+  sqInt bytesCopied= 0;
 
   if (b->data == NULL || buf == NULL)
  return 0;
@@ -386,14 +386,14 @@
 // read at most nbytes from the buffer into buf, wrapping in the middle if
 // necessary.  answer the actual number of bytes read.
 //
-inline int Buffer_read(Buffer *b, char *buf, int nbytes);
+inline sqInt Buffer_read(Buffer *b, char *buf, sqInt nbytes);
 
-inline int Buffer_read(Buffer *b, char *buf, int nbytes)
+inline sqInt Buffer_read(Buffer *b, char *buf, sqInt nbytes)
 {
-  int optr= b->optr;
-  int bytesToCopy= min(nbytes, Buffer_avail(b));
-  int headroom= b->size - optr;
-  int bytesCopied= 0;
+  sqInt optr= b->optr;
+  sqInt bytesToCopy= min(nbytes, Buffer_avail(b));
+  sqInt headroom= b->size - optr;
+  sqInt bytesCopied= 0;
 
   if (bytesToCopy >= headroom)
     {
@@ -428,15 +428,15 @@
 typedef struct Stream
 {
   AudioDeviceID id; // associated with this stream
-  int direction; // 1nput/0utput
-  int sampleRate; // Squeak frames per second
-  int channels; // channels per Squeak frame
-  int devBufSize; // bytes per device buffer
-  int imgBufSize; // bytes per Squeak buffer
-  int cvtBufSize; // bytes per converter buffer
+  sqInt direction; // 1nput/0utput
+  sqInt sampleRate; // Squeak frames per second
+  sqInt channels; // channels per Squeak frame
+  sqInt devBufSize; // bytes per device buffer
+  sqInt imgBufSize; // bytes per Squeak buffer
+  sqInt cvtBufSize; // bytes per converter buffer
   Buffer *buffer; // fifo
   AudioConverterRef converter; // frame format converter
-  int semaphore; // ping me!
+  sqInt semaphore; // ping me!
   u_int64_t timestamp; // nominal buffer tail time (uSecs)
 } Stream;
 
@@ -447,8 +447,8 @@
 
 // tell the SoundPlayer that output can be written.
 //
- void ioProcSignal(int semaphore);
-  void ioProcSignal(int semaphore)
+ void ioProcSignal(sqInt semaphore);
+  void ioProcSignal(sqInt semaphore)
 {
   if (semaphore)
     signalSemaphoreWithIndex(semaphore);
@@ -463,7 +463,7 @@
   Stream *s= (Stream *)context;
   Buffer *b= s->buffer;
   char *p1, *p2;
-  int   n1,  n2;
+  sqInt   n1,  n2;
   Buffer_getOutputPointers(b, &p1, &n1, &p2, &n2);
   if (!n1)
     {
@@ -539,7 +539,7 @@
 
   Stream *s= (Stream *)context;
   Buffer *b= s->buffer;
-  int     n= Buffer_free(b);
+  sqInt     n= Buffer_free(b);
   if ((UInt32) n >= inputData->mBuffers[0].mDataByteSize)
     Buffer_writeRecheck(b, inputData->mBuffers[0].mData, inputData->mBuffers[0].mDataByteSize);
   if (Buffer_avail(b) >= s->imgBufSize)
@@ -548,8 +548,8 @@
 }
 
 
- int getDefaultDevice(AudioDeviceID *id, int direction);
-int getDefaultDevice(AudioDeviceID *id, int direction)
+ sqInt getDefaultDevice(AudioDeviceID *id, sqInt direction);
+sqInt getDefaultDevice(AudioDeviceID *id, sqInt direction)
 {
   UInt32 sz= sizeof(*id);
   return (!checkError(AudioHardwareGetProperty((direction
@@ -562,8 +562,8 @@
 
 // allocate and a Stream and associate it with a suitable device.
 //
- Stream *Stream_new(int dir);
-Stream *Stream_new(int dir)
+ Stream *Stream_new(sqInt dir);
+Stream *Stream_new(sqInt dir)
 {
   AudioDeviceID id= 0;
   Stream       *s=  0;
@@ -599,10 +599,10 @@
 // setup conversion from Squeak to device frame format, or vice-versa.
 // requires: stereo for output, stereo or mono for input.
 //
- int Stream_setFormat(Stream *s, int frameCount, int sampleRate, int stereo);
-int Stream_setFormat(Stream *s, int frameCount, int sampleRate, int stereo)
+ sqInt Stream_setFormat(Stream *s, sqInt frameCount, sqInt sampleRate, sqInt stereo);
+sqInt Stream_setFormat(Stream *s, sqInt frameCount, sqInt sampleRate, sqInt stereo)
 {
-  int nChannels= 1 + stereo;
+  sqInt nChannels= 1 + stereo;
   AudioStreamBasicDescription imgFmt, devFmt;
   UInt32 sz= sizeof(devFmt);
 
@@ -660,8 +660,8 @@
 
 // start the device attached to the stream.
 //
- int Stream_startSema(Stream *s, int semaIndex);
-  int Stream_startSema(Stream *s, int semaIndex)
+ sqInt Stream_startSema(Stream *s, sqInt semaIndex);
+  sqInt Stream_startSema(Stream *s, sqInt semaIndex)
 {
   AudioDeviceIOProc ioProc= s->direction ? ioProcInput : ioProcOutput;
 
@@ -684,8 +684,8 @@
 
 // stop the device attached to a stream.
 //
- int Stream_stop(Stream *s);
-int Stream_stop(Stream *s)
+ sqInt Stream_stop(Stream *s);
+sqInt Stream_stop(Stream *s)
 {
   AudioDeviceIOProc ioProc= s->direction ? ioProcInput : ioProcOutput;
   checkError(AudioDeviceStop(s->id, ioProc),
@@ -701,9 +701,9 @@
 /// sound output primitives
 ///
 
- int sound_AvailableSpace(void);
+ sqInt sound_AvailableSpace(void);
 
- int sound_AvailableSpace(void)
+ sqInt sound_AvailableSpace(void)
 {
   if (output)
     return Buffer_free(output->buffer);
@@ -714,15 +714,15 @@
 
 // mix nFrames of samples into an output buffer.
 //
- void mixFrames(short *out, short *in, int nFrames);
+ void mixFrames(short *out, short *in, sqInt nFrames);
 
- void mixFrames(short *out, short *in, int nFrames)
+ void mixFrames(short *out, short *in, sqInt nFrames)
 {
   while (nFrames--)
     {
-      int sample;
-      sample= (int)*out + (int)*in++;  *out++= (short)max(-32768, min(32767, sample));
-      sample= (int)*out + (int)*in++;  *out++= (short)max(-32768, min(32767, sample));
+      sqInt sample;
+      sample= (sqInt)*out + (sqInt)*in++;  *out++= (short)max(-32768, min(32767, sample));
+      sample= (sqInt)*out + (sqInt)*in++;  *out++= (short)max(-32768, min(32767, sample));
     }
 }
 
@@ -737,10 +737,10 @@
 // Note: this is only used when the "sound quick start" preference is
 // enabled in the image.
 //
- int sound_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr,
-  int framesOfLeadTime);
- int sound_InsertSamplesFromLeadTime(int frameCount, int srcBufPtr,
-  int framesOfLeadTime)
+ sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, usqInt* srcBufPtr,
+  sqInt framesOfLeadTime);
+ sqInt sound_InsertSamplesFromLeadTime(sqInt frameCount, usqInt* srcBufPtr,
+  sqInt framesOfLeadTime)
 {
 #pragma unused(framesOfLeadTime)
   Stream *s= output;
@@ -757,9 +757,9 @@
       // middle?
 
       char *frontData=   0, *backData=   0;
-      int   frontFrames= 0,  backFrames= 0;
-      int   framesDone=  0;
-      int   leadBytes;
+      sqInt   frontFrames= 0,  backFrames= 0;
+      sqInt   framesDone=  0;
+      sqInt   leadBytes;
 
 #    if (OBEY_LEAD_TIME)
       {
@@ -781,8 +781,8 @@
 #    endif
 
       {
- int   availBytes;
- int   byteCount= frameCount * SqueakFrameSize;
+ sqInt   availBytes;
+ sqInt   byteCount= frameCount * SqueakFrameSize;
  Buffer_getOutputPointers(s->buffer,
  &frontData, &frontFrames, // bytes!
  &backData,  &backFrames); // bytes!
@@ -828,12 +828,12 @@
 // play (exactly) frameCount of samples (and no less, since the result is
 // ignored).
 //
- int sound_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int startIndex);
-  int sound_PlaySamplesFromAtLength(int frameCount, int arrayIndex, int startIndex)
+ sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, usqInt* arrayIndex, sqInt startIndex);
+  sqInt sound_PlaySamplesFromAtLength(sqInt frameCount, usqInt* arrayIndex, sqInt startIndex)
 {
   if (output)
     {
-      int byteCount= frameCount * SqueakFrameSize;
+      sqInt byteCount= frameCount * SqueakFrameSize;
       if (Buffer_free(output->buffer) >= byteCount)
  {
   Buffer_write(output->buffer,
@@ -850,8 +850,8 @@
 
 // play a buffer's worth of silence (as quietly as possible).
 //
- int sound_PlaySilence(void);
- int sound_PlaySilence(void)
+ sqInt sound_PlaySilence(void);
+ sqInt sound_PlaySilence(void)
 {
   success(false);
   return 8192;
@@ -860,8 +860,8 @@
 
 // shut down sound output.
 //
- int sound_Stop(void);
- int sound_Stop(void)
+ sqInt sound_Stop(void);
+ sqInt sound_Stop(void)
 {
   dprintf("snd_Stop\n");
   
@@ -877,8 +877,8 @@
 
 // start up sound output.
 //
- int sound_Start(int frameCount, int samplesPerSec, int stereo, int semaIndex);
- int sound_Start(int frameCount, int samplesPerSec, int stereo, int semaIndex)
+ sqInt sound_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex);
+ sqInt sound_Start(sqInt frameCount, sqInt samplesPerSec, sqInt stereo, sqInt semaIndex)
 {
   Stream *s= 0;
 
@@ -921,8 +921,8 @@
 }
 
 
- int sound_StopRecording(void);
-  int sound_StopRecording(void)
+ sqInt sound_StopRecording(void);
+  sqInt sound_StopRecording(void)
 {
   dprintf("snd_StopRecording\n");
 
@@ -938,8 +938,8 @@
 
 // start up sound input.
 //
- int sound_StartRecording(int samplesPerSec, int stereo, int semaIndex);
- int sound_StartRecording(int samplesPerSec, int stereo, int semaIndex)
+ sqInt sound_StartRecording(sqInt samplesPerSec, sqInt stereo, sqInt semaIndex);
+ sqInt sound_StartRecording(sqInt samplesPerSec, sqInt stereo, sqInt semaIndex)
 {
   Stream *s= 0;
 
@@ -952,7 +952,7 @@
   if ((s= Stream_new(1))) // 1nput
     {
       // approximate the frameCount that output uses for the same sample rate
-      int frameCount= 5288 * samplesPerSec / 44100;
+      sqInt frameCount= 5288 * samplesPerSec / 44100;
       if ((  Stream_setFormat(s, frameCount, samplesPerSec, stereo))
   && Stream_startSema(s, semaIndex))
  {
@@ -965,14 +965,14 @@
 }
 
 
- int sound_RecordSamplesIntoAtLength(int buf, int startSliceIndex, int bufferSizeInBytes);
- int sound_RecordSamplesIntoAtLength(int buf, int startSliceIndex, int bufferSizeInBytes)
+ sqInt sound_RecordSamplesIntoAtLength(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes);
+ sqInt sound_RecordSamplesIntoAtLength(sqInt buf, sqInt startSliceIndex, sqInt bufferSizeInBytes)
 {
   if (input)
     {
       if (Buffer_avail(input->buffer) >= (512 * DeviceFrameSize))
  {
-  int    start= startSliceIndex * SqueakFrameSize / 2;
+  sqInt    start= startSliceIndex * SqueakFrameSize / 2;
   UInt32 count= min(input->cvtBufSize, bufferSizeInBytes - start);
   if (kAudioHardwareNoError == AudioConverterFillBuffer(input->converter, bufferDataProc, input,
  &count, (char *)buf + start))
@@ -990,8 +990,8 @@
 ///
 
 
- int getVolume(int dir, double *left, double *right);
- int getVolume(int dir, double *left, double *right)
+ sqInt getVolume(sqInt dir, double *left, double *right);
+ sqInt getVolume(sqInt dir, double *left, double *right)
 {
   UInt32 sz;
   AudioDeviceID id;
@@ -1020,8 +1020,8 @@
 }
 
 
- int setVolume(int dir, double dleft, double dright);
- int setVolume(int dir, double dleft, double dright)
+ sqInt setVolume(sqInt dir, double dleft, double dright);
+ sqInt setVolume(sqInt dir, double dleft, double dright)
 {
   Float32 left=  (Float32)dleft;
   Float32 right= (Float32)dright;
@@ -1063,7 +1063,7 @@
  void sound_SetVolume(double left, double right);
  void sound_SetVolume(double left, double right)
 {
-  extern int noSoundMixer; //xxx FIXME: this should not be a global option
+  extern sqInt noSoundMixer; //xxx FIXME: this should not be a global option
 
   if (noSoundMixer)
     return;
@@ -1074,10 +1074,10 @@
 
 // set recording gain, 0 <= level <= 1000
 //
- int sound_SetRecordLevel(int level);
- int sound_SetRecordLevel(int level)
+ sqInt sound_SetRecordLevel(sqInt level);
+ sqInt sound_SetRecordLevel(sqInt level)
 {
-  extern int noSoundMixer;
+  extern sqInt noSoundMixer;
 
   if (noSoundMixer)
     return 0;
@@ -1105,8 +1105,8 @@
   else printf(" little-endian");
 
   if  (flags & kAudioFormatFlagIsFloat) printf(" float");
-  else if (flags & kAudioFormatFlagIsSignedInteger) printf(" signed-int");
-  else printf(" unsigned-int");
+  else if (flags & kAudioFormatFlagIsSignedInteger) printf(" signed-sqInt");
+  else printf(" unsigned-sqInt");
 
   if  (flags & kAudioFormatFlagIsPacked) printf(" packed");
   else if (flags & kAudioFormatFlagIsAlignedHigh) printf(" aligned-high");
@@ -1151,14 +1151,14 @@
 # include "SqModule.h"
 
   void  sound_parseEnvironment(void);
-   int   sound_parseArgument(int argc, char **argv);
+   sqInt   sound_parseArgument(sqInt argc, char **argv);
    void  sound_printUsage(void);
    void  sound_printUsageNotes(void);
    void *sound_makeInterface(void);
    void *np_sound_makeInterface(void);
 
  void  sound_parseEnvironment(void) {}
-   int   sound_parseArgument(int argc, char **argv) {
+   sqInt   sound_parseArgument(sqInt argc, char **argv) {
  #pragma unused(argc,argv)
  return 0; }
    void  sound_printUsage(void) {}
@@ -1177,9 +1177,9 @@
 # define FRAMES 5288 * RATE / 44100 // nominal buffer size requested by Squeak
 # define FREQ 440.0 // tuning fork required to verify this ;)
 
- short sound[(int)(FRAMES * 2)];
+ short sound[(sqInt)(FRAMES * 2)];
 
- void warble(int n)
+ void warble(sqInt n)
 {
    double phase = 0.0;
    double amp   = 0.5;
@@ -1196,16 +1196,16 @@
     }
 }
 
-int main()
+sqInt main()
 {
   sound_Start(FRAMES, RATE, 1, 3);
   for (;;)
     {
-      int n= min(sizeof(sound), sound_AvailableSpace()) / 4;
+      sqInt n= min(sizeof(sound), sound_AvailableSpace()) / 4;
       if (n)
  {
   warble(n);
-  sound_PlaySamplesFromAtLength(n, (int)sound, 0);
+  sound_PlaySamplesFromAtLength(n, (sqInt)sound, 0);
 #        if (DEBUG)
   putchar('.');  fflush(stdout);
 #        endif

Modified: trunk/platforms/Mac OS/plugins/UUIDPlugin/sqMacUUID.c
===================================================================
--- trunk/platforms/Mac OS/plugins/UUIDPlugin/sqMacUUID.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Mac OS/plugins/UUIDPlugin/sqMacUUID.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -12,8 +12,8 @@
 *
 */
 
+#include "sq.h"
 #include "UUIDPlugin.h"
-#include "sq.h"
 
 extern struct VirtualMachine *interpreterProxy;
 

Modified: trunk/platforms/Mac OS/vm/sqMacMain.c
===================================================================
--- trunk/platforms/Mac OS/vm/sqMacMain.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Mac OS/vm/sqMacMain.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -404,7 +404,8 @@
  /* vm build string */
 
     if (id == 1006) {
- return "Mac Carbon 4.2.3b1 13-Mar-10 >551DCCD5-0515-4A91-9316-73DCCB7E7C66<";
+ return "Mac Carbon 4.2.4b1 28-Mar-10 >45CAAEAC-5A1E-4327-9702-7973E3473FDE<";
+// return "Mac Carbon 4.2.3b1 13-Mar-10 >551DCCD5-0515-4A91-9316-73DCCB7E7C66<";
 // return "Mac Carbon 4.2.2b1 17-Sep-09 >6F0202CF-180C-420A-9CE8-411B696D3467<";
 // return "Mac Carbon 4.2.1b1 19-Aug-09 >4897EDBA-66BA-413A-9117-AC98701639F8<";
 // return "Mac Carbon 4.1.1b2 7-May-09 >028D94A1-439E-4D2D-9894-AF0DE7F057E8<";

Modified: trunk/platforms/Mac OS/vm/sqMacNSPluginUILogic2.c
===================================================================
--- trunk/platforms/Mac OS/vm/sqMacNSPluginUILogic2.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Mac OS/vm/sqMacNSPluginUILogic2.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -18,9 +18,9 @@
 #include <sys/types.h>
 #include <sys/mman.h>
 
+#include "sq.h"
 #include "sqMacNSPluginUILogic2.h"
 #include "sqMacHostWindow.h"
-#include "sq.h"
 #include "sqaio.h"
 #include "sqVirtualMachine.h"
 #include "sqUnixCharConv.h"

Modified: trunk/platforms/Mac OS/vm/sqMacTime.c
===================================================================
--- trunk/platforms/Mac OS/vm/sqMacTime.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Mac OS/vm/sqMacTime.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -95,6 +95,18 @@
   return (now.tv_usec / 1000 + now.tv_sec * 1000);
 }
 
+sqInt ioUtcWithOffset(sqLong *microSeconds, int *offset)
+{
+ struct timeval timeval;
+ if (gettimeofday(&timeval, NULL) == -1) return -1;
+ long long seconds = timeval.tv_sec;
+ suseconds_t usec = timeval.tv_usec;
+ *microSeconds = seconds * 1000000 + usec;
+ *offset = localtime(&seconds)->tm_gmtoff;
+ return 0;
+}
+
+
 int ioSeconds(void) {
     time_t unixTime;
     

Modified: trunk/platforms/Mac OS/vm/sqMacWindowUniversal.c
===================================================================
--- trunk/platforms/Mac OS/vm/sqMacWindowUniversal.c 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Mac OS/vm/sqMacWindowUniversal.c 2010-03-29 01:16:36 UTC (rev 2158)
@@ -337,7 +337,7 @@
  int affectedL, int affectedR, int affectedT, int affectedB) {
 
  if (gSqueakHeadless && !browserActiveAndDrawingContextOk()) return 1;
- ioShowDisplayOnWindow( (unsigned int*)  dispBitsIndex,  width,  height,  depth, affectedL,  affectedR,  affectedT,  affectedB, 1);
+ ioShowDisplayOnWindow( (unsigned char*)  dispBitsIndex,  width,  height,  depth, affectedL,  affectedR,  affectedT,  affectedB, 1);
  return 1;
 }
 
@@ -359,7 +359,7 @@
  int affectedL, int affectedR, int affectedT, int affectedB, int windowIndex, int *pitch);
 
 int ioShowDisplayOnWindow(
- unsigned int*  dispBitsIndex, int width, int height, int depth,
+ unsigned char*  dispBitsIndex, int width, int height, int depth,
  int affectedL, int affectedR, int affectedT, int affectedB, int windowIndex) {
 
  static CGColorSpaceRef colorspace = NULL;

Modified: trunk/platforms/Mac OS/vm/sqPlatformSpecific.h
===================================================================
--- trunk/platforms/Mac OS/vm/sqPlatformSpecific.h 2010-03-28 20:40:29 UTC (rev 2157)
+++ trunk/platforms/Mac OS/vm/sqPlatformSpecific.h 2010-03-29 01:16:36 UTC (rev 2158)
@@ -97,6 +97,9 @@
 #undef ioMicroMSecs
 #undef ioMSecs
 #define ioMSecs ioMicroMSecs
+#undef ioMicroSecondClock
+#define ioMicroSecondClock ioMicroSeconds
+#define ioUtcWithOffset(clock, offset) setMicroSecondsandOffset(clock, offset)
 
 /* macro to return from interpret() loop in browser plugin VM */
 #define ReturnFromInterpret() return