🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Lattice 5.04 problem with free()

#1922
From: Miguel Casteleiro
Date: Tue, 31 Oct 1989 02:07
22 lines
1344 bytes
In article <36899@srcsip.UUCP>, carpent@SRC.Honeywell.COM (Todd Carpenter) writes:
> 
> [...]
> As long as we are on the subject of Lattice, why doesn't this macro seem to
> work?  (I'm rather new to macrodom, so this is probably a silly one) I
> have some terribly long nasty expressions that need to be squared, and
> SQR(moocow) never returns what I expect:
> 
> #define SQR(x) (x*x)

This macro won't work if you have SQR(a+b), because the result will be
a+b*a+b which is diferent from what you want: (a+b)*(a+b).

So, try:

#define SQR(x) ((x)*(x))

-- 
                                                                      __
 Miguel Casteleiro at                                            __  ///
 INESC, Lisboa, Portugal.     "I know exactly what I'm doing."   \\\/// Only
 UUCP: ...!mcsun!inesc!jmc         -- Famous last words           \XX/ Amiga
Technical Details
Message-ID: <112@inesc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcsun!inesc!jmc
References: <36769@srcsip.UUCP> <37167@lll-winken.LLNL.GOV> <36899@srcsip.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcsun!inesc!jmc
From: jmc@inesc.UUCP (Miguel Casteleiro)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Lattice 5.04 problem with free()
Message-ID: <112@inesc.UUCP>
Date: 31 Oct 89 02:07:36 GMT
References: <36769@srcsip.UUCP> <37167@lll-winken.LLNL.GOV> <36899@srcsip.UUCP>
Organization: INESC - Inst. Eng. Sistemas e Computadores, LISBOA. PORTUGAL.
Lines: 22