--- Gnu-Mach/device/cirbuf.c 2020/09/02 04:36:57 1.1 +++ Gnu-Mach/device/cirbuf.c 2020/09/02 04:45:32 1.1.1.2 @@ -30,7 +30,9 @@ * Circular buffers for TTY */ +#include #include +#include #include @@ -44,7 +46,7 @@ int cb_check_enable = 0; #define CB_CHECK(cb) if (cb_check_enable) cb_check(cb) void -cb_check(register struct cirbuf *cb) +cb_check(struct cirbuf *cb) { if (!(cb->c_cf >= cb->c_start && cb->c_cf < cb->c_end)) panic("cf %x out of range [%x..%x)", @@ -76,9 +78,9 @@ cb_check(register struct cirbuf *cb) */ int putc( int c, - register struct cirbuf *cb) + struct cirbuf *cb) { - register char *ow, *nw; + char *ow, *nw; ow = cb->c_cl; nw = ow+1; @@ -99,10 +101,10 @@ int putc( /* * Get one character from circular buffer. */ -int getc(register struct cirbuf *cb) +int getc(struct cirbuf *cb) { - register unsigned char *nr; - register int c; + unsigned char *nr; + int c; nr = (unsigned char *)cb->c_cf; if (nr == (unsigned char *)cb->c_cl) { @@ -127,12 +129,12 @@ int getc(register struct cirbuf *cb) * Return number moved. */ int -q_to_b( register struct cirbuf *cb, - register char *cp, - register int count) +q_to_b( struct cirbuf *cb, + char *cp, + int count) { - char * ocp = cp; - register int i; + char *ocp = cp; + int i; while (count != 0) { if (cb->c_cl == cb->c_cf) @@ -143,7 +145,7 @@ q_to_b( register struct cirbuf *cb, i = cb->c_cl - cb->c_cf; if (i > count) i = count; - bcopy(cb->c_cf, cp, i); + memcpy(cp, cb->c_cf, i); cp += i; count -= i; cb->c_cf += i; @@ -163,12 +165,12 @@ q_to_b( register struct cirbuf *cb, * NOT entered. */ int -b_to_q( register char * cp, +b_to_q( char *cp, int count, - register struct cirbuf *cb) + struct cirbuf *cb) { - register int i; - register char *lim; + int i; + char *lim; while (count != 0) { lim = cb->c_cf - 1; @@ -184,7 +186,7 @@ b_to_q( register char * cp, if (i > count) i = count; - bcopy(cp, cb->c_cl, i); + memcpy(cb->c_cl, cp, i); cp += i; count -= i; cb->c_cc += i; @@ -203,10 +205,10 @@ b_to_q( register char * cp, * that matches the mask. */ int -ndqb( register struct cirbuf *cb, - register int mask) +ndqb( struct cirbuf *cb, + int mask) { - register char *cp, *lim; + char *cp, *lim; if (cb->c_cl < cb->c_cf) lim = cb->c_end; @@ -227,10 +229,10 @@ ndqb( register struct cirbuf *cb, * Flush characters from circular buffer. */ void -ndflush(register struct cirbuf *cb, - register int count) +ndflush(struct cirbuf *cb, + int count) { - register int i; + int i; while (count != 0) { if (cb->c_cl == cb->c_cf) @@ -267,10 +269,10 @@ void cb_clear(struct cirbuf *cb) */ void cb_alloc( - register struct cirbuf *cb, + struct cirbuf *cb, int buf_size) { - register char *buf; + char *buf; buf = (char *)kalloc(buf_size); @@ -288,7 +290,7 @@ cb_alloc( * Free character space for a circular buffer. */ void -cb_free(register struct cirbuf *cb) +cb_free(struct cirbuf *cb) { int size;