Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!roundup.crhc.uiuc.edu!ux1.cso.uiuc.edu!uxh.cso.uiuc.edu!johnsone From: johnsone@uxh.cso.uiuc.edu (Erik A. Johnson) Newsgroups: comp.sys.mac.programmer Subject: Help in THINK C4.0-got extra 4bytes going to subroutine? Keywords: think-c c Message-ID: <1991Jan28.082031.13924@ux1.cso.uiuc.edu> Date: 28 Jan 91 08:20:31 GMT Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 48 I have an extra 4 bytes being sent to a subroutine in THINK C (4.0)! (see code portion, below) For some reason, when the program gets into the MyGetEvent subroutine, it only works if I put a dummy long (4-byte) variable at the beginning, otherwise the other variables (event mask, event pointer, and mouse RgnHandle) are incorrect, off by the 4-byte offset. Any ideas? (Oh, I'm using an SE/30 8meg, various INITs, etc.) Thanks in advance. E-mail responses. Thanks. Erik A. Johnson, Graduate Student \ Internet: johnsone@uxh.cso.uiuc.edu Aeronautical & Astronautical Engineering \ University of Illinois at Urbana-Champaign \ AmericaOnline: ErikAJ +----------------------------------------------------------------------- |EventRecord gTheEvent; |RgnHandle theMouseRgnH; |Boolean is_WaitNextEvent_Implemented; | |main() | { . | . | . | theMouseRgnH = NewRgn(); | MyGetEvent( (int)everyEvent, &_gTheEvent, _theMouseRgnH ); | . | . | . | } | |/**************** My Get Event ******************/ |MyGetEvent( dummy, theEventMask, theEventP, mouseRgnH ) |long dummy; |int theEventMask; |EventRecord *theEventP; |RgnHandle mouseRgnH; | { | if (is_WaitNextEvent_Implemented) | WaitNextEvent( theEventMask, theEventP, 0L, mouseRgnH ); | else | { SystemTask(); | GetNextEvent( theEventMask, theEventP ); | } | } +-----------------------------------------------------------------------