*f->bptr++ = c;
}
-word bgetw_slow(struct fastbuf *f)
+int bgetw_slow(struct fastbuf *f)
{
- word w = bgetc_slow(f);
+ int w1, w2;
+ w1 = bgetc_slow(f);
+ if (w1 < 0)
+ return w1;
+ w2 = bgetc_slow(f);
+ if (w2 < 0)
+ return w2;
#ifdef CPU_BIG_ENDIAN
- return (w << 8) | bgetc_slow(f);
+ return (w1 << 8) | w2;
#else
- return w | (bgetc_slow(f) << 8);
+ return w1 | (w2 << 8);
#endif
}
bputc_slow(f, c);
}
-word bgetw_slow(struct fastbuf *f);
-static inline word bgetw(struct fastbuf *f)
+int bgetw_slow(struct fastbuf *f);
+static inline int bgetw(struct fastbuf *f)
{
- word w;
+ int w;
if (f->bptr + 2 <= f->bstop)
{
w = GET_U16(f->bptr);