| @@ -43,7 +43,7 @@ static int debug = 0; · 42 unmodified lines |
| 43 | | 43 | |
| 44 | static Sym **autos; /* Base of auto variables */ | 44 | static Sym **autos; /* Base of auto variables */ |
| 45 | static File *files; /* Base of file arena */ | 45 | static File *files; /* Base of file arena */ |
| 46 | static int fmax; /* largest file path index */ | 46 | static int fmaxp; /* largest file path index */ |
| 47 | static Sym **fnames; /* file names path component table */ | 47 | static Sym **fnames; /* file names path component table */ |
| 48 | static Sym **globals; /* globals by addr table */ | 48 | static Sym **globals; /* globals by addr table */ |
| 49 | static Hist *hist; /* base of history stack */ | 49 | static Hist *hist; /* base of history stack */ |
| @@ -144,8 +144,8 @@ syminit(int fd, Fhdr *fp) · 94 unmodified lines |
| 144 | p->type = 'm'; | 144 | p->type = 'm'; |
| 145 | nauto++; | 145 | nauto++; |
| 146 | } | 146 | } |
| 147 | else if(p->value > fmax) | 147 | else if(p->value > fmaxp) |
| 148 | fmax = p->value; /* highest path index */ | 148 | fmaxp = p->value; /* highest path index */ |
| 149 | break; | 149 | break; |
| 150 | case 'a': | 150 | case 'a': |
| 151 | case 'p': | 151 | case 'p': |
| @@ -164,7 +164,7 @@ syminit(int fd, Fhdr *fp) · 12 unmodified lines |
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | if (debug) | 166 | if (debug) |
| 167 | fprint(2,"NG: %ld NT: %ld NF: %d\n", nglob, ntxt, fmax); | 167 | fprint(2,"NG: %ld NT: %ld NF: %d\n", nglob, ntxt, fmaxp); |
| 168 | if (fp->sppcsz) { /* pc-sp offset table */ | 168 | if (fp->sppcsz) { /* pc-sp offset table */ |
| 169 | spoff = (uchar *)malloc(fp->sppcsz); | 169 | spoff = (uchar *)malloc(fp->sppcsz); |
| 170 | if(spoff == 0) { | 170 | if(spoff == 0) { |
| @@ -285,7 +285,7 @@ cleansyms(void) · 114 unmodified lines |
| 285 | if(fnames) | 285 | if(fnames) |
| 286 | free(fnames); | 286 | free(fnames); |
| 287 | fnames = 0; | 287 | fnames = 0; |
| 288 | fmax = 0; | 288 | fmaxp = 0; |
| 289 | | 289 | |
| 290 | if(files) | 290 | if(files) |
| 291 | free(files); | 291 | free(files); |
| @@ -373,13 +373,13 @@ buildtbls(void) · 81 unmodified lines |
| 373 | return 0; | 373 | return 0; |
| 374 | } | 374 | } |
| 375 | } | 375 | } |
| 376 | fmax++; | 376 | fmaxp++; |
| 377 | fnames = malloc(fmax*sizeof(*fnames)); | 377 | fnames = malloc(fmaxp*sizeof(*fnames)); |
| 378 | if (!fnames) { | 378 | if (!fnames) { |
| 379 | werrstr("can't malloc file name table"); | 379 | werrstr("can't malloc file name table"); |
| 380 | return 0; | 380 | return 0; |
| 381 | } | 381 | } |
| 382 | memset(fnames, 0, fmax*sizeof(*fnames)); | 382 | memset(fnames, 0, fmaxp*sizeof(*fnames)); |
| 383 | files = malloc(nfiles*sizeof(*files)); | 383 | files = malloc(nfiles*sizeof(*files)); |
| 384 | if(!files) { | 384 | if(!files) { |
| 385 | werrstr("can't malloc file table"); | 385 | werrstr("can't malloc file table"); |
| @@ -858,7 +858,7 @@ pathcomp(char *s, int n) · 472 unmodified lines |
| 858 | { | 858 | { |
| 859 | int i; | 859 | int i; |
| 860 | | 860 | |
| 861 | for(i = 0; i <= fmax; i++) | 861 | for(i = 0; i <= fmaxp; i++) |
| 862 | if(fnames[i] && strncmp(s, fnames[i]->name, n) == 0 && fnames[i]->name[n] == 0) | 862 | if(fnames[i] && strncmp(s, fnames[i]->name, n) == 0 && fnames[i]->name[n] == 0) |
| 863 | return i; | 863 | return i; |
| 864 | return -1; | 864 | return -1; |