🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Manxifying Lattice Code

#9448
From: Matt Dillon
Date: Sat, 06 Aug 1988 19:12
15 lines
929 bytes
>Also, Stuart mentioned he was compiling with +L.  Doesn't that mean that
>Manx will use longs for ints rather than shorts?  And if so, doesn't THAT
>mean that "sizeof(tplanet)" will be a long?  So, the question is: what will
>malloc() do when you pass it a long and it wants a short?

	Assuming you LINK with the proper library (c32.lib), malloc WANTS
a long.

>	pplant = (tplanet *) malloc((short)sizeof(tplanet));

	The compiler would promptly expand sizeof() backup to a long after
chopping the high 16 bits and pass a long. (assuming you are compiling with +L)

				-Matt
Technical Details
Message-ID: <8808061912.AA02369@cory.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!mailrus!uwmcsd1!ig!agate!ucbvax!CORY.BERKELEY.EDU!dillon

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!mailrus!uwmcsd1!ig!agate!ucbvax!CORY.BERKELEY.EDU!dillon
From: dillon@CORY.BERKELEY.EDU (Matt Dillon)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Manxifying Lattice Code
Message-ID: <8808061912.AA02369@cory.Berkeley.EDU>
Date: 6 Aug 88 19:12:07 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Lines: 15