[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] long pointer equivalent
From: |
Peter Keller |
Subject: |
Re: [Chicken-users] long pointer equivalent |
Date: |
Sun, 18 Aug 2002 01:59:29 -0500 |
User-agent: |
Mutt/1.2i |
On Sat, Aug 17, 2002 at 10:43:38PM +0200, felix wrote:
> Benedikt Rosenau wrote:
> >
> > On Fri, Aug 16, 2002 at 10:00:07PM -0500, Peter Keller wrote:
> >
> > > Why isn't there a C type for long* and unsigned long*? Zlib has a lot
> > > of functions that desire that type. And I KNOW on say linux / ia64 long
> > > is 8 bytes, but int is 4 bytes so it makes a difference.
> >
> > Assuming any type size for integer or pointers is mined territory
> > anyway.
>
> Well spoken. If I understand Pete's question correctly, he means
> something corresponding to SRFI-4 vectors, a `u64vector' type,
> so to speak (right?).
Sort of. :)
It is complicated by the fact that a long can be the same size of an
int or bigger. So the trouble is, if I use a s64vector type, but the
long representation on the machine is 32 bits and I'm building an FFI to
a function like this:
void foo(long *val);
I don't know what equivalent chicken type to use. An s64vector might not be
correct in this case.
> It is basically not such a bad idea to extend the implementation
> of SRFI-4 accordingly. But it gets tediuos on 32-bit machines,
> especially
> since we don't have bignums yet.
Well, you can extend SRFI-4 to include the missed types if you want, and
maybe we probably should (though does it continue to 128 bits :)).
However, I am only interested in the FFI case of a [unsigned] long pointer
or variable type being passed to a C function.
-pete
Re: [Chicken-users] long pointer equivalent, Benedikt Rosenau, 2002/08/17
Re: [Chicken-users] long pointer equivalent, Peter Keller, 2002/08/18