Talk:Trinity in Trouble

From Freepascal Amiga wiki
Revision as of 13:03, 27 September 2015 by Alb42 (talk | contribs) (untyped Pointer)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

untyped Pointer in structures

Notice to: "structure TWindow field WScreen" and all the others of this kind: You will find dozens of this kind in any kind of structures. The reason are recursive type definitions which does work little bit strange in Pascal. Forwarding of types only within the same Block. So this works:

type
  PScreen = ^TScreen;
  PWindow = ^TWindow;

  TWindow = record
    WScreen: PScreen
  end;
  
  TScreen = record
    FirstWindow: PWindow;   
  end;
const
  IDCMP_NEWSIZE = 1 shl 1;

and this does not work:

type
  PScreen = ^TScreen;
  PWindow = ^TWindow;

  TWindow = record
    WScreen: PScreen
  end;

const
  IDCMP_NEWSIZE = 1 shl 1;   

type
  TScreen = record
    FirstWindow: PWindow;   
  end;

So a complete Rewrite/Resort of the complete unit is needed, as I did for AROS. I will not do that for MorphOS/Amiga again. --ALB42 (talk) 13:03, 27 September 2015 (CEST)