]> 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>
Tue, 7 Jun 2016 00:41:18 +0000 (03:41 +0300)
src/lib-fs/fs-randomfail.c
src/lib-mail/message-address.c
src/lib/ioloop-epoll.c
src/lib/ioloop-poll.c

index 2deaaf84bb4f6873f6615da09e72962e270fb647..9423b0e205991ef1297fc83b1e2c3fbf001282eb 100644 (file)
@@ -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;
index bf72e3504ea94dd0847de4ff15faca6a06d42413..64f9da22b1e595d1df4cf727ecd33aa54026c75c 100644 (file)
@@ -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 */
index e70125f1f5f5447ed3c75a112ed4635ef68921f7..a6d92b9c7791736bdb4bcd7a16824124d34691e9 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 862d84ead232480590e737ef6a629ed2ce22f26b..5e040b223e78970ef096f18e256ca1c4d197bab6 100644 (file)
@@ -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 {