home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 13193 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  1.8 KB

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