[fpc-pascal]About order of units...
    XHajT03 at mbox.vol.cz 
    XHajT03 at mbox.vol.cz
       
    Sun Aug 31 12:31:47 CEST 2003
    
    
  
From:           	L D Blake <ldblake at sympatico.ca>
Organization:   	Secret society to end secret societies
To:             	Marco van de Voort <fpc-pascal at lists.freepascal.org>
Subject:        	Re: [fpc-pascal]About order of units...
Send reply to:  	fpc-pascal at lists.freepascal.org
Date sent:      	Sat, 30 Aug 2003 15:29:48 -0400
> 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;
.
.
If you have a look at the implementation, you'll quickly find, that 
all of the examples you listed in this mail make absolutely _no_ 
difference. For example:
----------
  function HIBYTE(w : longint) : BYTE;
    begin
       HIBYTE:=BYTE(((WORD(w)) shr 8) and $FF);
    end;
---------
The first thing being done with the supplied argument is type casting 
to a word. BTW, at least some of these macros could probably be 
implemented more efficiently using some pointer arithmetics, but 
that's a different story.
Tomas
    
    
More information about the fpc-pascal
mailing list