X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=token.c;h=7bba1993fd815aa13befd0c80228063fcd07e0eb;hp=3031895c1e5e63d5e451ab85166527ddb6b68da3;hb=bf97c76e7e6a87b0495cb037b094b6d8b5027a40;hpb=bb77eaee83ffa56a181fa1b92f4ea7de248a3af4 diff --git a/token.c b/token.c index 3031895..7bba199 100644 --- a/token.c +++ b/token.c @@ -24,7 +24,7 @@ int mjump_align = 0; // mjump alignment flag char lntag; // Line tag char * curfname; // Current filename char tolowertab[128]; // Uppercase ==> lowercase -char hextab[128]; // Table of hex values +int8_t hextab[128]; // Table of hex values char dotxtab[128]; // Table for ".b", ".s", etc. char irbuf[LNSIZ]; // Text for .rept block line char lnbuf[LNSIZ]; // Text of current line @@ -679,8 +679,8 @@ int include(int handle, char * fname) INOBJ * inobj; FILEREC * fr; - // Verbose mode - if (verb_flag) + // Debug mode + if (debug) printf("[include: %s, cfileno=%u]\n", fname, cfileno); // Alloc and initialize include-descriptors @@ -742,21 +742,21 @@ int fpop(void) switch (inobj->in_type) { case SRC_IFILE: // Pop and release an IFILE - if (verb_flag) + if (debug) printf("[Leaving: %s]\n", curfname); ifile = inobj->inobj.ifile; ifile->if_link = f_ifile; f_ifile = ifile; close(ifile->ifhandle); // Close source file -if (verb_flag) printf("[fpop (pre): curfname=%s]\n", curfname); +if (debug) printf("[fpop (pre): curfname=%s]\n", curfname); curfname = ifile->ifoldfname; // Set current filename -if (verb_flag) printf("[fpop (post): curfname=%s]\n", curfname); -if (verb_flag) printf("[fpop: (pre) cfileno=%d ifile->ifno=%d]\n", (int)cfileno, (int)ifile->ifno); +if (debug) printf("[fpop (post): curfname=%s]\n", curfname); +if (debug) printf("[fpop: (pre) cfileno=%d ifile->ifno=%d]\n", (int)cfileno, (int)ifile->ifno); curlineno = ifile->ifoldlineno; // Set current line# DEBUG printf("cfileno=%d ifile->ifno=%d\n", (int)cfileno, (int)ifile->ifno); cfileno = ifile->ifno; // Restore current file number -if (verb_flag) printf("[fpop: (post) cfileno=%d ifile->ifno=%d]\n", (int)cfileno, (int)ifile->ifno); +if (debug) printf("[fpop: (post) cfileno=%d ifile->ifno=%d]\n", (int)cfileno, (int)ifile->ifno); break; case SRC_IMACRO: // Pop and release an IMACRO imacro = inobj->inobj.imacro; @@ -911,8 +911,8 @@ retry: case SRC_IFILE: if ((ln = GetNextLine()) == NULL) { -if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IFILE...\n"); - if (fpop() == 0) // Pop input level +if (debug) printf("TokenizeLine: Calling fpop() from SRC_IFILE...\n"); + if (fpop()==0) // Pop input level goto retry; // Try for more lines else { @@ -965,7 +965,7 @@ if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IFILE...\n"); case SRC_IREPT: if ((ln = GetNextRepeatLine()) == NULL) { -if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); +if (debug) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); fpop(); goto retry; } @@ -1213,12 +1213,12 @@ if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); *p++ = EOS; continue; case '$': // $, hex constant - if ((int)chrtab[*ln] & HDIGIT) + if (chrtab[*ln] & HDIGIT) { v = 0; // Parse the hex value - while ((int)hextab[*ln] >= 0) + while (hextab[*ln] >= 0) v = (v << 4) + (int)hextab[*ln++]; // ggn: Okay, some comments here are in order I think....