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

[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

[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

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

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

[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

[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;    

[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

[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

[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:  

[fpc-pascal] FPC Mantis has 2 fields "fixed in revision" in issues

2019-10-21 Thread AlexeyT
First field is below the "OS" and "Product build" on the top; 2nd is below "Attach tags". Remove 1 of them. https://bugs.freepascal.org/view.php?id=35400 -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] FPC 3.3 trunk error with CudaText

2019-10-11 Thread AlexeyT
Win10 x32, Free Pascal Compiler version 3.3.1-r43163 [2019/10/11] for i386 After installing FPC trunk (via fpcupdeluxe), I cannot run CudaText from IDE. Also dont run from console: The application has failed to start because its side-by-side configuration is incorrect. Please see the

Re: [fpc-pascal] Cannot cross-compile from Linux to Solaris-SPARC ?

2019-10-04 Thread AlexeyT
So it was the issue of missing of fpcupdeluxe helper files (libs are not uploaded to fpcupdeluxe site) -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Errors on cross-compile from Linux x64 to NetBSD x64

2019-10-04 Thread AlexeyT
Thanks for fixing, after FPC update binary compiled okay. You maybe can test final binary: https://www.fosshub.com/CudaText.html (see "netbsd" link). -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] FPC docs about FindFirst

2019-09-22 Thread AlexeyT
https://www.freepascal.org/docs-html/rtl/sysutils/findfirst.html 1) add to the list of attribs the value faAnyFile. 2) correct the example: call FindClose only inside block "if FindFirst(..)=0" -- Regards, Alexey ___ fpc-pascal maillist -

Re: [fpc-pascal] OpenBSD platform define

2019-06-21 Thread AlexeyT
Added 2 defines: OpenBSD, DragonFlyBSD. Pls add others too. -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] SetCodePage in older FPC 3.0.4

2019-05-29 Thread AlexeyT
> FPC generally uses system library functions for the conversion, so it does not depend on the FPC version. But FPC has such files. Are they used in SetCodePage code? user@PC:~/fpcupdeluxe/fpcsrc/packages/rtl-unicode/src/inc$ ls cp* cp895.pas  cp932.pas  cp936.pas  cp949.pas  cp950.pas

[fpc-pascal] Regarding Win Pointer API

2019-05-18 Thread AlexeyT
https://bugs.freepascal.org/view.php?id=35578 Here I suggested to merge 3rd party unit into FPC, into Windows unit. Why to Windows? Because it's user32.dll imports. Maybe add APIs to JEDI component? I see FPC has /packages/winunits-jedi/src with many Win APIs, so maybe add unit there? Both ways

[fpc-pascal] Patch in trunk about 200/208 errors

2019-05-14 Thread AlexeyT
https://github.com/graemeg/freepascal/commit/2a1c95c8488dec617cefa65f4803bb17c7e57552 Seems 200 and 208 swapped (error) in some places of that patch. -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] Check WinAPI missing funcs from this MSDN list

2019-05-10 Thread AlexeyT
hi. I see the last FPC fixes has fix for missing WinAPI funcs. So I opened one of such func doc GetGuiResources, and got list of all related funcs. Pls check them: Process and Thread Functions     ICONINFO structure     ICONINFOEXA structure     ICONINFOEXW structure    

[fpc-pascal] FPC fixes3.2 gives error on "NWord div 2 * 2"

2019-02-17 Thread AlexeyT
https://github.com/Alexey-T/CudaText/commit/354858b19754d2d5fa2980b5f45fc76d1a266763#diff-c3361b43575e71110f1cea4cf54d8d13R325 this is fixed to avoid %subj% compile error. why error? -- Regards, Alexey ___ fpc-pascal maillist -

[fpc-pascal] FGL.TFPSList Find method needed (binary search)

2019-02-16 Thread AlexeyT
Hello. Can you pls, add Sorted property to TFPSList / TFPGList (Add() method must sort newly added item), and also Find method (which must use binary search in Sorted case, and use plain loop if not sorted)? -- Regards, Alexey ___ fpc-pascal

[fpc-pascal] StrUtils unit needs Widestring funcs

2019-02-15 Thread AlexeyT
According to one of new issues, StrUtils misses many funcs for UnicodeString: RPos, RPosEx Maybe someone here can help to write. (In CudaText project I had a bug, when i used RPos on Russian text and got too big result). -- Regards, Alexey ___

[fpc-pascal] GDeque unit crash, FPC trunk

2019-01-29 Thread AlexeyT
For those who wants to replicated gdeque crash. I avoided using of gdeque unit now, so to replicate, pls get an older version of atsynedit_adapter_cache.pas: before 2019.01.30 https://github.com/Alexey-T/ATSynEdit/commits/master/atsynedit/atsynedit_adapter_cache.pas -- Regards, Alexey

[fpc-pascal] GDeque unit crash, FPC trunk

2019-01-27 Thread AlexeyT
I see stange crash in gdeque unit if I use unit from FPC trunk https://github.com/graemeg/freepascal/blob/master/packages/fcl-stl/src/gdeque.pp crash in TDeque.PushFront, i cannot understand it and i don't know the code. pls, reproduce it like me: - Linux gtk2 x64 (Ubuntu 18.4), fpc 3.0.4,

Re: [fpc-pascal] Sleep(30) is not reliable?

2018-01-24 Thread AlexeyT
Details: Ubuntu 17.4 x64; Lazarus 1.9 trunk, fpc 3.0.2. I see IDE call stack like this  when i pause app (during loop forever) SYSTEM_$$_FPSYSCALL$INT64$INT64$$INT64 0041E7E0 55   push   %rbp 0041E7E1 4889e5   mov    %rsp,%rbp 0041E7E4

[fpc-pascal] Sleep(30) is not reliable?

2018-01-24 Thread AlexeyT
In Lazarus component EControl I call Sleep(30) to wait when timer tick work is done. while FBusy do Sleep(30); and app loops forever now in sleep(). procedure Sleep(milliseconds: Cardinal); Var   timeout,timeoutresult : TTimespec;   res: cint; begin   timeout.tv_sec:=milliseconds div 1000;  

Re: [fpc-pascal] fgl unit, TFPSList needs DeleteRange

2017-12-10 Thread AlexeyT
Pls, call Deref for all items (1 by 1), by REALLOC all items [e.g. 800K] as block. Today I call Delete 800K times and do realloc 800K times :( -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] fgl unit, TFPSList needs DeleteRange

2017-12-10 Thread AlexeyT
Hello I have 1M lines file. CudaText (Lazarus app) cannot delete lines fast [selected 800K lines]. Reason: TFPSList has only Delete for one item. Need DeleteRange for many items. -- Regards, Alexey ___ fpc-pascal maillist -