Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.38
 
1.39
 
MAIN:ragge:20061008071811
 
cpp.c
_>118118 /* include dirs */
 119119 struct incs {
 120120         struct incs *next;
<>121 -        char *dir;
  121+        usch *dir;
122122 } *incdir[2];
 123123 #define INCINC 0
 124124 #define SYSINC 1
     
 !
183183                         break;
 184184 
 185185                 case 'D': /* Define something */
<>186 -                        osp = optarg;
  186+                        osp = (usch *)optarg;
187187                         while (*osp && *osp != '=')
 188188                                 osp++;
 189189                         if (*osp == '=') {
     
 !
192192                                         osp++;
 193193                                 *osp = OBJCT;
 194194                         } else {
<>195 -                                static char c[3] = { 0, '1', OBJCT };
  195+                                static usch c[3] = { 0, '1', OBJCT };
196196                                 osp = &c[2];
 197197                         }
<>198 -                        nl = lookup(optarg, ENTER);
  198+                        nl = lookup((usch *)optarg, ENTER);
199199                         if (nl->value)
 200200                                 error("%s redefined", optarg);
 201201                         nl->value = osp;
     
 !
204204                 case 'S':
 205205                 case 'I':
 206206                         w = calloc(sizeof(struct incs), 1);
<>207 -                        w->dir = optarg;
  207+                        w->dir = (usch *)optarg;
