]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
-Wstrict-bool warning fixes
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 7 Jun 2016 00:41:18 +0000 (03:41 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 12 Jun 2017 14:04:25 +0000 (17:04 +0300)
src/lib-fs/fs-randomfail.c
src/lib-mail/message-address.c
src/lib/ioloop-epoll.c
src/lib/ioloop-poll.c

index b5366d2e2c19695a66e90243fe91d2829c6b0eac..c075e8730db2168d2e97b11e70fa6af2b6d70b44 100644 (file)
@@ -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;
index 015cf9044e17de20b21ac0b7d8f54d7269d97fee..7cb0b0ce5810cf8c86fc748a5308f9ed55dc7462 100644 (file)
@@ -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 */
index daec0bbf0efd6036631ac22a992f3e56512d43ee..d3c997df5307f5560ff726cefe78b114e8c9f57c 100644 (file)
@@ -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;
        }
 
index bcd49842a604af5e745ac0cf9ea42083ff68ee5b..b4bfc46424d33cb9be7753350f9c9d7413a1d797 100644 (file)
@@ -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 {