On 12/02/2017 10:50 PM, Lubomír Čabla wrote:
Hi,

in new version 3.0.4 you have changed the declaration of some procedures and functions in the go32 unit.

It does not matter, but I see a little mismatch for linear base address:

FPC 3.0.2

function get_segment_base_address(d : word) : longint;
function set_segment_base_address(d : word;s : longint) : boolean;

FPC 3.0.4

function get_segment_base_address(d : word) : longint;
function set_segment_base_address(d : word;s : dword) : boolean;

For get_segment_base_address is correct longint or dword?
I think (and I'm the one, who made the change) dword is more correct, because segment bases can be >=2GB and longint is signed, so results in a negative number. In theory, it should only matter if you have range checking turned on, but I think 32-bit linear addresses should only be declared as dword (or longword) and previous code, that used longint, or added longint typecasts to avoid range check errors should be fixed. Maybe I should document it in: http://wiki.freepascal.org/User_Changes_3.0.4 ? I kinda skimped on that, because it only affects existing code, when range checking is on, and usually range checking is turned off for low level selector manipulating code.

Best regards,
Nikolay
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to