[fpc-devel] FPC for microcontrollers

2006-08-15 Thread Alexander Todorov

Hello list,
I found this and it may be interesting to some of you:

http://jal.sourceforge.net/

A Pascal like compiler for microcontrollers.

It is a good thing to have in FPC like there is in gcc.
What do you think?
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Re: FPC for microcontrollers

2006-08-15 Thread Alexander Todorov

On Tue, 15 Aug 2006, Michael Van Canneyt wrote:

Could you be more clear ? I don't understand the question?
What is the relation with gcc ?

Michael.


AFAIK gcc can compile code for some models microcontrollers(cpus for
embeded devices).
I am not specialist in this area but know people who write software
for custom made devices using GCC and C instead of writing in some
assembler language.

The question is do we need/do we want support for this feature in FPC?
This can be used for FPC advocacy as well.
Are there people in the list who can/are willing to help? Can FPC beat
GCC in this area?

Just wanted to hear different oppinions.

Greetings to all!
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC 2.0.4 arm-linux testing

2006-08-12 Thread Alexander Todorov

Hello list,
full logs from the arm-linux testing are available at:
http://technobin.itafree.com/fpc/fpc_2.0.4_rc2_arm-linux_test.tar.bz2

All binary files are deleted, only plain text left.
Hope this will help FPC development.

Greetings to all.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC 2.0.4 arm-linux testing

2006-08-11 Thread Alexander Todorov

Hello,
thanks to all that helped me execute the tests.
These are the 3 digest files produced from testing
FPC 2.0.4 rc2 for arm-linux, using 2.0.4 rc3 tests.
Tested on x86(compile OK, all runs fail of course), qemu-arm, real arm device.
Will provide the full logs from the test if necessary.


digest.tar.bz2
Description: BZip2 compressed data
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC 2.0.4 arm-linux testing

2006-08-09 Thread Alexander Todorov

On 8/9/06, Florian Klaempfl [EMAIL PROTECTED] wrote:

No, TEST_FPC=/.../ must be appended because the test suite distinguishes between
the compiler used to build the test tools like digest and the compiler actually
being tested.


Thanks, I should have tried this.
Another question: How do I pass command line options to the compiler
being tested?
I need option -XP to prefix binutils names.
TEST_FPC=/path/to/ppcarm -XParm-linux- does not work. make thinks
-XP is optin for it.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC 2.0.4 arm-linux testing

2006-08-09 Thread Alexander Todorov

On 8/9/06, Jonas Maebe [EMAIL PROTECTED] wrote:

TEST_OPT=...

Thanks again. I saw the options in the readme file.

After running:
make TEST_FPC=/usr/local/lib/fpc/2.0.4/ppcarm TEST_OPT=-XParm-linux-
clean all digest

in the fpc/tests directory it starts compiling for a while and then
error occures:

/usr/local/lib/fpc/2.0.4/ppcarm -n -FEarm-linux -Tlinux -XParm-linux- erroru.pp
/usr/local/lib/fpc/2.0.4/ppcarm -n -FEarm-linux -Tlinux -XParm-linux-
../test/cg/ptest.pp
/usr/local/lib/fpc/2.0.4/ppcarm -n -FEarm-linux -Tlinux -XParm-linux-
popuperr.pp
make[1]: Leaving directory `/home/alexx/repos/fpc_2.0.4_rc3/tests/units'
/bin/cp -fp test/cg/obj/linux/arm/ctest.o test/cg
/bin/cp -fp test/cg/obj/linux/arm/tcext3.o test/cg
/bin/cp: cannot stat `test/cg/obj/linux/arm/tcext3.o': No such file or directory
make: *** [copyfiles] Error 1

The file tcext3.c seems to not compile. There are some .c files to
test linking between FPC and C object files. The test should compile
them as well, right?

According to readme file there is this option:
TEST_CCOMPILER - defaults to installed gcc compiler, but only if
driver and test full-targets are the same.

Does this mean that I need to have gcc-arm installed? Are there other
.c / .cpp files that need gcc? How to check why this file was not
compiled?
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC 2.0.4 arm-linux testing

2006-08-09 Thread Alexander Todorov

Here is the digest from the test:
The FPC being tested is ppcarm 2.0.4 rc2 from the ftp site. The test
suite is the 2.0.4 rc3 from svn.

