Prof A Olowofoyeku (The African Chief) a écrit:
On 2 Apr 2005 at 15:01, Maurice Lombardi wrote:
[...]
Here is a rough and ready example:
type listptr = pointer; pbuf = ^tbuf; tbuf = array [0..maxlist] of listptr;
type mylist = object values : pbuf; count : cardinal; constructor init (max : cardinal); procedure additem (const p; size : cardinal); virtual; [....] end;
[....]
procedure mylist.additem; begin [...] inc (count); move (p, values^[count]^, size); { gpc doesn't like this } end;
You could replace pointer by pByte. It shows you what size means, at least. This is not a solution for all, however. I had the same problem when writing also generic procedures for list manipulations. At some moment it is necessary to say what are the objects manipulated by the list. I found no way to avoid typecast at this moment. But for me this is an absolutely necessary condition to say where dereferencing leads to. Only generic list manipulations, input / output / move in memory can ignore that.
It is with the "move" call that I actually don't need the compiler complaining about dereferencing untyped pointers.
And this is what is solved by replacing pointer by pByte as I suggested before
Maurice