generator: fixed optional array parameters

This commit is contained in:
Stephan Sundermann 2013-08-12 10:50:13 +02:00 committed by Andrés G. Aragoneses
parent 5eea00f705
commit c3f7b8e32b

View File

@ -149,7 +149,9 @@ namespace GtkSharp.Generation {
result [i] = p.PassAs != "" ? p.PassAs + " " : "";
if (p.IsOptional && p.PassAs == String.Empty) {
if (p.Generatable is StructGen || p.Generatable is BoxedGen)
if (p.IsArray)
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";