generator: use default value for optional generation
This commit is contained in:
parent
5f271e04fa
commit
2152f4626e
1 changed files with 1 additions and 8 deletions
|
@ -149,14 +149,7 @@ namespace GtkSharp.Generation {
|
||||||
|
|
||||||
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) {
|
||||||
if (p.IsArray)
|
result [i++] += p.Generatable.DefaultValue;
|
||||||
result [i++] += "null";
|
|
||||||
else if (p.Generatable is StructGen || p.Generatable is BoxedGen)
|
|
||||||
result [i++] += p.CSType + ".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