Re: [fpc-pascal] package help & site bug

2008-09-07 Thread Marco Ciampa
On Mon, Sep 08, 2008 at 02:48:49AM +0200, Marco Ciampa wrote:
> On Wed, Sep 03, 2008 at 08:24:01PM -0700, David Emerson wrote:
> > Have you tried the ubuntu repositories?
> > 
> > http://packages.ubuntu.com/search?keywords=fp-&searchon=names&suite=all§ion=all
> Yes, no ppc packages at all
> 
> > 
> > Although many debian packages are incompatible with ubuntu, I suspect 
> > that the fpc packages may very well be compatible. (sid has 2.2.2)
> > 
> > http://packages.debian.org/search?suite=all§ion=all&arch=any&searchon=names&keywords=fp-
> Installed. fpc seems to work flawlessly.
> 
> Lazarus not! :-(
> 
> [EMAIL PROTECTED]:~$ lazarus-ide
> [FORMS.PP] ExceptionOccurred
>   Sender=EReadError
>   Exception=Error reading Image.Picture.Data: Failed to create handles
>   Stack trace:
>   $1007C618
>   $1007BAC4
>   $1006FC50
>   $1007B748
>   $1007BB84
>   $1006FC50
>   $1007D2A8
>   $101052E4
>   $101050F4
>   $100FBF04
>   $1004B7D4
>   $1026F330
>   $10057B88
>   $100572A8
>   $1000A5C4
>   $1000A404
> TApplication.HandleException Error reading Image.Picture.Data: Failed to
> create handles
>   Stack trace:
>   $1007C618
>   $1007BAC4
>   $1006FC50
>   $1007B748
>   $1007BB84
>   $1006FC50
>   $1007D2A8
>   $101052E4
>   $101050F4
>   $100FBF04
>   $1004B7D4
>   $1026F330
>   $10057B88
>   $100572A8
>   $1000A5C4
>   $1000A404
Missing:
[FORMS.PP] ExceptionOccurred

bye

-- 

Marco Ciampa

++
| Linux User  #78271 |
| FSFE fellow   #364 |
++
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] package help & site bug

2008-09-07 Thread Marco Ciampa
On Wed, Sep 03, 2008 at 08:24:01PM -0700, David Emerson wrote:
> Have you tried the ubuntu repositories?
> 
> http://packages.ubuntu.com/search?keywords=fp-&searchon=names&suite=all§ion=all
Yes, no ppc packages at all

> 
> Although many debian packages are incompatible with ubuntu, I suspect 
> that the fpc packages may very well be compatible. (sid has 2.2.2)
> 
> http://packages.debian.org/search?suite=all§ion=all&arch=any&searchon=names&keywords=fp-
Installed. fpc seems to work flawlessly.

Lazarus not! :-(

[EMAIL PROTECTED]:~$ lazarus-ide
[FORMS.PP] ExceptionOccurred
  Sender=EReadError
  Exception=Error reading Image.Picture.Data: Failed to create handles
  Stack trace:
  $1007C618
  $1007BAC4
  $1006FC50
  $1007B748
  $1007BB84
  $1006FC50
  $1007D2A8
  $101052E4
  $101050F4
  $100FBF04
  $1004B7D4
  $1026F330
  $10057B88
  $100572A8
  $1000A5C4
  $1000A404
TApplication.HandleException Error reading Image.Picture.Data: Failed to
create handles
  Stack trace:
  $1007C618
  $1007BAC4
  $1006FC50
  $1007B748
  $1007BB84
  $1006FC50
  $1007D2A8
  $101052E4
  $101050F4
  $100FBF04
  $1004B7D4
  $1026F330
  $10057B88
  $100572A8
  $1000A5C4
  $1000A404
 
-- 

Marco Ciampa

++
| Linux User  #78271 |
| FSFE fellow   #364 |
++
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Exe size

2008-09-07 Thread Tomas Hajny
On 6 Sep 08, at 11:08, Paul wrote:


Hi Paul,

> > Similarly to Felipe, I don't understand why this should be a bad news for
> > you or why this should mean that Visual Studio gave you something not
> > available with FPC (or what that "something" was in that case)... It looks
> > as if I either don't understand what you meant with the statement above,
> > or that I didn't express myself clearly and you understood me differently
> > (and that Marco's additional explanation regarding relation between Win32
> > and WinCE API hasn't helped to clarify that either).
> 
> It's clear that I can't call an api that doesn't exist on a specific 
> platform.
> I don't know how the crosscompiler works, maybe that's confusing me.

OK, let's try to clarify this part. I've somewhat extended and 
updated the previously existing Wiki page about cross-compilation 
with FPC - see http://wiki.freepascal.org/Cross_compiling (especially 
the starting part). Feel free to ask if there are still unclear 
points.


> If I use KOL, will all the api calls be translated to arm or do I have to 
> use ARM api's directly ?

I don't know much about KOL, but if I understand it correctly, it's a 
framework (GUI library if you like) allowing the programmer to use 
Pascal classes for the various GUI elements. Implementation of these 
classes uses then the native API calls provided by the particular 
platform (Win32 or WinCE in your case). In other words, if using KOL, 
you don't use the API calls directly at all. In any case, you don't 
need to care about whether the API calls are running on an x86 or ARM 
CPU, this is the job of FPC to generate proper binary code for the 
requested CPU (see notes about cross-compilation above).

Tomas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Tom Verhoeff
On Sun, Sep 07, 2008 at 12:44:13PM +0200, Marco van de Voort wrote:
> > >
> > > Post the sources somewhere using the license header we use?

I made the source available as a Contributed Unit using a modified LGPL.
You can find a zip archive here:



as well as individual files (float-view.zip and float-view-1_0.zip
are links to the same file).

For some reason, when I go there, it does not show the README.txt,
but is is there:



Feel free to incorporate it in the RTL.

Best regards,

Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science
PHONE:  +31 40 247 41 25| Technische Universiteit Eindhoven
FAX:+31 40 247 54 04| PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Speed difference between intel/ppc on intel Mac

2008-09-07 Thread Jonas Maebe


On 07 Sep 2008, at 21:38, Micha Nelissen wrote:


Jonas Maebe wrote:
You can use -vd to have the compiler print out all compiler options  
it interprets (both from configuration files and from the command  
line). In general, to get the best code for an Intel Core family  
processor, use something like

-O3ppentium4 -Cppentium4 -Cfsse2
i doubt it'll speed up your program by a factor of 2 in any case  
though.


Hmm there are weak spots in FPC. E.g. fannkuch in the shootout:

http://shootout.alioth.debian.org/u32/benchmark.php?test=fannkuch&lang=fpascal&id=5

FPC is 2.1 times slower than gcc here. Maybe this program is like it?


The program of Tom is compiled by FCP/PPC and emulated on an Intel  
machine vs compiled by FPC/Intel and run natively on the same Intel  
machine, with the former being 2 times faster than the latter.  
Programs written for advocacy purposes by different people in  
different languages and compiled by completely different compilers but  
for the same target architecture don't really seem to be very relevant  
to me in this case.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Speed difference between intel/ppc on intel Mac

2008-09-07 Thread Micha Nelissen

Jonas Maebe wrote:
You can use -vd to have the compiler print out all compiler options it 
interprets (both from configuration files and from the command line). In 
general, to get the best code for an Intel Core family processor, use 
something like


-O3ppentium4 -Cppentium4 -Cfsse2

i doubt it'll speed up your program by a factor of 2 in any case though.


Hmm there are weak spots in FPC. E.g. fannkuch in the shootout:

http://shootout.alioth.debian.org/u32/benchmark.php?test=fannkuch&lang=fpascal&id=5

FPC is 2.1 times slower than gcc here. Maybe this program is like it?

It's still quite unlikely that an assembly emulator would optimize it 
run so much better than the original compiler could.


Micha
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Using TSdfDataset

2008-09-07 Thread Felipe Monteiro de Carvalho
On 9/7/08, Graeme Geldenhuys <[EMAIL PROTECTED]> wrote:
>  I've never heard or seen TSdfDataset or TFixedDataset - other than
>  from your recent postings.  From the wiki page, it looks like the data
>  is stored in a simple CSV file. So does the TxxxDataset  class simply
>  act as a wrapper to the CSV file?  Is that correct?

For TSdfDataset you can choose the separator, so it's not necessarely
a comma, but yes, if using commas it will be a CSV file, with the
addition of having the names of the fields in the first row.

For TFixedDataset I added an example in the wiki. It's a completely
different format.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Using TSdfDataset

2008-09-07 Thread Graeme Geldenhuys
On Sun, Sep 7, 2008 at 2:46 PM, Felipe Monteiro de Carvalho
<[EMAIL PROTECTED]> wrote:
> I started a documentation for TSdfDataset:
>
> http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Using_TSdfDataset_and_TFixedDataset


Hi Felipe,

I've never heard or seen TSdfDataset or TFixedDataset - other than
from your recent postings.  From the wiki page, it looks like the data
is stored in a simple CSV file. So does the TxxxDataset  class simply
act as a wrapper to the CSV file?  Is that correct?



Regards,
 - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Tom Verhoeff
On Sun, Sep 07, 2008 at 07:53:06AM -0300, Felipe Monteiro de Carvalho wrote:
> I would suggest to put this routines in a new unit, to keep the
> existing base units small and clean.

How about naming them FloatUtils?

Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science
PHONE:  +31 40 247 41 25| Technische Universiteit Eindhoven
FAX:+31 40 247 54 04| PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Help converting h-file

2008-09-07 Thread Jonas Maebe


On 07 Sep 2008, at 14:35, Koenraad Lelong wrote:


Google helped me understand the "volatile" keyword, but is there a
Pascal alternative ?


No. FPC is at this time unlikely to perform any optimisations on  
pointer or global variables accesses that would be inhibited by making  
them "volatile" though.



The "static inline" is more difficult to understand.


Just declare them as regular functions (with or without inline). It's  
C's way of doing cross-module inlining:
a) the code has to be available in the header file, so the C compiler  
has the C code available to inline when the function is called
b) if you declare the same function more than once, you are going to  
get multiple symbols with the same name and these will clash at link  
time. Therefore such inline functions in headers (which are almost  
always included in more than one source file) have to be declared  
static, as this makes these symbols private to that particular file.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Help converting h-file

2008-09-07 Thread Koenraad Lelong
Hi,
I want to convert a h-file of a c-library and h2pas has problems with it.
The file contains "static inline" functions.
A second problem is the "volatile" keyword that's used in the function.

How do I approach this ?
Google helped me understand the "volatile" keyword, but is there a
Pascal alternative ?
The "static inline" is more difficult to understand.
I add the original source, and the resulting h2pas file so you can see
what's happening.

Any help ?
As allways, TIA.

Regards,
Koenraad Lelong


libdevmem.tar.gz
Description: GNU Zip compressed data
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Re: Using TSdfDataset

2008-09-07 Thread Felipe Monteiro de Carvalho
I started a documentation for TSdfDataset:

http://wiki.lazarus.freepascal.org/Lazarus_Database_Tutorial#Using_TSdfDataset_and_TFixedDataset
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Jonas Maebe


On 07 Sep 2008, at 11:44, Marco van de Voort wrote:

This is a bit more liberal than LGPL either, otherwise everybody  
would have
to linking dynamically to FPC libs, which is technically hard to  
impossible.

(and not desirable to make that mandatory anyway).


Or they would have to make the object files of their programs  
available to their users so that the latter can relink these with  
newer versions of the rtl.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Marco van de Voort
In our previous episode, Felipe Monteiro de Carvalho said:
> I would suggest to put this routines in a new unit, to keep the
> existing base units small and clean.

Fragmenting the same kind of functionality over several units is IMHO not
clean.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Felipe Monteiro de Carvalho
I would suggest to put this routines in a new unit, to keep the
existing base units small and clean.

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Marco van de Voort
In our previous episode, Tom Verhoeff said:
> > > 
> > > If it's endian safe and if there are tests, I propose to incoperate it 
> > > in math.
> > 
> > The "Tostring" stuff should go into sysutils or strutils.
> 
> There are also some constants and (conversion) types shared by the
> mathematical operations and ToString operations.  Where would they go?

Sysutils is imported by both math and strutils. It depends a bit on the
nature and number of them. This would speak for adding them to sysutils
rather than strutils.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Marco van de Voort
In our previous episode, Tom Verhoeff said:
> >
> > Post the sources somewhere using the license header we use?
> 
> I intend to do just that.  I was considering the use of plain GPL,
> rather than LGPL.  However, I wonder if that would interfere with the
> incorporation into FreePascal.

