On Sun, Jan 4, 2009 at 5:15 AM, Martin Friebe <[email protected]> wrote: > Hi > I know there are issues becuse on 64 bity systems pointer are 8 byte. > And I know there is PTRInt / PTRUInt. An integer of the correct size. > > But how much casting is needed? > > if I have an integer, word, or byte do I need to go via PTRInt? That is > if I know the data is only 4 or less bytes. > > So what happens if I do > SomeInt = Pointer(foo); > Will that compile on 64 bit, or do I need > SomeInt = PTRInt(Pointer(foo));
Don't do that, do instead: SomeInt = PTRInt(foo); If you cast it (twice) to pointer it will not result in what you expected, and on 64 bit, you will not solve the problem. > > In both case the data must be truncated, so the question is not will it > work (the data is small enough). > the question is will it compile. > _______________________________________________ > Lazarus mailing list > [email protected] > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus > Ido _______________________________________________ Lazarus mailing list [email protected] http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
