<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 12/02/2017 10:50 PM, Lubomír Čabla
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAER7s6d0B6Ox56T00ZBsLKaoC88oPW8kWA=HvXyB_gHoqFzFSQ@mail.gmail.com">
<div dir="ltr">
<div class="gmail_default">
<div class="gmail_default"><font face="verdana, sans-serif">Hi,</font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">in
new version 3.0.4 you have changed the declaration of some
procedures and functions in the go32 unit.</font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">It
does not matter, but I see a little mismatch for linear
base address:</font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">FPC
3.0.2</font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">
function get_segment_base_address(d : word) : longint;</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">
function set_segment_base_address(d : word;s : longint) :
boolean;</font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">FPC
3.0.4</font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">
function get_segment_base_address(d : word) : longint;</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">
function set_segment_base_address(d : word;s : dword) :
boolean;</font></div>
<div class="gmail_default"><font face="verdana, sans-serif"><br>
</font></div>
<div class="gmail_default"><font face="verdana, sans-serif">For
get_segment_base_address is correct longint or dword?</font></div>
</div>
</div>
</blockquote>
<font face="verdana, sans-serif">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:
<a class="moz-txt-link-freetext" href="http://wiki.freepascal.org/User_Changes_3.0.4">http://wiki.freepascal.org/User_Changes_3.0.4</a> ? 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.<br>
<br>
Best regards,<br>
Nikolay<br>
</font>
</body>
</html>