[net.micro.amiga] APTR data types

moorel@eglin-vax@caip.RUTGERS.EDU (03/07/86)

From: "LYNNE C MOORE" <moorel@eglin-vax>


	In setting up an Interrupt structure on my Amiga, I noticed that it 
required a pointer to a data area for the interrupt server. It uses the data 
type APTR, which is defined in exec/types.h; however, if I call AllocMem to 
allocate a block of memory and return a pointer of this type, the compiler 
flags it as "Pointers do not point to the same object."
	Looking at types.h, APTR is defined:

	typedef unsigned char *STRPTR;	/* string pointer. */
	typedef STRPTR	      *APTR;	/* absolute memory pointer. */

which seems to say that an APTR variable is actually a pointer to a pointer to 
an absolute memory location. I tried several test routines to use an APTR to 
access unsigned char data, and did indeed have to set up a pointer to a STRPTR 
to the data in order to access the data properly. 
	The example of the interrupt structure in the ROM Kernel manual 
defines the data pointer as  
	APTR	*data;
while the exec/interrupts.h header file defines it as
	APTR 	is_data;
and I have to typecast the pointer from the AllocMem function to get around 
the compiler warning. 
	Does the ROM Kernel handle APTR data as pointers to pointers to data 
or as a direct pointer to a memory location, and if the latter, how can I 
correct the problem with the existing definition without irreparably 
corrupting the system? Is this problem corrected in v.3.03 of Lattice C (we 
have 3.02)?

	Thanks, 
	Lynne C. Moore <MOOREL@EGLIN-VAX.ARPA>


------