X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Ffastbuf.c;h=22501f43ed87cba8ff3e1529da0ebe2b57038b8c;hb=bc2bbfcbe76e78db9cde27455ddbcfe1ddcc61d6;hp=a66d712b2902a1c564cbff5fb3636356941dea3d;hpb=ba1c173f544383aa6553a75dee6e6858d8f243a4;p=libucw.git diff --git a/ucw/fastbuf.c b/ucw/fastbuf.c index a66d712b..22501f43 100644 --- a/ucw/fastbuf.c +++ b/ucw/fastbuf.c @@ -9,11 +9,11 @@ #undef LOCAL_DEBUG -#include "ucw/lib.h" -#include "ucw/fastbuf.h" -#include "ucw/resource.h" -#include "ucw/trans.h" -#include "ucw/stkstring.h" +#include +#include +#include +#include +#include #include #include @@ -108,7 +108,7 @@ static void do_seek(struct fastbuf *f, ucw_off_t pos, int whence) ASSERT(btell(f) >= 0); } -inline void bsetpos(struct fastbuf *f, ucw_off_t pos) +void bsetpos(struct fastbuf *f, ucw_off_t pos) { /* We can optimize seeks only when reading */ if (f->bptr < f->bstop && pos <= f->pos && pos >= f->pos - (f->bstop - f->buffer)) /* If bptr == bstop, then [buffer, bstop] may be undefined */ @@ -164,19 +164,19 @@ int beof_slow(struct fastbuf *f) return f->bptr >= f->bstop && !brefill(f, 1); } -void bputc_slow(struct fastbuf *f, uns c) +void bputc_slow(struct fastbuf *f, uint c) { if (f->bptr >= f->bufend) bspout(f); *f->bptr++ = c; } -uns bread_slow(struct fastbuf *f, void *b, uns l, uns check) +uint bread_slow(struct fastbuf *f, void *b, uint l, uint check) { - uns total = 0; + uint total = 0; while (l) { - uns k = f->bstop - f->bptr; + uint k = f->bstop - f->bptr; if (!k) { @@ -198,11 +198,11 @@ uns bread_slow(struct fastbuf *f, void *b, uns l, uns check) return total; } -void bwrite_slow(struct fastbuf *f, const void *b, uns l) +void bwrite_slow(struct fastbuf *f, const void *b, uint l) { while (l) { - uns k = f->bufend - f->bptr; + uint k = f->bufend - f->bptr; if (!k) { @@ -218,12 +218,12 @@ void bwrite_slow(struct fastbuf *f, const void *b, uns l) } } -void bbcopy_slow(struct fastbuf *f, struct fastbuf *t, uns l) +void bbcopy_slow(struct fastbuf *f, struct fastbuf *t, uint l) { while (l) { byte *fptr, *tptr; - uns favail, tavail, n; + uint favail, tavail, n; favail = bdirect_read_prepare(f, &fptr); if (!favail) @@ -243,7 +243,7 @@ void bbcopy_slow(struct fastbuf *f, struct fastbuf *t, uns l) } } -int bconfig(struct fastbuf *f, uns item, int value) +int bconfig(struct fastbuf *f, uint item, int value) { return (f->config && !(f->flags & FB_DEAD)) ? f->config(f, item, value) : -1; } @@ -254,12 +254,12 @@ void brewind(struct fastbuf *f) bsetpos(f, 0); } -int bskip_slow(struct fastbuf *f, uns len) +int bskip_slow(struct fastbuf *f, uint len) { while (len) { byte *buf; - uns l = bdirect_read_prepare(f, &buf); + uint l = bdirect_read_prepare(f, &buf); if (!l) return 0; l = MIN(l, len); @@ -299,7 +299,7 @@ static void fb_res_free(struct resource *r) bclose(f); } -static void fb_res_dump(struct resource *r, uns indent UNUSED) +static void fb_res_dump(struct resource *r, uint indent UNUSED) { struct fastbuf *f = r->priv; printf(" name=%s\n", f->name);