SysBase

4 posts / 0 new
Last post
mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
SysBase

I am stuck on this, updating from OS3.9 to 4.1FE:

  1. struct Process *ThisProcess=NULL;
  2.  
  3. ThisProcess=((struct ExecBase *)SysBase)->ThisTask;
  4. if (ThisProcess->pr_CLI)
  5. {
  6. // get command line args
  7. }
  8.  
  9.  
  10. // disable requesters
  11. wptr=ThisProcess->pr_WindowPtr;
  12. ThisProcess->pr_WindowPtr=(APTR)-1L;

The first call gives me GCC warning 'assignment from incompatible pointer type'.

Since the first one doesn't work correctly, the second one crashes when I go to block the system requesters (Please insert volume "xxx")

What is the correct OS4 code for this?

gazelle
gazelle's picture
Offline
Last seen: 1 year 9 months ago
Joined: 2011-04-13 12:52
Something like that: struct

Something like that:

  1. struct Process *ThisProcess=(struct Process *)IExec->FindTask(NULL);
  2. ...
  3. APTR oldvalue = IDOS->SetProcWindow((APTR)-1L);
mritter0
mritter0's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2014-04-21 21:15
Thank you!

Thank you!

thomas
thomas's picture
Offline
Last seen: 3 months 1 week ago
Joined: 2011-05-16 14:23
ThisProcess=((struct ExecBase

ThisProcess=((struct ExecBase *)SysBase)->ThisTask;

This is not allowed anyway. Use ThisProcess = FindTask(NULL); instead.

Furthermore moving a task pointer to a process pointer should give an incompatible pointer warning. This is correct: ThisProcess = (struct Process *) FindTask(NULL);

Log in or register to post comments