🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10188

Re: Manx help

#10188
From: Guy Streeter
Date: Mon, 31 Oct 1988 22:41
29 lines
1253 bytes
In article <10632@cup.portal.com> thad@cup.portal.com (Thad P Floryan) writes:
>Extracted fragment:
>          struct FileInfoBlock *fib;
>
>          fib = AllocMem((long)sizeof(fib), 1L);
>
>Should be:
>   fib = (struct FileInfoBlock *)
>              AllocMem((long)sizeof(struct FileInfoBlock), MEMF_CLEAR);
>                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Actually,

extern void *AllocMem();

prevents your having to cast its return value, but, I think, it is a MANXism.
And,

	fib = AllocMem ((long)sizeof(*fib), MEMF_CLEAR);
                                     ^<--- sizeof what fib points to

would have been perfectly good C code, and a handy typing and thinking
shortcut I use all the time.
But I agree that MEMF_whatever should be used instead of the constant.


-- 
Guy Streeter
...uunet!ingr!b11!guy		(UUCP)
ingr!b11!guy@uunet.uu.net	(ARPANET)
Technical Details
Message-ID: <273@b11.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ingr!b11!guy
References: <5918@killer.DALLAS.TX.US> <10632@cup.portal.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ingr!b11!guy
From: guy@b11.UUCP (Guy Streeter)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Manx help
Message-ID: <273@b11.UUCP>
Date: 31 Oct 88 22:41:42 GMT
References: <5918@killer.DALLAS.TX.US> <10632@cup.portal.com>
Reply-To: ingr!b11!guy@uunet.uu.net (Guy Streeter)
Organization: Third Rock from the Sun
Lines: 29