Heh, much better - thank you! On Thu 28/03/19 14:31 , "Karoly Balogh (Charlie/SGR)" char...@scenergy.dfmk.hu sent: Hi,
On Thu, 28 Mar 2019, J. Gareth Moreton wrote: > I think the official unsigned 32-bit integer type in Pascal is > "LongWord". As others have said, be aware that pointers are 64-bit under > x64... that's kind of why it's called x64! If you absolutely must have > a packed record with 32-bit types, I recommend changing Sender and > Target to indices that are added to a base address. > > Similar to what Pierre said, change your Pointer code to something like > this: > > for Indx := 0 to SizeOf(TTCPPackageHeader) - 1 do Dec(Byte(Pointer(PtrUInt(@x) + Indx)^), ARollCount); How about Dec(PByte(@x)[Indx], ARollCount); instead? That doesn't look like an angry C programmer tried to convert some abomination to Pascal, and works on all pointer sizes. (Unless it also has to compile with say, Delphi.) Charlie _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org [1] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel [2]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel Links: ------ [1] mailto:fpc-devel@lists.freepascal.org [2] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel