Re: [fpc-pascal] overloading function StrPLCopy

2014-05-07 Thread Bruno Krayenbuhl
You have troubled me seriously, so I have dug in the compiler source. It appears that when parsing the source, Currency constants are cast to type BestReal (EXTENDED on I386) before being converted to the 8 byte currency written to the PPU or EXE or whatever is done. The combination of these

Re: [fpc-pascal] overloading function StrPLCopy

2014-05-07 Thread LacaK
When I change definition of 3rd parameter in unicode version of StrPLCopy from SizeInt to SizeUInt, then in my example program is correctly called "ansi version" So it seems, that this 3rd parameter confused compiler and somehow forced him to prefer wrong version...? -Laco. Hi again, I reply

Re: [fpc-pascal] overloading function

2014-05-06 Thread LacaK
Hi again, I reply also to fpc-devel list (excuse me, if it is off-topic), because I would like understand wat is going on. I attach also simple test program. I use FPC 2.6.4 but I think, that same happens also with fresh 2.7.1 Thanks -Laco. On 02.05.2014 07:45, LacaK wrote: Hi, I am trying un

Re: [fpc-pascal] overloading function

2014-05-02 Thread LacaK
>> I am trying understand how FPC determines which version of >>overloaded>> function to call.>> Take as example these 2 functions (from SysUtils):>> 1. function StrPLCopy(Dest: PChar; Source: string; MaxLen: >>SizeUInt):>> PChar; overload;>> 2. function StrPLCopy(Dest: PWideChar; const Source: Uni

Re: [fpc-pascal] overloading function

2014-05-01 Thread Sven Barth
On 02.05.2014 07:45, LacaK wrote: Hi, I am trying understand how FPC determines which version of overloaded function to call. Take as example these 2 functions (from SysUtils): 1. function StrPLCopy(Dest: PChar; Source: string; MaxLen: SizeUInt): PChar; overload; 2. function StrPLCopy(Dest: PWide

[fpc-pascal] overloading function

2014-05-01 Thread LacaK
Hi, I am trying understand how FPC determines which version of overloaded function to call. Take as example these 2 functions (from SysUtils): 1. function StrPLCopy(Dest: PChar; Source: string; MaxLen: SizeUInt): PChar; overload; 2. function StrPLCopy(Dest: PWideChar; const Source: UnicodeStrin