Neither are good. GPL is mostly definitely not allowed for library routines
(it is fine for the compiler, IDE or utils)
 
> Is it the case that all FPC libraries use (a variant of) LGPL?

LGPL-with-linking-exception to be precise. (see rtl/copying.fpc for the
differences with ordinary LGPL)

This is a bit more liberal than LGPL either, otherwise everybody would have
to linking dynamically to FPC libs, which is technically hard to impossible.
(and not desirable to make that mandatory anyway).

> I am willing to use that license, but if GPL is an option, I would
> prefer that.

Not for library routines. GPLed library routines are useless. Even GNU
doesn't do that.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Tom Verhoeff
On Sat, Sep 06, 2008 at 11:28:52PM +0200, Marco van de Voort wrote:
> In our previous episode, Florian Klaempfl said:
> > > Would there be any interest in incorporating it?
> > 
> > If it's endian safe and if there are tests, I propose to incoperate it 
> > in math.
> 
> The "Tostring" stuff should go into sysutils or strutils.

There are also some constants and (conversion) types shared by the
mathematical operations and ToString operations.  Where would they go?

Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science
PHONE:  +31 40 247 41 25| Technische Universiteit Eindhoven
FAX:+31 40 247 54 04| PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] License question; unit to view floating-point details

2008-09-07 Thread Tom Verhoeff
On Sat, Sep 06, 2008 at 09:31:02PM +0200, Florian Klaempfl wrote:
>>
>> What would I need to do to release it under the same license as
>> other FreePascal libraries?
>
> Post the sources somewhere using the license header we use?

I intend to do just that.  I was considering the use of plain GPL,
rather than LGPL.  However, I wonder if that would interfere with the
incorporation into FreePascal.

Is it the case that all FPC libraries use (a variant of) LGPL?
I am willing to use that license, but if GPL is an option, I would
prefer that.

>> Would there be any interest in incorporating it?
>
> If it's endian safe and if there are tests, I propose to incoperate it  
> in math.

The old version initially was not, and the next version resolved
that through conditional compilation.  It used a set-of construct
to access the bits of floating-point numbers.

The current version is safe on most "reasonable" processors.

Let me explain.  I use 32-bit (Cardinal) and 64-bit (QWord) integers
to access the bits of Single/Double values.  The IEEE 754 standard
format for floating-point numbers was specifically designed to allow
the use of some integer operations on the representation to implement
some floating-point operations, because this gives an opportunity to save
on hardware.  In particular, succ and pred on the floating-point number
bit pattern _interpreted_as_integer_ will yield the next larger/smaller
floating-point number.

Therefore, I believe that my current implemenation is endian-safe
on processors that exploit the IEEE 754 standard wisely.

In particular, I tested it on Intel and PowerPC (which have opposite
endianness; though PowerPC can switch endianness).

The unit comes with a separate test driver.  There are also some examples.

Tom
-- 
E-MAIL: T.Verhoeff @ TUE.NL | Dept. of Math. & Comp. Science
PHONE:  +31 40 247 41 25| Technische Universiteit Eindhoven
FAX:+31 40 247 54 04| PO Box 513, NL-5600 MB Eindhoven
http://www.win.tue.nl/~wstomv/  | The Netherlands
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] How to customize a TDBMemo

2008-09-07 Thread Graeme Geldenhuys
On Sun, Sep 7, 2008 at 1:35 AM, Felipe Monteiro de Carvalho
<[EMAIL PROTECTED]> wrote:
> I could not find events which would allow me to do this, so I tryed to
> create a TDBMemo descendent and override some method, but this also
> doesn't work, because I would need to access private fields in TDBMemo
> (specially FDataLink).

I got no idea if this will work, but wouldn't it be possible to
override the LoadMemo() method. I see they already to some testing
before displaying values for Blob fields. This might point you in te
right direction.

[advertising hat on]
Otherwise, leave DB-aware components completely and instead use an
Object Persistent Framework like tiOPF and Model-GUI-Mediator (MGM is
also part of tiOFF) to make standard controls "object-aware" without
creating descendants.  ;-)
With Michael van Canneyt's awesome Lazarus Data Desktop and
refactoring changes in MGM, you can now put together a database
application just as quick if not quicker with tiOPF and standard GUI
components.
[advertising hat off]

Regards,
 - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal