Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!hplabs!nsc!voder!apple!darin From: darin@Apple.COM (Darin Adler) Newsgroups: comp.sys.mac.programmer Subject: Re: Pointer arithmetic in C w/ or w/o locked handles Message-ID: <8542@apple.Apple.Com> Date: 18 Apr 88 19:22:24 GMT References: <1988Apr15.125337.100@mntgfx.mentor.com> Reply-To: darin@apple.UUCP (Darin Adler) Organization: Apple Lines: 16 Keywords: pointer C arithmetic handles In article <1988Apr15.125337.100@mntgfx.mentor.com> tomc@mntgfx.mentor.com (Tom Carstensen) writes: > Is the problem I'm noticing with the following code > fragment the compiler, or on error? > ... > The '8' (or 1000 binary) occurs because it is Locked - > (only on 68000 w/ 24 bit addressing). but when I do > pointer arithmetic, is the compiler messing up or > should I only add Locked handles or Unlocked handles > together. The solution to this is the StripAddress trap. It is used to strip any bits from the high byte of a dereferenced handle. You can use it like this: pointer = StripAddress(*handle); -- Darin Adler AppleLink:Adler4 UUCP: {sun,voder,nsc,mtxinu,dual}!apple!darin CSNET: darin@Apple.com