Dear list,

Here are a few small improvements on gsl bindings.

Several places the pointers are properly replaced by arrays, and several
delegates are handled the native vala way.


- Yu
--- vapi/gsl.vapi	2009-06-19 15:45:23.000000000 +0800
+++ ../vala/vapi/gsl.vapi	2009-06-25 07:06:59.000000000 +0800
@@ -2978,8 +2978,8 @@
 		public double* F;
 		
 		[CCode (cname="gsl_ran_discrete_preproc")]
-		public RanDiscrete ([CCode (array_length_pos = 0.9)] double[] P);
-		[CCode (cname="gsl_ran_discrete", instance_pos = -1)]
+		public RanDiscrete (size_t K, double* P);
+		[CCode (cname="gsl_ran_discrete")]
 		public size_t discrete (RNG g);
 		[CCode (instance_pos=-1)]
 		public double pdf (size_t k);	
@@ -3396,9 +3396,8 @@
 		DEC
 	}
 	
-	public delegate int OdeivFunction (double t, [CCode (array_length = false)] double[] y, [CCode (array_length = false)] double[] dydt);
-	public delegate int OdeivJacobian (double t, [CCode (array_length = false)] double[] y, [CCode (array_length = false)] double[] dfdy, [CCode (array_length = false)] double[] dfdt);
-
+	public static delegate int OdeivFunction (double t, [CCode (array_length = false)] double[] y, [CCode (array_length = false)] double[] dydt, void* params);
+	public static delegate int OdeivJacobian (double t, [CCode (array_length = false)] double[] y, [CCode (array_length = false)] double[] dfdy, [CCode (array_length = false)] double[] dfdt, void* params);
 	public static delegate void* OdeivStepAlloc (size_t dim);
 	public static delegate int OdeivStepApply (void* state, size_t dim, double t, double h, [CCode (array_length = false)] double[] y, [CCode (array_length = false)] double[] yerr, [CCode (array_length = false)] double[] dydt_in, [CCode (array_length = false)] double[] dydt_out, OdeivSystem* dydt);
 	public static delegate int OdeivStepReset (void* state, size_t dim);
@@ -3413,9 +3412,7 @@
 	[CCode (cname="gsl_odeiv_system", cheader_filename="gsl/gsl_odeiv.h")]
 	public struct OdeivSystem
 	{
-		[CCode (delegate_target = false)]
 		public OdeivFunction function;
-		[CCode (delegate_target = false)]
 		public OdeivJacobian jacobian;
 		public size_t dimension;
 		public void* params;
@@ -3465,7 +3462,7 @@
 		public string name ();
 		public uint order ();
 		
-		public int apply (double t, double h, [CCode (array_length = false)] double[] y, [CCode (array_length = false)] double[] yerr, [CCode (array_length = false)] double[]? dydt_in, [CCode (array_length = false)] double[]? dydt_out, OdeivSystem* dydt);
+		public int apply (double t, double h, [CCode (array_length = false)] double[] y, [CCode (array_length = false)] double[] yerr, [CCode (array_length = false)] double[] dydt_in, [CCode (array_length = false)] double[] dydt_out, OdeivSystem* dydt);
 	}
 	
 	[SimpleType]
@@ -3517,7 +3514,7 @@
 		
 		[CCode (cname="gsl_odeiv_evolve_alloc")]
 		public OdeivEvolve (size_t dim);
-		public int apply (OdeivControl con, OdeivStep step, OdeivSystem* dydt, ref double t, double t1, ref double h, [CCode (array_length = false)] double[] y);
+		public int apply (OdeivControl con, OdeivStep step, OdeivSystem* dydt, [CCode (array_length = false)] double[] t, double t1, [CCode (array_length = false)] double[] h, [CCode (array_length = false)] double[] y);
 		public int reset ();
 	}
 	
@@ -3989,7 +3986,7 @@
 	public static delegate int MultirootFdfFree (void* state);
 	
 	[SimpleType]
-	[CCode (cname="gsl_multiroot_function", cheaer_filename="gsl/gsl_multiroots.h")]
+	[CCode (cname="gsl_multiroot_function", cheader_filename="gsl/gsl_multiroots.h")]
 	public struct MultirootFunction
 	{
 		public MultirootF f;
_______________________________________________
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to