Re: [fpc-pascal] StrToInt is using ShortString buffer?

2022-01-14 Thread Alexey Tor. via fpc-pascal
That is another reason for PChar based inner func. :) the input might be 00

[fpc-pascal] StrToInt is using ShortString buffer?

2022-01-12 Thread Alexey Tor. via fpc-pascal
Hello. As I see in the commit https://gitlab.com/freepascal.org/fpc/source/-/commit/beecbf1581a986f544fde77aa428e05c21a35f6f StrToInt always uses ShortString buffer: *Function fpc_Val_SInt_ShortStr(DestSize: SizeInt; Const S: ShortString; out Code: ValSInt): ValSInt;* If it is correct: Can w

[fpc-pascal] FP wiki shows bad picture sizes

2020-08-09 Thread Alexey Tor. via fpc-pascal
Picture at https://wiki.freepascal.org/CudaText#Lexers and at https://wiki.freepascal.org/CudaText#Lexers_editing both shown with wrong sizes -- left from old picture  versions. Upload of new pics gave "red error text". -- Regards, Alexey ___ fpc-pasc

[fpc-pascal] FPC 3.2.1 gdeque Erase(0) hangs forever

2020-07-17 Thread Alexey Tor. via fpc-pascal
CudaText for linux x64. gdeque (fcl-stl) method Erase(0) (list has single item) hangs. I made workaround- replaced Erase(i) with Clear (erase all items). deque items - not managed.   PATAdapterCacheItem = ^TATAdapterCacheItem;   TATAdapterCacheItem = packed record     LineIndex, CharIndex, Lin

[fpc-pascal] TProcess doc page bugs

2020-07-13 Thread Alexey Tor. via fpc-pascal
>No, read-only. It's input from the point of view of the *parent process*. Doc is blurry. Can you write there - what streams (3: input/ output/ stderr) are OK for ReadInputStream ? -- Regards, Alexey

[fpc-pascal] TProcess doc page bugs

2020-07-12 Thread Alexey Tor. via fpc-pascal
>It's an input pipe stream, which is by definition read-only. Input is read-only?? it's write-only I guess. >It automatically follows you can only read from Output and StdErr streams. Then we need ". from Output/StdErr streams" text there. Cur text is misleading. Alexey

[fpc-pascal] TProcess doc page bugs

2020-07-12 Thread Alexey Tor. via fpc-pascal
https://www.freepascal.org/docs-html/current/fcl/process/tprocess.readinputstream.html a) it has 2 sections "Arguments" (mixed with "Func result")- pls make nicer output: "Arguments (variant 1)", "Arguments (variant 2)", "Function result" b) first variant of func has "public" mark - it's crap

[fpc-pascal] TProcessUTF8 doc - 2

2020-07-06 Thread Alexey Tor. via fpc-pascal
a) https://lazarus-ccr.sourceforge.io/docs/lazutils/utf8process/tprocessutf8.html here we have 2-3 items depre - ApplicationName, CommandLine. but list shows no special mark. confusing. it shows [rw] marks, pls add near the [deprecated] marks. b) https://lazarus-ccr.sourceforge.io/docs/fcl/

[fpc-pascal] TProcessUTF8 doc - 2

2020-07-06 Thread Alexey Tor. via fpc-pascal
a) https://lazarus-ccr.sourceforge.io/docs/lazutils/utf8process/tprocessutf8.html here we have 2-3 items depre - ApplicationName, CommandLine. but list shows no special mark. confusing. it shows [rw] marks, pls add near the [deprecated] marks. b) https://lazarus-ccr.sourceforge.io/docs/fcl/

[fpc-pascal] TProcessUTF8 doc - 2

2020-07-06 Thread Alexey Tor. via fpc-pascal
a) https://lazarus-ccr.sourceforge.io/docs/lazutils/utf8process/tprocessutf8.html here we have 2-3 items depre - ApplicationName, CommandLine. but list shows no special mark. confusing. it shows [rw] marks, pls add near the [deprecated] marks. b) https://lazarus-ccr.sourceforge.io/docs/fcl/

[fpc-pascal] TProcess.CurrentDirectory doc

2020-07-06 Thread Alexey Tor. via fpc-pascal
https://lazarus-ccr.sourceforge.io/docs/fcl/process/tprocess.currentdirectory.html CurrentDirectory specifies the working directory of the newly started process.Changing this property after the process was started has no effect. need more info there! a) what happens when the process, eg Bash f

[fpc-pascal] optimization for strlicomp()

