From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA30784; Thu, 13 Mar 2003 10:36:32 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA19103 for ; Thu, 13 Mar 2003 10:36:31 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h2D9aRf00401; Thu, 13 Mar 2003 10:36:27 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA18985; Thu, 13 Mar 2003 10:36:27 +0100 (MET) Date: Thu, 13 Mar 2003 10:36:27 +0100 From: Xavier Leroy To: francois bereux Cc: caml-list@inria.fr Subject: Re: [Caml-list] how to interface with integer Bigarrays using camlidl Message-ID: <20030313103627.B15203@pauillac.inria.fr> References: <20030306232731.7374.qmail@web10305.mail.yahoo.com> <20030312185904.GB372@phaeton.entropie.net> <20030312212448.A30685@pauillac.inria.fr> <3E70480B.7CAFF86F@fr.thalesgroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <3E70480B.7CAFF86F@fr.thalesgroup.com>; from francois.bereux@fr.thalesgroup.com on Thu, Mar 13, 2003 at 09:57:47AM +0100 X-Spam: no; 0.00; caml-list:01 bigarrays:01 32,:01 elt:01 idl:01 bigarray:01 -bit:01 caml:01 camlidl:01 int:01 native:02 interface:03 let:04 layout:04 array:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I posted this question on the beginner list, but I got no answer. > I do not manage to interface a 1D Bigarray of integers with C code, using > camlidl. > [...] > This expression has type > (int32, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array1.t > but is here used with type > (int, Bigarray.int32_elt, Bigarray.c_layout) Bigarray.Array1.t You have to decide whether you want your bigarray to hold values of type int32 (i.e. 32-bit integers) or int (i.e. Caml native integers -- 31 bits on a 32-bit processor). In the first case, change your IDL spec as follows: void linear([in,ref] int* m, [in,out,length_is(*m),*int32,bigarray] int ia[] ); In the second case, change your Caml client code as follows: let lin n = let ia = Array1.create int c_layout n in begin linear ia; ia; end;; - Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners