From c982330d65a5ff8930682b250612ea135db2d4f6 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 22 May 2002 15:43:47 +0000 Subject: [PATCH] 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. --- lib/fastbuf.c | 4 ++-- lib/fastbuf.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) 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) { -- 2.39.2