Xref: utzoo comp.sys.mac.programmer:5628 comp.sys.mac:30101 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer,comp.sys.mac Subject: Re: CopyBits in MPW C 3.0 Keywords: CopyBits , MPW C Message-ID: <6988@hoptoad.uucp> Date: 13 Apr 89 20:59:28 GMT References: <225@uw-apl.UUCP> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Distribution: na Organization: Eclectic Software, San Francisco Lines: 27 In article <225@uw-apl.UUCP> keith@uw-apl.UUCP (Keith Kerr) writes: >I am converting some MPW C code from v.2.02 to v.3.0. >The much tighter type-checking is a constant frustration >to my fast and loose programming style. One particular >problem is with CopyBits. > >eg. >PixMapHandle mypixhandle; >. > CopyBits(*mypixhandle, &(((GrafPtr)wind)->portBits), > &((*mypixhandle)->bounds),&((*mypixhandle)->bounds), > srcCopy, 0L); > >This compiles and works OK in MPW 2.02, but won't compile >in MPW 3.0 because of a type mismatch between formal and actual >parameters in the first argument *mypixhandle. Try "CopyBits(*(BitMap **)mypixhandle, ...);" Incidentally, you shouldn't be passing a pointer to something stored in a relocatable handle to CopyBits or any other routine listed as allocating or moving memory. Declare a Rect variable and assign the bounds rectangle to that, then pass a pointer to the variable instead. -- Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim "I see little divinity about them or you. You talk to me of Christianity when you are in the act of hanging your enemies. Was there ever such blasphemous nonsense!" - Shaw, "The Devil's Disciple"