Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Unsigned int ?!
@ 2000-06-16  9:57 Luc MAZARDO
  2000-06-19 15:51 ` Xavier Leroy
  2000-06-23 16:05 ` thierry BRAVIER
  0 siblings, 2 replies; 3+ messages in thread
From: Luc MAZARDO @ 2000-06-16  9:57 UTC (permalink / raw)
  To: caml-list


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---
<<some stuff>>

printf("%d\n", toto()); /* unsigned int: --> 3 */

<<some stuff>>
-----------


---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?



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-06-26 10:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-16  9:57 Unsigned int ?! Luc MAZARDO
2000-06-19 15:51 ` Xavier Leroy
2000-06-23 16:05 ` thierry BRAVIER

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox