Re: [fpc-pascal] Why is Random(255) some 529x slower compared to Delphi 7?

2011-12-09 Thread Vinzent Höfler
On Thu, 08 Dec 2011 10:52:01 +0100, Graeme Geldenhuys graemeg.li...@gmail.com wrote: On 8 December 2011 11:33, Henry Vermaak wrote: I agree, quality first. I would normally agree with that. But such huge magnitudes slower (20ms vs 10585ms) on a new Quad-Core type system? That just seems

Re: [fpc-pascal] Adding code indentation without Lazarus

2012-01-02 Thread Vinzent Höfler
On Mon, 02 Jan 2012 15:12:15 +0100, luciano de souza luchya...@gmail.com wrote: So I ask: Does someone know a commandline tool that indents the code automatically? Try 'ptop'. It comes with FPC already. Vinzent. ___ fpc-pascal maillist -

Re: [fpc-pascal] High precision timing

2012-01-20 Thread Vinzent Höfler
On Fri, 20 Jan 2012 21:38:04 +0100, kingbiz...@gmail.com kingbiz...@gmail.com wrote: I would like to know if is there any way to get the time in a high precision, something like nannoseconds. Yes. Depending on the required resolution, the operating system, processor architecture, and your

Re: [fpc-pascal] OT: Amazing new development tools

2012-02-25 Thread Vinzent Höfler
On Sat, 25 Feb 2012 19:15:54 +0100, ik ido...@gmail.com wrote: I found the following amazing lecture that present a new idea of a development tool, that I think will interest you all: http://vimeo.com/36579366 Impressive, indeed. And I am usually not that easily impressed. Vinzent.

Re: [fpc-pascal] C Enum vs. Integer

