mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Fix signed/unsigned warnings on win32
This commit is contained in:
parent
6be589ae68
commit
e06f514d4e
@ -110,7 +110,7 @@ evbuffer_commit_read(struct evbuffer *evbuf, ev_ssize_t nBytes)
|
||||
if (!((*chainp)->flags & EVBUFFER_MEM_PINNED_R))
|
||||
chainp = &(*chainp)->next;
|
||||
remaining = nBytes;
|
||||
for (i = 0; remaining > 0 && i < buf->n_buffers; ++i) {
|
||||
for (i = 0; remaining > 0 && i < (unsigned)buf->n_buffers; ++i) {
|
||||
EVUTIL_ASSERT(*chainp);
|
||||
len = buf->buffers[i].len;
|
||||
if (remaining < len)
|
||||
|
@ -195,7 +195,7 @@ bev_async_consider_writing(struct bufferevent_async *beva)
|
||||
|
||||
/* XXXX This over-commits. */
|
||||
limit = _bufferevent_get_write_max(&beva->bev);
|
||||
if (at_most >= limit)
|
||||
if (at_most >= (size_t)limit && limit >= 0)
|
||||
at_most = limit;
|
||||
|
||||
if (beva->bev.write_suspended) {
|
||||
@ -249,7 +249,7 @@ bev_async_consider_reading(struct bufferevent_async *beva)
|
||||
|
||||
/* XXXX This over-commits. */
|
||||
limit = _bufferevent_get_read_max(&beva->bev);
|
||||
if (at_most >= limit)
|
||||
if (at_most >= (size_t)limit && limit >= 0)
|
||||
at_most = limit;
|
||||
|
||||
if (beva->bev.read_suspended) {
|
||||
|
@ -247,7 +247,7 @@ test_iocp_evbuffer(void *ptr)
|
||||
event_overlapped_init(&rol, read_complete);
|
||||
event_overlapped_init(&wol, write_complete);
|
||||
|
||||
for (i = 0; i < sizeof(junk); ++i)
|
||||
for (i = 0; i < (int)sizeof(junk); ++i)
|
||||
junk[i] = (char)(i);
|
||||
|
||||
rbuf = evbuffer_overlapped_new(data->pair[0]);
|
||||
|
@ -126,7 +126,7 @@ do_fd_set(struct win32op *op, struct idx_info *ent, evutil_socket_t s, int read)
|
||||
if (ent->write_pos_plus1 > 0)
|
||||
return (0);
|
||||
}
|
||||
if (set->fd_count == op->fd_setsz) {
|
||||
if ((int)set->fd_count == op->fd_setsz) {
|
||||
if (realloc_fd_sets(op, op->fd_setsz*2))
|
||||
return (-1);
|
||||
/* set pointer will have changed and needs reiniting! */
|
||||
@ -155,7 +155,7 @@ do_fd_clear(struct event_base *base,
|
||||
}
|
||||
if (i < 0)
|
||||
return (0);
|
||||
if (--set->fd_count != i) {
|
||||
if (--set->fd_count != (unsigned)i) {
|
||||
struct idx_info *ent2;
|
||||
SOCKET s2;
|
||||
s2 = set->fd_array[i] = set->fd_array[set->fd_count];
|
||||
|
Loading…
x
Reference in New Issue
Block a user