In reply to your message of August 30, 2003
>> The real problem here is types declared in the windows unit where, as I
>> pointed out previously, LongInt has been confused with BYTE, WORD and LONGWORD
>> types...
> Can you name examples of that?
> Most notably about byte's and word's confusion (so places where types
> have a different size then they should have, regardless of signedness)
>From base.inc ...
{ was #define dname(params) def_expr }
{ argument types are unknown }
function HIBYTE(w : longint) : BYTE;
Should be hibyte(w : word) : byte; according to the SDK.
{ was #define dname(params) def_expr }
{ argument types are unknown }
function HIWORD(l : longint) : WORD;
Should be hiword(l : longword) : word;
{ was #define dname(params) def_expr }
{ argument types are unknown }
function LOBYTE(w : longint) : BYTE;
Should be lobyte(w : word) : byte;
{ was #define dname(params) def_expr }
{ argument types are unknown }
function LOWORD(l : longint) : WORD;
Should be lowword(l : longword) : word;
{ was #define dname(params) def_expr }
{ argument types are unknown }
function MAKEWORD(a,b : longint) : WORD;
Should be makeword(a,b : byte) : word;
{ was #define dname(params) def_expr }
{ argument types are unknown }
function GetBValue(rgb : longint) : BYTE;
Should be getbvalue(rgb : longword) : byte;
{ was #define dname(params) def_expr }
{ argument types are unknown }
function GetGValue(rgb : longint) : BYTE;
Should be getgvalue(rgb : longword) : byte;
{ was #define dname(params) def_expr }
{ argument types are unknown }
function GetRValue(rgb : longint) : BYTE;
Should be getrvalue (rgb : longword) : byte;
{ was #define dname(params) def_expr }
{ argument types are unknown }
function RGB(r,g,b : longint) : DWORD;
Should be rgb(r,g,b : byte) : longword;
That's only in BASE.INC, there are literally *hundreds* of other places where
this happens... It's all through the whole windows unit. It's also common in
both the record and function declarations as well... I did a quick search for
"longint" in the wininc directory and got over 1000 returns, all of which are
now suspect.
> Signedness only generates range checks, and shouldn't be a problem
> otherwise.
Well, unless you want to actually produce error free code, that is.
-----
L D Blake
_______________________________________________
fpc-pascal maillist - [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal