From: Martin Mares Date: Wed, 22 May 2002 15:43:47 +0000 (+0000) Subject: bungetc() is no longer passed the character to unget -- it always ungets X-Git-Tag: holmes-import~1430 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=c982330d65a5ff8930682b250612ea135db2d4f6;p=libucw.git bungetc() is no longer passed the character to unget -- it always ungets the last character read. bputc() and bputw() are now passed unsigned int instead of byte/word. --- diff --git a/lib/fastbuf.c b/lib/fastbuf.c index 8df90548..1b039c6c 100644 --- a/lib/fastbuf.c +++ b/lib/fastbuf.c @@ -80,7 +80,7 @@ int bpeekc_slow(struct fastbuf *f) return *f->bptr; } -void bputc_slow(struct fastbuf *f, byte c) +void bputc_slow(struct fastbuf *f, uns c) { if (f->bptr >= f->bufend) f->spout(f); @@ -143,7 +143,7 @@ u64 bget5_slow(struct fastbuf *f) return ((u64) h << 32) | l; } -void bputw_slow(struct fastbuf *f, word w) +void bputw_slow(struct fastbuf *f, uns w) { #ifdef CPU_BIG_ENDIAN bputc_slow(f, w >> 8); diff --git a/lib/fastbuf.h b/lib/fastbuf.h index f644cc81..c6e6e333 100644 --- a/lib/fastbuf.h +++ b/lib/fastbuf.h @@ -91,13 +91,13 @@ static inline int bpeekc(struct fastbuf *f) return (f->bptr < f->bstop) ? (int) *f->bptr : bpeekc_slow(f); } -static inline void bungetc(struct fastbuf *f, byte c) +static inline void bungetc(struct fastbuf *f) { - *--f->bptr = c; + f->bptr--; } -void bputc_slow(struct fastbuf *f, byte c); -static inline void bputc(struct fastbuf *f, byte c) +void bputc_slow(struct fastbuf *f, uns c); +static inline void bputc(struct fastbuf *f, uns c) { if (f->bptr < f->bufend) *f->bptr++ = c; @@ -161,8 +161,8 @@ static inline u64 bget5(struct fastbuf *f) return bget5_slow(f); } -void bputw_slow(struct fastbuf *f, word w); -static inline void bputw(struct fastbuf *f, word w) +void bputw_slow(struct fastbuf *f, uns w); +static inline void bputw(struct fastbuf *f, uns w) { if (f->bptr + 2 <= f->bufend) {