208208                         w2 = incdir[ch == 'I' ? INCINC : SYSINC];
 209209                         if (w2 != NULL) {
 210210                                 while (w2->next)
     
 !
215215                         break;
 216216 
 217217                 case 'U':
<>218 -                        nl = lookup(optarg, FIND);
 219 -                        if ((nl = lookup(optarg, FIND)))
  218+                        if ((nl = lookup((usch *)optarg, FIND)))
220219                                 nl->value = NULL;
 221220                         break;
 222221 #ifdef CPP_DEBUG
     
 !
236235         argc -= optind;
 237236         argv += optind;
 238237 
<>239 -        filloc = lookup("__FILE__", ENTER);
 240 -        linloc = lookup("__LINE__", ENTER);
 241 -        filloc->value = linloc->value = ""; /* Just something */
  238+        filloc = lookup((usch *)"__FILE__", ENTER);
  239+        linloc = lookup((usch *)"__LINE__", ENTER);
  240+        filloc->value = linloc->value = (usch *)""; /* Just something */
242241 
 243242         if (tflag == 0) {
 244243                 time_t t = time(NULL);
<>245 -                char *n = ctime(&t);
  244+                usch *n = (usch *)ctime(&t);
246245 
 247246                 /*
 248247                  * Manually move in the predefined macros.
 249248                  */
<>250 -                nl = lookup("__TIME__", ENTER);
  249+                nl = lookup((usch *)"__TIME__", ENTER);
251250                 savch(0); savch('"');  n[19] = 0; savstr(&n[11]); savch('"');
 252251                 savch(OBJCT);
 253252                 nl->value = stringbuf-1;
 254253 
<>255 -                nl = lookup("__DATE__", ENTER);
  254+                nl = lookup((usch *)"__DATE__", ENTER);
256255                 savch(0); savch('"'); n[24] = n[11] = 0; savstr(&n[4]);
 257256                 savstr(&n[20]); savch('"'); savch(OBJCT);
 258257                 nl->value = stringbuf-1;
 259258 
<>260 -                nl = lookup("__STDC__", ENTER);
  259+                nl = lookup((usch *)"__STDC__", ENTER);
261260                 savch(0); savch('1'); savch(OBJCT);
 262261                 nl->value = stringbuf-1;
 263262         }
     
 !
269268                 ofd = 1; /* stdout */
 270269         istty = isatty(ofd);
 271270 
<>272 -        if (pushfile(argc ? argv[0] : NULL))
  271+        if (pushfile((usch *)(argc ? argv[0] : NULL)))
273272                 error("cannot open %s", argv[0]);
 274273 
 275274         flbuf();
     
 !
302301                         osp = stringbuf;
 303302 
 304303                         DPRINT(("IDENT0: %s\n", yytext));
<>305 -                        nl = lookup(yytext, FIND);
  304+                        nl = lookup((usch *)yytext, FIND);
306305                         if (nl == 0 || thisnl == 0)
 307306                                 goto found;
 308307                         if (thisnl == nl) {
     
 !
311310                         }
 312311                         ss2 = stringbuf;
 313312                         if ((c = yylex()) == WSPACE) {
<>314 -                                savstr(yytext);
  313+                                savstr((usch *)yytext);
315314                                 c = yylex();
 316315                         }
 317316                         if (c != EXPAND) {
<>318 -                                unpstr(yytext);
  317+                                unpstr((usch *)yytext);
319318                                 if (ss2 != stringbuf)
 320319                                         unpstr(ss2);
 321320                                 unpstr(nl->namep);
     
 !
335334                                 if (nl)
 336335                                         savstr(nl->namep);
 337336                                 else
<>338 -                                        savstr(yytext);
  337+                                        savstr((usch *)yytext);
339338                         } else if (osp != stringbuf) {
 340339                                 DPRINT(("IDENT1: unput osp %p stringbuf %p\n",
 341340                                     osp, stringbuf));
     
 !
358357                 case NUMBER:
 359358                 case FPOINT:
 360359                 case WSPACE:
<>361 -                        if (flslvl == 0)
 362 -                                savstr(yytext);
  360+                        savstr((usch *)yytext);
363361                         break;
 364362 
 365363                 default:
<>366 -                        if (flslvl == 0) {
 367 -                                if (c < 256)
 368 -                                        savch(c);
 369 -                                else
 370 -                                        error("bad dir2 %d", c);
 371 -                        }
  364+                        if (c < 256)
  365+                                savch(c);
  366+                        else
  367+                                savstr((usch *)yytext);
372368                         break;
 373369                 }
 374370                 if (thisnl == NULL) {
     
 !
396392         if ((c = yylex()) == IDENT) {
 397393                 /* Do macro preprocessing first */
 398394                 usch *osp = stringbuf;
<>399 -                if ((nl = lookup(yytext, FIND)) == NULL)
  395+                if ((nl = lookup((usch *)yytext, FIND)) == NULL)
400396                         goto bad;
 401397                 unpstr(gotident(nl));
 402398                 stringbuf = osp;
     
 !
415411         }
 416412         if (yylex() != STRING)
 417413                 goto bad;
<>418 -        c = strlen(yytext);
  414+        c = strlen((char *)yytext);
419415         if (llen < c) {
 420416                 /* may loose heap space */
 421417                 lbuf = stringbuf;
 422418                 stringbuf += c;
 423419                 llen = c;
 424420         }
 425421         yytext[strlen(yytext)-1] = 0;
<>426 -        strcpy(lbuf, &yytext[1]);
  422+        strcpy((char *)lbuf, &yytext[1]);
427423         ifiles->fname = lbuf;
 428424         if (yylex() != '\n')
 429425                 goto bad;
     
 !
444440         struct incs *w;
 445441         struct symtab *nl;
 446442         usch *osp;
<>447 -        char *fn;
  443+        usch *fn;
448444         int i, c, it;
 449445 
 450446         if (flslvl)
     
 !
457453                 goto bad;
 458454 
 459455         if (c == IDENT) {
<>460 -                if ((nl = lookup(yytext, FIND)) == NULL)
  456+                if ((nl = lookup((usch *)yytext, FIND)) == NULL)
461457                         goto bad;
 462458                 if (subst(nl, NULL) == 0)
 463459                         goto bad;
     
 !
469465                 while ((c = yylex()) != '>' && c != '\n') {
 470466                         if (c == '\n')
 471467                                 goto bad;
<>472 -                        savstr(yytext);
  468+                        savstr((usch *)yytext);
473469                 }
 474470                 savch('\0');
 475471                 while ((c = yylex()) == WSPACE)
     
 !
481477                 usch *nm = stringbuf;
 482478 
 483479                 yytext[strlen(yytext)-1] = 0;
<>484 -                fn = &yytext[1];
  480+                fn = (usch *)&yytext[1];
485481                 /* first try to open file relative to previous file */
 486482                 savstr(ifiles->fname);
<>487 -                if ((stringbuf = strrchr(nm, '/')) == NULL)
  483+                if ((stringbuf = (usch *)strrchr((char *)nm, '/')) == NULL)
488484                         stringbuf = nm;
 489485                 else
 490486                         stringbuf++;
     
 !
545541         if (yylex() != WSPACE || yylex() != IDENT)
 546542                 goto bad;
 547543 
<>548 -        np = lookup(yytext, ENTER);
  544+        np = lookup((usch *)yytext, ENTER);
549545         redef = np->value != NULL;
 550546 
 551547         sbeg = stringbuf;
     
 !
564560                         }
 565561                         if (c == IDENT) {
 566562                                 args[narg] = alloca(strlen(yytext)+1);
<>567 -                                strcpy(args[narg], yytext);
  563+                                strcpy((char *)args[narg], yytext);
568564                                 narg++;
 569565                                 if ((c = definp()) == ',')
 570566                                         continue;
     
 !
591587                 case WSPACE:
 592588                         /* remove spaces if it surrounds a ## directive */
 593589                         ubuf = stringbuf;
<>594 -                        savstr(yytext);
  590+                        savstr((usch *)yytext);
595591                         c = yylex();
 596592                         if (c == CONCAT) {
 597593                                 stringbuf = ubuf;
     
 !
628624                                 goto id; /* just add it if object */
 629625                         /* check if its an argument */
 630626                         for (i = 0; i < narg; i++)
<>631 -                                if (strcmp(yytext, args[i]) == 0)
  627+                                if (strcmp(yytext, (char *)args[i]) == 0)
632628                                         break;
 633629                         if (i == narg) {
 634630                                 if (mkstr)
     
 !
651647                         break;
 652648 
 653649                 default:
<>654 -id:                     savstr(yytext);
  650+id:                     savstr((usch *)yytext);
655651                         break;
 656652                 }
 657653                 c = yylex();
     
 !
714710         savch(0);
 715711         if (ifiles != NULL) {
 716712                 t = sheap("%s:%d: ", ifiles->fname, ifiles->lineno);
<>717 -                write (2, t, strlen(t));
  713+                write (2, t, strlen((char *)t));
718714         }
<>719 -        write (2, s, strlen(s));
  715+        write (2, s, strlen((char *)s));
720716         write (2, "\n", 1);
 721717         exit(1);
 722718 }
     
 !
740736  */
 741737 struct symtab *
 742738 lookup(namep, enterf)
<>743 -        char *namep;
  739+        usch *namep;
744740 {
<>745 -        register char *np;
 746 -        register struct symtab *sp;
  741+        usch *np;
  742+        struct symtab *sp;
747743         int i, c, around;
 748744 
 749745         DPRINT(("lookup '%s'\n", namep));
     
 !
755751         sp = &symtab[i];
 756752 
 757753         while (sp->namep) {
<>758 -                if (*sp->namep == *namep && strcmp(sp->namep, namep) == 0)
  754+                if (*sp->namep == *namep &&
  755+                    strcmp((char *)sp->namep, (char *)namep) == 0)
759756                         return sp->value || enterf == ENTER ? sp : NULL;
 760757                 if (++sp >= &symtab[SYMSIZ]) {
 761758                         if (around++)
     
 !
813810                         }
 814811                 } while (c == WSPACE || c == '\n' || c == WARN);
 815812 
<>816 -                cp = yytext;
  813+                cp = (usch *)yytext;
817814                 while (*cp)
 818815                         cp++;
 819816                 while (cp > (usch *)yytext)
     
 !
880877                 case IDENT:
 881878                         /* workaround if an arg will be concatenated */
 882879                         och = stringbuf;
<>883 -                        savstr(yytext);
  880+                        savstr((usch *)yytext);
884881                         savch('\0');
 885882                         DDPRINT(("id: str %s\n", och));
 886883                         if ((c = yylex()) == EXPAND) {
     
 !
892889                                                 DDPRINT(("funnet ident %s%s\n",
 893890                                                     och, yytext));
 894891                                                 stringbuf--;
<>895 -                                                savstr(yytext);
  892+                                                savstr((usch *)yytext);
896893                                                 savch('\0');
 897894                                                 cunput(NOEXP);
 898895                                                 unpstr(och);
     
 !
901898                                                 continue;
 902899                                         } else {
 903900                                                 DDPRINT(("ofunnet ident\n"));
<>904 -                                                unpstr(yytext);
  901+                                                unpstr((usch *)yytext);
905902                                                 unpstr(och);
 906903                                                 stringbuf = och;
 907904                                                 continue;
     
 !
910907                                         if (c == IDENT)
 911908                                                 goto yid;
 912909                                         DDPRINT(("ofunnet inoexp\n"));
<>913 -                                        unpstr(yytext);
  910+                                        unpstr((usch *)yytext);
914911                                         cunput(EXPAND);
 915912                                         unpstr(och);
 916913                                         yylex();
     
 !
922919                                                 noexp++;
 923920                                                 goto yid;
 924921                                         }
<>925 -                                        unpstr(yytext);
  922+                                        unpstr((usch *)yytext);
926923                                         cunput(NOEXP);
 927924                                 } else
<>928 -                                        unpstr(yytext);
  925+                                        unpstr((usch *)yytext);
929926                                 DDPRINT(("ofunnet expand yys (%d)\n", *yytext));
 930927                                 unpstr(och);
 931928                                 yylex();
     
 !
934931                         }
 935932                         stringbuf = och;
 936933 
<>937 -                        if ((nl = lookup(yytext, FIND)) == NULL)
  934+                        if ((nl = lookup((usch *)yytext, FIND)) == NULL)
938935                                 goto def;
 939936 
 940937                         if (canexpand(rp, nl) == 0)
     
 !
955952                         stksv = NULL;
 956953                         if ((c = yylex()) == WSPACE) {
 957954                                 stksv = alloca(yyleng+1);
<>958 -                                strcpy(stksv, yytext);
  955+                                strcpy((char *)stksv, yytext);
959956                                 c = yylex();
 960957                         }
 961958                         /* only valid for expansion if fun macro */
     
 !
967964                                 if (stksv)
 968965                                         savstr(stksv);
 969966                         } else {
<>970 -                                unpstr(yytext);
  967+                                unpstr((usch *)yytext);
971968                                 if (stksv)
 972969                                         unpstr(stksv);
 973970                                 savstr(nl->namep);
     
 !
978975                         /* remove EXPAND/NOEXP from strings */
 979976                         if (yytext[1] == NOEXP) {
 980977                                 savch('"');
<>981 -                                och = &yytext[2];
  978+                                och = (usch *)&yytext[2];
982979                                 while (*och != EXPAND)
 983980                                         savch(*och++);
 984981                                 savch('"');
     
 !
987984                         /* FALLTHROUGH */
 988985 
 989986 def:            default:
<>990 -                        savstr(yytext);
  987+                        savstr((usch *)yytext);
991988                         break;
 992989                 }
 993990         }
     
 !
10371034                                 plev++;
 10381035                         if (c == ')')
 10391036                                 plev--;
<>1040 -                        savstr(yytext);
  1037+                        savstr((usch *)yytext);
10411038                         while ((c = yylex()) == '\n')
 10421039                                 savch('\n');
 10431040                 }
     
 !
10581055                                 plev++;
 10591056                         if (c == ')')
 10601057                                 plev--;
<>1061 -                        savstr(yytext);
  1058+                        savstr((usch *)yytext);
10621059                         while ((c = yylex()) == '\n')
 10631060                                 savch('\n');
 10641061                 }
     
 !
11441141 usch *
 11451142 savstr(usch *str)
 11461143 {
<>1147 -        char *rv = stringbuf;
  1144+        usch *rv = stringbuf;
11481145 
 11491146         while ((*stringbuf++ = *str++))
 11501147                 if (stringbuf >= &sbf[SBSIZE])
     
 !
12391236                         fmt++;
 12401237                         switch (*fmt) {
 12411238                         case 's':
<>1242 -                                savstr(va_arg(ap, char *));
  1239+                                savstr(va_arg(ap, usch *));
<_12431240                                 break;
 12441241                         case 'd':
 12451242                                 num2str(va_arg(ap, int));
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-30 19:53 +0200