Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.1
 
1.2
 
MAIN:ragge:20020324112007
 
cc.c
_> 1+/*      $Id$    */
  2+
  3+#if 0
14 static  char sccsid[] = "@(#)cc.c 4.21 6/30/90";
<> 5+#endif
26 /*
 37  * cc - front end for C compiler
 48  */
 59 #include <sys/param.h>
<> 10+#include <sys/dir.h>
  11+#include <sys/wait.h>
  12+
613 #include <stdio.h>
 714 #include <ctype.h>
 815 #include <signal.h>
<>9 -#include <sys/dir.h>
  16+#include <stdlib.h>
  17+#include <unistd.h>
  18+#include <string.h>
  19+
1020 #include "pathnames.h"
 1121 
 1222 char    *cpp = _PATH_CPP;
 1323 char    *ccom = _PATH_CCOM;
<>14 -char    *sccom = _PATH_SCCOM;
1524 char    *c2 = _PATH_C2;
 1625 char    *as = _PATH_AS;
 1726 char    *ld = _PATH_LD;
     
 !
2029 char    tmp0[MAXPATHLEN];
 2130 char    *tmp1, *tmp2, *tmp3, *tmp4, *tmp5;
 2231 char    *outfile;
<>23 -char    *savestr(), *strspl(), *setsuf();
 24 -int     idexit();
  32+char    *savestr(char *cp), *strspl(char *left, char *right);
  33+char    *setsuf(char *as, int ch);
  34+int     getsuf(char as[]), nodup(char **l, char *os);
  35+int     callsys(char *f, char **v);
  36+void    idexit(int a), error(char *s, char *x), dexit(void);
2537 char    **av, **clist, **llist, **plist;
 2638 int     cflag, eflag, oflag, pflag, sflag, wflag, Rflag, exflag, proflag;
<>27 -int     fflag, gflag, Gflag, Mflag, debug;
  39+int     gflag, Gflag, Mflag, debug;
2840 char    *dflag;
 2941 int     exfail;
 3042 char    *chpass;
     
 !
3446 
 3547 #define cunlink(s)      if (s) unlink(s)
 3648 
<>37 -main(argc, argv)
 38 -        char **argv;
  49+int
  50+main(int argc, char **argv)
3951 {
 4052         char *t;
 4153         char *assource;
     
 !
7789                         if (argv[i][2] == 'g')
 7890                                 crt0 = _PATH_GCRT0;
 7991                         continue;
<>80 -                case 'f':
 81 -                        fflag++;
 82 -                        continue;
8392                 case 'g':
 8493                         if (argv[i][2] == 'o') {
 8594                             Gflag++;    /* old format for -go */
     
 !
163172                 switch (*t) {
 164173 
 165174                 case '0':
<>166 -                        if (fflag)
 167 -                                sccom = strspl(npassname, "sccom");
 168 -                        else
 169 -                                ccom = strspl(npassname, "ccom");
  175+                        ccom = strspl(npassname, "ccom");
170176                         continue;
 171177                 case '2':
 172178                         c2 = strspl(npassname, "c2");
     
 !
185191         if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
 186192                 signal(SIGHUP, idexit);
 187193         if (pflag==0)
<>188 -                (void)sprintf(tmp0, "%s/ctm%05.5d", _PATH_TMP, getpid());
  194+                (void)sprintf(tmp0, "%s/ctm%5.5d", _PATH_TMP, getpid());
189195         tmp1 = strspl(tmp0, "1");
 190196         tmp2 = strspl(tmp0, "2");
 191197         tmp3 = strspl(tmp0, "3");
     
 !
229235                                 tmp3 = setsuf(clist[i], 's');
 230236                         assource = tmp3;
 231237                 }
<>232 -                av[0] = fflag ? "sccom" : "ccom";
  238+                av[0] = "ccom";
233239                 av[1] = tmp4; av[2] = oflag?tmp5:tmp3; na = 3;
 234240                 if (proflag)
 235241                         av[na++] = "-XP";
     
 !
241247                 if (wflag)
 242248                         av[na++] = "-w";
 243249                 av[na] = 0;
<>244 -                if (callsys(fflag ? sccom : ccom, av)) {
  250+                if (callsys(ccom, av)) {
245251                         cflag++;
 246252                         eflag++;
 247253                         continue;
     
 !
296302                         unlink(setsuf(clist[0], 'o'));
 297303         }
 298304         dexit();
<> 305+        return 0; /* not reached */
299306 }
 300307 
<>301 -idexit()
  308+void
  309+idexit(int a)
302310 {
 303311 
 304312         eflag = 100;
 305313         dexit();
 306314 }
 307315 
<>308 -dexit()
  316+void
  317+dexit(void)
309318 {
 310319 
 311320         if (!pflag) {
     
 !
319328         exit(eflag);
 320329 }
 321330 
<>322 -error(s, x)
 323 -        char *s, *x;
  331+void
  332+error(char *s, char *x)
324333 {
 325334         FILE *diag = exflag ? stderr : stdout;
 326335 
     
 !
332341         eflag++;
 333342 }
 334343 
<>335 -getsuf(as)
 336 -char as[];
  344+int
  345+getsuf(char as[])
337346 {
 338347         register int c;
 339348         register char *s;
 340349         register int t;
 341350 
 342351         s = as;
 343352         c = 0;
<>344 -        while (t = *s++)
  353+        while ((t = *s++))
345354                 if (t=='/')
 346355                         c = 0;
 347356                 else
     
 !
353362 }
 354363 
 355364 char *
<>356 -setsuf(as, ch)
 357 -        char *as;
  365+setsuf(char *as, int ch)
358366 {
 359367         register char *s, *s1;
 360368 
     
 !
366374         return (s1);
 367375 }
 368376 
<>369 -callsys(f, v)
 370 -        char *f, **v;
  377+int
  378+callsys(char *f, char **v)
371379 {
 372380         int t, status;
 373381         char **cpp;
     
 !
401409         return ((status>>8) & 0377);
 402410 }
 403411 
<>404 -nodup(l, os)
 405 -        char **l, *os;
  412+int
  413+nodup(char **l, char *os)
406414 {
 407415         register char *t, *s;
 408416         register int c;
 409417 
 410418         s = os;
 411419         if (getsuf(s) != 'o')
 412420                 return (1);
<>413 -        while (t = *l++) {
 414 -                while (c = *s++)
  421+        while ((t = *l++)) {
  422+                while ((c = *s++))
415423                         if (c != *t++)
 416424                                 break;
 417425                 if (*t==0 && c==0)
     
 !
426434 int     saveleft;
 427435 
 428436 char *
<>429 -savestr(cp)
 430 -        register char *cp;
  437+savestr(char *cp)
431438 {
 432439         register int len;
 433440 
     
 !
450457 }
 451458 
 452459 char *
<>453 -strspl(left, right)
 454 -        char *left, *right;
  460+strspl(char *left, char *right)
<_455461 {
 456462         char buf[BUFSIZ];
 457463 
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-21 04:04 +0200