Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!ucla-cs!zen!ucbvax!hplabs!well!ewhac From: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Newsgroups: comp.sys.amiga Subject: Re: AllocMem() with 16-bit Manx Message-ID: <3878@well.UUCP> Date: Wed, 2-Sep-87 17:15:19 EDT Article-I.D.: well.3878 Posted: Wed Sep 2 17:15:19 1987 Date-Received: Sat, 5-Sep-87 07:43:46 EDT References: <872@percival.UUCP> Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Distribution: na Organization: Hole Earth 'Lectronic Loss (or words to that effect) Lines: 30 Summary: You too, huh? In article <872@percival.UUCP> baer@percival.UUCP (Ken Baer) writes: > >I have been working on a program that uses AllocMem(), and I can't get it >to work with 16-bit Manx C. [ ... ] >SpriteHead = (struct VSprite *)AllocMem(sizeof(struct VSprite), MEMF_PUBLIC | > MEMF_CLEAR); >BTW I already tried: >void *AllocMem(); Welcome to the Wonderful World of MANX C. Do this: extern void *AllocMem(); [ ... ] SpriteHead = AllocMem ((long) sizeof (struct VSprite), MEMF_PUBLIC | MEMF_CLEAR); You have to coerce that sizeof() reference to a long or you'll get stack misalignment. Tons 'o fun. MANX Programming Rule #1: *ALL* Amiga-specific function call arguments are 32 bits wide. Make sure they are this size, or bad karma will result. _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ Leo L. Schwab -- The Guy in The Cape ihnp4!ptsfa -\ \_ -_ Bike shrunk by popular demand, dual ---> !{well,unicom}!ewhac O----^o But it's still the only way to fly. hplabs / (pronounced "AE-wack") "Work FOR? I don't work FOR anybody! I'm just having fun." -- The Doctor