Re: [fpc-pascal] Typecasting by accident

2006-05-20 Thread Flávio Etrusco
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

Re: [fpc-pascal] How to get rid of hint?

2006-05-20 Thread Mattias Gaertner
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

Re: [fpc-pascal] How to get rid of hint?

2006-05-20 Thread Florian Klaempfl
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

Re: [fpc-pascal] How to get rid of hint?

2006-05-20 Thread Florian Klaempfl
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@

Re: [fpc-pascal] How to get rid of hint?

2006-05-20 Thread Mattias Gaertner
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

Re: [fpc-pascal] How to get rid of hint?

2006-05-20 Thread Micha Nelissen
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

Re: [fpc-pascal] How to get rid of hint?

2006-05-20 Thread Marco van de Voort
> 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

[fpc-pascal] How to get rid of hint?

2006-05-20 Thread Mattias Gaertner
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

Re: [fpc-pascal] SSE3

2006-05-20 Thread Florian Klaempfl
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 > --