Skip to content
Browse files

2005-12-22 Alp Toker <alp@atoker.com>

  * cilc.cs: Add support for char, sbyte, byte and double
  * Test.cs, demo.c: Update tests

svn path=/trunk/mcs/; revision=54712
  • Loading branch information...
1 parent 6bb8e27 commit 8fefcba39061d7cf7091214399bb230385007ddc Alp Toker committed Dec 22, 2005
Showing with 30 additions and 0 deletions.
  1. +5 −0 mcs/tools/cilc/ChangeLog
  2. +5 −0 mcs/tools/cilc/Test.cs
  3. +16 −0 mcs/tools/cilc/cilc.cs
  4. +4 −0 mcs/tools/cilc/demo.c
View
5 mcs/tools/cilc/ChangeLog
@@ -1,3 +1,8 @@
+2005-12-22 Alp Toker <alp@atoker.com>
+
+ * cilc.cs: Add support for char, sbyte, byte and double
+ * Test.cs, demo.c: Update tests
+
2005-05-08 Alp Toker <alp@atoker.com>
* cilc.cs: Add null check to NsToC and fix warnings.
View
5 mcs/tools/cilc/Test.cs
@@ -49,6 +49,11 @@ public void AddNumber (int num)
Console.WriteLine ("Instance method with an argument invoked: " + num + " added to value, making it " + counter);
}
+ public double GetDoubleValue ()
+ {
+ return (double)counter;
+ }
+
public int GetValue ()
{
return counter;
View
16 mcs/tools/cilc/cilc.cs
@@ -34,6 +34,10 @@ public static int Main (string[] args)
RegisterByVal (typeof (int));
RegisterByVal (typeof (IntPtr));
RegisterByVal (typeof (bool));
+ RegisterByVal (typeof (char));
+ RegisterByVal (typeof (sbyte));
+ RegisterByVal (typeof (byte));
+ RegisterByVal (typeof (double));
if (args.Length == 1) {
SmartBind (args[0]);
@@ -866,6 +870,18 @@ static string CsTypeToC (Type t)
case "System.IntPtr":
return "gpointer ";
+
+ case "System.Char":
+ return "guint16 ";
+
+ case "System.SByte":
+ return "gint8 ";
+
+ case "System.Byte":
+ return "guint8 ";
+
+ case "System.Double":
+ return "gdouble ";
//questionable
case "System.EventHandler":
View
4 mcs/tools/cilc/demo.c
@@ -6,6 +6,7 @@ int main () {
DemoTest *my_test;
//gchar *tmp;
int num;
+ gdouble num_dbl;
DemoDrink drink;
//GEnumClass *enum_class;
@@ -33,6 +34,9 @@ int main () {
num = demo_test_get_value (my_test);
g_printf ("The counter's value is %d\n", num);
+ num_dbl = demo_test_get_double_value (my_test);
+ g_printf ("The counter's double value is %.16f\n", num_dbl);
+
drink = demo_test_pick_drink ();
//enum_class = g_type_class_peek (demo_drink_get_type ());
//g_enum_get_value (enum_class, drink);

0 comments on commit 8fefcba

Please sign in to comment.
Something went wrong with that request. Please try again.