Using qemu-arm emulator
`make TEST_FPC=/usr/local/lib/fpc/2.0.4/ppcarm TEST_OPT=-XParm-linux-
EMULATOR=qemu-arm clean all digest`
---
Total = 3065 (59:3006)
Total number of compilations = 1774 (44:1730)
Successfully compiled = 1375
Successfully failed = 355
Compilation failures = 42
Compilation that did not fail while they should = 2
Total number of runs = 1291 (15:1276)
Successful runs = 1276
Failed runs = 15
Number units compiled = 72
Number program that should not be run = 8
Number of skipped tests = 170
Number of skipped graph tests = 10
Number of skipped interactive tests = 15
Number of skipped known bug tests = 5
Number of skipped tests for other versions = 9
Number of skipped tests for other cpus = 110
Number of skipped tests for other targets = 21
---




With no emulator. Tested on i386 machine.
`make TEST_FPC=/usr/local/lib/fpc/2.0.4/ppcarm TEST_OPT=-XParm-linux-
clean all digest`
---
Total = 3069 (1337:1732)
Total number of compilations = 1776 (44:1732)
Successfully compiled = 1377
Successfully failed = 355
Compilation failures = 42
Compilation that did not fail while they should = 2
Total number of runs = 1293 (1293:0)
Successful runs = 0
Failed runs = 1293
Number units compiled = 72
Number program that should not be run = 8
Number of skipped tests = 168
Number of skipped graph tests = 10
Number of skipped interactive tests = 15
Number of skipped known bug tests = 5
Number of skipped tests for other versions = 9
Number of skipped tests for other cpus = 108
Number of skipped tests for other targets = 21
---

Please let me know what other log files do you need (e.g. longlog, ...).

I tested only the 'pi' program on real hardware. Is there a way to
automatically execute all compiled programs on real device? How to
know if they worked correctly?


I am going to play with my Zaurus PDA and see if it can take 'on
board' compilation.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] native compiler for ARM

2006-08-08 Thread Alexander Todorov

Hello list,
I am wondering why there isn't native compiler/ide fro ARM but just
cross-compiler?
What is the problem for missing that? Any readings about compiler
internals and different targets are more that welcome!

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


[fpc-devel] Re: native compiler for ARM

2006-08-08 Thread Alexander Todorov

We do not have a system that is powerfull enough (enough memory) to build
one. You need 64mb at minimum to build the compiler and even that will be
tight.


Is it possible to be done with less amount of memory and large swap space?



By the way, I haven't received test reports about the 2.0.4rc cross compiler 
yet, would you be willing to test it?


I have a Sharp Zaurus SL-5500 device, that will be siutable for tests I suppose.
Can you give more details about testing? I will try to do some tests.



Dani=EBl


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


[fpc-devel] Array with char index could not compile

2006-07-06 Thread Alexander Todorov

Hello,
I have troubles with compiling array with char index that uses
cyrillic characters.
Please see issue: #7122 for details.
http://www.freepascal.org/mantis/view.php?id=7122

Any ideas or workarounds are more than welcome.
Thanks.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Possible bug in thread manager

2006-06-01 Thread Alexander Todorov

Hello,
I am sending you a sample which is not working as expected.
The sample contains 2 FPC projects compiled with Lazarus. They are
demonstrating a program that starts, goes in daemon mode, and creates
two threads that will do their job, as well as the demonized program
will do some job as well. This is shown with writelns.
classthreads.lpr - threads implementation using TThread descendants
systhreads.lpr - threads implementation using BeginThread functions
To run as daemon pass some parameter on command line.

The two FPC implementations are pretty much the same.
fork.c - a pthreads implementation in C. this is for reference only.

issue 1:
When demonising with LibC.Daemon(0, 0) the file handles to the
standard Input, Output and Error are closed properly and they are not
accessible to the created threads.
When the program is demonised using FpFork and closing the file hadles
with Close() this is not working as expected. Thread1/Thread2 CAN
write to the standard output and results get written in the console.
When forking file handles are copied to the child process and changes
are not visible to the parent or to the child. When creating threads
the changes should be visible to the new threads since they are in the
space of the process creating them. Am I right or not?

Issue 2:
When the program is compiled without {$DEFINE USE_DAEMON} it is being forked.
In this case the second thread is not created (IMO), the masted
program does not continue execution and all hangs up in the while loop
for thread 1.
If it is started with without any parameters, it is running in
non-daemon mode and the two threads are working fine.
If started with  in the end two threads are working fine again.