2020-05-31 Thread Alexey Tor. via fpc-pascal
function strlicomp(str1,str2 : pwidechar;l : SizeInt) : SizeInt;   var    counter: sizeint;    c1, c2: char;   begin     counter := 0;     if l=0 then   begin     strlicomp := 0;     exit;   end;     repeat   c1:=simplewideupcase(str1[counter]);   c2:=simplewideupcase(str2[

[fpc-pascal] Array of const: docs

2020-02-09 Thread Alexey Tor. via fpc-pascal
https://www.freepascal.org/docs-html/ref/refsu69.html Remark: Note that there is no support for QWord arguments in array of const. This is for Delphi compatibility, and the compiler will ignore any resulting range checks when in mode Delphi. but the code shows that QWord is supported. huh?   T

[fpc-pascal] Incorrect IDE Messages error line

2019-10-29 Thread Alexey Tor.
Compile Project, Mode: linux x64 qt5, Target: builds/linux-x64-qt5/cudatext: Exit code 1, Errors: 3 Error: /home/user/lazarus/lcl/units/x86_64-linux/qt5/qtwidgets.o: In function `SETTEXTHINT': Error: /home/user/lazarus/lcl/interfaces//qt5/qtwidgets.pas:10156: undefined reference to `QTextEdit_se

Re: [fpc-pascal] DirectoryExists on FreeBSD , problem

2019-10-14 Thread Alexey Tor.
>Does SysUtils.DirectoryExists work? No, the dir name is pure English, so DirectoryExistsUTF8 does the same. -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pasca

[fpc-pascal] DirectoryExists on FreeBSD , problem

2019-10-14 Thread Alexey Tor.
 FPC 3.3.1-r43118 [2019/10/04], on Linux x64, cross compiling to FreeBSD x64 12.0 (TrueOS). Smth is broken in DirectoryExistsUTF8() on FreeBSD. After this FPC update CudaText cannot see that folder (in subdir of home dir, access rights ok) exists. After removing this check in app, app now cannot

[fpc-pascal] TThreadedQueue like in Delphi?

2019-10-12 Thread Alexey Tor.
Hi I want to make some open source project for Laz, and need the thread-safe queue for it. So this Delphi class is Ok, but FPC 3.3 r42919 misses it in Generics.Collections: http://docwiki.embarcadero.com/Libraries/Rio/en/System.Generics.Collections.TThreadedQueue Can you please add it? Is it h

[fpc-pascal] WideStringToUCS4String optimization

2019-10-11 Thread Alexey Tor.
Hi {$ifdef FPC_HAS_FEATURE_DYNARRAYS} procedure UCS4Encode(p: PWideChar; len: sizeint; out res: UCS4String);   var     i, reslen: sizeint;     w: longint;   begin     reslen:=0;     i:=0;     { calculate required length } this func loops over the buffer 2 times. 1) find len in UCS4 chars, 2) ma

[fpc-pascal] Improve THandleStream.Size for VFS on Linux

2019-10-07 Thread Alexey Tor.
Ubuntu 18.x x64. FPC 3.3 trunk. I get handle of '/proc/version' using func below (e.g. handle=22). Now I want to get file size of that file. and read all contents into THandleStream. But problem is: THandleSteam.Size gets 0. I guess THandleStream can override GetSize to get size smarter. Maybe s

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

2019-10-04 Thread Alexey Tor.
FPC 3.3 trunk from today. Lazarus trunk from today. Project CudaText. Cross compilers installed via fpcupdeluxe 1.6.2y ... Compile package atsynedit_cmp_package 1.1: Success Compile package atsynedit_ex_package 1.3: Success Compile Project, Mode: netbsd x64, OS: netbsd, Target: builds/netbsd-x6

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

2019-10-02 Thread Alexey Tor.
Linux x64. Free Pascal Compiler version 3.2.0-beta-r41315 [2019/02/16] for x86_64 Installed cross-compiler to Solaris-SPARC, using fpcupdeluxe 1.6.2y. I got such errors on compiling my project. what it means? maybe I must update FPC to trunk? Error: /home/user/fpcupdeluxe/cross/bin/sparc-solari

[fpc-pascal] Wiki: platform defines

2019-06-28 Thread Alexey Tor.
https://wiki.freepascal.org/Platform_defines#Operating_system_defines I 've added all defines of OS. You can tell me if it's not ok. Missed one item: 'nativent' target. Seems some Win32 target? why new? Why it don't have extradefines "windows"? https://github.com/graemeg/freepascal/blob/maste

[fpc-pascal] FPC 3.2 error when cross compile from Linux x64 to NetBSD

2019-06-24 Thread Alexey Tor.
FPC 3.2 installed in FPCupdeluxe, with Lazarus trunk. NetBSD binary is made but with such error in Laz window: Compile Project, Mode: netbsd x64, OS: netbsd, Target: builds/netbsd-x64-gtk2/cudatext: Success, Errors: 2 Error: /home/user/fpcupdeluxe/cross/bin/x86_64-netbsd/x86_64-netbsd-ld: /ho

[fpc-pascal] OpenBSD platform define

2019-06-21 Thread Alexey Tor.
I cannot find such in the https://wiki.freepascal.org/Platform_defines - its missed? -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] SetCodePage in older FPC 3.0.4

2019-05-28 Thread Alexey Tor.
I am making small unit https://github.com/alexey-t/aencoding so I need to know: a) will it work on FPC 3.0.4? do I need to use {$ifdef}? b) my trick to set CP_UTF8 at the end of FromTo function is ok? c) what encoding numbers (e.g. 936, 950) exist in FPC 3.3 but didn't exist in FPC 3.0.4?

[fpc-pascal] Convert codepages back to UTF8

2019-05-28 Thread Alexey Tor.
Ok, I got it. But I wonder: if my code changes codepage of a "string" to e.g. 1250, will all Lazarus string functions work ok with such changed string? For ex, will Pos('Петя', s) work? -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.

[fpc-pascal] Convert codepages back to UTF8

2019-05-27 Thread Alexey Tor.
LazUtils.LConvEncoding can convert utf8 to codepage (not many codepages) and vice versa. FPC 3 can convert utf8 to codepage - via SetCodePage(s, codepage, true). But how can FPC convert back - codepage to utf8? Does such way exist? -- Regards, Alexey _

[fpc-pascal] Improve message "Wrong ppu found"

2019-04-24 Thread Alexey Tor.
Suggestion: in the message $subj, can you add FPC version of that PPU? so it will be "Wrong PPU found [FPC 2.7.8]" when FPC needs PPU for 3.2.0. -- Regards, Alexey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org

[fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-13 Thread Alexey Tor.
E.g. i have a loop which test each s[i] char for several cases: 'a', 'b', 'c'. for i:= 1 to length(s) do if (s[i]='a') or (s[i]='b') or (s[i]='c') then ... Can FPC optimize it so it only reads s[i] once (to register), not 3 times? -- Regards, Alexey __