[fpc-pascal] FPC 3.0.4 DOS GO32V2

2017-12-02 Thread Lubomír Čabla
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?

Thanks for the help.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC 3.0.4 DOS GO32V2

2017-12-03 Thread Nikolay Nikolov



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

Re: [fpc-pascal] FPC 3.0.4 DOS GO32V2

2017-12-03 Thread Marco van de Voort
In our previous episode, Nikolay Nikolov said:
> >
> > 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 

(I think he also meant having a signed getter and unsigned setter)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC 3.0.4 DOS GO32V2

2017-12-03 Thread Tomas Hajny
On Sun, December 3, 2017 22:10, Nikolay Nikolov wrote:
> On 12/02/2017 10:50 PM, Lubomír Čabla wrote:


Hi,

>> 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.

That makes sense (and DJGPP sources assume the same), but
get_segment_base_address should probably return a dword as well then,
right?


> 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.

Yes, adding a note there would be better.

Tomas


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC 3.0.4 DOS GO32V2

2017-12-03 Thread Nikolay Nikolov



On 12/03/2017 11:44 PM, Tomas Hajny wrote:

On Sun, December 3, 2017 22:10, Nikolay Nikolov wrote:

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


Hi,


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.

That makes sense (and DJGPP sources assume the same), but
get_segment_base_address should probably return a dword as well then,
right?
That is true. I've missed that one, unfortunately :( I'll probably fix 
this in trunk tomorrow.




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.

Yes, adding a note there would be better.

Ok, added it.

Nikolay
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC 3.0.4 DOS GO32V2

2017-12-04 Thread Lubomír Čabla
Thanks to all for help.

On Mon, Dec 4, 2017 at 3:56 AM, Nikolay Nikolov  wrote:

>
>
> On 12/03/2017 11:44 PM, Tomas Hajny wrote:
>
>> On Sun, December 3, 2017 22:10, Nikolay Nikolov wrote:
>>
>>> On 12/02/2017 10:50 PM, Lubomír Čabla wrote:
>>>
>>
>> Hi,
>>
>> 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.
>>>
>> That makes sense (and DJGPP sources assume the same), but
>> get_segment_base_address should probably return a dword as well then,
>> right?
>>
> That is true. I've missed that one, unfortunately :( I'll probably fix
> this in trunk tomorrow.
>
>>
>>
>> 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.
>>>
>> Yes, adding a note there would be better.
>>
> Ok, added it.
>
> Nikolay
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC 3.0.4 DOS GO32V2

2017-12-07 Thread Nikolay Nikolov



On 12/05/2017 12:01 AM, Lubomír Čabla wrote:

Thanks to all for help.
I checked and there were also other longint to dword changes in the go32 
unit. I've documented them all at:


http://wiki.freepascal.org/User_Changes_3.0.4#go32

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