2012-09-12 Thread Vinzent Höfler
On Wed, 12 Sep 2012 20:44:21 +0200, Jonas Maebe jonas.ma...@elis.ugent.be wrote: Include an appropriate {$packenum xxx} directive in your source code. There is no {$packenum c} (I'm not even sure whether the C standard says anything about the size of enums), Yes, it does say something

Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Vinzent Höfler
On Fri, 14 Sep 2012 14:48:08 +0200, Krzysztof dib...@wp.pl wrote: I just quicky googled not allowed characters and wrote this simple function: Seems, you found one of the many (I'd suspect) wrong search results. function IsValidFilename(const AFilename: String): Boolean; var c: set of

Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Vinzent Höfler
On Fri, 14 Sep 2012 18:42:55 +0200, Jorge Aldo G. de F. Junior jagf...@gmail.com wrote: am i the only one seeing a security risk here ? *scratching head* Which part? Care to elaborate? I'd presume, you mean another than that I'm using Windows? ;) I don't see how manually restricting the

Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Vinzent Höfler
On Fri, 14 Sep 2012 18:42:55 +0200, Jorge Aldo G. de F. Junior jagf...@gmail.com wrote: am i the only one seeing a security risk here ? Now it dawns. You're thinking environment variables (%)? Vinzent. -- The most likely way for the world to be destroyed, most experts agree, is by

Re: [fpc-pascal] Function for checking correct file name

2012-09-14 Thread Vinzent Höfler
On Fri, 14 Sep 2012 18:53:53 +0200, Krzysztof dib...@wp.pl wrote: I need only basic checking, it not need to be 100% compability with OS specification. My program asking user for playlist name and I'm saving it in local folder with my own extension. Then for von Neumanns sake simply try to

Re: [fpc-pascal] Function for checking correct file name

2012-09-15 Thread Vinzent Höfler
On Sat, 15 Sep 2012 11:20:53 +0200, Sven Barth pascaldra...@googlemail.com wrote: On 14.09.2012 17:44, Graeme Geldenhuys wrote: On 14/09/12 13:48, Krzysztof wrote: I just quicky googled not allowed characters and wrote this simple function: Also in Windows (as far as I know), file names

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-29 Thread Vinzent Höfler
Florian Klaempfl flor...@freepascal.org: If you have a better for unix this will be fine. IIRC it is not easy (if possible after all?) to implement TMultiReadExclusiveWriteSynchronizer for unix systems. It's possible, yes. If it's possible in an efficient way, is another question. Vinzent.

Re: [fpc-pascal] TMultiReadExclusiveWriteSynchronizer is wrongly implemented

2009-08-29 Thread Vinzent Höfler
Graeme Geldenhuys grae...@opensoft.homeip.net: I have a corrected TMultiReadExclusiveWriteSynchronizer implementation (don't worry, not based on Delphi implementation) that I can donate to FPC. I hope it isn't based on the Delphi one. Last time I heard the Delphi implementation suffers from

Re: [fpc-pascal] Case in Record

2009-10-08 Thread Vinzent Höfler
Jürgen Hestermann juergen.hesterm...@gmx.de: And I don't know any other Pascal Compiler who does any checks in this direction. Do some? I don't know, but ADA reportedly does. Yes, but the semantics of discriminants is slightly different than in PASCAL. I don't know the differences to

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-10 Thread Vinzent Höfler
Henry Vermaak henry.verm...@gmail.com I can't understand what you are trying to say. An array is a pointer to where the elements of the array resides in memory. No, not in Pascal. In Pascal an array is a variable just like any other: A name for some memory area where values can be stored.

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-10 Thread Vinzent Höfler
Henry Vermaak henry.verm...@gmail.com: One thing I think you don't understand is that an array _is_ a pointer. Look at this table to visualise: http://en.wikipedia.org/wiki/C_syntax#Accessing_elements One thing I think you don't understand is that arrays and pointers are orthogonal

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-11 Thread Vinzent Höfler
mar...@stack.nl: In our previous episode, Vinzent Höfler said: One thing I think you don't understand is that arrays and pointers are orthogonal concepts in almost every other programming language than C. So technically, C is the one who got it wrong. Wrong and right are absolute

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-11 Thread Vinzent Höfler
Henry Vermaak henry.verm...@gmail.com: Thanks for the explanation, I was under the impression that arrays in Pascal were similar to C. How do you explain the automatic dereferencing with a pointer to an array that Jürgen is talking about? Those are dynamic arrays, IOW pointers disguised as

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-11 Thread Vinzent Höfler
Henry Vermaak henry.verm...@gmail.com: 2009/10/10 Vinzent Höfler jellyfish.softw...@gmx.net: Henry Vermaak henry.verm...@gmail.com: One thing I think you don't understand is that an array _is_ a pointer.  Look at this table to visualise: http://en.wikipedia.org/wiki/C_syntax

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-11 Thread Vinzent Höfler
Henry Vermaak henry.verm...@gmail.com: Please don't confuse your opinion with right and wrong. It's not just my opinion, that arrays and pointer are different things. One might say it's a fact. Confusion and consistency were what this discussion was about. Confusing code may have many

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-11 Thread Vinzent Höfler
Marco van de Voort mar...@stack.nl: And the criticism about introducing Cisms in FPC/Delphi is also old. In the past I would have joined you, but after a few non-trivial header conversions and library conversions that pretty much died out. Yes. But that's not the fault of the C-language.

Re: [fpc-pascal] Why use pointers to arrays?

2009-10-11 Thread Vinzent Höfler
Andrew Brunner andrew.t.brun...@gmail.com: 1st benefit: declaring methods associated with classes before TIntArray needs to be defined or declared. eg. procedure DoSomething(Var Data:TIntArray); vs (DataP:PIntArray); Huh? Is there any difference other than the second one can take a NIL

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-11 Thread Vinzent Höfler
mar...@stack.nl: That simply means, the code is not documented. Again: Not entirely C's fault. Docs. Like anybody reads them. Well, I do. If the coder cares to write any, that is. :) Vinzent. -- Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 - sicherer,

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-11 Thread Vinzent Höfler
Henry Vermaak henry.verm...@gmail.com: You said C did it wrong, because you think that arrays and pointers should be different things. No, I said so, because arrays and pointers *are* different things (even in C there are subtle differences - which should sort of prove my point). Apart from

Re: [fpc-pascal] Who said Pascal isn't popular

2009-10-12 Thread Vinzent Höfler
Jürgen Hestermann juergen.hesterm...@gmx.de: And why should that be the case? What are the outstanding feature of C that make it so supperiour? It's illogical and hard to maintain syntax? Its Compile anything, crash everywhere. interface. :P Vinzent. -- Jetzt kostenlos herunterladen:

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-12 Thread Vinzent Höfler
Jürgen Hestermann juergen.hesterm...@gmx.de: Adding yet another variant is not good. I once thought that Pascal was superior to other languages because of it's clear and strict concept but now there is no longer *the* Pascal language anymore. If you're searching for some stricter Pascal

Re: [fpc-pascal] Illogical automatic dereferencing

2009-10-12 Thread Vinzent Höfler
Martin laza...@mfriebe.de: The beauty of the current solution is that static and dynamic arrays can be substituted with each other, simple by changing the declaration, and adding/removing a setlength. All other code can be left as it is. No, because of subtle differences in the handling of

Re: [fpc-pascal] Why use pointers to arrays?

2009-10-12 Thread Vinzent Höfler
Andrew Brunner andrew.t.brun...@gmail.com: On Sun, Oct 11, 2009 at 5:25 PM, Vinzent Höfler Read up on forward declarations. The technique of declaring a typed pointer to any data structure in FPC and Delphi was that you can use it in fields and methods of objects and data structures w/o

Re: [fpc-pascal] pointer arithmetic help required

2009-10-15 Thread Vinzent Höfler
Graeme Geldenhuys graemeg.li...@gmail.com: Now I know why vendors of newer languages (Dephi, Java etc) are trying to hide pointers from programmers. They are very tricky to work with - and give errors without warning! Especially when compiler and programmer are both trying to outsmart each

Re: [fpc-pascal] BNF grammar for fpc

2009-10-16 Thread Vinzent Höfler
mar...@stack.nl: The reason is probably more because Wirthian languages traditionally use recursive descent parsers. Yeah, right. The reason is most definitely that of all those people who know the language well enough to write the grammar, there's no one actually doing it. Of course, with

Re: [fpc-pascal] Who said Pascal isn't popular

2009-10-16 Thread Vinzent Höfler
Jürgen Hestermann juergen.hesterm...@gmx.de: You can post an ad for a C programmer and get 1,000 applicants, if you post an ad for a Pascal programmer you might get 5, at least where I live. Yes, and guess what: Odds are that there are more than 5 good ones out of the 1000 C-programmers

Re: [fpc-pascal] Who said Pascal isn't popular

2009-10-17 Thread Vinzent Höfler
Graeme Geldenhuys graemeg.li...@gmail.com: Any programmer worth hiring should find it relatively easy to switch to another language. Or and least become proficient in it in a relative short period of time. The basic principles apply to all languages, it's just the tool-chain and syntax that

Re: [fpc-pascal] Who said Pascal isn't popular

2009-10-17 Thread Vinzent Höfler
Graeme Geldenhuys graemeg.li...@gmail.com: I have been programming solely in Object Pascal for the last 9 years. I dab in Java every now and again (but not for any production software). I also read a lot of C/C++ code which I rewrite into Object Pascal for whatever reason. So just like me

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Vinzent Höfler
Holger Bruns holger.br...@gmx.net: Accessing ports is limited to ports 03ffh, more ports cannot be released with fpioperm. This means to me, successful serial port access on higher addresses cannot yet be implemented with fpc. Or any other compiler, for that matter, because this is a

Re: [fpc-pascal] x86.pp and oldlinux.pp

2009-11-04 Thread Vinzent Höfler
Von: Holger Bruns holger.br...@gmx.net: If I intend to use device drivers, I need to know how to access the ports of a device, which means in my case to a serial port based on the 16550D Universal Asynchronous Receiver/Transmiter with FIFOs. No. I need to read and write every register

Re: [fpc-pascal] x86.pp and oldlinux.pp

2009-11-04 Thread Vinzent Höfler
Von: Holger Bruns holger.br...@gmx.net: I am rather clueless while dealing with device drivers like /dev/ttyS0 on linux. My question is, what do I grab while reading from a device driver file like /dev/ttyS0? You don't read from a device driver. You read from a device. What you read is

Re: [fpc-pascal] Stopping daemon in linux

2009-11-09 Thread Vinzent Höfler
Jonas Maebe jonas.ma...@elis.ugent.be: On 09 Nov 2009, at 21:03, Michael Van Canneyt wrote: On Mon, 9 Nov 2009, Vinzent Höfler wrote: As wrong as in Don't call most system functions from within a signal handler., maybe? Hmm... In that case, many exceptions would not work either

Re: [fpc-pascal] Compiler Warning: Constructor should be public

2009-11-11 Thread Vinzent Höfler
Graeme Geldenhuys gra...@mastermaths.co.za: A very quick and dirty solution would be to reimplement the public Create() constructor and immediately raise an exception inside it, explaining the problem. That way if any developer tries to use that default constructor, they will get an error -

Re: [fpc-pascal] How to solve variable does not seem to be initialized compiler hint.

2009-11-19 Thread Vinzent Höfler
Graeme Geldenhuys gra...@mastermaths.co.za: [FillChar] As for the COM usage requirement (which I honestly believe is the minority use case in FPC). AFAIK, the different semantic of out parameters applies to all reference counted types. That's especially unfortunate with dynamic arrays, where

Re: [fpc-pascal] How to solve variable does not seem to be initialized compiler hint.

2009-11-19 Thread Vinzent Höfler
Florian Klaempfl flor...@freepascal.org: Out is not made to solve such problems but plainly to work with COM/Corba. Really? Well, that's not what the FPC manual says: -- 8 -- The purpose of an out parameter is to pass values back to the calling routine: The variable is passed by reference.

Re: [fpc-pascal] One experience with the unit serial

2009-11-19 Thread Vinzent Höfler
Holger Bruns holger.br...@gmx.net: Despite queues an baud rates, you must expect data loss. You will loss data in the physical layer. You have to implement some handshake to prevent it. (using google translator, excuse my english). Which can be done through a direct port access and some

Re: [fpc-pascal] One experience with the unit serial

2009-11-19 Thread Vinzent Höfler
mar...@stack.nl: [Synapse/Synaser] How do you use it? I'm used to TComport, and it seems that synaser, like unit serial, only supports blocking use. call Connect, call Config, call the appropriate reading and writing subroutines (like SendString and RecvPacket)... Do you put it in a thread?

Re: [fpc-pascal] How to solve variable does not seem to be initialized compiler hint.

2009-11-19 Thread Vinzent Höfler
Florian Klaempfl flor...@freepascal.org: Vinzent Höfler schrieb: Florian Klaempfl flor...@freepascal.org: Out is not made to solve such problems but plainly to work with COM/Corba. Really? Well, that's not what the FPC manual says: And? Is there a different reason written

Re: [fpc-pascal] How to solve variable does not seem to be initialized compiler hint.

2009-11-19 Thread Vinzent Höfler
Graeme Geldenhuys graemeg.li...@gmail.com: 2009/11/19 Vinzent Höfler jellyfish.softw...@gmx.net: Why don't you create your own initialization routine together with the Because not all the code I maintain is my own. Some code, as in the case of DCPCrypt gave stacks of hints which were all

Re: [fpc-pascal] How to solve variable does not seem to be initialized compiler hint.

2009-11-19 Thread Vinzent Höfler
Rainer Stratmann rainerstratm...@t-online.de: For me a variable is initialised when it passes a procedure/function which has a var declaration in the parameters. -- 8 -- procedure Add_2 (var I : Integer); begin I := I + 2; end; -- 8 -- If the variable for the parameter I wasn't correctly

Re: suppressing hints[Re: [fpc-pascal] How to solve variable does not seem to be initialized compiler hint.]

2009-11-19 Thread Vinzent Höfler
Martin f...@mfriebe.de: Ideally it would be, if there was a directive or similar, to suppress it for given lines (or statements). one that is easier than {$push} { $HINT OFF} ... {$POP} {$HINTS OFF} ... code ... {$HINTS DEFAULT} maybe? Whereas DEFAULT restores the switch to the original

Re: suppressing hints[Re: [fpc-pascal] How to solve variable does not seem to be initialized compiler hint.]

2009-11-19 Thread Vinzent Höfler
Rainer Stratmann rainerstratm...@t-online.de: Am Thursday 19 November 2009 23:16:26 schrieb Vinzent Höfler: {$HINTS OFF} ... code ... {$HINTS DEFAULT} maybe? Whereas DEFAULT restores the switch to the original state. But then you have to do it everywhere in the code instead

Re: [fpc-pascal] dynamic array contents and system.move

2010-05-04 Thread Vinzent Höfler
I fear you've simply no clue about the usage, internals and purpose of dyn. arrays so I stop this discussion. As you always do once someone does not share your point of view, even after you tried so hard to convince him. :P Well, never mind. Still, dynamic arrays are a bitch, because they

Re: [fpc-pascal] Is this a reference counting bug?

2010-05-07 Thread Vinzent Höfler
Bihar Anwar bihar_an...@rocketmail.com Moreover, I've seen many Delphi code snippets out there (e.g. http://www.cs.wisc.edu/~rkennedy/array-delete) rely on reference counting behaviour. Great. I once wrote code that relied on Turbo Pascal's heap list structure internals. Shall I post a bug

Re: Re[2]: [fpc-pascal] about dynamic array

2010-05-08 Thread Vinzent Höfler
c TList wraps TFPList, which is based internally on an array. So access c is fast; insertion, deletion not. But it is faster than inserting elements in a dynamic array (unless reference counted ones) because it usually moves less amount of data (4/8 bytes per element). Implementing a

Re: Re[4]: [fpc-pascal] about dynamic array

2010-05-08 Thread Vinzent Höfler
1) TheArray: array of ItemArray; AnyItem: ItemOfArray; [...] for j:=0 to 1000 do begin SetLength(TheArray,j+1); TheArray[j]:=AnyItem; end; [...] About 1000 GetMem operations (and 1000 assignments which aren't there in the code below, so I won't count them). Now here add

Re: Re[6]: [fpc-pascal] about dynamic array

2010-05-09 Thread Vinzent Höfler
Saturday, May 8, 2010, 5:07:12 PM, you wrote: JM And depending on the usage patterns and the size of the JM elements stored in the array, it probably can be. That's all he JM was saying, and only as a side remark in the context of the JM discussion (which was meanly to steer away a new

Re: Re[6]: [fpc-pascal] about dynamic array

2010-05-09 Thread Vinzent Höfler
Hello FPC-Pascal, Saturday, May 8, 2010, 4:42:46 PM, you wrote: VH So, apart from a possibly more optimized implementation (like VH not changing the allocated memory size on each single VH insertion/deletion) how do you come up with the idea that adding VH another layer would make it

Re: [fpc-pascal] a few trivial questions

2010-05-13 Thread Vinzent Höfler
Von: Jürgen Hestermann juergen.hesterm...@gmx.de it's just easier to follow the crowd than fight them. :-) In the first place it is. But if it would be available, the crowd may change its mind. No, she won't. She never did. Vinzent. -- GRATIS für alle GMX-Mitglieder: Die maxdome

Re: [fpc-pascal] What is the lowest MS-DOS version supported by FPC?

2010-05-15 Thread Vinzent Höfler
Bihar Anwar bihar_an...@rocketmail.com I've tried googling and searching FPC mailing list for information about this one, but I found nothing. I just found in http://www.delorie.com/djgpp/v2faq/faq3_1.html that DJGPP requires MS-DOS version 3.1 or later. Would someone here tell me

Re: [fpc-pascal] time_fractionBetween bug?

2010-06-01 Thread Vinzent Höfler
Bee Jay bee.ogra...@gmail.com: [TDateTime] What if an app need a precise and correct result, say a rocket launcher? :D Is there other alternative solution? Yes. Use a time type based on a fixed point representation. This eliminates drift and accuracy issues cause by a floating point

Re: [fpc-pascal] timing again

2010-06-01 Thread Vinzent Höfler
spir ☣ denis.s...@gmail.com: Thank you. Using dos.getTime (including its last arg), the following returns integer time in 10^-2s units: [...] This is the needed base for my uses. (A unit of 1s is too gross for timing, this leads to endless runs; more precision than 10^-2s is unneeded.)

Re: [fpc-pascal] timing again

2010-06-01 Thread Vinzent Höfler
On Tue, 01 Jun 2010 19:58:54 +0200 Vinzent Höfler jellyfish.softw...@gmx.net wrote: spir ☣ denis.s...@gmail.com: Thank you. Using dos.getTime (including its last arg), the following returns integer time in 10^-2s units: [...] This is the needed base for my uses. (A unit

Re: [fpc-pascal] timing again

2010-06-01 Thread Vinzent Höfler
The standard clock for the system timer runs at 1,193,182 Hz, derived for the original IBM PC as the 4.77 MHz processor clock divided by 4. Digging a bit deeper clarifies it: http://sos.enix.org/lxr/source/hwcore/i8254.c?v=6.5 |* Ahhh PC systems are nice toys: this maximum strange frequency

Re: [fpc-pascal] timing again

2010-06-02 Thread Vinzent Höfler
Reimar Grabowski reimg...@web.de: If you want to get better than that, you need to get system specific, I'm afraid. That's not true. As Graeme already mentioned there is EpikTimer which is a cross-plattform, high-resolution timer (which btw works very well for realtime tasks). Well, that

Re: [fpc-pascal] Do you get type errors?

2010-06-20 Thread Vinzent Höfler
spir denis.s...@gmail.com: Theoretically speaking, I'm all for type checking; and for programming discipline in general. But in practice I never get type errors. Then you are either a genius or you are using not enough types. ;) So, a few questions: * Do you get type errors? Occasionally,

Re: [fpc-pascal] Static Initialisation of Arrays

2010-06-29 Thread Vinzent Höfler
spir denis.s...@gmail.com: Sure, but this is just a matter of convention and support by a given compiler: typeIntegers = array of Integer; var ints : Integers = [1,2,3]; could work as expected by automatically sizing, allocating and initialising. How else could work

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Vinzent Höfler
On Fri, 15 Oct 2010 16:45:04 +0200, Andrew Brunner andrew.t.brun...@gmail.com wrote: It was also suggested that PThread's Suspend and Resume may not do anything. What I would do (if that is the case), is try to find where PThread has access to the Semaphore or CriticalSection it has on that

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Vinzent Höfler
On Fri, 15 Oct 2010 17:39:59 +0200, Andrew Brunner andrew.t.brun...@gmail.com wrote: BTW: I did notice that the semaphore was being used to suspend the thread. And I also know that that was it's only function... Suspend and Resume. The problem is not pthreads or anything, the problem is how

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Vinzent Höfler
On Fri, 15 Oct 2010 18:19:14 +0200, Andrew Brunner andrew.t.brun...@gmail.com wrote: On Fri, Oct 15, 2010 at 10:57 AM, Vinzent Höfler jellyfish.softw...@gmx.net wrote: If you access it inside the execute method, you more or less crash (or at least leak memory). You obviously had a problem

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Vinzent Höfler
On Fri, 15 Oct 2010 20:15:51 +0200, Andrew Brunner andrew.t.brun...@gmail.com wrote: On Fri, Oct 15, 2010 at 12:01 PM, Vinzent Höfler jellyfish.softw...@gmx.net wrote: Exactly. It was poor implementation. You should have had a global barrier onExecute. That would unlock the thread after

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Vinzent Höfler
On Fri, 15 Oct 2010 18:26:59 +0200, Andrew Brunner andrew.t.brun...@gmail.com wrote: Externally suspending a thread *IS* absolutely unsafe. At least we're on the same page here. :) But the notion of suspending an ENGINE at runtime externally is totally expected. The thread itself MUST put

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Vinzent Höfler
On Fri, 15 Oct 2010 22:13:36 +0200, Sven Barth pascaldra...@googlemail.com wrote: I'm curious. How should this FPThread class look like? You saw flaws in Delphi's API so what would you do better? Hmm. Actually, I did not think too hard about it yet. So for a quick brainstorming approach:

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Vinzent Höfler
On Fri, 15 Oct 2010 22:50:29 +0200, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 15 Oct 2010, at 22:31, Vinzent Höfler wrote: - Suspend/Resume should be gone (you can't guarantee it to work, so there's no point in doing it at all) FWIW, they're deprecated since Delphi 2009, so

Re: [fpc-pascal] FPC for High Performance Computing (HPC) Components with Application API

2010-10-15 Thread Vinzent Höfler
On Fri, 15 Oct 2010 23:41:36 +0200, Andrew Brunner andrew.t.brun...@gmail.com wrote: Do you have a link to the latest version of pthreads? You probably mean NPTL (Native Posix Threading Library). It was my understanding that libc took over the pthreads project. I just took up this issue

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-15 Thread Vinzent Höfler
On Sat, 16 Oct 2010 00:17:33 +0200, Marco van de Voort mar...@stack.nl wrote: In our previous episode, Vinzent H?fler said: Hmm. Actually, I did not think too hard about it yet. So for a quick brainstorming approach: - Suspend/Resume should be gone (you can't guarantee it to work, so

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-16 Thread Vinzent Höfler
On Sat, 16 Oct 2010 10:45:49 +0200, Luca Olivetti l...@ventoso.org wrote: Al 15/10/10 22:31, En/na Vinzent Höfler ha escrit: - FreeOnTerminate should be gone, (meaning no way to actively call TThread.Destroy from another thread, a thread gets destroyed automatically when it leaves its execute

Re: [fpc-pascal] Re: Re: Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-16 Thread Vinzent Höfler
On Sat, 16 Oct 2010 17:12:51 +0200, Jonas Maebe jonas.ma...@elis.ugent.be wrote: On 16 Oct 2010, at 17:13, Martin Schreiber wrote: As written before it does not crash in tmsethread which does not inherit from FPC TThread. You're just getting lucky in your tests. Either that, or the

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-16 Thread Vinzent Höfler
On Sat, 16 Oct 2010 17:42:03 +0200, Luca Olivetti l...@ventoso.org wrote: Al 16/10/10 16:57, En/na Vinzent Höfler ha escrit: Well, the usual implementation of an externally called Destroy is - first a call to the Terminate method - then a WaitFor() Nope, I avoid the WaitFor. Nice

Re: [fpc-pascal] Re: Multi-threaded project with few locks (no Thread.waitfor). Memory consumption keeps increasing on Ubuntu 10.10 x64

2010-10-16 Thread Vinzent Höfler
On Sat, 16 Oct 2010 18:04:59 +0200, Luca Olivetti l...@ventoso.org wrote: I use that only for threads I start at the beginning of the app and terminate at the end, so polling isn't a big issue. Those kind of threads are not a big issue at all. As they are running during the whole

Re: [fpc-pascal] Re: Can variables be declared within a block?

2010-10-19 Thread Vinzent Höfler
On Tue, 19 Oct 2010 02:07:25 +0200, Dimitri Smits smi...@telenet.be wrote: on the other hand, what stops the OP from using 'with'? (multiple levels/variables?) with contaminates the name space. Locally scoped variables don't. and you won't die from using another stack variable scoped at the

Re: [fpc-pascal] Re: Endian issues when porting FPC programs from x86 to other platforms

2010-11-02 Thread Vinzent Höfler
On Tue, 02 Nov 2010 21:39:31 +0100, Felipe Monteiro de Carvalho felipemonteiro.carva...@gmail.com wrote: On Tue, Nov 2, 2010 at 7:04 PM, Bo Berglund bo.bergl...@gmail.com wrote: Thanks, that helps a lot! Are there also overloaded BEtoN functions for floating point values? I think that

Re: [fpc-pascal] Is System.IOResult thread-safe? (If not, I need to replace it.)

2010-11-19 Thread Vinzent Höfler
On Fri, 19 Nov 2010 23:02:11 +0100, Cox, Stuart TRAN:EX stuart@gov.bc.ca wrote: I think the easiest way to get cross-platform lockfile behaviour, is to a) create the lockfile at the start of your program (e.g., a rewrite followed by a close) b) whenever you want to lock it, use

Re: [fpc-pascal] fpc 32 / 64 bit / c++/ floating point question

2010-11-21 Thread Vinzent Höfler
On Sun, 21 Nov 2010 18:54:13 +0100, Helmut Hartl helmut.ha...@firmos.at wrote: Running the above program gives 1) C++ / FPC 64 Bit 6.3846106530 6.3846106530 2) FPC32 Bit 6.3846106530 6.3846111610 Is this explainable or wrong behaviour ? First suspect candidate: the intermediate

Re: [fpc-pascal] fpc 32 / 64 bit / c++/ floating point question

2010-11-21 Thread Vinzent Höfler
On Sun, 21 Nov 2010 20:35:42 +0100, Michael Müller mueller_mich...@alice-dsl.net wrote: Single has 7 significant digits. mode style=nitpicking Six significant digits. The seventh already is unreliable. /mode Vinzent. ___ fpc-pascal maillist -

Re: [fpc-pascal] Standard exceptions

2011-03-01 Thread Vinzent Höfler
On Tue, 01 Mar 2011 12:38:27 +0100, Michael Fuchs freepas...@ypa-software.de wrote: I also miss a NotImplementedException (or ENotImplemented in FPC style), very handy for test driven development. :) Yeah. And type //-- @abstract(Obvious coding error.) Coder_Needs_Coffee = class

Re: [fpc-pascal] FPC 2.4.2 source

2011-05-21 Thread Vinzent Höfler
On Sat, 21 May 2011 13:19:35 +0200, Rainer Stratmann rainerstratm...@t-online.de wrote: Am Saturday 21 May 2011 12:21:54 schrieb Mattias Gaertner: They are typical dpkg messages. This is pretty normal when installing deb packages manually. That is not specific to Lazarus or FPC. The problem

Re: RES: [fpc-pascal] dot within unit file name

2008-01-18 Thread Vinzent Höfler
Daniël Mantione wrote: Op Fri, 18 Jan 2008, schreef Vinzent Hoefler: On Friday 18 January 2008 16:04, Michael Van Canneyt wrote: On Fri, 18 Jan 2008, Daniël Mantione wrote: Op Fri, 18 Jan 2008, schreef Michael Van Canneyt: To the user, it may appear as a bunch of dots. To the compiler, it

Re: RES: [fpc-pascal] dot within unit file name

2008-01-18 Thread Vinzent Höfler
Daniël Mantione wrote: Op Fri, 18 Jan 2008, schreef Vinzent Höfler: Maybe my view is skewed too much by the use of Ada where even a function declares a record identifier. In Ada it is even possible to do: --- procedure Test is X : Integer; procedure B is X : Integer; begin

Re: RES: [fpc-pascal] dot within unit file name

2008-01-18 Thread Vinzent Höfler
Michael Van Canneyt wrote: You are wrong. It does not compile, neither in delphi, nor in FPC. D is not found, because 'A' resolves to the local a, and then the search is stopped. Ok, I think I got it. It's probably the same reason why in --- procedure Foo (const A : My_Type); overload;

Re: [fpc-pascal] FreePascal Coding style

2008-01-21 Thread Vinzent Höfler
Graeme Geldenhuys wrote: I hope this will be my last reply. Please take a look at the flash video on the ET website. I don't have flash, so I am bound to check out the Java example. There he uses two editors (gvim and gedit). With appropriate plugins/scripts, I suppose. And for the

