remove non-idiomatic increment/decrement

This commit is contained in:
rsc 2006-07-16 01:52:22 +00:00
parent 51716a869c
commit 6f2b626d28
3 changed files with 3 additions and 10 deletions

View file

@ -53,7 +53,7 @@ real_cons_putc(int c)
} else { } else {
c |= 0x0700; // black on white c |= 0x0700; // black on white
crt[ind] = c; crt[ind] = c;
ind += 1; ind++;
} }
if((ind / 80) >= 24){ if((ind / 80) >= 24){
@ -100,11 +100,9 @@ printint(int xx, int base, int sgn)
if(neg) if(neg)
buf[i++] = '-'; buf[i++] = '-';
while(i > 0){ while(--i >= 0)
i -= 1;
real_cons_putc(buf[i]); real_cons_putc(buf[i]);
} }
}
/* /*
* print to the console. only understands %d and %x. * print to the console. only understands %d and %x.

2
fd.c
View file

@ -104,6 +104,6 @@ fd_incref(struct fd *fd)
acquire(&fd_table_lock); acquire(&fd_table_lock);
if(fd->count < 1 || fd->type == FD_CLOSED) if(fd->count < 1 || fd->type == FD_CLOSED)
panic("fd_reference"); panic("fd_reference");
fd->count += 1; fd->count++;
release(&fd_table_lock); release(&fd_table_lock);
} }

5
trap.c
View file

@ -71,13 +71,8 @@ trap(struct Trapframe *tf)
if(cpus[cpu()].nlock) if(cpus[cpu()].nlock)
panic("timer interrupt while holding a lock"); panic("timer interrupt while holding a lock");
if(cp){ if(cp){
#if 1
if((read_eflags() & FL_IF) == 0) if((read_eflags() & FL_IF) == 0)
panic("timer interrupt but interrupts now disabled"); panic("timer interrupt but interrupts now disabled");
#else
cpus[cpu()].clis += 1;
sti();
#endif
if(cp->killed) if(cp->killed)
proc_exit(); proc_exit();
if(cp->state == RUNNING) if(cp->state == RUNNING)