Re: [fpc-pascal] FCGI MultiThreaded
On 05/05/2014 06:22 PM, Paul Breneman wrote: I'm glad to learn a little more from your recent messages. As you are interested I am happy to provide some more information. In msegui, the EventQueue is done using a decently structured construct of classes that allows for creating any type of information queues. As in Lazarus the GUI based WidgetTypes all use implement own dedicated event queue code, using an msegui based construct IMHO would only makes sense if all appropriate queues in the LCL would be done on that base. I of course am not in a position to trigger such a re-construction. So I gave up on that idea for such a "small" and seldom used Widget Type as I have in mind. When doing a not GUI based Widget Type (for embedded and/or CGI use) using just the Event queue that is implemented in the fpc rtl, a very basic and rather inaccurate but platform independent TTimer implementation could be done managing the Timeout parameter of "CheckSynchronize" according to the needs of all active instances of TTimer. A more accurate implementation would need to use OS features such as timers or threads and push events onto the queue. When doing such a WidgetType, "Application.QueueAsynCall" would need to be implemented in a way that it pushes events onto the said queue. -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Currency constant wrongly stored in generated EXE ? was: Re: Inconsistent results currency - extended ?
Bruno Krayenbuhl wrote / napísal(a): 2 - Difference between 2.6.4 on Win98 and WinXP. I suspect that these 2 are on different computers and thus do not have exactly the same floating point unit. Yes Win 98 is on PC with Intel Pentium 4 CPU and Win XP on PC with Intel Core 2 Duo CPU But lets look again at our "simplified" program: = var c: currency; i64: int64; begin c:=92233720368547; = Here I stop and let's look at assembler of "c:=92233720368547" : -- 00401543 a1c0204100 mov0x4120c0,%eax // low 4 bytes; EAX=-859001088 resp. 0xaf00 = 3435966208 00401548 a300604100 mov%eax,0x416000 0040154D a1c4204100 mov0x4120c4,%eax // high 4 bytes; EAX=214748364 00401552 a304604100 mov%eax,0x416004 -- So currency value is: 2^32*214748364 + 3435966208 = 922337200249503744 + 3435966208 = 922337203685469952 Not as expected 92233720368547 ! (this is on Win 98 PC !, on Win XP PC are values in EAX correct 3435966256, 214748364) So constant "92233720368547" which is part of generated EXE (I think) is wrong parsed or interpreted or what and stored wrongly in output EXE file. But why it happens ? What part of compiler is responsible for parsing constants in source code and translating them to binary form in which is stored in output EXE file ? Does compiler links any external DLLs which probably may change FPU control word (precision or so) ? Does compiler first converts value to floating point representation ant then back to currency or ? Thanks -Laco. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Currency constant wrongly stored in generated EXE ? was: Re: Inconsistent results currency - extended ?
My point N°2 regarding potential FPU difference was only concerning instruction line e:=c; = I have absolutely no idea of how the compiler does translate Currency constant to code, sorry. May be it uses the FPU when translating from String representation to assembler value, but I have absolutely no idea where that would be done in the compiler. Anyway, it may be possible that the compiler uses StrToCurr or something similar. var cAsString:string; . . cAsString:=CurrToStr(c); c:=StrToCurr(cAsString). { <== Check after here on W98 / XP and look for differences on value c. That uses an FPU instruction fistpll that look as causing some trouble to other projects (Non FPC) } . . Regards, Bruno Note : I'm interested to know what you discover since I like using Currency's var. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For Slackware users
It seems that there is no website category in bug tracker. Should I report this somewhere else ? Thanks 2014-05-05 14:05 GMT+02:00 Yann Mérignac : > So, there is a problem with the mailing list page of the free pascal > website (http://freepascal.org/maillist.var). > > The first link (http://lists.freepascal.org/lists/fpc-pascal/) gives an > error. > > The second one ( > http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/) is ok. But > the archive is not updated very often. > > > > > 2014-05-05 13:52 GMT+02:00 Jonas Maebe : > > >> On 05 May 2014, at 13:40, Yann Mérignac wrote: >> >> PS : I already post this message 4 hours ago but it doesn't appear in >>> mailing list archives... >>> >> >> Your previous post is at http://lists.freepascal.org/ >> pipermail/fpc-pascal/2014-May/041799.html >> >> This one is at http://lists.freepascal.org/pipermail/fpc-pascal/2014-May/ >> 041803.html >> >> >> Jonas >> >> ___ >> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal >> > > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For Slackware users
On Tue, May 6, 2014 17:02, Yann Mérignac wrote: > It seems that there is no website category in bug tracker. Should I report > this somewhere else ? While there is such a category (at least if you select project FPC), I'm aware of the raised point (confirmed) and plan to fix it (together with adding the link to your site as discussed). Tomas > > 2014-05-05 14:05 GMT+02:00 Yann Mérignac : > >> So, there is a problem with the mailing list page of the free pascal >> website (http://freepascal.org/maillist.var). >> >> The first link (http://lists.freepascal.org/lists/fpc-pascal/) gives an >> error. >> >> The second one ( >> http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/) is ok. But >> the archive is not updated very often. >> >> >> >> >> 2014-05-05 13:52 GMT+02:00 Jonas Maebe : >> >> >>> On 05 May 2014, at 13:40, Yann Mérignac wrote: >>> >>> PS : I already post this message 4 hours ago but it doesn't appear in mailing list archives... >>> >>> Your previous post is at http://lists.freepascal.org/ >>> pipermail/fpc-pascal/2014-May/041799.html >>> >>> This one is at >>> http://lists.freepascal.org/pipermail/fpc-pascal/2014-May/ >>> 041803.html >>> >>> >>> Jonas >>> >>> ___ >>> fpc-pascal maillist - fpc-pascal@lists.freepascal.org >>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal >>> >> >> > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] For Slackware users
Sorry, I thought that bugs reported in project FPC should concern compiler or units bugs. 2014-05-06 17:20 GMT+02:00 Tomas Hajny : > On Tue, May 6, 2014 17:02, Yann Mérignac wrote: > > It seems that there is no website category in bug tracker. Should I > report > > this somewhere else ? > > While there is such a category (at least if you select project FPC), I'm > aware of the raised point (confirmed) and plan to fix it (together with > adding the link to your site as discussed). > > Tomas > > > > > > > 2014-05-05 14:05 GMT+02:00 Yann Mérignac : > > > >> So, there is a problem with the mailing list page of the free pascal > >> website (http://freepascal.org/maillist.var). > >> > >> The first link (http://lists.freepascal.org/lists/fpc-pascal/) gives an > >> error. > >> > >> The second one ( > >> http://www.mail-archive.com/fpc-pascal@lists.freepascal.org/) is ok. > But > >> the archive is not updated very often. > >> > >> > >> > >> > >> 2014-05-05 13:52 GMT+02:00 Jonas Maebe : > >> > >> > >>> On 05 May 2014, at 13:40, Yann Mérignac wrote: > >>> > >>> PS : I already post this message 4 hours ago but it doesn't appear in > mailing list archives... > > >>> > >>> Your previous post is at http://lists.freepascal.org/ > >>> pipermail/fpc-pascal/2014-May/041799.html > >>> > >>> This one is at > >>> http://lists.freepascal.org/pipermail/fpc-pascal/2014-May/ > >>> 041803.html > >>> > >>> > >>> Jonas > >>> > >>> ___ > >>> fpc-pascal maillist - fpc-pascal@lists.freepascal.org > >>> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > >>> > >> > >> > > ___ > > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > > > ___ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal > ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] Wrong links to mailing list archives fixed (Was: Re: For Slackware users)
On 6 May 14, at 17:25, Yann MĂŠrignac wrote: > Sorry, I thought that bugs reported in project FPC should concern compiler > or units bugs. No problem - as can see if looking at the list of categories defined for that project, this "project" is really meant for anything related to content hosted on http://www.freepascal.org (including the site itself). I hope that the links should be OK now, thanks for your report (and your interest in FPC :-) ). Tomas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] overloading function
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 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: UnicodeString; MaxLen: SizeInt): PWideChar; overload; And in program I use: var p: pointer; s: string; begin StrPLCopy(p, s, 10); end; It seems, that 2nd "unicode" version of StrPLCopy is called. But why? I am thinking as: 1st parameter is untyped pointer, so no one of function can be prefered 2nd parameter is "string" which exactly match 1st function signature 3rd parameter is "integer constant" which mach both signatures So it seems to me, that 1st version of function signature matches better, because of exact match of 2nd parameter ... why is then called 2nd version? I don't have a explanation for now, but it *might* be important to note whether you are using 2.6.x or 2.7.1. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal program test_StrPLCopy; {$mode objfpc}{$H+} uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF} Classes { you can add units after this }; function StrPLCopy(Dest: PChar; Source: string; MaxLen: SizeUInt): PChar;overload; begin writeln('Ansi version'); end; function StrPLCopy(Dest: PWideChar; const Source: UnicodeString; MaxLen: SizeInt): PWideChar; overload; begin writeln('Unicode version'); end; var p: pointer; s: string; begin StrPLCopy(p, s, 10); readln; end. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] Currency constant wrongly stored in generated EXE ? was: Re: Inconsistent results currency - extended ?
Bruno Krayenbuhl wrote / napísal(a): I have absolutely no idea of how the compiler does translate Currency constant to code, sorry. May be it uses the FPU when translating from String representation to assembler value, but I have absolutely no idea where that would be done in the compiler. Anyway, it may be possible that the compiler uses StrToCurr or something similar. var cAsString:string; . . cAsString:=CurrToStr(c); c:=StrToCurr(cAsString). { <== Check after here on W98 / XP and look for differences on value c. That uses an FPU instruction fistpll that look as causing For : c:=strtocurr('92233720368547'); writeln(c); // here I get CORRECT result: 9.22337203685470E+13 But as I wrote: c:=92233720368547; writeln(c); // here I get INCORRECT result: 9.223372036854699520E+13 But as I wrote it is not a problem of displaying currency value, it is problem that currency variable realy contains incorrect number, which is then correctly displayed ... ;-( -Laco. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal