[fpc-pascal] fpGetTimeOfDay

2015-03-09 Thread Mark Morgan Lloyd
Are there any known issues with this sort of thing fpGetTimeOfDay (@TimeVal, nil) on various platforms? FPC 2.6.4 and 2.7.1 seem to be OK on x86, but on x64 (and FWIW SPARC, haven't tested others) it appears to be returning a fixed TimeVal plus a result of zero even if there are several

Re: [fpc-pascal] fpGetTimeOfDay

2015-03-09 Thread Mark Morgan Lloyd
Marco van de Voort wrote: In our previous episode, Mark Morgan Lloyd said: Are there any known issues with this sort of thing fpGetTimeOfDay (@TimeVal, nil) on various platforms? FPC 2.6.4 and 2.7.1 seem to be OK on x86, but on x64 (and FWIW SPARC, haven't tested others) it appears to be

Re: [fpc-pascal] License terms for FastHTMLParser

2015-03-09 Thread Andrew Haines
On 03/08/2015 11:23 AM, Christo wrote: While reading up on the history of FastHTMLParser (to find out who/where the root owner of this unit is) I noticed that the last release (0.4) from Jazarsoft

Re: [fpc-pascal] fpGetTimeOfDay

2015-03-09 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: Are there any known issues with this sort of thing fpGetTimeOfDay (@TimeVal, nil) on various platforms? FPC 2.6.4 and 2.7.1 seem to be OK on x86, but on x64 (and FWIW SPARC, haven't tested others) it appears to be returning a fixed TimeVal

Re: [fpc-pascal] fpGetTimeOfDay

2015-03-09 Thread Henry Vermaak
On Mon, Mar 09, 2015 at 01:30:28PM +0100, Marco van de Voort wrote: In our previous episode, Mark Morgan Lloyd said: Are there any known issues with this sort of thing fpGetTimeOfDay (@TimeVal, nil) on various platforms? FPC 2.6.4 and 2.7.1 seem to be OK on x86, but on x64 (and FWIW

[fpc-pascal] how to use procedure of object in C

2015-03-09 Thread Xiangrong Fang
Hi all, I define a procedure like this: type TDataHandler = procedure(data: Pointer) of object; procedure SetHandler(h: TDataHandler); external cdecl; Now, can I implement SetHandler in a library written in C, then call h in C? Thankyou. -- Sent from Gmail Mobile

Re: [fpc-pascal] fpGetTimeOfDay

2015-03-09 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said: If either tv or tz is NULL, the corresponding structure is not set or returned. (However, compilation warnings will result if tv is NULL.) The funny thing is that the snippet of code that I'm using was contributed by you, and

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jürgen Hestermann
Am 2015-03-09 um 18:31 schrieb Jonas Maebe: On 09 Mar 2015, at 17:49, Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Am 2015-03-09 um 17:40 schrieb Jonas Maebe: http://bugs.freepascal.org/view.php?id=24601#c75617 (and the comment below + use -vq to see warning numbers, and -vm to

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jürgen Hestermann
Am 2015-03-09 um 17:40 schrieb Jonas Maebe: On 09 Mar 2015, at 17:25, Jürgen Hestermann wrote: I get a warning that a local dynamic array variable is not initialized. Aren't such managed types initialized by default? On http://wiki.freepascal.org/Dynamic_array it says: Actually, dynamic

Re: [fpc-pascal] how to use procedure of object in C

2015-03-09 Thread Ewald
On 09 Mar 2015, at 18:43, Michael Van Canneyt wrote: You must be sure that self is passed in the correct register. I am not sure this is the case if you declare it as an extra argument. It is, as long as the `self` is the first parameter. Same goes for `Class Procedure XXX;` kind of

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jonas Maebe
On 09 Mar 2015, at 17:49, Jürgen Hestermann juergen.hesterm...@gmx.de wrote: Am 2015-03-09 um 17:40 schrieb Jonas Maebe: http://bugs.freepascal.org/view.php?id=24601#c75617 (and the comment below + use -vq to see warning numbers, and -vm to block a particular warning number).

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread DaWorm
I would think this part answers that question: The warning means that no value has been *explicitly* assigned to these variables (which *may indicate a logic error* in the code), not necessarily that they contain an unpredictable value. (emphasis mine) Jeff.

Re: [fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jonas Maebe
On 09 Mar 2015, at 17:25, Jürgen Hestermann wrote: I get a warning that a local dynamic array variable is not initialized. Aren't such managed types initialized by default? On http://wiki.freepascal.org/Dynamic_array it says: Actually, dynamic arrays are pointers with automatic

Re: [fpc-pascal] how to use procedure of object in C

2015-03-09 Thread Michael Van Canneyt
On Mon, 9 Mar 2015, OBones wrote: Michael Van Canneyt wrote: On Mon, 9 Mar 2015, Xiangrong Fang wrote: Hi all, I define a procedure like this: type TDataHandler = procedure(data: Pointer) of object; procedure SetHandler(h: TDataHandler); external cdecl; Now, can I implement

Re: [fpc-pascal] how to use procedure of object in C

2015-03-09 Thread Michael Van Canneyt
On Mon, 9 Mar 2015, Xiangrong Fang wrote: Hi all, I define a procedure like this: type   TDataHandler = procedure(data: Pointer) of object; procedure SetHandler(h: TDataHandler); external cdecl; Now, can I implement SetHandler in a library written in C, then call h in C? IMHO Not without

[fpc-pascal] Warning Local variable seems to be not initialized on dyn array

2015-03-09 Thread Jürgen Hestermann
I get a warning that a local dynamic array variable is not initialized. Aren't such managed types initialized by default? On http://wiki.freepascal.org/Dynamic_array it says: Actually, dynamic arrays are pointers with automatic dereferencing. They are initialized to *nil* automatically. So why

Re: [fpc-pascal] how to use procedure of object in C

2015-03-09 Thread OBones
Michael Van Canneyt wrote: On Mon, 9 Mar 2015, Xiangrong Fang wrote: Hi all, I define a procedure like this: type TDataHandler = procedure(data: Pointer) of object; procedure SetHandler(h: TDataHandler); external cdecl; Now, can I implement SetHandler in a library written in C, then

Re: [fpc-pascal] how to use procedure of object in C

2015-03-09 Thread Xiangrong Fang
2015-03-10 0:33 GMT+08:00 OBones obo...@free.fr: How about using TMethod? procedure DataHandler(DummySelf: Pointer; data: Pointer); begin // do what you want to do, DummySelf is always nil. end; var Method: TMethod; begin Method.Data := nil; Method.Code := @DataHandler;

Re: [fpc-pascal] FPC embedded ?

2015-03-09 Thread Michael Schnell
On 03/07/2015 05:20 PM, Adriaan van Os wrote: Also for low-power battery-powered devices ? PIC32MX5XX/6XX/7XX Datasheet: Power Management: Low-power management modes (Sleep and Idle) Integrated Power-on Reset, Brown-out Reset 0.5 mA/MHz dynamic current (typical) 41 μA IPD current (typical)