Re: [fpc-devel] csize_t

2009-10-29 Thread Michael Van Canneyt



On Wed, 28 Oct 2009, Felipe Monteiro de Carvalho wrote:


On Wed, Oct 28, 2009 at 4:51 PM, Vincent Snijders
vsnijd...@vodafonevast.nl wrote:

Well, there is still is:
http://lazarus-ccr.sourceforge.net/fpcdoc/rtl/ctypes/csize_t.html


The docs could be out-dated, csize_t doesn't compile in FPC 2.2.4


I think the description is a bit strange: Character size type. I wouldhave
guess the c was not because of Character, but because of the C language.


The descriptions is completely wrong.


Please post a bugreport.

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


Re: [fpc-devel] csize_t

2009-10-29 Thread Vincent Snijders

Michael Van Canneyt schreef:


The descriptions is completely wrong.


Please post a bugreport.


Done:
http://bugs.freepascal.org/view.php?id=14932

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


Re: [fpc-devel] csize_t

2009-10-29 Thread Michael Van Canneyt



On Thu, 29 Oct 2009, Vincent Snijders wrote:


Michael Van Canneyt schreef:


The descriptions is completely wrong.


Please post a bugreport.


Done:
http://bugs.freepascal.org/view.php?id=14932

Vincnet


Thank you, Vincnet :-)

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


[fpc-devel] Bug 14937

2009-10-29 Thread Desmond Coertzen
Please kill this bug, the real issue is on bug 14936.

The first issue issue timed out when attaching the sample file. The sample
was was over 2MB, so I removed the binaries and sent only the code.

Afterwards, bug 14937 also came through.

I don't know why, I think it the first operation just took very long.

Please accept my apologies
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] First cppclass test

2009-10-29 Thread Sven Barth

Hello together!

After I sent the first Native NT patches to the bugtracker I found some 
time to test the cppclass-feature.


The following class compiles with 2.5.1:

  TestClass = cppclass
procedure Test1; external 'cpplib.so';
function Test2: LongInt; external 'cpplib.so';
  end;

The 'external' after each method is required as you can't add a 
'external' after the class definition (I think I'll have to look at 
Jonas' objc branch to see how he solved that...).



Adding a method with a parameter results in an internal error 2103001. 
This is in symdef.tprocdef.cplusplusmangledname in the local method 
getcppparaname. The reason is the hidden self parameter which isn't 
checked for in cplusplusmangledname. I've attached a patch were I added 
a check for hidden parameters in the parameter-for-loop. If you think 
that patch is ok I'll post it to the bugtracker.



The following program compiles and runs (the result of Test2 is printed 
- in my case 42 ^^), but there is a runtime error 217 after FreeClass 
(with after I mean that a Writeln after FreeClass is executed)


program cpptest1;

{$mode objfpc}{$H+}

type
  TestClass = cppclass
procedure Test1; external 'cpplib.so';
function Test2: LongInt; external 'cpplib.so';
procedure Test3(aArg1: LongInt); external 'cpplib.so';
  end;
  PTestClass = ^TestClass;

function NewClass: PTestClass; cdecl; external 'cpplib.so';
procedure FreeClass(aUser: PTestClass); cdecl; external 'cpplib.so';

var
  c: PTestClass;
  i: LongInt;
begin
  c := NewClass; // internal error
  try
i := c^.Test2;
Writeln(i);
  finally
FreeClass(c);
  end;
end.

The Pointer type is required, because a cppclass does not seem to be 
handled as a implicit pointer. When I don't use a pointer type I get an 
internal error 200301231 (x86/cpubase.cgsize2subreg) on the line c := 
NewClass.
As I'd like to have a cppclass behave like a normal class, I'd like to 
know where I can setup a cppclass reference as an implicit reference 
inside the compiler.



All in all I have the following goals for (my) future work on this:
* make a cppclass an implicit pointer
* use only one external 'foo' after the class declaration


Regards,
Sven

PS: when answering, please CC me, because I'm using digest mode :)
--- fpc/compiler/symdef.pas 2009-10-22 20:30:05.0 +0200
+++ fpc-build/compiler/symdef.pas   2009-10-28 21:08:16.0 +0100
@@ -3488,6 +3488,9 @@
  for i:=0 to paras.count-1 do
begin
  hp:=tparavarsym(paras[i]);
+ { we ignore all hidden parameters (like self) }
+ if vo_is_hidden_para in hp.varoptions then
+   continue;
  s2:=getcppparaname(hp.vardef);
  if hp.varspez in [vs_var,vs_out] then
s2:='R'+s2;
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] First cppclass test

2009-10-29 Thread Florian Klaempfl
Sven Barth schrieb:
 All in all I have the following goals for (my) future work on this:
 * make a cppclass an implicit pointer

I don't like this idea because C++-classes aren't an implicit pointer
either.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel