From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA12963 for caml-red; Fri, 16 Jun 2000 20:31:14 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA07666 for ; Fri, 16 Jun 2000 11:57:17 +0200 (MET DST) Received: from mail.cvf.fr (mail.cvf.fr [194.250.196.243]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e5G9vG527975 for ; Fri, 16 Jun 2000 11:57:16 +0200 (MET DST) Received: from beepbeep.dev33.cvf ([10.33.100.33]) by mail.cvf.fr with esmtp (Exim 3.12 #1 (CVF)) id 132ssF-0005Kx-00 for ; Fri, 16 Jun 2000 11:57:16 +0200 Received: (from lmazardo@localhost) by beepbeep.dev33.cvf (8.9.3/8.9.3/Debian 8.9.3-21) id LAA17557; Fri, 16 Jun 2000 11:57:15 +0200 To: caml-list@inria.fr Subject: Unsigned int ?! From: Luc MAZARDO Date: 16 Jun 2000 11:57:15 +0200 Message-ID: <87pupigd8k.fsf@beepbeep.dev33.cvf> X-Mailer: Gnus v5.7/Emacs 20.6 X-Face: #wZ#V}4Q$LQxR+z[sn~km1Q"PzS@K(uPAf)t{I~J#+gh,^t"s=-12r&8aps4D^u7?_@>PE_ !^4HIF_Zy;%y. X-complaints-to: abuse@cvf.fr Sender: weis@pauillac.inria.fr I would like to get the "caml unsigned int value" of an "unsigned int C value". Is there a way to do this ?? I do the following, and it fails ... ---toto_stub.c--- value toto(void) { return Val_int(get()); } ------------ ---toto.mli--- val toto : unit -> int ;; ------------ ---toto.ml--- external toto : unit -> int = "toto";; ------------- ---test.c--- <> printf("%d\n", toto()); /* unsigned int: --> 3 */ <> ----------- ---test.ml--- let t = toto () ;; val t : int = -924646501 /* uh ?? */ ------------- -- Luc Mazardo http://OCamlSDL.sourceforge.net Gnu Emacs:flame.el Don't you realise that Michael Jackson is a cool dude?