Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Luc MAZARDO <Luc.Mazardo@cvf.fr>
To: caml-list@inria.fr
Subject: Unsigned int ?!
Date: 16 Jun 2000 11:57:15 +0200	[thread overview]
Message-ID: <87pupigd8k.fsf@beepbeep.dev33.cvf> (raw)


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?



             reply	other threads:[~2000-06-16 18:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-16  9:57 Luc MAZARDO [this message]
2000-06-19 15:51 ` Xavier Leroy
2000-06-23 16:05 ` thierry BRAVIER

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pupigd8k.fsf@beepbeep.dev33.cvf \
    --to=luc.mazardo@cvf.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox