From 5d639d6c201b9bbee3e28dae85aab285d3fae7a1 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 15 May 2009 01:14:08 +0000 Subject: [PATCH] Fix win32 compilation warnings in 1.4. svn:r1287 --- WIN32-Code/win32.c | 2 +- buffer.c | 4 ++-- http.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/WIN32-Code/win32.c b/WIN32-Code/win32.c index 2258ca87..9acfa981 100644 --- a/WIN32-Code/win32.c +++ b/WIN32-Code/win32.c @@ -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); diff --git a/buffer.c b/buffer.c index e66080f3..9cb0f0ce 100644 --- a/buffer.c +++ b/buffer.c @@ -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; diff --git a/http.c b/http.c index d165b3ee..c11b165b 100644 --- a/http.c +++ b/http.c @@ -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;