From: John Hodge Date: Thu, 20 Oct 2011 14:29:54 +0000 (+0800) Subject: Kernel/vterm - Removed an unneeded divide X-Git-Tag: rel0.13~18 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=6017fe6e4bbe7852451ce2e717ff4c665a270f44;p=tpg%2Facess2.git Kernel/vterm - Removed an unneeded divide --- diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index ea184ee1..1be52ac1 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -468,7 +468,8 @@ Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) ((char*)Buffer)[pos] = term->InputBuffer[term->InputRead]; pos ++; term->InputRead ++; - term->InputRead %= MAX_INPUT_CHARS8; + while(term->InputRead > MAX_INPUT_CHARS8) + term->InputRead -= MAX_INPUT_CHARS8; } break; @@ -491,7 +492,8 @@ Uint64 VT_Read(tVFS_Node *Node, Uint64 Offset, Uint64 Length, void *Buffer) codepoint_buf[pos] = codepoint_in[term->InputRead]; pos ++; term->InputRead ++; - term->InputRead %= MAX_INPUT_CHARS32; + while(term->InputRead > MAX_INPUT_CHARS32) + term->InputRead -= MAX_INPUT_CHARS32; } pos *= 4; break;