BeRo1985/pucu

Avoid use of longint and longword

Opened this issue · 0 comments

In Delphi LongInt and LongWord are platform dependant types: 32-bit on Windows and 64-bit on Linux, iOS, and Android.
In FreePascal LongInt and LongWord are 32-bit on all platforms. I don't know if this is dependent on Delphi-mode or not.

You probably want to use Integer and Cardinal instead as these are 32-bit on all platforms, regardless of the compiler.

https://docwiki.embarcadero.com/RADStudio/Sydney/en/Simple_Types_(Delphi)#Platform-Dependent_Integer_Types
https://www.freepascal.org/docs-html/rtl/system/longint.html

It appears that you were aware of this when you wrote the code, but got the handling of it reversed:

TPUCUInt32={$ifdef fpc}Int32{$else}LongInt{$endif};
TPUCUUInt32={$ifdef fpc}UInt32{$else}LongWord{$endif};

Regardless, it would be better to just alias the integer and cardinal types.