victor@wheaton.UUCP (Victor E Roetman ) (12/05/87)
When I tried to compile the starchart program, I ran into a problem in the starlaser.c part of it. When I saw where the errors were, I looked in starlaser.c to see what they were, but I found some lines of C that were a little beyond my comprehension, so I have no idea what I can do to fix it. Maybe some of you who have had the same problem, or those of you who know enough to see the error outright can give me a hand in fixing this problem. I really don't know where to start, as I am still trying to get a grip on the C language. We are currently running Ultrix 2.0 on a DEC MicrovaxII. Thank you very much. The following is a script of the errors listed and a few lines from the program starlaser.c where the errors are: Victor Roetman UUCP: ihnp4!wheaton!victor Script started on Sat Dec 5 12:47:39 1987 % make all /bin/cc -O -DSTARFILE='"./yale.star"' -DPLANETFILE='"./planet.star"' -DMESSFILE='"./messier.star"' -c starlaser.c "starlaser.c", line 184: illegal indirection "starlaser.c", line 184: illegal indirection "starlaser.c", line 184: cannot assign to a const "starlaser.c", line 195: illegal indirection "starlaser.c", line 195: illegal indirection "starlaser.c", line 209: cannot assign const address to non-const pointer "starlaser.c", line 214: illegal indirection "starlaser.c", line 214: cannot assign to a const "starlaser.c", line 214: warning: illegal combination of pointer and integer, op = "starlaser.c", line 305: illegal indirection *** Error code 1 Stop. % cat -n starlaser.c ... 180 int x, y; 181 ritem val; 182 { 183 if (IN(x, r_xsize) && IN(y, r_ysize)) { ***184 *(((*r_p)[y]) + x) = val; 185 } 186 } 187 188 /* 189 ** get pixel (x,y) value (0 or 1) 190 */ 191 int 192 r_getpixel(x, y) 193 { 194 if (IN(x, r_xsize) && IN(y, r_ysize)) { ***195 return *(((*r_p)[y]) + x); 196 } ... 207 208 /* allocate row pointers */ ***209 if ((r_p = (raster *)calloc(y, sizeof(ritem *))) == NULL) { 210 perror("Raster buffer allocation failure"); 211 exit(1); 212 } 213 for (j = 0; j < y; j++) { ***214 if (((*r_p)[j] = (ritem *)calloc(x, sizeof(ritem))) == NULL) { 215 perror("Raster buffer allocation failure"); 216 exit(1); 217 } ... script done on Sat Dec 5 12:48:46 1987