Commit 76007e33 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Signed/Unsigned cleanup

parent 6334f553
......@@ -38,7 +38,7 @@ char *VFIL_readfile(const char *pfx, const char *fn, ssize_t *sz);
int VFIL_writefile(const char *pfx, const char *fn, const char *buf, size_t sz);
int VFIL_nonblocking(int fd);
int VFIL_fsinfo(int fd, unsigned *pbs, uintmax_t *size, uintmax_t *space);
int VFIL_allocate(int fd, off_t size, int insist);
int VFIL_allocate(int fd, uintmax_t size, int insist);
void VFIL_setpath(struct vfil_path**, const char *path);
typedef int vfil_path_func_f(void *priv, const char *fn);
int VFIL_searchpath(const struct vfil_path *, vfil_path_func_f *func,
......
......@@ -400,7 +400,8 @@ VEV_Once(struct vev_root *evb)
{
double t;
struct vev *e;
int i, j, k, tmo, retval = 1;
int i, k, tmo, retval = 1;
unsigned u;
CHECK_OBJ_NOTNULL(evb, VEV_BASE_MAGIC);
assert(evb->thread == pthread_self());
......@@ -440,21 +441,21 @@ VEV_Once(struct vev_root *evb)
}
k = 0;
for (j = 1; j < evb->lpfd; j++) {
evb->pev[j]->fd_events = evb->pfd[j].revents;
if (evb->pev[j]->fd_events)
for (u = 1; u < evb->lpfd; u++) {
evb->pev[u]->fd_events = evb->pfd[u].revents;
if (evb->pev[u]->fd_events)
k++;
}
assert(k == i);
DBG(evb, "EVENTS %d\n", i);
while (i > 0) {
for (j = BINHEAP_NOIDX + 1; j < evb->lpfd; j++) {
e = evb->pev[j];
for (u = BINHEAP_NOIDX + 1; u < evb->lpfd; u++) {
e = evb->pev[u];
if (e->fd_events == 0)
continue;
DBG(evb, "EVENT %p j=%d fd=%d ev=0x%x %d\n",
e, j, e->fd, e->fd_events, i);
DBG(evb, "EVENT %p u=%u fd=%d ev=0x%x %d\n",
e, u, e->fd, e->fd_events, i);
k = e->callback(e, e->fd_events);
e->fd_events = 0;
i--;
......
......@@ -224,7 +224,7 @@ VFIL_fsinfo(int fd, unsigned *pbs, uintmax_t *psize, uintmax_t *pspace)
*/
int
VFIL_allocate(int fd, off_t size, int insist)
VFIL_allocate(int fd, uintmax_t size, int insist)
{
struct stat st;
uintmax_t fsspace;
......
......@@ -144,19 +144,20 @@ VLU_File(int fd, vlu_f *func, void *priv, unsigned bufsize)
int
VLU_Feed(struct vlu *l, const char *ptr, int len)
{
int i = 0, ll;
int i = 0;
unsigned u;
CHECK_OBJ_NOTNULL(l, LINEUP_MAGIC);
AN(ptr);
assert(len > 0);
while (len > 0) {
ll = len;
if (ll > l->bufl - l->bufp)
ll = l->bufl - l->bufp;
memcpy(l->buf + l->bufp, ptr, ll);
len -= ll;
ptr += ll;
l->bufp += ll;
u = len;
if (u > l->bufl - l->bufp)
u = l->bufl - l->bufp;
memcpy(l->buf + l->bufp, ptr, u);
len -= u;
ptr += u;
l->bufp += u;
i = LineUpProcess(l);
if (i)
return (i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment