[Vm-dev] [commit] r2519 - Change the VM argument access back to be consistent with linux:

commits at squeakvm.org commits at squeakvm.org
Wed Nov 30 22:30:40 UTC 2011


Author: eliot
Date: 2011-11-30 14:30:39 -0800 (Wed, 30 Nov 2011)
New Revision: 2519

Modified:
   branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
   branches/Cog/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c
   branches/Cog/platforms/unix/vm/sqUnixMain.c
   branches/Cog/platforms/win32/vm/sqWin32Intel.c
   branches/Cog/platforms/win32/vm/sqWin32Window.c
Log:
Change the VM argument access back to be consistent with linux:
    0 => executable name    -1 .. -n => VM arguments *including* image (if explicitly supplied).
Provide standard i/o console access on Windows.



Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Mon Nov 28 15:51:11 PST 2011
   + Wed Nov 30 14:29:57 PST 2011

Modified: branches/Cog/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c	2011-11-28 23:53:52 UTC (rev 2518)
+++ branches/Cog/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c	2011-11-30 22:30:39 UTC (rev 2519)
@@ -64,7 +64,7 @@
 	int actual;
 	
 	if (n < 0) {
-		actual = -1 - n;
+		actual = -n;
 		return actual < vmArgCnt ? vmArgVec[actual] : nil;
 	}
 	else {

Modified: branches/Cog/platforms/unix/vm/sqUnixMain.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixMain.c	2011-11-28 23:53:52 UTC (rev 2518)
+++ branches/Cog/platforms/unix/vm/sqUnixMain.c	2011-11-30 22:30:39 UTC (rev 2519)
@@ -438,8 +438,8 @@
 {
   if (id < 0)	/* VM argument */
     {
-      if (-id  <= vmArgCnt)
-	return vmArgVec[-id - 1];
+      if (-id  < vmArgCnt)
+	return vmArgVec[-id];
     }
   else
     switch (id)

Modified: branches/Cog/platforms/win32/vm/sqWin32Intel.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Intel.c	2011-11-28 23:53:52 UTC (rev 2518)
+++ branches/Cog/platforms/win32/vm/sqWin32Intel.c	2011-11-30 22:30:39 UTC (rev 2519)
@@ -1671,6 +1671,7 @@
         if ((n = parseVMArgument(argc - i, argv + i))) {
 			for (j = 0; j < n; j++)
 				vmOptions[numOptionsVM++] = argv[i+j];
+			i += n - 1;
 		}
 		else {
           fprintf(stderr,"Unknown option encountered!\n");

Modified: branches/Cog/platforms/win32/vm/sqWin32Window.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Window.c	2011-11-28 23:53:52 UTC (rev 2518)
+++ branches/Cog/platforms/win32/vm/sqWin32Window.c	2011-11-30 22:30:39 UTC (rev 2519)
@@ -2764,7 +2764,7 @@
     return GetImageOption(id-1);
   /* id < 0 : return options of the VM (e.g. given *before* the image name) */
   if(id < 0)
-    return GetVMOption(0-id-1);
+    return GetVMOption(-id);
   /* special attributes */
   switch(id) {
     case 1001: /* Primary OS type */



More information about the Vm-dev mailing list