No subject


Tue Jun 11 14:29:31 CEST 2019


  { 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





More information about the fpc-pascal mailing list