home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / mac / programm / 20464 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  3.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!gatech!destroyer!cs.ubc.ca!news.UVic.CA!spruce.pfc.forestry.ca!bcsystems!cconstantine
  2. From: cconstantine@galaxy.gov.bc.ca
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: MPW Compile errors, Help!!! (long)
  5. Message-ID: <1992Dec23.075909.1414@galaxy.gov.bc.ca>
  6. Date: 23 Dec 92 07:59:09 -0800
  7. Organization: BC Systems Corporation
  8. Lines: 88
  9.  
  10. Here is yet another question on MPW C.  In one of my initialze routines, I do a
  11. check to see what kind of system the App is running on.  One of the checks is
  12. to quit if the screen is not in 8-bit mode (256 colors). I used the routine
  13. found in Dave Mark & Cartwright Reed's C book 2, chapter 4 and just modified it
  14. so that all I want is the 8-bit depth.  However, I get the following error
  15. message when I compile:
  16.  
  17. # 7:55:00 AM ----- Build of AR DataLogger/Mac.
  18. # 7:55:00 AM ----- Analyzing dependencies.
  19. # 7:55:02 AM ----- Executing build commands.
  20.     Rez 'AR DataLogger/Mac.r' -append -o 'AR DataLogger/Mac'
  21.     C -r -i ":Hdrs:" -sym on ":Src:"Main.c -o ":Obj:"Main.c.o
  22. #        pixDepth = GetPixelDepth( curDev );
  23. #        if ( pixDepth <> 8 )
  24. #                       ?     
  25. ### Error 22 error in factor
  26. #                         ?   
  27. ### Error 29 ')' expected
  28. #                           ? 
  29. ### Error 30 ';' expected
  30. #                           ? 
  31. ### Error 22 error in factor
  32. #--------------------------------------------------------------------------------------------------------------------------------
  33.     File ":Src:Main.c"; Line 198
  34. #--------------------------------------------------------------------------------------------------------------------------------
  35. #        if ( pixDepth <> 8 )
  36. #            DeathAlert( 6 );
  37. #                     ?       
  38. ### Error 30 ';' expected
  39. #--------------------------------------------------------------------------------------------------------------------------------
  40.     File ":Src:Main.c"; Line 199
  41. #--------------------------------------------------------------------------------------------------------------------------------
  42. ### MPW Shell - Execution of AR DataLogger/Mac.makeout terminated.
  43. ### MPW Shell - Execution of BuildProgram terminated.
  44.  
  45.  
  46. I'm pretty sure i'm including everything I need (includeing Types.h, Traps.h &
  47. QuickDraw.h).  Here is the section I call the code from:
  48.  
  49.  
  50. void SystemCheck()
  51. {
  52.     long        machineType, qdVersion;
  53.     short        pixDepth;
  54.     GDHandle    curDev;
  55.  
  56.     if ( !GestaltAvailable() || !System607Available() )
  57.         DeathAlert( errWimpySystem );
  58.     
  59.     if ( !Gestalt( gestaltMachineType, &machineType ))
  60.     {
  61.         if ( machineType < 7 )
  62.             DeathAlert( errWimpyMac );
  63.     }
  64.     
  65.     if ( !Gestalt( gestaltQuickdrawVersion, &qdVersion ))
  66.     {
  67.         if (qdVersion < 0x0200)
  68.             DeathAlert( errNo32BitQD );
  69.             
  70.         pixDepth = GetPixelDepth( curDev );
  71.         if ( pixDepth <> 8 )
  72.             DeathAlert( errNot8Bit );
  73.     }
  74.  
  75. }
  76.  
  77.  
  78. and here is the actual code for the GetPixelDepth:
  79.  
  80.  
  81. short GetPixelDepth( GDHandle theDevice )
  82. {
  83.     short            pixelDepth;
  84.     PixMapHandle    screenPMapH;
  85.     
  86.     screenPMapH = (**theDevice).gdPMap;
  87.     pixelDepth = (**screenPMapH).pixelSize;
  88.     return( pixelDepth );
  89. }
  90.  
  91. pretty short and simple, huh...  Can anyone see what I am doing wrong.
  92.  
  93. Any help is appreciated.
  94.  
  95.  
  96. Carl B. Constantine
  97. CCONSTANTINE@galaxy.gov.bc.ca
  98.