Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!ncar!husc6!endor!siegel From: siegel@endor.uucp (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Known Symantec Think C 4.01 bug and work-around Message-ID: <4510@husc6.harvard.edu> Date: 25 Oct 90 11:16:18 GMT References: <514@tci.UUCP> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Distribution: comp Organization: Symantec Language Products Group Lines: 38 In article steve@huxley.huxley.bitstream.com (Steve Stein) writes: >In article <514@tci.UUCP> mitchell@tci.UUCP (Rob Mitchell) writes: > >> Subj: Known Symantec Think C 4.01 bug and work-around >> BUG: LLastClick, of List Manager routines, returns a long instead >> of a Cell type as defined in Inside Mac. This is not a bug. The reason that LLastClick returns a long is because functions declared 'pascal' (such as all of the Toolbox routines) in THINK C may not return structures or any simple type larger than 4 bytes (such as a result-type of 'double'). The behavior of 'pascal'-declared functions is not standardized, and is pretty much implementation-dependent. (A future release of THINK C may support the returning of structured function results by 'pascal' functions. One way to deal with LLastClick is to cast the result using a pointer cast; the compiler will recognize this trick for what it is and generate a simple move. If you feel more comfortable doing it explicitly, you can try this: { extern LLastClick(); asm { clr.l -(a7) ; function result move.l myList, -(a7) ; argument jsr LLastClick ; call it move.l (a7)+, theCell ; pop result } } R. Rich Siegel Software Engineer Symantec Languages Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel If you have telekinetic powers, raise my hand.