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:
parent
778f049caa
commit
57c664572c
2 changed files with 14 additions and 4 deletions
|
@ -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>
|
2007-12-11 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
* parser/gapi2xml.pl: fix tightloop in single-line prop declarations.
|
* parser/gapi2xml.pl: fix tightloop in single-line prop declarations.
|
||||||
|
|
|
@ -394,6 +394,12 @@ namespace GtkSharp.Generation {
|
||||||
this.invert = invert;
|
this.invert = invert;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string CountNativeType {
|
||||||
|
get {
|
||||||
|
return SymbolTable.Table.GetMarshalType(count_elem.GetAttribute("type"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string CountType {
|
string CountType {
|
||||||
get {
|
get {
|
||||||
return SymbolTable.Table.GetCSType(count_elem.GetAttribute("type"));
|
return SymbolTable.Table.GetCSType(count_elem.GetAttribute("type"));
|
||||||
|
@ -417,8 +423,7 @@ namespace GtkSharp.Generation {
|
||||||
|
|
||||||
string CallCount (string name)
|
string CallCount (string name)
|
||||||
{
|
{
|
||||||
string result = name + " == null ? 0 : ";
|
string result = CountCast + "(" + name + " == null ? 0 : " + name + ".Length)";
|
||||||
result += CountCast + name + ".Length";
|
|
||||||
IGeneratable gen = SymbolTable.Table[count_elem.GetAttribute("type")];
|
IGeneratable gen = SymbolTable.Table[count_elem.GetAttribute("type")];
|
||||||
return gen.CallByName (result);
|
return gen.CallByName (result);
|
||||||
}
|
}
|
||||||
|
@ -435,9 +440,9 @@ namespace GtkSharp.Generation {
|
||||||
public override string NativeSignature {
|
public override string NativeSignature {
|
||||||
get {
|
get {
|
||||||
if (invert)
|
if (invert)
|
||||||
return CountType + " " + CountName + ", " + MarshalType + " " + Name;
|
return CountNativeType + " " + CountName + ", " + MarshalType + " " + Name;
|
||||||
else
|
else
|
||||||
return MarshalType + " " + Name + ", " + CountType + " " + CountName;
|
return MarshalType + " " + Name + ", " + CountNativeType + " " + CountName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue