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); ...@@ -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_writefile(const char *pfx, const char *fn, const char *buf, size_t sz);
int VFIL_nonblocking(int fd); int VFIL_nonblocking(int fd);
int VFIL_fsinfo(int fd, unsigned *pbs, uintmax_t *size, uintmax_t *space); 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); void VFIL_setpath(struct vfil_path**, const char *path);
typedef int vfil_path_func_f(void *priv, const char *fn); typedef int vfil_path_func_f(void *priv, const char *fn);
int VFIL_searchpath(const struct vfil_path *, vfil_path_func_f *func, int VFIL_searchpath(const struct vfil_path *, vfil_path_func_f *func,
......
...@@ -400,7 +400,8 @@ VEV_Once(struct vev_root *evb) ...@@ -400,7 +400,8 @@ VEV_Once(struct vev_root *evb)
{ {
double t; double t;
struct vev *e; 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); CHECK_OBJ_NOTNULL(evb, VEV_BASE_MAGIC);
assert(evb->thread == pthread_self()); assert(evb->thread == pthread_self());
...@@ -440,21 +441,21 @@ VEV_Once(struct vev_root *evb) ...@@ -440,21 +441,21 @@ VEV_Once(struct vev_root *evb)
} }
k = 0; k = 0;
for (j = 1; j < evb->lpfd; j++) { for (u = 1; u < evb->lpfd; u++) {
evb->pev[j]->fd_events = evb->pfd[j].revents; evb->pev[u]->fd_events = evb->pfd[u].revents;
if (evb->pev[j]->fd_events) if (evb->pev[u]->fd_events)
k++; k++;
} }
assert(k == i); assert(k == i);
DBG(evb, "EVENTS %d\n", i); DBG(evb, "EVENTS %d\n", i);
while (i > 0) { while (i > 0) {
for (j = BINHEAP_NOIDX + 1; j < evb->lpfd; j++) { for (u = BINHEAP_NOIDX + 1; u < evb->lpfd; u++) {
e = evb->pev[j]; e = evb->pev[u];
if (e->fd_events == 0) if (e->fd_events == 0)
continue; continue;
DBG(evb, "EVENT %p j=%d fd=%d ev=0x%x %d\n", DBG(evb, "EVENT %p u=%u fd=%d ev=0x%x %d\n",
e, j, e->fd, e->fd_events, i); e, u, e->fd, e->fd_events, i);
k = e->callback(e, e->fd_events); k = e->callback(e, e->fd_events);
e->fd_events = 0; e->fd_events = 0;
i--; i--;
......
...@@ -224,7 +224,7 @@ VFIL_fsinfo(int fd, unsigned *pbs, uintmax_t *psize, uintmax_t *pspace) ...@@ -224,7 +224,7 @@ VFIL_fsinfo(int fd, unsigned *pbs, uintmax_t *psize, uintmax_t *pspace)
*/ */
int int
VFIL_allocate(int fd, off_t size, int insist) VFIL_allocate(int fd, uintmax_t size, int insist)
{ {
struct stat st; struct stat st;
uintmax_t fsspace; uintmax_t fsspace;
......
...@@ -144,19 +144,20 @@ VLU_File(int fd, vlu_f *func, void *priv, unsigned bufsize) ...@@ -144,19 +144,20 @@ VLU_File(int fd, vlu_f *func, void *priv, unsigned bufsize)
int int
VLU_Feed(struct vlu *l, const char *ptr, int len) 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); CHECK_OBJ_NOTNULL(l, LINEUP_MAGIC);
AN(ptr); AN(ptr);
assert(len > 0); assert(len > 0);
while (len > 0) { while (len > 0) {
ll = len; u = len;
if (ll > l->bufl - l->bufp) if (u > l->bufl - l->bufp)
ll = l->bufl - l->bufp; u = l->bufl - l->bufp;
memcpy(l->buf + l->bufp, ptr, ll); memcpy(l->buf + l->bufp, ptr, u);
len -= ll; len -= u;
ptr += ll; ptr += u;
l->bufp += ll; l->bufp += u;
i = LineUpProcess(l); i = LineUpProcess(l);
if (i) if (i)
return (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