From b0b7dbdd098b339073eccedfd5d69cf78aae6ac9 Mon Sep 17 00:00:00 2001 From: mterwoord_cp <7cd3fd84a0151ea055c2f79e4d2eef9576fe9afesxUZAwxD> Date: Fri, 9 May 2008 15:02:58 +0000 Subject: [PATCH] Some small enhancements --- source/Indy.IL2CPU.IL.X86/Callvirt.cs | 13 ++++++----- source/MatthijsTest/Program.cs | 32 +++++++++------------------ 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/source/Indy.IL2CPU.IL.X86/Callvirt.cs b/source/Indy.IL2CPU.IL.X86/Callvirt.cs index cd53573a8..8244da9f9 100644 --- a/source/Indy.IL2CPU.IL.X86/Callvirt.cs +++ b/source/Indy.IL2CPU.IL.X86/Callvirt.cs @@ -110,11 +110,14 @@ namespace Indy.IL2CPU.IL.X86 { } else if (mReturnSize <= 4) { new CPUx86.Pushd(CPUx86.Registers.EAX); Assembler.StackContents.Push(new StackContent(mReturnSize, mCurrentMethodInfo.ReturnType)); - } else if (mReturnSize <= 8) { - new CPUx86.Pushd(CPUx86.Registers.EBX); - new CPUx86.Pushd(CPUx86.Registers.EAX); - Assembler.StackContents.Push(new StackContent(mReturnSize, mCurrentMethodInfo.ReturnType)); - } + } + else if (mReturnSize <= 8) + { + new CPUx86.Pushd(CPUx86.Registers.EBX); + new CPUx86.Pushd(CPUx86.Registers.EAX); + Assembler.StackContents.Push(new StackContent(mReturnSize, mCurrentMethodInfo.ReturnType)); + } + else { throw new NotSupportedException(">8 byte return codes not yet supported!"); } } } } \ No newline at end of file diff --git a/source/MatthijsTest/Program.cs b/source/MatthijsTest/Program.cs index 6ba58b008..f2fd9c131 100644 --- a/source/MatthijsTest/Program.cs +++ b/source/MatthijsTest/Program.cs @@ -4,43 +4,31 @@ using System.Text; using Cosmos.Build.Windows; using System.Collections; -namespace MatthijsTest { - public class Program { +namespace MatthijsTest +{ + public class Program + { #region Cosmos Builder logic // Most users wont touch this. This will call the Cosmos Build tool [STAThread] - private static void Main(string[] args) { + private static void Main(string[] args) + { BuildUI.Run(); } #endregion - public class MessageContainer : IEnumerable - { - public IEnumerator GetEnumerator() { - yield return "String1"; - yield return "String2"; - yield return "String3"; - yield return "String4"; - yield return "String5"; - - } - } - - - public static void GetResumeAndResume(ref uint aSuspend) { aSuspend = 0; throw new NotImplementedException(); } - public static void Init() { - var xTest = (IEnumerable)new string[] { "String1", "String2", "String3" }; - foreach(string xItem in xTest){ - Console.WriteLine(xItem); - } + public static void Init() + { + var xTest = new List() { "String1", "String2", "String3", "String4" }; + foreach (string xItem in xTest) { Console.WriteLine(xItem); } } } } \ No newline at end of file