[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pika-dev] C argument type for indices?
From: |
Tom Lord |
Subject: |
Re: [Pika-dev] C argument type for indices? |
Date: |
Wed, 4 Feb 2004 12:39:39 -0800 (PST) |
> From: Andreas Rottmann <address@hidden>
> Tom Lord <address@hidden> writes:
> > (`int' is fine for the number of limbs and limb indexes -- just not
> > for elt offsets into limbs. `int' is similarly fine for vtable-object
> > slot indexes.)
> So I guess you want t_uint for elt offsets into limbs?
No, ssize_t.
The rule is:
* signed integers for indexes -- mostly so that functions
can return either a valid index or -1.
* ssize_t for indexes of things that are of indefinate size --
such as limb elements
* int for indexes for things that are guaranteed small in number
-- such as vtable object slots and vtable limbs
* t_scm_fixnum for hash values -- which aren't indexes but which we
want to give to and get back from Scheme as fixnums, not bignums
-t