Re: [fpc-devel] market as inline is not inlined

2019-12-27 Thread Jonas Maebe
On 27/12/2019 19:27, Joao Schuler wrote:
> I'm not sure if it's happening only to me, but I have a feeling that
> trunk produces more "marked as inline is not inlined" than FPC 3.0.4.

That's because FPC 3.0.4 did not report all of those cases, while trunk
does. In practice, trunk can inline in more situations than 3.0.4.


Jonas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] market as inline is not inlined

2019-12-27 Thread Joao Schuler
Hello,
I'm not sure if it's happening only to me, but I have a feeling that trunk
produces more "marked as inline is not inlined" than FPC 3.0.4.

This is an example if anyone intends to build and see:
https://github.com/joaopauloschuler/neural-api/tree/master/examples/XorAndOr


BTW, trunk is faster than FPC 3.0.4 at my end.

Long life to pascal.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-27 Thread Mattias Gaertner via fpc-devel
On Fri, 27 Dec 2019 12:01:24 +0100
Ondrej Pokorny  wrote:

>[...]
> > If I understand your reasoning correct, that should solve the
> > problems you
> > report ?  
> 
> Yes, that perfectly solves the issues Lazarus developers and users
> face. I am OK with this solution as well. Thanks!

Thank you both \O/

Mattias
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-27 Thread Ondrej Pokorny

On 27.12.2019 10:40, Michael Van Canneyt wrote:

Yes, indeed. Therefore I suggested
* TEncoding.Default for the DefaultSystemCodePage variable
and
* TEncoding.ANSI for the system encoding.

Currently we have
* TEncoding.SystemEncoding for the DefaultSystemCodePage variable
and
* both TEncoding.ANSI and TEncoding.Default for the system encoding. 
(TEncoding.ANSI and TEncoding.Default are equal in FPC.)


In that case,  why not simply change:

 class function TEncoding.GetDefault: TEncoding;
 begin
   Result := GetSystemEncoding;
 end;

Nothing need be removed. I consider SystemEncoding a better name than 
Default,
and the latter should only be kept for Delphi compatibility. IMHO it 
would be

better to avoid Default, in fact I would change references to Default to
SystemEncoding for clarity. Default is completely non-descriptive.

If I understand your reasoning correct, that should solve the problems 
you

report ?


Yes, that perfectly solves the issues Lazarus developers and users face. 
I am OK with this solution as well. Thanks!


Ondrej

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] TEncoding.Default and default encoding for TStrings.LoadFrom*()

2019-12-27 Thread Michael Van Canneyt



On Fri, 27 Dec 2019, Ondrej Pokorny wrote:


On 27.12.2019 0:19, Michael Van Canneyt wrote:

On Thu, 26 Dec 2019, Ondrej Pokorny wrote:


On 26.12.2019 19:29, Michael Van Canneyt wrote:
So no, I don't think these need to be changed/merged. What IMO can 
be discussed is
which of these 2 need to be used as the default codepage in other 
code. It

should then resolve the problems that appear, I think.


That would be possible as well. But still please reconsider it:
One reason: just from the convention - the default codepage to use 
should be TEncoding.Default. That is intuitive.


Second reason: Now we have TEncoding.ANSI = TEncoding.Default. 2 
equal properties. And another FPC-only property 
TEncoding.SystemEncoding. That means 3 properties for 2 values.


As far as I know, TEncoding.ANSI = CP_ACP.


This is indeed not correct. See 
https://wiki.freepascal.org/FPC_Unicode_support :
CP_ACP: this value represents the currently set "default system code 
page". See #Code page settings for more information.


I meant the windows meaning of CP_ACP, not what the RTL makes of it. 
I think the use of CP_ACP in the RTL is quite dubious.


Using CP_SYSTEM or so would have been better. No doubt again a Delphi
compatibility naming :(


TMBCSEncoding.Create(widestringmanager.GetStandardCodePageProc(scpAnsi))


This corresponds to what I meant.



and
  TStandardCodePageEnum = (
    scpAnsi, // system Ansi code page (GetACP on windows)

- as you can see the CP_ACP value does not correspond with the GetACP 
WinAPI call result. (But this is wanted as documented in 
https://wiki.freepascal.org/FPC_Unicode_support ).


Why should this equal TEncoding.Default ? 


sysencoding.inc:

class function TEncoding.GetDefault: TEncoding;
begin
  Result := GetANSI;
end;


I know it is currently so, the question is : why ? :)

Maybe Default is better SystemEncoding, see below.




I think  TEncoding.Default  = CP_UTF8 on linux ?


Yes, in FPC this is correct. Also TEncoding.ANSI =CP_UTF8 on linux in FPC.


Not necessarily, if I read the wiki page correctly.





The main problem I see is that there is the system (OS) encoding, and the
encoding specified by DefaultSystemCodePage.

These do not necessarily agree. So it makes sense to have 2 
TEncodings: one

for the system encoding, one for the DefaultSystemCodePage variable. They
will not be equal.

If they were, then the DefaultSystemCodePage variable makes no sense 
whatever.


Yes, indeed. Therefore I suggested
* TEncoding.Default for the DefaultSystemCodePage variable
and
* TEncoding.ANSI for the system encoding.

Currently we have
* TEncoding.SystemEncoding for the DefaultSystemCodePage variable
and
* both TEncoding.ANSI and TEncoding.Default for the system encoding. 
(TEncoding.ANSI and TEncoding.Default are equal in FPC.)


In that case,  why not simply change:

 class function TEncoding.GetDefault: TEncoding;
 begin
   Result := GetSystemEncoding;
 end;

Nothing need be removed. I consider SystemEncoding a better name than Default,
and the latter should only be kept for Delphi compatibility. IMHO it would be
better to avoid Default, in fact I would change references to Default to
SystemEncoding for clarity. Default is completely non-descriptive.

If I understand your reasoning correct, that should solve the problems you
report ?

Michael.___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel