On Wed, Jul 23, 2008 at 6:55 AM, Andrew Ross
<[EMAIL PROTECTED]> wrote:
> 2) The types used by these functions are a bit loose. The use of unsigned
> long (usually 64 bit on modern hardware) as the return value for plrandi
> caused me some headaches with java until I realised that the return
> value is actually a 32-bit unsigned integer. (Java has no concept of
> unsigned type and so the largest positive integer you can have is
> actually 63 bits with the long type - crazy, but there you are. See
> google for the logic behind it.)

There are similar issues for OCaml.  There are no stand-alone unsigned
integer types included in the standard library.  The current interface
ignores the "unsigned" aspect and simply uses OCaml native integers,
which are 31bits or 63bits depending on the architecture (32bits or
64bits - 1bit used for GC purposes).

Would it be reasonable to make the interfaces take signed integers and
then shift/cast them appropriately to unsigned values in the PLplot
interface wrapper functions?  This does not address the PLUNICODE
issue you brought up, but it may make the interface to other languages
- at least Java and OCaml? - simpler.

Hez

-- 
Hezekiah M. Carty
Graduate Research Assistant
University of Maryland
Department of Atmospheric and Oceanic Science

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to