[Vm-dev] [commit][3241] CogVM source as per VMMaker.oscog-eem.1032

commits at squeakvm.org commits at squeakvm.org
Sat Jan 31 01:17:32 UTC 2015


Revision: 3241
Author:   eliot
Date:     2015-01-30 17:17:30 -0800 (Fri, 30 Jan 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1032

Eliminate some warnings in the B3DAcceleratorPlugin

Fix 64-bit warnings in AsynchFilePlugin and in
#Array parameters in the SmartSyntaxInterpreterPlugins.

Fix a warning in the Alien plgins.

Modified Paths:
--------------
    branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c
    branches/Cog/src/plugins/AsynchFilePlugin/AsynchFilePlugin.c
    branches/Cog/src/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.c
    branches/Cog/src/plugins/IA32ABI/IA32ABI.c
    branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c

Property Changed:
----------------
    branches/Cog/platforms/Cross/vm/sqSCCSVersion.h

Modified: branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c
===================================================================
--- branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c	2015-01-30 19:16:19 UTC (rev 3240)
+++ branches/Cog/nscogsrc/plugins/IA32ABI/IA32ABI.c	2015-01-31 01:17:30 UTC (rev 3241)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	VMPluginCodeGenerator VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
    from
-	NewsqueakIA32ABIPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	NewsqueakIA32ABIPlugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
  */
-static char __buildInfo[] = "NewsqueakIA32ABIPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d " __DATE__ ;
+static char __buildInfo[] = "NewsqueakIA32ABIPlugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549 " __DATE__ ;
 
 
 
@@ -223,9 +223,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"IA32ABI VMMaker.oscog-eem.983 (i)"
+	"IA32ABI VMMaker.oscog-eem.1032 (i)"
 #else
-	"IA32ABI VMMaker.oscog-eem.983 (e)"
+	"IA32ABI VMMaker.oscog-eem.1032 (e)"
 #endif
 ;
 
@@ -885,8 +885,8 @@
 
 	
 	methodReturnValue((BytesPerWord == 8
-		? positive64BitIntegerFor((&inIOProcessEvents))
-		: positive32BitIntegerFor((&inIOProcessEvents))));
+		? positive64BitIntegerFor(((usqInt)((&inIOProcessEvents))))
+		: positive32BitIntegerFor(((usqInt)((&inIOProcessEvents))))));
 }
 
 


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Fri Jan 30 11:16:38 PST 2015
   + Fri Jan 30 17:17:40 PST 2015

Modified: branches/Cog/src/plugins/AsynchFilePlugin/AsynchFilePlugin.c
===================================================================
--- branches/Cog/src/plugins/AsynchFilePlugin/AsynchFilePlugin.c	2015-01-30 19:16:19 UTC (rev 3240)
+++ branches/Cog/src/plugins/AsynchFilePlugin/AsynchFilePlugin.c	2015-01-31 01:17:30 UTC (rev 3241)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
    from
-	AsynchFilePlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	AsynchFilePlugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
  */
-static char __buildInfo[] = "AsynchFilePlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d " __DATE__ ;
+static char __buildInfo[] = "AsynchFilePlugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549 " __DATE__ ;
 
 
 
@@ -102,9 +102,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"AsynchFilePlugin VMMaker.oscog-eem.983 (i)"
+	"AsynchFilePlugin VMMaker.oscog-eem.1032 (i)"
 #else
-	"AsynchFilePlugin VMMaker.oscog-eem.983 (e)"
+	"AsynchFilePlugin VMMaker.oscog-eem.1032 (e)"
 #endif
 ;
 static void * sCOAFfn;
@@ -182,6 +182,9 @@
 	primitiveFailFor(PrimErrBadArgument);
 	f = null;
 l1:	/* end asyncFileValueOf: */;
+	if (failed()) {
+		return null;
+	}
 	asyncFileClose(f);
 	if (failed()) {
 		return null;
@@ -287,13 +290,11 @@
 	}
 	success((startIndex >= 1)
 	 && (((startIndex + count) - 1) <= bufferSize));
-
-	/* adjust for zero-origin indexing */
-
+	if (failed()) {
+		return null;
+	}
 	bufferPtr = ((((sqInt) (firstIndexableField(buffer)))) + startIndex) - 1;
