[fpc-pascal] FPC 3.2fixes UTF8Decode strange place

2020-11-01 Thread AlexeyT via fpc-pascal
>Though one could probably exclude the check at line 1981 of rtl/inc/ustrings.inc as well as the two existing branches will result in the same Yes, it was my point B. @/José Mejuto, can you pls simplify this place, ie remove "if /IBYTE = 10" + then/else. -- Regards, Alexey

Re: [fpc-pascal] FPC 3.2fixes UTF8Decode strange place

2020-10-29 Thread AlexeyT via fpc-pascal
 So can you COMMENT that dead part with "and FALSE" and dead part II with "if ... =#10"? It will make things faster for people! Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fp

[fpc-pascal] FPC 3.2fixes UTF8Decode strange place

2020-10-27 Thread AlexeyT via fpc-pascal
rtl/inc/ustrings.inc function UTF8ToUnicode(Dest: PUnicodeChar; MaxDestChars: SizeUInt; Source: PChar; SourceBytes: SizeUInt): SizeUInt; a) it has "If (PreChar<>13) and FALSE then" and later some big block. with a comment which tells that "and FALSE" is on purpose and block is ignored.

[fpc-pascal] UnicodeCompareStr and UnicodeCompareText strange result

2020-03-17 Thread AlexeyT via fpc-pascal
FPC 3.0.4 Linux x64, test from Lazarus 2.0 trunk, ie with widestringmanager. UnicodeCompareStr('aaa', 'AA')=1 - ? UnicodeCompareText('aaa', 'AA')=1 - ok UnicodeCompareStr('AAA', 'aa')=1 - ? UnicodeCompareText('AAA', 'aa')=1 - ok I expected that *Str gives different results, because 'a' vs 'A'

[fpc-pascal] App crash on FPC 3.3 today's trunk

2020-02-18 Thread AlexeyT via fpc-pascal
Linux x64 gtk2, crash in regnext() in "offset:=", https://github.com/Alexey-T/ATSynEdit/blob/master/atsynedit/atsynedit_regexpr.pas#L3664 -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-

Re: [fpc-pascal] Last fix for RegExpr (error on empty input)

2020-02-15 Thread AlexeyT via fpc-pascal
My app does mass replace with regex. in big text, user enters regex "\b" and replaces it to eg "__". app calls Substitute() with each found match, match is zero length so your code will NOT replace it to "__". but it's needed to replace it to "__". -- Regards, Alexey _

[fpc-pascal] Last fix for RegExpr (error on empty input)

2020-02-15 Thread AlexeyT via fpc-pascal
1) typo in new Id: iMput. 2) wrong fix for 2nd "Error" call in Substitute(): you disabled Error call but didn't disable Exit, you need to skip Exit there too, so Substitute will return non empty result when user replaces regex "\b" to e.g. "__". -- Regards, Alexey __

Re: [fpc-pascal] TIniFile.WriteString gives file with BOM, bad

2020-01-10 Thread AlexeyT via fpc-pascal
Can you add TIniFile.WriteBom property? it's not quite enough, I need to disable it globally in entire app (I have ~10 ini objects), so additional global default is needed (like Lazarus has global variables). -- Regards, Alexey ___ fpc-pascal maillis

Re: [fpc-pascal] TIniFile.WriteString gives file with BOM, bad

2020-01-10 Thread AlexeyT via fpc-pascal
>> 2) if BOM is there, allow ReadString to find section at the file begin: I can read/write IniFiles with BOM with fpc r43847, with and withoud DefautSystemCodePage := CP_UTF8. Sorry, my mistake-- TIniFile can read this BOM file, but my software cannot: a) I've fixed one place where my app re

[fpc-pascal] TIniFile.WriteString gives file with BOM, bad

2020-01-10 Thread AlexeyT via fpc-pascal
    ini_lexmap:= TIniFile.Create(fn_lexmap_final);     try   ini_lexmap.WriteString('ref', IntToStr(i_sub), s_lexer);     finally   FreeAndNil(ini_lexmap);     end; with FPC trunk it converts .ini file to UTF8 BOM! Bad, because then my code reads this .ini file an

[fpc-pascal] DirectoryExists of FreeBSD 12- Java solution

2019-11-21 Thread AlexeyT via fpc-pascal
https://github.com/jnr/jnr-posix/issues/126 these guys had found the reason of broken Java code on freebsd 12: they now detect ABI version and use different struct on freebsd 12. link shows Github patch to Java "stat" struct. -- Regards, Alexey ___

[fpc-pascal] DirectoryExists on FreeBSD 12 problem

2019-11-21 Thread AlexeyT via fpc-pascal
freebsd src is https://github.com/freebsd/freebsd/blob/master/sys/sys/stat.h it has 2 defines for "stat": usual struct stat {     dev_t st_dev;        /* inode's device */     ino_t      st_ino;        /* inode's number */     nlink_t      st_nlink;        /* number of hard links */ *mode_t 

[fpc-pascal] TStringList.SetCommaText needs refactor

2019-11-09 Thread AlexeyT via fpc-pascal
It's obvious this needs to use SetDelimetedText with other params (2nd 3rd) Procedure TStrings.SetCommaText(const Value: string); begin   CheckSpecialChars;   C1:=Delimiter;   C2:=QuoteChar;   Delimiter:=',';   QuoteChar:='"';   Try     SetDelimitedText(Value);   Finally     Delimiter:=C1;     Qu

[fpc-pascal] StringList micro optimization

2019-11-07 Thread AlexeyT via fpc-pascal
Procedure TStrings.SetDelimitedText(const AValue: string);  has about 16 calls to Length(AValue), so make a variable NLen to speed up it. -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-b

[fpc-pascal] TEventObject.ManualReset help page

2019-11-05 Thread AlexeyT via fpc-pascal
https://www.freepascal.org/docs-html/current/fcl/syncobjs/teventobject.manualreset.html text is poor, even the text in .Create (about ManualReset) is more detailed, so copy text from .Create to this page. -- Regards, Alexey ___ fpc-pascal maillist

[fpc-pascal] TEventObject.Create site help

2019-11-05 Thread AlexeyT via fpc-pascal
https://www.freepascal.org/docs-html/current/fcl/syncobjs/teventobject.create.html Create creates a new event object with unique name AName. The object will be created security attributes EventAttributes (windows only). - "created security" - "with" missed - "windows only"-> "parameter is use

[fpc-pascal] FPC cannot understand 1-char string as PChar

2019-11-04 Thread AlexeyT via fpc-pascal
FPC 3.3.1-r43022 [2019/09/16] for Linux x64. This code crashes, because fpc sees 'x', 'y' wrong:   Py_BuildValue('{sLsisisisisisisOsOsOsisisisisisO}',     'tag',     Mark.Tag,     'x',     Mark.PosX,     'y',     Mark.PosY,     'len',     Mark.LenX, I must change it to this, it works ok:   Py_B