<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I'd like to avoid using "long" and "ulong" anywhere.<BR>
On Unix, they are always pointer sized.<BR>
On Windows, they are always 32 bits.<BR>
<BR>
This divergence of meaning I think it renders it useless.<BR>
<BR>
I believe for pointer-sized integers, the right types are any of:<BR>
unsigned: size_t, Word.T<BR>
signed: INTEGER, ssize_t, ptrdiff_t<BR>
<BR>For 32bit integers: int32_t and uint32_t, perhaps int.<BR>
<BR>
There is arguably some ambiguity if you consider 16bit platforms.<BR>
<BR>
Now, I noticed we have:<BR>
INTERFACE Cstddef;<BR>
<BR>
size_t = Ctypes.unsigned_long;<BR> ssize_t = Ctypes.long;<BR> ptrdiff_t = Ctypes.long;<BR>
<BR>
I would like to change this, either to:<BR>
<BR>
32bits:<BR>
size_t = Ctypes.unsigned_int;<BR> ssize_t = Ctypes.int;<BR> ptrdiff_t = Ctypes.int;<BR><BR>
<BR>
64bits:<BR>
size_t = Ctypes.unsigned_long_long;<BR> ssize_t = Ctypes.long_long;<BR> ptrdiff_t = Ctypes.long_long;<BR>
<BR>
or portable:<BR>
size_t = Word.T;<BR> ssize_t = INTEGER;<BR> ptrdiff_t = INTEGER;<BR>
<BR><BR>but, my question then is, why isn't the portable version already in use?<BR>
Especially for the signed types.<BR>
<BR>
I mean, you know, we have:<BR>
<BR>
32bits/BasicCtypes:<BR>
<BR>
INTERFACE BasicCtypes;<BR>
IMPORT Word, Long;<BR>
TYPE<BR> (* the four signed integer types *)<BR> signed_char = [-16_7f-1 .. 16_7f];<BR> short_int = [-16_7fff-1 .. 16_7fff];<BR> int = [-16_7fffffff-1 .. 16_7fffffff];<BR> long_int = [-16_7fffffff-1 .. 16_7fffffff];<BR><BR>
question is, why aren't int and long_int INTEGER?<BR>
<BR>
64bits/BasicCtypes:<BR>
<BR>
long_int = [-16_7fffffffffffffff -1 .. 16_7fffffffffffffff ];<BR> long_long = [-16_7fffffffffffffffL-1L .. 16_7fffffffffffffffL];<BR><BR>
<BR>
why not INTEGER?<BR>
<BR>
- Jay<BR></body>
</html>