Skip to content

Commit

Permalink
CogVM source as per VMMaker.oscog-eem.3456.
Browse files Browse the repository at this point in the history
Commit plugins missed in the first commit.
  • Loading branch information
eliotmiranda committed Sep 27, 2024
1 parent c3fe9f4 commit bcac77a
Show file tree
Hide file tree
Showing 26 changed files with 2,544 additions and 2,293 deletions.
309 changes: 174 additions & 135 deletions src/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c

Large diffs are not rendered by default.

28 changes: 13 additions & 15 deletions src/plugins/AioPlugin/AioPlugin.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Automatically generated by
VMPluginCodeGenerator VMMaker.oscog-eem.3455 uuid: 3fb5350e-7e08-4a76-8b1b-7755e8e0811f
VMPluginCodeGenerator VMMaker.oscog-eem.3456 uuid: e316760f-1758-4b6b-aa08-f84bc7c44ef3
from
UnixAioPlugin VMConstruction-Plugins-AioPlugin.oscog-eem.26 uuid: 9d32c4ef-9646-4ce2-b069-44fe86a2dbfb
*/
Expand Down Expand Up @@ -70,7 +70,7 @@ static sqInt (*failed)(void);
static sqInt (*getThisSessionID)(void);
static sqInt (*isBytes)(sqInt oop);
static sqInt (*methodReturnInteger)(sqInt integer);
static sqInt (*methodReturnString)(char *aCString);
static sqInt (*methodReturnString)(const char *aCString);
static sqInt (*primitiveFail)(void);
static sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex);
static sqInt (*stackIntegerValue)(sqInt offset);
Expand All @@ -83,7 +83,7 @@ extern sqInt failed(void);
extern sqInt getThisSessionID(void);
extern sqInt isBytes(sqInt oop);
extern sqInt methodReturnInteger(sqInt integer);
extern sqInt methodReturnString(char *aCString);
extern sqInt methodReturnString(const char *aCString);
extern sqInt primitiveFail(void);
extern sqInt signalSemaphoreWithIndex(sqInt semaIndex);
extern sqInt stackIntegerValue(sqInt offset);
Expand Down Expand Up @@ -132,7 +132,7 @@ aioForwardwithDataandFlags(int fd, void *data, int flags)
static int
fileDescriptorFrom(sqInt aSQFileByteArray)
{
if (!( /* begin isSQFileObject: */
if (!(/* isSQFileObject: */
(((isBytes(aSQFileByteArray))
&& ((byteSizeOf(aSQFileByteArray)) == (sizeof(SQFile))))
&& ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(aSQFileByteArray)))))
Expand Down Expand Up @@ -182,7 +182,7 @@ isNonNullSQFile(sqInt objectPointer)
sqFileBytes = arrayValueOf(objectPointer);
idx = 0;
while (idx < (sizeof(SQFile))) {
if ((sqFileBytes[idx]) != 0) {
if (sqFileBytes[idx]) {
return 1;
}
idx += 1;
Expand All @@ -203,7 +203,7 @@ isNullSQSocket(sqInt objectPointer)
sqSocketBytes = arrayValueOf(objectPointer);
idx = 0;
while (idx < (sizeof(SQSocket))) {
if ((sqSocketBytes[idx]) != 0) {
if (sqSocketBytes[idx]) {
return 0;
}
idx += 1;
Expand Down Expand Up @@ -261,8 +261,8 @@ primitiveAioEnable(void)
}
eventSemaphoreIndices[semaIndex] = semaIndex;
flags = (externalNotification
? AIO_EXT
: 0);
? AIO_EXT
: 0);
aioEnable(fd, (&(eventSemaphoreIndices[semaIndex])), flags);
methodReturnInteger(semaIndex);
return 0;
Expand Down Expand Up @@ -383,7 +383,7 @@ primitiveOSFileHandle(void)
sqInt sqFileOop;

sqFileOop = stackValue(0);
if (!( /* begin isSQFileObject: */
if (!(/* isSQFileObject: */
(((isBytes(sqFileOop))
&& ((byteSizeOf(sqFileOop)) == (sizeof(SQFile))))
&& ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(sqFileOop)))))
Expand All @@ -407,7 +407,7 @@ primitiveOSSocketHandle(void)
sqInt sqSocketOop;

sqSocketOop = stackValue(0);
if (!(( /* begin isSQSocketObject: */
if (!((/* isSQSocketObject: */
((isBytes(sqSocketOop))
&& ((byteSizeOf(sqSocketOop)) == (sizeof(SQSocket))))
&& (!(isNullSQSocket(sqSocketOop))))
Expand Down Expand Up @@ -438,12 +438,11 @@ setInterpreter(struct VirtualMachine *anInterpreter)
{
sqInt ok;


/* This may seem tautological, but in a real plugin it checks that the VM provides
the version the plugin was compiled against which is the version the plugin expects. */
interpreterProxy = anInterpreter;
ok = ((interpreterProxy->majorVersion()) == (VM_PROXY_MAJOR))
&& ((interpreterProxy->minorVersion()) >= (VM_PROXY_MINOR));
&& ((interpreterProxy->minorVersion()) >= (VM_PROXY_MINOR));
if (ok) {

#if !defined(SQUEAK_BUILTIN_PLUGIN)
Expand Down Expand Up @@ -484,11 +483,10 @@ socketDescriptorFrom(sqInt sqSocketOop)
void *privateSocketStruct;
SQSocket *sqSocket;


/* begin socketValueOf: */
sqSocket = arrayValueOf(sqSocketOop);
privateSocketStruct = sqSocket->privateSocketPtr;
if (privateSocketStruct == 0) {
if (!privateSocketStruct) {
return -1;
}
return * (int *) privateSocketStruct;
Expand All @@ -513,8 +511,8 @@ versionString(void)
return version;
}


/*** Exports ***/

#ifdef SQUEAK_BUILTIN_PLUGIN

static char _m[] = "AioPlugin";
Expand Down
Loading

0 comments on commit bcac77a

Please sign in to comment.