🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Fonts and freeing memory

#2802
From: Bruce Dawson
Date: Tue, 16 Jan 1990 17:12
16 lines
1099 bytes
     Ignoring the fact that OpenFont() is NOT needed before a call to
OpenDiskFont(), there is nothing wrong with the following code:

     if (!(winfont = (struct TextFont *)OpenFont(&ta)) &&
          !(winfont = (struct TextFont *)OpenDiskFont(&ta)))
               blah blah it didn't work.

     C _guarantees_ that the first expression will be evaluated first.
Furthermore, it guarantees that if the first expression fails, the second
expression will not be executed at all.  If you look at K&R, you will find some
programs that _depend_ on this for proper execution.  However, as has been
pointed out, from an Amiga point of view that code is bunk, because the call to
OpenFont() isn't necessary.

.Bruce.
Technical Details
Message-ID: <956@mindlink.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!pasteur!ucbvax!van-bc!rsoft!mindlink!a464

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!pasteur!ucbvax!van-bc!rsoft!mindlink!a464
From: a464@mindlink.UUCP (Bruce Dawson)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Fonts and freeing memory
Message-ID: <956@mindlink.UUCP>
Date: 16 Jan 90 17:12:02 GMT
Organization: MIND LINK! - British Columbia, Canada
Lines: 16