I stand corrected. I've just checked Delphi5 and indeed it allows a
direct typecast from ansistring to any object/class :-/
But Delphi also allows direct cast from enumeration value to pointer
(which FPC doesn't allow), so maybe this is another nice oportunity to
be stricter than Delphi ;-)
Cheer
On Sat, 20 May 2006 23:20:41 +0200
Florian Klaempfl <[EMAIL PROTECTED]> wrote:
> Mattias Gaertner wrote:
> > On Sat, 20 May 2006 22:50:17 +0200 (CEST)
> > [EMAIL PROTECTED] (Marco van de Voort) wrote:
> >
> >>> i:=PtrInt(p1)-PtrInt(p2);
> >> i:=prtint(p1-p2);
> >
> > Thanks.
> > So the trick
Mattias Gaertner wrote:
> On Sat, 20 May 2006 22:50:17 +0200 (CEST)
> [EMAIL PROTECTED] (Marco van de Voort) wrote:
>
>>> i:=PtrInt(p1)-PtrInt(p2);
>> i:=prtint(p1-p2);
>
> Thanks.
> So the trick to get convert a Pointer to an ordinal is to add/subtract
> something. For example:
> i:=PtrInt(p1
Micha Nelissen wrote:
> On Sat, 20 May 2006 22:50:17 +0200 (CEST)
> [EMAIL PROTECTED] (Marco van de Voort) wrote:
>
>>> i:=PtrInt(p1)-PtrInt(p2);
>> i:=prtint(p1-p2);
>
> Is the cast still necessary here ?
No.
___
fpc-pascal maillist - fpc-pascal@
On Sat, 20 May 2006 22:50:17 +0200 (CEST)
[EMAIL PROTECTED] (Marco van de Voort) wrote:
> > i:=PtrInt(p1)-PtrInt(p2);
>
> i:=prtint(p1-p2);
Thanks.
So the trick to get convert a Pointer to an ordinal is to add/subtract
something. For example:
i:=PtrInt(p1-nil);
Is there a better trick?
What
On Sat, 20 May 2006 22:50:17 +0200 (CEST)
[EMAIL PROTECTED] (Marco van de Voort) wrote:
> > i:=PtrInt(p1)-PtrInt(p2);
>
> i:=prtint(p1-p2);
Is the cast still necessary here ?
Micha
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://l
> i:=PtrInt(p1)-PtrInt(p2);
i:=prtint(p1-p2);
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
I want to compute the offset/difference between two pointers. But I didn't
found a way to do that without compiler hints.
unit1.pas(42,6) Hint: Conversion between ordinals and pointers is not
portable
var
p1, p2: pointer;
i: PtrInt;
begin
...
i:=PtrInt(p1)-PtrInt(p2);
...
end;
Any ide
Pianoman wrote:
> Hi, I am interested whether is planed implementation of SSE3 floating
> instruction in to FPC. I saw optimizations in gpc for p2 p3 how can I
> set FPC to optimize let's say for P4?
FPC supports sse and sse2. sse3 gives no real advantage for a compiler.
> Regards
> Pianoman
> --