The C reference uses fork() to become a daemon.
When the file handles for stdin, stdout, stderr are closed the threads
don't print on the console.
If they are not closed the printed results are visible in console. In
both cases the two threads and the master process are running.

For more info please see the provided source code and the provided
listing of ps.
I am using FPC 2.0.2 on Linux.

Are these issues bugs in the thread manager?
The projects are Linux (Unix) speciffic, can someone verify on Windows?
Can someone test this with newer FPC?
A long time ago I saw an e-mail that anouced another ThreadManager
implementation for FPC /something for real time threads IIRC/. Can
someone test with different thread manager?

If these are bugs, 2 as I see it, should I report them in mantis?

Thanks to all.


thread_test.tar.bz2
Description: BZip2 compressed data
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Possible bug in thread manager

2006-06-01 Thread Alexander Todorov

On 6/1/06, Alexander Todorov [EMAIL PROTECTED] wrote:

Hello,
I am sending you a sample which is not working as expected.
The sample contains 2 FPC projects compiled with Lazarus. They are
demonstrating a program that starts, goes in daemon mode, and creates
two threads that will do their job, as well as the demonized program
will do some job as well. This is shown with writelns.
classthreads.lpr - threads implementation using TThread descendants
systhreads.lpr - threads implementation using BeginThread functions
To run as daemon pass some parameter on command line.

The two FPC implementations are pretty much the same.
fork.c - a pthreads implementation in C. this is for reference only.

issue 1:
When demonising with LibC.Daemon(0, 0) the file handles to the
standard Input, Output and Error are closed properly and they are not
accessible to the created threads.
When the program is demonised using FpFork and closing the file hadles
with Close() this is not working as expected. Thread1/Thread2 CAN
write to the standard output and results get written in the console.
When forking file handles are copied to the child process and changes
are not visible to the parent or to the child. When creating threads
the changes should be visible to the new threads since they are in the
space of the process creating them. Am I right or not?

Issue 2:
When the program is compiled without {$DEFINE USE_DAEMON} it is being forked.
In this case the second thread is not created (IMO), the masted
program does not continue execution and all hangs up in the while loop
for thread 1.
If it is started with without any parameters, it is running in
non-daemon mode and the two threads are working fine.
If started with  in the end two threads are working fine again.

The C reference uses fork() to become a daemon.
When the file handles for stdin, stdout, stderr are closed the threads
don't print on the console.
If they are not closed the printed results are visible in console. In
both cases the two threads and the master process are running.

For more info please see the provided source code and the provided
listing of ps.
I am using FPC 2.0.2 on Linux.

Are these issues bugs in the thread manager?
The projects are Linux (Unix) speciffic, can someone verify on Windows?
Can someone test this with newer FPC?
A long time ago I saw an e-mail that anouced another ThreadManager
implementation for FPC /something for real time threads IIRC/. Can
someone test with different thread manager?

If these are bugs, 2 as I see it, should I report them in mantis?

Thanks to all.





I forgot to add some details.
[EMAIL PROTECTED]:~$ uname -a
Linux optical 2.4.27-1-386 #1 Fri Sep 3 06:24:46 UTC 2004 i686 GNU/Linux
This is my developer machine.

I have a production machine that runs with a modified 2.6 kernel and
the projects in question work on it.
I will give more details if needed.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] data alignment and int64 (or qword, maybe any single piece of size 8 if any)

2006-05-15 Thread Alexander Todorov

On 5/15/06, Пётр Косаревский [EMAIL PROTECTED] wrote:

begin
writeln(sizeof(a)); // 12 ok!
writeln(sizeof(b)); // 16???
writeln(sizeof(c)); // 14 ok!
writeln(sizeof(d)); // 16???
writeln(sizeof(e)); // 12 ok!
end.
// I don't know the numbers on other platforms/systems


Linux, i386, FPC 2.0.2, results are the same.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] TList.Assign - overloaded implementation

2006-05-11 Thread Alexander Todorov

Hello,

procedure TList.Assign(ListA: TList; AOperator: TListAssignOp; ListB: TList);

exists in Delphi that allows you to assign to a TList object the
result of the operation
'ListA   AOperator  ListB'. This can be : copy, and, xor for example.

The attached file contains and implementation of this, maybe it needs
to be improved.


tlist_assign.txt.tar.bz2
Description: BZip2 compressed data
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Workaround for issue #5093

