Author: mkestner
Date: 2007-12-13 00:11:07 -0500 (Thu, 13 Dec 2007)
New Revision: 91199

Modified:
   trunk/gtk-sharp/ChangeLog
   trunk/gtk-sharp/generator/Parameters.cs
Log:

2007-12-12  Mike Kestner  <[EMAIL PROTECTED]>

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


Modified: trunk/gtk-sharp/ChangeLog
===================================================================
--- trunk/gtk-sharp/ChangeLog   2007-12-13 02:50:54 UTC (rev 91198)
+++ trunk/gtk-sharp/ChangeLog   2007-12-13 05:11:07 UTC (rev 91199)
@@ -1,3 +1,8 @@
+2007-12-12  Mike Kestner  <[EMAIL PROTECTED]>
+
+       * generator/Parameters.cs: fix marshaling for ArrayCount params where
+       casting is required, like gsize/size_t count parameters.
+
 2007-12-11  Mike Kestner  <[EMAIL PROTECTED]>
 
        * parser/gapi2xml.pl: fix tightloop in single-line prop declarations.

Modified: trunk/gtk-sharp/generator/Parameters.cs
===================================================================
--- trunk/gtk-sharp/generator/Parameters.cs     2007-12-13 02:50:54 UTC (rev 
91198)
+++ trunk/gtk-sharp/generator/Parameters.cs     2007-12-13 05:11:07 UTC (rev 
91199)
@@ -394,6 +394,12 @@
                        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 @@
 
                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 @@
                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;
                        }
                }
        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to