generator: IntPtr.Zero for optional IntPtr params
IntPtr.Zero should be passed for optional IntPtr params instead of null
This commit is contained in:
parent
972e6257fc
commit
949c538fe3
1 changed files with 8 additions and 2 deletions
|
@ -148,8 +148,14 @@ namespace GtkSharp.Generation {
|
||||||
foreach (Parameter p in parms) {
|
foreach (Parameter p in parms) {
|
||||||
|
|
||||||
result [i] = p.PassAs != "" ? p.PassAs + " " : "";
|
result [i] = p.PassAs != "" ? p.PassAs + " " : "";
|
||||||
if (p.IsOptional && p.PassAs == String.Empty)
|
if (p.IsOptional && p.PassAs == String.Empty) {
|
||||||
result [i++] += (p.Generatable is StructGen || p.Generatable is BoxedGen) ? (p.CSType + ".Zero") : "null";
|
if (p.Generatable is StructGen || p.Generatable is BoxedGen)
|
||||||
|
result [i++] += " .Zero";
|
||||||
|
else if (p.CSType == "System.IntPtr")
|
||||||
|
result [i++] += "System.IntPtr.Zero";
|
||||||
|
else
|
||||||
|
result [i++] += "null";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
result [i++] += p.Name;
|
result [i++] += p.Name;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue