Path: utzoo!mnetor!uunet!husc6!bloom-beacon!mit-eddie!ll-xn!ames!pasteur!ucbvax!CORY.BERKELEY.EDU!dillon From: dillon@CORY.BERKELEY.EDU (Matt Dillon) Newsgroups: comp.sys.amiga Subject: Re: malloc() prob. on 3.4a Message-ID: <8804151901.AA15726@cory.Berkeley.EDU> Date: 15 Apr 88 19:01:14 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 21 > You may accuse me of being lazy, but it works, and I think it makes >my code more readable. Can anyone think of a compelling reason why I should >explicitly cast stuff? > >_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ >Leo L. Schwab -- The Guy in The Cape ihnp4!pacbell -\ Oh, not *that* bad, Leo. I use (void *) to. What I meant was that for some things, like OpenScreen(), which returns an explicit Screen structure, declaring it: extern Struct Screen *OpenScreen(); or extern SCR *OpenScreen(); (I use typedefs all the time) Means that you still do not need casts in the code. BUT, for things like GetMsg(), AllocMem(), malloc(), GetHead(), etc... I usually declare those (void *) Since they can returns just about anything (e.g. my linked list is a custom structure with a Node at the front). -Matt