2007-12-12 Mike Kestner <mkestner@novell.com>

* generator/Parameters.cs: fix marshaling for ArrayCount params where
	casting is required, like gsize/size_t count parameters.

svn path=/trunk/gtk-sharp/; revision=91199
This commit is contained in:
Mike Kestner 2007-12-13 05:11:07 +00:00
parent 778f049caa
commit 57c664572c
2 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2007-12-12 Mike Kestner <mkestner@novell.com>
* generator/Parameters.cs: fix marshaling for ArrayCount params where
casting is required, like gsize/size_t count parameters.
2007-12-11 Mike Kestner <mkestner@novell.com>
* parser/gapi2xml.pl: fix tightloop in single-line prop declarations.

View File

@ -394,6 +394,12 @@ namespace GtkSharp.Generation {
this.invert = invert;
}
string CountNativeType {
get {
return SymbolTable.Table.GetMarshalType(count_elem.GetAttribute("type"));
}
}
string CountType {
get {
return SymbolTable.Table.GetCSType(count_elem.GetAttribute("type"));
@ -417,8 +423,7 @@ namespace GtkSharp.Generation {
string CallCount (string name)
{
string result = name + " == null ? 0 : ";
result += CountCast + name + ".Length";
string result = CountCast + "(" + name + " == null ? 0 : " + name + ".Length)";
IGeneratable gen = SymbolTable.Table[count_elem.GetAttribute("type")];
return gen.CallByName (result);
}
@ -435,9 +440,9 @@ namespace GtkSharp.Generation {
public override string NativeSignature {
get {
if (invert)
return CountType + " " + CountName + ", " + MarshalType + " " + Name;
return CountNativeType + " " + CountName + ", " + MarshalType + " " + Name;
else
return MarshalType + " " + Name + ", " + CountType + " " + CountName;
return MarshalType + " " + Name + ", " + CountNativeType + " " + CountName;
}
}
}