summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <rsc>2006-07-16 01:52:22 +0000
committerrsc <rsc>2006-07-16 01:52:22 +0000
commit6f2b626d2882c2b9df5039b324c4167be3d74f28 (patch)
tree433d5df5590b4f2f4b744e3ed2da95a771c1bfe0
parent51716a869c2e596b43dcc9d030a6626b29cf4829 (diff)
downloadxv6-labs-6f2b626d2882c2b9df5039b324c4167be3d74f28.tar.gz
xv6-labs-6f2b626d2882c2b9df5039b324c4167be3d74f28.tar.bz2
xv6-labs-6f2b626d2882c2b9df5039b324c4167be3d74f28.zip
remove non-idiomatic increment/decrement
-rw-r--r--console.c6
-rw-r--r--fd.c2
-rw-r--r--trap.c5
3 files changed, 3 insertions, 10 deletions
diff --git a/console.c b/console.c
index 5dad05a..75dd82e 100644
--- a/console.c
+++ b/console.c
@@ -53,7 +53,7 @@ real_cons_putc(int c)
} else {
c |= 0x0700; // black on white
crt[ind] = c;
- ind += 1;
+ ind++;
}
if((ind / 80) >= 24){
@@ -100,10 +100,8 @@ printint(int xx, int base, int sgn)
if(neg)
buf[i++] = '-';
- while(i > 0){
- i -= 1;
+ while(--i >= 0)
real_cons_putc(buf[i]);
- }
}
/*
diff --git a/fd.c b/fd.c
index b34f313..68f75e3 100644
--- a/fd.c
+++ b/fd.c
@@ -104,6 +104,6 @@ fd_incref(struct fd *fd)
acquire(&fd_table_lock);
if(fd->count < 1 || fd->type == FD_CLOSED)
panic("fd_reference");
- fd->count += 1;
+ fd->count++;
release(&fd_table_lock);
}
diff --git a/trap.c b/trap.c
index b210541..78a62f0 100644
--- a/trap.c
+++ b/trap.c
@@ -71,13 +71,8 @@ trap(struct Trapframe *tf)
if(cpus[cpu()].nlock)
panic("timer interrupt while holding a lock");
if(cp){
-#if 1
if((read_eflags() & FL_IF) == 0)
panic("timer interrupt but interrupts now disabled");
-#else
- cpus[cpu()].clis += 1;
- sti();
-#endif
if(cp->killed)
proc_exit();
if(cp->state == RUNNING)