Re: [fpc-pascal] FreePascal Coding style

2008-01-21 Thread Vinzent Höfler
Florian Klaempfl wrote: Imo that plugin discussion is pretty useless. I'am coding in at least four different editors pascal (fp ide, joe, lazarus, ultraedit) and I fear there is no plugin for all editors I use :) Same here, although the editors' names are a bit different. ;) Vinzent.

Re: [fpc-pascal] FreePascal Coding style

2008-01-21 Thread Vinzent Höfler
Graeme Geldenhuys wrote: On 21/01/2008, Vinzent Höfler [EMAIL PROTECTED] wrote: Yes, that's what I figured. What I don't get is how the editor extracts the information _back_ from the file after the tabstop information has been deleted (that's what it does once it gets replaced with spaces

Re: [fpc-pascal] syscalls and fpc

2008-02-16 Thread Vinzent Höfler
ik wrote: I think that the entire design of the Do_SysCall is malformed in the way it assumes the number of parameters and also the type of them, so as I asked before, how I can either call the syscall command without assembler, or how I can pass an array of const (prior to that I asked

Re: [fpc-pascal] The reason why linus torvalds hate-pascal

2008-04-15 Thread Vinzent Höfler
Marco van de Voort wrote: Ahthe old goto arguinghow many beers have gone with it! Linus is just right, since everyday the purists of the OO languages still can't live without writing a GOTO; they just call it in another politically correct way: raise Exception.Create(TA-DA!)

Re: [fpc-pascal] Printing of Pointer Type

2008-07-17 Thread Vinzent Höfler
leledumbo [EMAIL PROTECTED] Jonas Maebe-2 wrote: Because there are easy ways around it (as you mention) and the work to implement and maintain this would probably outweigh the usefulness. Yes, it's easy but uncomfortable and needs more typing. Well, sure, but printing pointer

Re: [fpc-pascal] Translate C to Pascal

2008-07-30 Thread Vinzent Höfler
Datum: Wed, 30 Jul 2008 10:10:09 -0700 (PDT) Von: Gene Buckle [EMAIL PROTECTED] An: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org Betreff: Re: [fpc-pascal] Translate C to Pascal How to translate this: struct a; er... Closest would be: type record = foo

Re: [fpc-pascal] Ugly exception during compilation FPC 2.3.1 MacOS X 10.5 PowerPC

2008-08-04 Thread Vinzent Höfler
Original-Nachricht Zitat von Roland Turcan [EMAIL PROTECTED]: Hello Mattias, I have also uncommented some DebugLns which are inside of code: Compiling ./unit/ResConf.pas Assembling resconf An unhandled exception occurred at $00148A20 : TOutputFilter.Execute

Re: [fpc-pascal] Compiler option to check return value ignorance

2008-08-13 Thread Vinzent Höfler
leledumbo wrote: Joost van der Sluis wrote: And there's no way the compiler can detect this. I don't think so. The compiler understand that a procedure doesn't return a value while a function does (i.e. trying to return a value from a procedure causes compile error). I haven't checked how

Re: [fpc-pascal] Translate C to Pascal

2008-08-13 Thread Vinzent Höfler
Mattias Gaertner wrote: On Tue, 12 Aug 2008 09:39:36 +0200 Jilani Khaldi [EMAIL PROTECTED] wrote: Marc Weustink wrote: Micha Nelissen wrote: Mattias Gärtner wrote: How to translate this: struct a; Isn't this a forward declaration? So sometime later it needs to declare 'struct a { ... };'

Re: [fpc-pascal] Translate C to Pascal

2008-08-13 Thread Vinzent Höfler
Felipe Monteiro de Carvalho wrote: On Wed, Aug 13, 2008 at 7:38 AM, Vinzent Höfler [EMAIL PROTECTED] wrote: What for? The C statement is empty, it's not a variable and not even a type. So before translating that into an empty Pascal-record, you should rather look at what the actually used

Re: [fpc-pascal] Converting C's bit field struct

2008-08-13 Thread Vinzent Höfler
leledumbo wrote: Since no one answers on message board, I'll post it here. C struct: typedef unsigned int u32int; typedef struct page { u32int present: 1; // Page present in memory u32int rw : 1; // Read-only if clear, readwrite if set u32int user : 1; //

Re: [fpc-pascal] Translate C to Pascal

2008-08-13 Thread Vinzent Höfler
Mattias Gärtner wrote: Zitat von Vinzent Höfler [EMAIL PROTECTED]: [...] a: record end; Thanks. I will use that. What for? The C statement is empty, it's not a variable and not even a type. So before translating that into an empty Pascal-record, you should rather look at what the

Re: [fpc-pascal] Compiler option to check return value ignorance

2008-08-13 Thread Vinzent Höfler
Joost van der Sluis wrote: Ok, so I misunderstood you. You want that the compiler complains if you don't assign the result of a function. While that can be done, I don't think you want that. Well, don't decide for others, please. I am a stupid programmmer, I am making mistakes all the time,

Re: [fpc-pascal] Compiler option to check return value ignorance

2008-08-13 Thread Vinzent Höfler
Vincent Snijders wrote: Vinzent Höfler schreef: Joost van der Sluis wrote: Ok, so I misunderstood you. You want that the compiler complains if you don't assign the result of a function. While that can be done, I don't think you want that. Well, don't decide for others, please. I am a stupid

Re: [fpc-pascal] Compiler option to check return value ignorance

2008-08-13 Thread Vinzent Höfler
Original-Nachricht Datum: Wed, 13 Aug 2008 16:02:10 -0400 Von: Jeff Wormsley [EMAIL PROTECTED] An: FPC-Pascal users discussions fpc-pascal@lists.freepascal.org Betreff: Re: [fpc-pascal] Compiler option to check return value ignorance Vinzent Höfler wrote: I just

  1   2   >