2006-05-10 Thread Alexander Todorov

Hello,
recently I have reported this issue on the FPC site and there were
some e-mails about SQLDb not working with PostgreSQL.
http://www.freepascal.org/bugs/showrec.php3?ID=5093

The work around for TPQConnection is:
Do NOT use FTransaction.Commit but USE FTransaction.CommitRetaining instead.
It is working for me this way.

PS: This is not working with PostgreSQL but is working with Firebird.
I am not able to test with MySQL at the moment. Could someone test it
please? If possible test with other types of connections provided with
SQLdb.

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


[fpc-devel] proposal: Extension for class properties

2006-05-10 Thread Alexander Todorov

Hello,
Let's consider the following code fragment:
--
type

 TMyRecord = record
Name : String;
Value : Integer;
 end;

 TMyClass = class(TObject)
 private
FButton : TButton;
FRecord : TMyRecord;
 public
property RecordName : String read FRecord.Name write
FRecord.Name;// compiles
property ButtonWidth: Integer read FButton.Width write
FButton.Width; // does not compile
 end;
--

Is it really too hard to make the compiler understand properties with
the second type of declaration as the ButtonWidth example? I would
prefer this to
--
property ButtonWidth: Integer read GetButtonWidth write SetButtonWidth;

function class name.GetButtonWidth: Integer;
begin
  Result := FButton.Width;
end;

procedure class name.SetButtonWidth(const AValue: Integer);
begin
  FButton.Width := AValue;
end;
--

Please state your comments on this idea. Is it good or not? Is this
something that you would like to have as a feature? Is it able to be
implemented?
How?
Maybe using hidden Get/Set methods?

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


Re: [fpc-devel] gtk1 linklib directive under FreeBSD

2006-05-09 Thread Alexander Todorov

On 5/9/06, Mattias Gaertner [EMAIL PROTECTED] wrote:

I heard that the gtk1 libs under FreeBSD are libglib-12.so, libgdk-12.so and
libgtk-12.so.
But at the moment the linklib directive for FreeBSD defines
{$ifdef FreeBSD}
  gtkdll='gtk12';
  {$linklib gtk12}
without the '-'.

Can someone with FreeBSD please test if changing

packages/extra/gtk/gtk/gtk.pp
packages/extra/gtk/gdk/gdk.pp
packages/extra/gtk/glib/glib.pp

fixes the issue.


Mattias


Two or three months ago I tested Lazarus on FreeBSD 6.0 RELEASE.
After installing some missing libs (like pixbuf-devel, etc.) it
compiled and run without any problems. Lazarus version was 0.9.12
IIRC.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Unix sockets for Windows

2006-05-05 Thread Alexander Todorov

Hello,
I have an application that uses TCP sockets nut it is going to be
changed with UNIX sockets.
Can you point me to some easy and clean approach how to emulate UNIX
sockets for Windows.
The only thing I can think of is using named pipes and encapsulate the
functionality in some class. Any other alternative are welcome.

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


Re: [fpc-devel] How to add comments on FPC buglist?

2006-05-04 Thread Alexander Todorov

On 5/3/06, Daniël Mantione [EMAIL PROTECTED] wrote:

It has been discussed, but Michael is currently writing a new bug
reporting system in Free Pascal, and the developers are supportive to
software written with our own bare hands.


Glad to hear that. Hope the new system comes soon and has all
necessary features.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] How to add comments on FPC buglist?

2006-05-03 Thread Alexander Todorov

Hello,
Is it possible to add comments once a bug has been submited to the FPC
bugs database?
It seems to be only for admins. Password is required.

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


Re: [fpc-devel] How to add comments on FPC buglist?

2006-05-03 Thread Alexander Todorov

On 5/3/06, Michael Van Canneyt [EMAIL PROTECTED] wrote:

It is not yet possible. We're working on this.

Michael.

Why don't you use a bugtracking system like Mantis, Bugzilla,
PhpBugTracker, etc... like many projects do?
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] XML and encoding problems

2006-04-25 Thread Alexander Todorov
On 4/23/06, Bogusław Brandys [EMAIL PROTECTED] wrote:
 Result printed on console are not sufficient.Compare binary chunks,
C:\fc -B save.txt.windows save.txt.linux
Comparing files save.txt.windows and save.txt.linux
0005: 3F D0
0006: 3F A2
0007: 3F D0
0008: 3F B8
0009: 4E D1
000A: 3F 85
000B: 3F D0
000C: 3F BE
000D: 3F D0
000E: 3F BC
000F: 3F D0
0010: 3F B8
0011: 4E D1
0012: 3F 80
0014: 3F D0
0016: 4E D1
0017: 3F 83
0018: 3F D0
0019: 3F BC
001A: 3F D0
001C: 3F D0
001D: 3F BD
001E: 3F D0
001F: 3F BE
0020: 3F D0
0021: 3F B2
0023: 3F D0
0024: 3F A2
0025: 3F D0
0026: 3F BE
0027: 4E D1
0028: 3F 82
0029: 3F D0
002B: 3F D0
002C: 3F B2
002D: 0D 0A
FC: save.txt.windows longer than save.txt.linux

 then later check for system locale support.

How do I do that?
On Linux:
[EMAIL PROTECTED]:~/temp/utf$ locale
LANG=bg_BG.UTF-8
LANGUAGE=bg,mk
LC_CTYPE=bg_BG.UTF-8
LC_NUMERIC=bg_BG.UTF-8
LC_TIME=bg_BG.UTF-8
LC_COLLATE=bg_BG.UTF-8
LC_MONETARY=bg_BG.UTF-8
LC_MESSAGES=bg_BG.UTF-8
LC_PAPER=bg_BG.UTF-8
LC_NAME=bg_BG.UTF-8
LC_ADDRESS=bg_BG.UTF-8
LC_TELEPHONE=bg_BG.UTF-8
LC_MEASUREMENT=bg_BG.UTF-8
LC_IDENTIFICATION=bg_BG.UTF-8
LC_ALL=
[EMAIL PROTECTED]:~/temp/utf$

How to check on Windows?

Is this enough to report as a bug?


save.txt.windows
Description: Binary data


save.txt.linux
Description: Binary data
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] XML and encoding problems

2006-04-25 Thread Alexander Todorov
This may be relevant:
http://www.freepascal.org/bugs/showrec.php3?ID=3434
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] XML and encoding problems

2006-04-23 Thread Alexander Todorov
Hello,
I am developing an application in Lazarus that is multi platform. It
has very strong usage of xml that contains contains cyrillic text
(Bulgarian language). All xml feeds are UTF-8 encoding and is
converted internaly using iconv (UTF-8 - CP1251 and vice versa) when
needed. On Linux this is working very well, but on Windows it is not.
I have iconv.pas and link to iconv.dll but the problem is that when a
xml document is read from file / stream after that the contents of the
document are not UTF-8 encoded and iconv fails.
Attached is a simple program that reads a file and prints xml values.

On Linux the result is :
[EMAIL PROTECTED]:~/temp/utf$ ./project1
user=Тихомир Руменов Тотев

This is correct. Tested with gnome-terminal on native Linux system and
with Bitvise Tunelier ssh client for Windows.

On Windows the result is :
E:\TMP\utfproject1.exe
user=N???N? ?аN╡?? N??╡??

This is not correct. I tried debugging this but couldn't find the problem.
Compiled with Lazarus 0.9.14 / FPC 2.0.2.

Please give some help / hints / workaround. This is very cruical for me ATM.

Thanks.


utf.tar.bz2
Description: BZip2 compressed data
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] TDOMNodeList.GetItem

2006-04-13 Thread Alexander Todorov
Hello,
as far as I tested TDOMNodeList.GetItem is not working correctly.
- original ---
function TDOMNodeList.GetItem(index: LongWord): TDOMNode;
var
  child: TDOMNode;
begin
  Result := nil;
  child := node.FirstChild;
  while Assigned(child) do
  begin
if index = 0 then
begin
  Result := child;
  break;
end;
if (not UseFilter) or (child.NodeName = filter) then
  Dec(index);
child := child.NextSibling;
  end;
end;
 end original --
This is not checking the filter value if index is 0 /GetItem(0)/. And
what about negative inices? It should be changed like this :

-- change like this --
function TDOMNodeList.GetItem(index: LongWord): TnDOMElement;
var
  child: TDOMNode;
begin
  Result := nil;
  if index  0 then
exit;
  child := node.FirstChild;
  while Assigned(child) do
  begin
if ((index = 0) and (not UseFilter)) or
   ((index = 0) and (UseFilter) and (child.NodeName = filter)) then
   begin
 Result := TnDOMElement(child);
 break;
   end;

if (not UseFilter) or (child.NodeName = filter) then
  Dec(index);
child := child.NextSibling;
  end;
end;
-- end change 

Your comments please.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC and OpenMP support.

2006-03-17 Thread Alexander Todorov
On 3/17/06, Daniël Mantione [EMAIL PROTECTED] wrote:
 I don't plan to put effort in OpenMP support; I don't see the need
 for an external library to be able to do multithreaded programming. Focus
 here should be on 100% Pascal implementations.

Am I missing something here ? OpenMP is a standard not a library. It
uses fork-join model, which is a task of the compiler not external
library. MPI though uses an external library. Correct me if I am
wrong.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] FPC and OpenMP support.

2006-03-16 Thread Alexander Todorov
Hello to all,
are there any parallel code developers in the list?

I will have to work on a mixed mode parallel project using MPI and OpenMP.
There are some bindings in pascal for the MPI library which is ok.
Does fpc support OpenMP compiler directives? AFAIK no.
Is there a known pascal compiler that supports OpenMP?

Integrating such support canbe a great step towards making FPC an
industrial class compiler.
This will require a lot of work, that is not in the roadmap for now.
What do you think?

here are some related links :
Message Passing Interface
http://www.open-mpi.org/
http://www.lam-mpi.org/
http://www.mpi-forum.org/
http://www-unix.mcs.anl.gov/mpi/

OpenMP :
http://www.openmp.org

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


[fpc-devel] possible bug in TDOMNamedNodeMap.RemoveNamedItem

2006-03-06 Thread Alexander Todorov
Hello folks,
I found that TDOMNamedNodeMap.RemoveNamedItem does not delete from
memory the specified Item. It just sets FParentNode := nil. In this
case the following doesn't work as expected :
//-
while Node.Attributes.Length  0 do
   Node.Attributes.RemoveNamedItem(Node.Attributes.Item[0].NodeName);
//-
// working example
while Node.Attributes.Length  0 do
   Node.Attributes.Delete(0);
//--

This loop continues forever being stuck at the first attribute of a xml node.
Is this a bug or it is by design?
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Variant assignment error

2006-01-25 Thread Alexander Todorov
Hi to all,
When assigning string that represent numerical value to a variant and
after that assigning that variant to a numeric variable an exception
is raised. When debugging it shows the following message :
---
EVarianterror
###(gdb unparsed remainder: s $0 out of bounds)###)
---
The error is for Int64 and Double types. Should I check for values
from other numerical types?

Here is the sample program.

program project1;

{$mode objfpc}{$H+}

uses SysUtils, Variants;

var D : Double;
V : Variant;
I64 : Int64;
I : Integer;
begin
  V := 15000; //150 000 000
  I := V;
  writeln('integer - ', I);

  V := IntToStr(15000);
  I := V; // --- works
  writeln('integer str - ', I);

  V := 1500; // 150 000 000 000
  I64 := V;
  writeln('int64 - ', I64);

  V := IntToStr(1500);
  I64 := V;  // --- doesn't work  FPC / Delphi 6
  writeln('int64 str - ', I64);

  V := 3.14;
  D := V;
  writeln('double - ', D);

  V := FloatToStr(3.14);
  D := V;  // --- doesn't work FPC. works in Delphi 6
  writeln('double str - ', D);
end.


Tested with FPC 2.0.1 on Windows XP. Should I add a bug report for that ?
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] WinSock error 10106

2006-01-05 Thread Alexander Todorov
Hello,
I have a two classes that implement TCP / IP client and server.
Internally they use a base class which uses sockets to handle communication.
In this part of code I get an error :

procedure TTCPClient.Connect;
begin
  FSocket := Socket(AF_INET, SOCK_STREAM, 0); // create socket descriptor
  if (FSocket = 0) then
raise Exception.Create(IntToStr(SocketError));
.
end;

According to Google this is :
WSAEPROVIDERFAILEDINIT 10106   - (Winsock2)

The code itself is OK and is tested heavy under Linux and now I wanted
to use it under Windows.

I call TTCPClient.Connect that is supposed to connect to 127.0.0.1:.
On the server side thare is TTCPServer written in simillar manner.

This error occurs on my development machine, but not on other testing
machine. On testing machine the connection between server and client
is established.

Does anyone have a clue what is causing the problem ?? I don't think
this is a bug, maybe it's some dependency?

machines used:
developer :
Windows XP, SP1 + critical patches
Lazarus 0.9.8, fpc 2.0.0

tester :
Windows XP, SP1, just installed.

linux :
Lazarus 0.9.10, fpc 2.0.0
OS : Debian (don't know exact version)
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] FPC 2.0.0 arm crosscompiler and bin utils.

2005-12-27 Thread Alexander Todorov
Hi,
where I can download the FPC crosscompiler for arm, and related binutils?
They are missing from the ftp site.

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


Re: [fpc-devel] FPC 2.0.0 arm crosscompiler and bin utils.

2005-12-27 Thread Alexander Todorov
 ftp://ftp.freepascal.org/pub/fpc/dist/arm-linux-2.0.0/

Thanks. I was lookingin the wrong location.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] TProcess and mpg123/321 issues

2005-12-13 Thread Alexander Todorov
Hi,
I have a GUI application created with Lazarus and I need to let users
play some mp3 files.
I have the following Button.OnClick
-
begin
  pMusic.CommandLine := 'mpg123 /home/user/song.mp3';
  pMusic.Active := true;

  while pMusic.Running then Application.ProcessMessages;

  ShowMessage('Done');
end.
-

pMusic is a TProcess component dropped on the form. It is set not to
wait the executed application because that hangs up the whole gui app.

If I try to run mpg321 the process is created (the ShowMessage is
executed after some time) but no music is played.
With mpg123 all is fine.

N.B. I mean the two different packages mpg123 and mpg321, not the
symbolic link created during the installation.

Does anyone have a clue what's causing this behaviour ???
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] TDataSet.TempBuffer

2005-12-03 Thread Alexander Todorov
Hi folks,
in FPC 2.0.0 there is TDataSet.TempBuffer function with an empty body.
In FPC 2.0.1 it is removed.

I am writing a custom dataset that uses a part ported from Delphi and
there is TempBuffer.

Can you tell me what is its purpose?
It is used only in two places where TDataSet.State = dsFilter.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Cryptography class nedded ?

2005-11-17 Thread Alexander Todorov
Hi folks,
can you tell if there is a good crypto class for FPC / Lazarus ?
What do you use for crypting your stuff ?
Any opinions are welcome.

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


[fpc-devel] Does FPC support XML encoding ?

2005-11-04 Thread Alexander Todorov
Hi all,
does fpc xml support encoding ???
I have a document with
?xml version=1.0 encoding=UTF-8?

and an application which runs on a system with CP1251 locale. The text
is read from the xml file but is not properly shown.
How can I make it show properly ???
Delphi does this automatically ?

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


[fpc-devel] Thread support for windows ?

2005-11-04 Thread Alexander Todorov
Hi,
what is the CThreads unit replacement in Windows 
Do I need to use thread driver under Win32 or it is needed only for Linux?

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


[fpc-devel] RQ : using TTCPClient / TEventLoop HOWTO ?

2005-10-21 Thread Alexander Todorov
Hello,
can anybody point me to documentation on using TTCPClient from fpSock.pp ?
I am porting a Delphi app which uses TidTCPClient to send / receive
text over tcp.
I changed this to using TTCPClient but when doing :
MyTCPClient.Active := true
an exception is raised : 'No event loop assigned'

This is because property EventLoop : TEventLoop is not assigned.
What is it used for ? Nothing found on google. (:

Even doing :
  MyTCPClient.EventLoop := MyEventLoop;
  MyTCPClient.Active := true

doesn't help. The exception is not raised but the client is still disconnected.

Any help / hints would be more than welcome.

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


[fpc-devel] Strange behaviour of ;

2005-10-20 Thread Alexander Todorov
Hi all,
i have noticed something strange and I am not sure if this is a bug or
a feature.

strSQL := Copy(strSQL,1,Length(strSQL)-1) + ' WHERE ';
strSQL := strSQL ; + ConstructWhereClause;
--^

This part of code must construct a sql sttement which is used later on.
the function ConstructWhereClause constructs everything that is behind `WHERE`.
How ever having a semi-colon not in right place messed things up.
The result is the old value of strSQL without the result of
ConstructWhereClause.
Removing ; before the plus (+) character fixes the problem.

In Delphi this would cause a compilation error, but in FPC it does not. Why ?

Btw : the miss placed ; appeared because Lazarus' identifier
completion adds a ; when the completion is selected. Any comments on
this ?
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel