Re: [AD] WIP 4.1.15 and CVS freeze |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Mon, 2004-07-26 at 15:54 +0200, Eric Botcazou wrote:
> > Along that, we can athen lso get rid of all "long" values,
> > since that type makes little sense, given it is the same as int on most
> > 32-bit platforms (and probably 64-bit as well).
>
> No, any sane compiler makes it so that '(unsigned) long' can hold pointer
> values and, in order not to double the memory requirement for every single
> program, keeps 'int' as a 32-bit type. This means LP64 on true 64-bit
> platforms, so sizeof(int) != sizeof(long) there. The only exception is MSVC
> for Windows 64-bit, which is P64: 'long' are 32-bit there too. Major
> compatibility problem with the Unix world.
>
> That's why there is the line
> - fix use of 32-bit 'long' on 64-bit platforms
> in the TODO file: we need to untangle uses of 'long' as a 32-bit type
> (typically, 32-bit pixel values) from uses of 'long' as a pointer-like type.
> The former must be downgraded to a 32-bit type everywhere (probably 'int')
> while the latter are fine. Or would have been fine without MSVC for Win64.
>
Well, the use of "long" in the rest function is neither. There's no
reason at all to use long there instead of int..
--
Elias Pschernig