2004-02-06 Mike Kestner <mkestner@ximian.com>

* generator/Method.cs : for Opaque/Object retvals, if raw_ret is
	NULL, return null instead of an object with a NULL handle.

svn path=/trunk/gtk-sharp/; revision=22847
This commit is contained in:
Mike Kestner 2004-02-06 21:33:14 +00:00
parent cbd7afb761
commit dc7145103d
2 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2004-02-06 Mike Kestner <mkestner@ximian.com>
* generator/Method.cs : for Opaque/Object retvals, if raw_ret is
NULL, return null instead of an object with a NULL handle.
2004-02-06 Mike Kestner <mkestner@ximian.com> 2004-02-06 Mike Kestner <mkestner@ximian.com>
* glib/time_t_CustomMarshaler.cs : use TimeSpan.TotalSeconds, not * glib/time_t_CustomMarshaler.cs : use TimeSpan.TotalSeconds, not

View file

@ -359,9 +359,11 @@ namespace GtkSharp.Generation {
sw.WriteLine(cname + call + ";"); sw.WriteLine(cname + call + ";");
} else if (ret_igen is ObjectGen || ret_igen is OpaqueGen) { } else if (ret_igen is ObjectGen || ret_igen is OpaqueGen) {
sw.WriteLine(m_ret + " raw_ret = " + cname + call + ";"); sw.WriteLine(m_ret + " raw_ret = " + cname + call + ";");
sw.WriteLine(indent +"\t\t\t" + s_ret + " ret = " + table.FromNativeReturn(rettype, "raw_ret") + ";"); sw.WriteLine(indent +"\t\t\t" + s_ret + " ret;");
if (table.IsOpaque (rettype)) sw.WriteLine(indent + "\t\t\tif (raw_ret == IntPtr.Zero)");
sw.WriteLine(indent + "\t\t\tif (ret == null) ret = new " + s_ret + "(raw_ret);"); sw.WriteLine(indent + "\t\t\t\tret = null;");
sw.WriteLine(indent + "\t\t\telse");
sw.WriteLine(indent +"\t\t\t\tret = " + table.FromNativeReturn(rettype, "raw_ret") + ";");
} else if (ret_igen is CustomMarshalerGen) { } else if (ret_igen is CustomMarshalerGen) {
sw.WriteLine(s_ret + " ret = " + cname + call + ";"); sw.WriteLine(s_ret + " ret = " + cname + call + ";");
} else { } else {