From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA24821 for caml-redistribution@pauillac.inria.fr; Wed, 22 Mar 2000 17:09:24 +0100 (MET) Resent-Message-Id: <200003221609.RAA24821@pauillac.inria.fr> 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 XAA28554 for ; Tue, 21 Mar 2000 23:16:36 +0100 (MET) Received: from localhost.localdomain (krusty43.zip.com.au [61.8.16.43]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id XAA11081 for ; Tue, 21 Mar 2000 23:16:30 +0100 (MET) Received: from maxtal.com.au (IDENT:root@localhost [127.0.0.1]) by localhost.localdomain (8.9.3/8.8.7) with ESMTP id JAA09007 for ; Wed, 22 Mar 2000 09:22:16 +1100 Sender: root@localhost.localdomain Message-ID: <38D7F617.1A8386D5@maxtal.com.au> Date: Wed, 22 Mar 2000 09:22:15 +1100 From: John Max Skaller X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 CC: caml-list@inria.fr Subject: Unsigned integers? References: <20000315145830.22463@pauillac.inria.fr> <20000316115540L.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-From: weis@pauillac.inria.fr Resent-Date: Wed, 22 Mar 2000 17:09:24 +0100 Resent-To: caml-redistribution@pauillac.inria.fr I have some code for processing ISO-10646 characters and UTF-8, which uses caml integers. ISO-10646 has 2^31 code points, which can be covered by caml integers on a 32bit machine. Using an unboxed type is mandatory for performance. Unfortunately, caml integers are signed, which makes most of the code I have written wrong (I haven't taken the care to handle integers over 2^30 correctly). What is the best way to handle this problem? Would a (standard?) library module (written in C), that treats integers as unsigned be a reasonable solution? [This may require writing 'uint_add x y' instead of 'x+y', but that doesn't matter in the above mentioned application, since the integers are being used to represent characters] -- John (Max) Skaller, mailto:skaller@maxtal.com.au 10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850 checkout Vyper http://Vyper.sourceforge.net download Interscript http://Interscript.sourceforge.net