Fix win32 compilation warnings in 1.4.

svn:r1287
This commit is contained in:
Nick Mathewson 2009-05-15 01:14:08 +00:00
parent 5e0563ba9a
commit 5d639d6c20
3 changed files with 7 additions and 7 deletions

View File

@ -347,7 +347,7 @@ win32_dispatch(struct event_base *base, void *op,
{
struct win32op *win32op = op;
int res = 0;
int i;
unsigned i;
int fd_count;
fd_set_copy(win32op->readset_out, win32op->readset_in);

View File

@ -161,7 +161,7 @@ evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
if (sz < 0)
return (-1);
if (sz < space) {
if ((size_t)sz < space) {
buf->off += sz;
if (buf->cb != NULL)
(*buf->cb)(buf, oldoff, buf->off, buf->cbarg);
@ -370,7 +370,7 @@ evbuffer_read(struct evbuffer *buf, int fd, int howmuch)
* about it. If the reader does not tell us how much
* data we should read, we artifically limit it.
*/
if (n > buf->totallen << 2)
if ((size_t)n > buf->totallen << 2)
n = buf->totallen << 2;
if (n < EVBUFFER_MAX_READ)
n = EVBUFFER_MAX_READ;

8
http.c
View File

@ -822,8 +822,8 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf)
/* Completed chunk */
evbuffer_add(req->input_buffer,
EVBUFFER_DATA(buf), req->ntoread);
evbuffer_drain(buf, req->ntoread);
EVBUFFER_DATA(buf), (size_t)req->ntoread);
evbuffer_drain(buf, (size_t)req->ntoread);
req->ntoread = -1;
if (req->chunk_cb != NULL) {
(*req->chunk_cb)(req, req->cb_arg);
@ -887,8 +887,8 @@ evhttp_read_body(struct evhttp_connection *evcon, struct evhttp_request *req)
} else if (EVBUFFER_LENGTH(buf) >= req->ntoread) {
/* Completed content length */
evbuffer_add(req->input_buffer, EVBUFFER_DATA(buf),
req->ntoread);
evbuffer_drain(buf, req->ntoread);
(size_t)req->ntoread);
evbuffer_drain(buf, (size_t)req->ntoread);
req->ntoread = 0;
evhttp_connection_done(evcon);
return;