Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!yale!mintaka!nuhub!nic!chaos.cs.brandeis.edu!chaos!phils From: phils@chaos.cs.brandeis.edu (Phil Shapiro) Newsgroups: comp.sys.mac.programmer Subject: Re: Tech Note 202 (Resetting the Event Mask) question Message-ID: Date: 4 Jan 91 20:52:05 GMT References: <3687@uakari.primate.wisc.edu> Sender: phils@chaos.cs.brandeis.edu (Phil Shapiro) Organization: Symantec Corp. Lines: 33 In-Reply-To: bin@primate.wisc.edu's message of 4 Jan 91 16:47:13 GMT In article <3687@uakari.primate.wisc.edu> bin@primate.wisc.edu (Brain in Neutral) writes: Tech Note 202 (Resetting the Event Mask) says the event mask should be saved/restored at the beginning/end of a program that modifies it, e.g., # define SysEvtMask 0x0144 saveMask = * ((Integer *) SysEvtMask; ... SetEventMask (newMask); ... * ((Integer *) SysEvtMask = saveMask My question: why not just reset at the end with SetEventMask (saveMask)? Is there some difference between that and setting the low memory global directly? There's no difference, SetEventMask() is [Not in ROM] -- it's implemented with glue that writes directly to the low memory global. I would still use the function instead, just in case this changes. The tech note writers were probably just being absent-minded. BTW, you can skip some hassle and use the definition of SysEvtMask() from EventMgr.h, if you're using Think C. -phil -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu