X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Ffb-mem.c;h=1acb38f6c3f6721b6742abe67934cbe8ce70a7f0;hb=b9db3187d404ffec3840f9a3ffc237fb9523de79;hp=40b9f1e5458034594b18ff1901b3df0c2bf64f23;hpb=031256ad2e123eec58521f8e3eb9496c197641d2;p=libucw.git diff --git a/ucw/fb-mem.c b/ucw/fb-mem.c index 40b9f1e5..1acb38f6 100644 --- a/ucw/fb-mem.c +++ b/ucw/fb-mem.c @@ -20,7 +20,7 @@ struct memstream { struct msblock { struct msblock *next; - sh_off_t pos; + ucw_off_t pos; unsigned size; byte data[0]; }; @@ -96,7 +96,7 @@ fbmem_spout(struct fastbuf *f) } static int -fbmem_seek(struct fastbuf *f, sh_off_t pos, int whence) +fbmem_seek(struct fastbuf *f, ucw_off_t pos, int whence) { struct memstream *m = FB_MEM(f)->stream; struct msblock *b; @@ -110,7 +110,7 @@ fbmem_seek(struct fastbuf *f, sh_off_t pos, int whence) /* Yes, this is linear. But considering the average number of buckets, it doesn't matter. */ for (b=m->first; b; b=b->next) { - if (pos <= b->pos + (sh_off_t)b->size) /* <=, because we need to be able to seek just after file end */ + if (pos <= b->pos + (ucw_off_t)b->size) /* <=, because we need to be able to seek just after file end */ { f->buffer = b->data; f->bptr = b->data + (pos - b->pos); @@ -213,6 +213,7 @@ int main(void) printf("", (int)btell(r)); while ((t = bgetc(r)) >= 0) putchar(t); + putchar('\n'); fflush(stdout); bclose(r); return 0;