-	if (!(failed())) {
-		r = asyncFileReadResult(f, bufferPtr, count);
-	}
+	r = asyncFileReadResult(f, ((void *)bufferPtr), count);
 	_return_value = integerObjectOf(r);
 	if (failed()) {
 		return null;
@@ -325,6 +326,9 @@
 	primitiveFailFor(PrimErrBadArgument);
 	f = null;
 l1:	/* end asyncFileValueOf: */;
+	if (failed()) {
+		return null;
+	}
 	asyncFileReadStart(f, fPosition, count);
 	if (failed()) {
 		return null;
@@ -354,7 +358,10 @@
 	primitiveFailFor(PrimErrBadArgument);
 	f = null;
 l1:	/* end asyncFileValueOf: */;
-	r =  asyncFileWriteResult(f);
+	if (failed()) {
+		return null;
+	}
+	r = asyncFileWriteResult(f);
 	_return_value = integerObjectOf(r);
 	if (failed()) {
 		return null;
@@ -394,9 +401,6 @@
 	primitiveFailFor(PrimErrBadArgument);
 	f = null;
 l1:	/* end asyncFileValueOf: */;
-	if (failed()) {
-		return null;
-	}
 	count = num;
 	startIndex = start;
 
@@ -413,13 +417,11 @@
 	}
 	success((startIndex >= 1)
 	 && (((startIndex + count) - 1) <= bufferSize));
-
-	/* adjust for zero-origin indexing */
-
+	if (failed()) {
+		return null;
+	}
 	bufferPtr = ((((sqInt) (firstIndexableField(buffer)))) + startIndex) - 1;
-	if (!(failed())) {
-		asyncFileWriteStart(f, fPosition, bufferPtr, count);
-	}
+	asyncFileWriteStart(f, fPosition, ((void *)bufferPtr), count);
 	if (failed()) {
 		return null;
 	}

Modified: branches/Cog/src/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.c
===================================================================
--- branches/Cog/src/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.c	2015-01-30 19:16:19 UTC (rev 3240)
+++ branches/Cog/src/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.c	2015-01-31 01:17:30 UTC (rev 3241)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	VMPluginCodeGenerator VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
    from
-	B3DAcceleratorPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	B3DAcceleratorPlugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
  */
-static char __buildInfo[] = "B3DAcceleratorPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d " __DATE__ ;
+static char __buildInfo[] = "B3DAcceleratorPlugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549 " __DATE__ ;
 
 
 
@@ -91,7 +91,6 @@
 static void* stackMatrix(sqInt index);
 static void* stackPrimitiveIndexArrayofSizevalidateforVertexSize(sqInt stackIndex, sqInt nItems, sqInt aBool, sqInt maxIndex);
 static void* stackPrimitiveVertexArrayofSize(sqInt index, sqInt nItems);
-static void* stackPrimitiveVertex(sqInt index);
 
 
 /*** Variables ***/
@@ -156,9 +155,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"B3DAcceleratorPlugin VMMaker.oscog-eem.983 (i)"
+	"B3DAcceleratorPlugin VMMaker.oscog-eem.1032 (i)"
 #else
-	"B3DAcceleratorPlugin VMMaker.oscog-eem.983 (e)"
+	"B3DAcceleratorPlugin VMMaker.oscog-eem.1032 (e)"
 #endif
 ;
 
@@ -242,6 +241,7 @@
 loadClientStateverticescolorsnormalstexCoords(sqInt handle, sqInt vertices, sqInt colors, sqInt normals, sqInt texCoords)
 {
     void *colorPtr;
+    sqInt nilOop;
     void *normalPtr;
     sqInt ok;
     sqInt sz;
@@ -249,10 +249,11 @@
     void *vertexPtr;
     sqInt vtxSize;
 
+	colorPtr = (normalPtr = (txPtr = (vertexPtr = null)));
 
 	/* Verify vertex data */
 
-	colorPtr = (normalPtr = (txPtr = (vertexPtr = null)));
+	sz = 0;
 	if (!(isWords(vertices))) {
 		return primitiveFail();
 	}
@@ -260,38 +261,39 @@
 	/* Verify assumptions of color, normal, texCoords data */
 
 	vtxSize = (slotSizeOf(vertices)) / 3;
-	if (!((colors == (nilObject()))
+	nilOop = nilObject();
+	if (!((colors == nilOop)
 		 || ((isWords(colors))
 		 && ((slotSizeOf(colors)) == (vtxSize * 4))))) {
 		return primitiveFail();
 	}
-	if (!((normals == (nilObject()))
+	if (!((normals == nilOop)
 		 || ((isWords(normals))
 		 && ((slotSizeOf(normals)) == (vtxSize * 3))))) {
 		return primitiveFail();
 	}
-	if (!((texCoords == (nilObject()))
+	if (!((texCoords == nilOop)
 		 || (isWords(texCoords)))) {
 		return primitiveFail();
 	}
-	if (!(colors == (nilObject()))) {
+	if (!(colors == nilOop)) {
 		colorPtr = firstIndexableField(colors);
 	}
-	if (!(normals == (nilObject()))) {
+	if (!(normals == nilOop)) {
 		normalPtr = firstIndexableField(normals);
 	}
-	if (!(texCoords == (nilObject()))) {
+	if (!(texCoords == nilOop)) {
 		sz = (slotSizeOf(texCoords)) / vtxSize;
 		txPtr = firstIndexableField(texCoords);
 	}
 	vertexPtr = firstIndexableField(vertices);
-	if (failed()) {
-		return null;
+	if (!(failed())) {
+		ok = b3dLoadClientState(handle, vertexPtr, 3, colorPtr, 4, normalPtr, 3, txPtr, sz);
+		if (!ok) {
+			primitiveFail();
+		}
 	}
-	ok = b3dLoadClientState(handle, vertexPtr, 3, colorPtr, 4, normalPtr, 3, txPtr, sz);
-	if (!ok) {
-		return primitiveFail();
-	}
+	return null;
 }
 
 EXPORT(sqInt)
@@ -560,19 +562,16 @@
 		if ((minIdx < 0)
 		 || ((minIdx > maxIdx)
 		 || (maxIdx > vtxSize))) {
-			return primitiveFail();
+			primitiveFail();
 		}
 	}
-	if (failed()) {
-		return null;
-	}
-	ok = b3dDrawArrays(handle, mode, minIdx, maxIdx);
-	if (!ok) {
-		return primitiveFail();
-	}
 	if (!(failed())) {
-		pop(methodArgumentCount());
+		ok = b3dDrawArrays(handle, mode, minIdx, maxIdx);
+		if (ok) {
+			pop(methodArgumentCount());
+		}
 	}
+	return null;
 }
 
 
@@ -643,16 +642,13 @@
 		}
 	l2:	/* end checkBoundsRange:faces:count: */;
 	}
-	if (failed()) {
-		return null;
-	}
-	ok = b3dDrawElements(handle, mode, faceSize, facePtr);
-	if (!ok) {
-		return primitiveFail();
-	}
 	if (!(failed())) {
-		pop(methodArgumentCount());
+		ok = b3dDrawElements(handle, mode, faceSize, facePtr);
+		if (ok) {
+			pop(methodArgumentCount());
+		}
 	}
+	return null;
 }
 
 
@@ -733,19 +729,16 @@
 		if ((minIdx < 0)
 		 || ((minIdx > maxIdx)
 		 || (maxIdx > vtxSize))) {
-			return primitiveFail();
+			primitiveFail();
 		}
 	}
-	if (failed()) {
-		return null;
-	}
-	ok = b3dDrawRangeElements(handle, mode, minIdx, maxIdx, faceSize,  facePtr);
-	if (!ok) {
-		return primitiveFail();
-	}
 	if (!(failed())) {
-		pop(methodArgumentCount());
+		ok = b3dDrawRangeElements(handle, mode, minIdx, maxIdx, faceSize,  facePtr);
+		if (ok) {
+			pop(methodArgumentCount());
+		}
 	}
+	return null;
 }
 
 
@@ -762,12 +755,12 @@
 	}
 	if ((methodArgumentCount()) == 1) {
 		enabled = booleanValueOf(stackValue(0));
-		if (failed()) {
-			return null;
+		if (!(failed())) {
+			doRangeChecks = enabled;
+			return pop(1);
 		}
-		doRangeChecks = enabled;
-		return pop(1);
 	}
+	return null;
 }
 
 EXPORT(sqInt)
@@ -1592,26 +1585,6 @@
 }
 
 
-/*	Load a primitive vertex from the interpreter stack.
-	Return a pointer to the vertex data if successful, nil otherwise. */
-
-static void*
-stackPrimitiveVertex(sqInt index)
-{
-    sqInt oop;
-
-	oop = stackObjectValue(index);
-	if (oop == null) {
-		return null;
-	}
-	if ((isWords(oop))
-	 && ((slotSizeOf(oop)) == 16)) {
-		return firstIndexableField(oop);
-	}
-	return null;
-}
-
-
 #ifdef SQUEAK_BUILTIN_PLUGIN
 
 void* B3DAcceleratorPlugin_exports[][3] = {

Modified: branches/Cog/src/plugins/IA32ABI/IA32ABI.c
===================================================================
--- branches/Cog/src/plugins/IA32ABI/IA32ABI.c	2015-01-30 19:16:19 UTC (rev 3240)
+++ branches/Cog/src/plugins/IA32ABI/IA32ABI.c	2015-01-31 01:17:30 UTC (rev 3241)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	VMPluginCodeGenerator VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
    from
-	IA32ABIPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	IA32ABIPlugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
  */
-static char __buildInfo[] = "IA32ABIPlugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d " __DATE__ ;
+static char __buildInfo[] = "IA32ABIPlugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549 " __DATE__ ;
 
 
 
@@ -219,9 +219,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"IA32ABI VMMaker.oscog-eem.983 (i)"
+	"IA32ABI VMMaker.oscog-eem.1032 (i)"
 #else
-	"IA32ABI VMMaker.oscog-eem.983 (e)"
+	"IA32ABI VMMaker.oscog-eem.1032 (e)"
 #endif
 ;
 
@@ -863,8 +863,8 @@
 
 	
 	methodReturnValue((BytesPerWord == 8
-		? positive64BitIntegerFor((&inIOProcessEvents))
-		: positive32BitIntegerFor((&inIOProcessEvents))));
+		? positive64BitIntegerFor(((usqInt)((&inIOProcessEvents))))
+		: positive32BitIntegerFor(((usqInt)((&inIOProcessEvents))))));
 }
 
 

Modified: branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c
===================================================================
--- branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c	2015-01-30 19:16:19 UTC (rev 3240)
+++ branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c	2015-01-31 01:17:30 UTC (rev 3241)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
    from
-	Mpeg3Plugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d
+	Mpeg3Plugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549
  */
-static char __buildInfo[] = "Mpeg3Plugin VMMaker.oscog-eem.983 uuid: 4cdca841-6318-4c49-95de-8c47d0d7e91d " __DATE__ ;
+static char __buildInfo[] = "Mpeg3Plugin VMMaker.oscog-eem.1032 uuid: a3c915e6-d663-4d65-ab41-493c71498549 " __DATE__ ;
 
 
 
@@ -137,9 +137,9 @@
 static sqInt maximumNumberOfFilesToWatch;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"Mpeg3Plugin VMMaker.oscog-eem.983 (i)"
+	"Mpeg3Plugin VMMaker.oscog-eem.1032 (i)"
 #else
-	"Mpeg3Plugin VMMaker.oscog-eem.983 (e)"
+	"Mpeg3Plugin VMMaker.oscog-eem.1032 (e)"
 #endif
 ;
 static mpeg3_t *mpegFiles[1024+1];
@@ -889,7 +889,7 @@
 
 	fileHandle = stackValue(4);
 	success(isIndexable(stackValue(3)));
-	anArray = ((int *) (firstIndexableField(stackValue(3))));
+	anArray = ((sqInt *) (firstIndexableField(stackValue(3))));
 	aChannelNumber = stackIntegerValue(2);
 	aSampleNumber = stackIntegerValue(1);
 	aNumber = stackIntegerValue(0);
@@ -1120,7 +1120,7 @@
 
 	fileHandle = stackValue(4);
 	success(isIndexable(stackValue(3)));
-	anArray = ((int *) (firstIndexableField(stackValue(3))));
+	anArray = ((sqInt *) (firstIndexableField(stackValue(3))));
 	aChannelNumber = stackIntegerValue(2);
 	aSampleNumber = stackIntegerValue(1);
 	aNumber = stackIntegerValue(0);



More information about the Vm-dev mailing list