From: Timo Sirainen Date: Tue, 7 Jun 2016 00:41:18 +0000 (+0300) Subject: -Wstrict-bool warning fixes X-Git-Tag: 2.3.0.rc1~3522 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=49b6e2d72cfaa5c244c798ddbae5b61489b0f728;p=thirdparty%2Fdovecot%2Fcore.git -Wstrict-bool warning fixes --- diff --git a/src/lib-fs/fs-randomfail.c b/src/lib-fs/fs-randomfail.c index 2deaaf84bb..9423b0e205 100644 --- a/src/lib-fs/fs-randomfail.c +++ b/src/lib-fs/fs-randomfail.c @@ -285,7 +285,7 @@ fs_file_random_fail_end(struct randomfail_fs_file *file, { if (ret == 0 || errno != ENOENT) { if (fs_random_fail(file->file.fs, 2, op)) - return TRUE; + return -1; file->op_pending[op] = FALSE; } return ret; diff --git a/src/lib-mail/message-address.c b/src/lib-mail/message-address.c index bf72e3504e..64f9da22b1 100644 --- a/src/lib-mail/message-address.c +++ b/src/lib-mail/message-address.c @@ -457,7 +457,7 @@ void message_address_write(string_t *str, const struct message_address *addr) if (addr->name != NULL) { /* check for MIME encoded-word */ - if (strstr(addr->name, "=?")) + if (strstr(addr->name, "=?") != NULL) /* MIME encoded-word MUST NOT appear within a 'quoted-string' so escaping and quoting of phrase is not possible, instead use obsolete RFC822 phrase syntax which allow spaces */ diff --git a/src/lib/ioloop-epoll.c b/src/lib/ioloop-epoll.c index e70125f1f5..a6d92b9c77 100644 --- a/src/lib/ioloop-epoll.c +++ b/src/lib/ioloop-epoll.c @@ -72,11 +72,11 @@ static int epoll_event_mask(struct io_list *list) if (io == NULL) continue; - if (io->io.condition & IO_READ) + if ((io->io.condition & IO_READ) != 0) events |= IO_EPOLL_INPUT; - if (io->io.condition & IO_WRITE) + if ((io->io.condition & IO_WRITE) != 0) events |= IO_EPOLL_OUTPUT; - if (io->io.condition & IO_ERROR) + if ((io->io.condition & IO_ERROR) != 0) events |= IO_EPOLL_ERROR; } diff --git a/src/lib/ioloop-poll.c b/src/lib/ioloop-poll.c index 862d84ead2..5e040b223e 100644 --- a/src/lib/ioloop-poll.c +++ b/src/lib/ioloop-poll.c @@ -87,11 +87,11 @@ void io_loop_handle_add(struct io_file *io) } old_events = ctx->fds[index].events; - if (condition & IO_READ) + if ((condition & IO_READ) != 0) ctx->fds[index].events |= IO_POLL_INPUT; - if (condition & IO_WRITE) + if ((condition & IO_WRITE) != 0) ctx->fds[index].events |= IO_POLL_OUTPUT; - if (condition & IO_ERROR) + if ((condition & IO_ERROR) != 0) ctx->fds[index].events |= IO_POLL_ERROR; i_assert(ctx->fds[index].events != old_events); } @@ -122,11 +122,11 @@ void io_loop_handle_remove(struct io_file *io, bool closed ATTR_UNUSED) #endif i_free(io); - if (condition & IO_READ) { + if ((condition & IO_READ) != 0) { ctx->fds[index].events &= ~(POLLIN|POLLPRI); ctx->fds[index].revents &= ~(POLLIN|POLLPRI); } - if (condition & IO_WRITE) { + if ((condition & IO_WRITE) != 0) { ctx->fds[index].events &= ~POLLOUT; ctx->fds[index].revents &= ~POLLOUT; } @@ -191,13 +191,13 @@ void io_loop_handler_run_internal(struct ioloop *ioloop) (IO_READ|IO_WRITE)) == (IO_READ|IO_WRITE)) { call = TRUE; pollfd->revents = 0; - } else if (io->io.condition & IO_READ) { + } else if ((io->io.condition & IO_READ) != 0) { call = (pollfd->revents & IO_POLL_INPUT) != 0; pollfd->revents &= ~IO_POLL_INPUT; - } else if (io->io.condition & IO_WRITE) { + } else if ((io->io.condition & IO_WRITE) != 0) { call = (pollfd->revents & IO_POLL_OUTPUT) != 0; pollfd->revents &= ~IO_POLL_OUTPUT; - } else if (io->io.condition & IO_ERROR) { + } else if ((io->io.condition & IO_ERROR) != 0) { call = (pollfd->revents & IO_POLL_ERROR) != 0; pollfd->revents &= ~IO_POLL_ERROR; } else {