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

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!gatech!destroyer!cs.ubc.ca!bcsystems!cconstantine
  2. From: cconstantine@galaxy.gov.bc.ca
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: MPW Compile errors, Help!!! (repost)
  5. Message-ID: <1992Dec24.085803.1415@galaxy.gov.bc.ca>
  6. Date: 24 Dec 92 08:58:03 -0800
  7. References: <1992Dec23.075909.1414@galaxy.gov.bc.ca>
  8. Organization: BC Systems Corporation
  9. Lines: 105
  10.  
  11. In article <1992Dec23.075909.1414@galaxy.gov.bc.ca>, cconstantine@galaxy.gov.bc.ca writes:
  12.  
  13.  
  14. This is a repost 'cause I don't know if the first one got out, but I also have
  15. some new information.  When I take a look at my variables in SourceBug, I get a
  16. rather large negative value for pixDepth (-18756488 or something like that). 
  17. This is bizzar to say the least.  At work I'm running on a Mac IIci running
  18. System 6.0.7 w/ Multifinder 6.1b9 and 2 monitors.  At home I'm running on a Mac
  19. LCII running system 7.0.1 w/ tuneup 1.1.1 and I still get the following error
  20. messages.  
  21.  
  22. Please, does anyone have any ideas????  I've definatly got everything #include
  23. 'd that needs to be.
  24.  
  25. Carl B. Constantine
  26. CCONSTANTINE@galaxy.gov.bc.ca
  27.  
  28. > Here is yet another question on MPW C.  In one of my initialze routines, I do a
  29. > check to see what kind of system the App is running on.  One of the checks is
  30. > to quit if the screen is not in 8-bit mode (256 colors). I used the routine
  31. > found in Dave Mark & Cartwright Reed's C book 2, chapter 4 and just modified it
  32. > so that all I want is the 8-bit depth.  However, I get the following error
  33. > message when I compile:
  34. > # 7:55:00 AM ----- Build of AR DataLogger/Mac.
  35. > # 7:55:00 AM ----- Analyzing dependencies.
  36. > # 7:55:02 AM ----- Executing build commands.
  37. >     Rez 'AR DataLogger/Mac.r' -append -o 'AR DataLogger/Mac'
  38. >     C -r -i ":Hdrs:" -sym on ":Src:"Main.c -o ":Obj:"Main.c.o
  39. > #        pixDepth = GetPixelDepth( curDev );
  40. > #        if ( pixDepth <> 8 )
  41. > #                       ?     
  42. > ### Error 22 error in factor
  43. > #                         ?   
  44. > ### Error 29 ')' expected
  45. > #                           ? 
  46. > ### Error 30 ';' expected
  47. > #                           ? 
  48. > ### Error 22 error in factor
  49. > #--------------------------------------------------------------------------------------------------------------------------------
  50. >     File ":Src:Main.c"; Line 198
  51. > #--------------------------------------------------------------------------------------------------------------------------------
  52. > #        if ( pixDepth <> 8 )
  53. > #            DeathAlert( 6 );
  54. > #                     ?       
  55. > ### Error 30 ';' expected
  56. > #--------------------------------------------------------------------------------------------------------------------------------
  57. >     File ":Src:Main.c"; Line 199
  58. > #--------------------------------------------------------------------------------------------------------------------------------
  59. > ### MPW Shell - Execution of AR DataLogger/Mac.makeout terminated.
  60. > ### MPW Shell - Execution of BuildProgram terminated.
  61. > I'm pretty sure i'm including everything I need (includeing Types.h, Traps.h &
  62. > QuickDraw.h).  Here is the section I call the code from:
  63. > void SystemCheck()
  64. > {
  65. >     long        machineType, qdVersion;
  66. >     short        pixDepth;
  67. >     GDHandle    curDev;
  68. >     if ( !GestaltAvailable() || !System607Available() )
  69. >         DeathAlert( errWimpySystem );
  70. >     
  71. >     if ( !Gestalt( gestaltMachineType, &machineType ))
  72. >     {
  73. >         if ( machineType < 7 )
  74. >             DeathAlert( errWimpyMac );
  75. >     }
  76. >     
  77. >     if ( !Gestalt( gestaltQuickdrawVersion, &qdVersion ))
  78. >     {
  79. >         if (qdVersion < 0x0200)
  80. >             DeathAlert( errNo32BitQD );
  81. >             
  82. >         pixDepth = GetPixelDepth( curDev );
  83. >         if ( pixDepth <> 8 )
  84. >             DeathAlert( errNot8Bit );
  85. >     }
  86. > }
  87. > and here is the actual code for the GetPixelDepth:
  88. > short GetPixelDepth( GDHandle theDevice )
  89. > {
  90. >     short            pixelDepth;
  91. >     PixMapHandle    screenPMapH;
  92. >     
  93. >     screenPMapH = (**theDevice).gdPMap;
  94. >     pixelDepth = (**screenPMapH).pixelSize;
  95. >     return( pixelDepth );
  96. > }
  97. > pretty short and simple, huh...  Can anyone see what I am doing wrong.
  98. > Any help is appreciated.
  99. > Carl B. Constantine
  100. > CCONSTANTINE@galaxy.gov.bc.ca
  101.