Why not just make it 16 bits on the Intel platform? On certain computers,
like the Macintosh I believe, a Byte is the size of a PC Word.
> behaviour. In this case I would appreciate suggestions how to rename
> all GPC Integer types above (which I wouldn't like to do because I find
> the above quite consistent).
When I was playing with GPC doing the Port inline assembly stuff, I
delcared the types as follows:
...
TYPE
ShortInt = __byte__ Integer; { 8 bits }
Int = __short__ Integer; { 16 bits }
LongInt = __long__ Integer; { 32 bits }
Byte = __unsigned__ ShortInt; { 8 bits }
Word = __unsigned__ Int; { 16 bits }
DWord = __unsigned__ LongInt; { 32 bits }
...
Or soemthing to that effect. Altho I'd prefer to re-declare the Integer as
a PC Integer, I didn't because I don't like overriding the default type.
I think that there should be a compiler directive to generate code, or
maybe typecasting should be implemented, in case someone writes data from a
32-bit word to prevent it from being read into a 16-bit word. I like
Borland Style Type-Casting because it's logical, for example:
VAR
MyDword : DWord;
MyLInt : LongInt;
BEGIN
MyLint := -23;
LongInt( MyDword ) := MyLint;
END.
Not much of a logical example, but hopefully it shows you what I mean :}
See ya!
Orlando Llanes