/*
* Sherlock Library -- File Page Cache
*
- * (c) 1999--2000 Martin Mares <mj@ucw.cz>
+ * (c) 1999--2002 Martin Mares <mj@ucw.cz>
*/
#include "lib/lib.h"
#ifdef SHERLOCK_HAVE_PREAD
s = sh_pwrite(p->fd, p->data, c->page_size, p->pos);
#else
- if (c->pos != p->pos || c->pos_fd != p->fd)
+ if (c->pos != p->pos || c->pos_fd != (int) p->fd)
sh_seek(p->fd, p->pos, SEEK_SET);
s = write(p->fd, p->data, c->page_size);
c->pos = p->pos + s;
flush_pages(struct page_cache *c, uns force)
{
uns cnt = 0;
- uns max = force ? ~0 : c->free_count / 2; /* FIXME: Needs tuning */
+ uns max = force ? ~0U : c->free_count / 2; /* FIXME: Needs tuning */
uns i;
struct page *p, *q, **req, **rr;
#ifdef SHERLOCK_HAVE_PREAD
s = sh_pread(fd, p->data, c->page_size, pos);
#else
- if (c->pos != pos || c->pos_fd != fd)
+ if (c->pos != pos || c->pos_fd != (int)fd)
sh_seek(fd, pos, SEEK_SET);
s = read(fd, p->data, c->page_size);
c->pos = pos + s;