From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p787nCuD022109 for ; Mon, 8 Aug 2011 09:49:12 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtYHANWTP07Lzuai/2dsb2JhbABCmDGPB3eBQAEBBAE6RAsLRj0aiAa8L4ZGBJs4iEQ X-IronPort-AV: E=Sophos;i="4.67,336,1309730400"; d="scan'208";a="104933286" Received: from hendrix.mega-nerd.net ([203.206.230.162]) by mail4-smtp-sop.national.inria.fr with ESMTP; 08 Aug 2011 09:49:05 +0200 Received: from hendrix.mnn (hendrix.mnn [192.168.200.99]) by hendrix.mega-nerd.net (Postfix) with SMTP id DE52B1067BC for ; Mon, 8 Aug 2011 17:49:03 +1000 (EST) Date: Mon, 8 Aug 2011 17:49:03 +1000 From: Erik de Castro Lopo To: caml-list@inria.fr Message-Id: <20110808174903.ec7927c968f82ca05d35025f@mega-nerd.com> In-Reply-To: <20110808035901.GJ29083@localhost> References: <20110808131504.d9137220d4b4401cc3450e5a@mega-nerd.com> <20110808035901.GJ29083@localhost> Reply-To: caml-list@inria.fr Organization: Erik Conspiracy Secret Labs X-Mailer: Sylpheed 3.2.0beta1 (GTK+ 2.24.4; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Val_int vs caml_copy_nativeint Guillaume Yziquel wrote: > Given that Val_int is Val_long (in mlvalues.h): > > #define Val_int(x) Val_long(x) > > it's not an issue with this piece of code. > > But depending on what "doesn't work" means and on the declarations of > width and height, then sizeof(int) < sizeof(long) may explain the issue. The width and height variables are both defined as int and I'm working on 32 bit Linux. Doesn't work means I don't get the value I think I should (small integers in the range [16, 144]) but rather gte values that look more like pointers. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/