From: Timo Sirainen Date: Tue, 7 Jun 2016 00:41:18 +0000 (+0300) Subject: -Wstrict-bool warning fixes X-Git-Tag: 2.2.31.rc1~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f0b3012a2edf25d7180be7a9750f87e34df60b3;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 b5366d2e2c..c075e8730d 100644 --- a/src/lib-fs/fs-randomfail.c +++ b/src/lib-fs/fs-randomfail.c @@ -261,7 +261,7 @@ fs_file_random_fail_end(struct randomfail_fs_file *file, { if (ret == 0 || errno != EAGAIN) { 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 015cf9044e..7cb0b0ce58 100644 --- a/src/lib-mail/message-address.c +++ b/src/lib-mail/message-address.c @@ -458,7 +458,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 daec0bbf0e..d3c997df53 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 bcd49842a6..b4bfc46424 100644 --- a/src/lib/ioloop-poll.c +++ b/src/lib/ioloop-poll.c @@ -85,11 +85,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); } @@ -120,11 +120,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; } @@ -189,13 +189,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 {