aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-05-20 12:47:28 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-05-20 12:47:28 -0700
commit25f01e69f946c37a74de8646a3cd047f849885bc (patch)
tree556ce0b924fb38e9f97eb7dc0e57a0acc56d66cc /sys/cmd
parent3d20d19ed2bad7ab673b0855ebca86e6bba1880e (diff)
small renaming
Diffstat (limited to 'sys/cmd')
-rw-r--r--sys/cmd/cc/cc.c16
-rw-r--r--sys/cmd/cc/cc.h2
-rw-r--r--sys/cmd/cc/lex.c13
3 files changed, 14 insertions, 17 deletions
diff --git a/sys/cmd/cc/cc.c b/sys/cmd/cc/cc.c
index 00cd4a5..cb37af4 100644
--- a/sys/cmd/cc/cc.c
+++ b/sys/cmd/cc/cc.c
@@ -113,8 +113,6 @@ openio(byte *path)
// TODO: See if we have already loaded the file
//
- printf("OPENING PATH %s\n", path);
-
if ((C.io - C.iostk) >= arrlen(C.iostk)-1)
panicf("out of I/O space!");
@@ -124,7 +122,7 @@ openio(byte *path)
C.io->kind = IOfile;
C.io->path = path;
- bufio·initreader(&C.io->buf, asrdr(io·read), C.io->f);
+ bufio·initreader(&C.io->rdr, asrdr(io·read), C.io->f);
return C.io++;
}
@@ -136,16 +134,16 @@ makeio(byte *name)
panicf("out of I/O space!");
C.io->path = name;
- C.io->buf = (io·Buffer) {
+ C.io->rdr = (io·Buffer) {
.state = bufio·rdr | bufio·end,
.runesize = 0,
.h = nil,
.size = bufio·size,
- .beg = C.io->buf.buf + bufio·ungets,
- .pos = C.io->buf.buf + bufio·ungets,
- .end = C.io->buf.buf + bufio·ungets,
+ .beg = C.io->rdr.buf + bufio·ungets,
+ .pos = C.io->rdr.buf + bufio·ungets,
+ .end = C.io->rdr.buf + bufio·ungets,
};
- C.io->b = C.io->buf.beg;
+ C.io->b = C.io->rdr.beg;
return C.io++;
}
@@ -158,7 +156,7 @@ freeio(Io *io)
io·close(io->f);
}
- io->buf.state = 0;
+ io->rdr.state = 0;
io->kind = 0;
io->link = nil;
io->path = nil;
diff --git a/sys/cmd/cc/cc.h b/sys/cmd/cc/cc.h
index 685dce2..b45c5fa 100644
--- a/sys/cmd/cc/cc.h
+++ b/sys/cmd/cc/cc.h
@@ -374,7 +374,7 @@ enum
struct Io
{
- io·Buffer buf;
+ io·Buffer rdr;
string path;
uint32 kind;
union {
diff --git a/sys/cmd/cc/lex.c b/sys/cmd/cc/lex.c
index 4cc1259..7a08373 100644
--- a/sys/cmd/cc/lex.c
+++ b/sys/cmd/cc/lex.c
@@ -28,7 +28,7 @@ puttok(Token tok)
int
getbyte(Lexer *lx)
{
- return bufio·getbyte(&lx->io->buf);
+ return bufio·getbyte(&lx->io->rdr);
}
int
@@ -58,20 +58,20 @@ getnsbyte(Lexer *lx)
rune
getrune(Lexer *lx)
{
- return bufio·getrune(&lx->io->buf);
+ return bufio·getrune(&lx->io->rdr);
}
byte
ungetbyte(Lexer *lx)
{
byte b;
- return bufio·ungetbyte(&lx->io->buf, b);
+ return bufio·ungetbyte(&lx->io->rdr, b);
}
rune
ungetrune(Lexer *l, rune r)
{
- return bufio·ungetrune(&l->io->buf, r);
+ return bufio·ungetrune(&l->io->rdr, r);
}
// -----------------------------------------------------------------------
@@ -637,9 +637,8 @@ Dispatch:
sym = lookup(&lx->sym, tok.val.s);
if (sym && ((uintptr)sym->name != (uintptr)lx->io->path)) {
io = makeio(sym->name);
- printf("EXPANDING MACRO %s\n", sym->name);
- io->buf.end += expandmacro(lx, sym, io->b);
- *io->buf.end++ = EOF;
+ io->rdr.end += expandmacro(lx, sym, io->b);
+ *io->rdr.end++ = EOF;
pushio(lx, io);
goto GetByte;
}