mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-16 11:34:47 +02:00
2007-07-12 Mike Kestner <mkestner@novell.com>
* generator/StructBase.cs : use typeof to pass type to PtrToStruct to avoid an instantiation and method call. Duh. svn path=/trunk/gtk-sharp/; revision=81907
This commit is contained in:
parent
b1bb3f9056
commit
ce3db510d7
@ -1,4 +1,9 @@
|
|||||||
2007-07-03 Mike Kestner <mkestner@novell.com>
|
2007-07-12 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
|
* generator/StructBase.cs : use typeof to pass type to PtrToStruct
|
||||||
|
to avoid an instantiation and method call. Duh.
|
||||||
|
|
||||||
|
2007-07-10 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* generator/ImportSignature.cs : use Parameter.NativeSignature
|
* generator/ImportSignature.cs : use Parameter.NativeSignature
|
||||||
prop and refactor out some GError handling.
|
prop and refactor out some GError handling.
|
||||||
|
@ -190,12 +190,9 @@ namespace GtkSharp.Generation {
|
|||||||
sw.WriteLine();
|
sw.WriteLine();
|
||||||
if (!DisableNew) {
|
if (!DisableNew) {
|
||||||
sw.WriteLine ("\t\tpublic static " + QualifiedName + " New(IntPtr raw) {");
|
sw.WriteLine ("\t\tpublic static " + QualifiedName + " New(IntPtr raw) {");
|
||||||
sw.WriteLine ("\t\t\tif (raw == IntPtr.Zero) {");
|
sw.WriteLine ("\t\t\tif (raw == IntPtr.Zero)");
|
||||||
sw.WriteLine ("\t\t\t\treturn {0}.Zero;", QualifiedName);
|
sw.WriteLine ("\t\t\t\treturn {0}.Zero;", QualifiedName);
|
||||||
sw.WriteLine ("\t\t\t}");
|
sw.WriteLine ("\t\t\treturn ({0}) Marshal.PtrToStructure (raw, typeof ({0}));", QualifiedName);
|
||||||
sw.WriteLine ("\t\t\t{0} self = new {0}();", QualifiedName);
|
|
||||||
sw.WriteLine ("\t\t\tself = ({0}) Marshal.PtrToStructure (raw, self.GetType ());", QualifiedName);
|
|
||||||
sw.WriteLine ("\t\t\treturn self;");
|
|
||||||
sw.WriteLine ("\t\t}");
|
sw.WriteLine ("\t\t}");
|
||||||
sw.WriteLine ();
|
sw.WriteLine ();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user