home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!veritas!amdcad!sono!brianc
- From: brianc@acuson.com (Brian Cox)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Think C 5.0 under sys7, help!!!
- Message-ID: <1992Jul30.000432.14617@acuson.com>
- Date: 30 Jul 92 00:04:32 GMT
- References: <1992Jul25.053648.12278@midway.uchicago.edu> <14864@claris.com>
- Organization: Acuson; Mountain View, California
- Lines: 34
-
- wombat@claris.com (Scott Lindsey) writes:
-
- >In article <1992Jul25.053648.12278@midway.uchicago.edu>, hd12@ellis.uchicago.edu (hui dong) writes:
- >>
- >> I am trying to use Think C 5.0 under sys7 to recompile a C code I wrote
- >> using 4.0 under sys6. I get lots of errors, drive me crazy! It even complains
- >> about GetNewCWindow(WINDOW_ID,0L,-1L), saying the last argument isn't valid.
-
- >You basically have two choices. If you turn prototype enforcement off, you
- >should get fewer, if any, errors. The "correct" thing to do is to fix your
- >code so it correctly observes the prototypes. In your example, the last arg
- >to GetNewCWindow is of type WindowPtr. -1L isn't a windowptr (it's a long --
- >yes, 0 is a special case when it comes to constants). If you cast it, it
- >should work "GetNewCWindow(WINDOW_ID, 0L, (WindowPtr) -1L);"
-
- >--
- >Scott Lindsey <wombat@claris.com>
-
- A common trick is to
-
- #define IN_FRONT (WindowPtr) -1L
-
- and then use IN_FRONT to say what you really mean. I have also experienced
- the very real pain in converting "working" code from 4.0 to 5.0. But I
- discovered that I was not as careful as I had thought. Sure there were
- a whole bunch of ticky-tacky things like the WindowPtr thing above. But the
- kind of bug that type checking uncovers are just about the most annoying and
- difficult to detect otherwise. In the end it is WAY worth it. (IMO)
-
-
- --
-
- --Brian Cox--
- ------------------
-