[Lazarus] C Integer types

Bernd prof7bit at gmail.com
Mon Jul 9 10:42:26 CEST 2012


2012/7/9 Hans-Peter Diettrich <DrDiettrich1 at aol.com>:

> Often it is not desired, or even not possible, to describe a commonly used
> data structure with properly typed members (cyclic unit references!). That's
> when even in Pascal untyped pointers or handles have to be passed around,
> which have a specific meaning only in specific parts of the code.

I was criticizing the usage of obfuscating convoluted pointer
arithmetics with hardcoded offsets to emulate something as simple as a
record with 4 integers in it.

Even if you can't use the the original definition of that one record
(why not?) you can still define the needed parts of that record a
second time in a private type section (type is where knowledge about
structure of data belongs) instead of hardcoding obscure byte offsets
between begin/end where it clearly does *not* belong.

Bernd




More information about the Lazarus mailing list