From e5c3ea2dca3ebdc51b6ccfa08429fc94f7db4de9 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sat, 1 Jun 2019 20:48:29 +0100 Subject: [PATCH] add brackets to clarify logic --- mutt_thread.c | 4 +++- muttlib.c | 2 +- test/url/url_parse.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mutt_thread.c b/mutt_thread.c index 92e24c4c0..8cd541113 100644 --- a/mutt_thread.c +++ b/mutt_thread.c @@ -741,7 +741,9 @@ struct MuttThread *mutt_sort_subthreads(struct MuttThread *thread, bool init) if (!thread->sort_key || thread->sort_children) { /* make sort_key the first or last sibling, as appropriate */ - sort_key = (!(C_Sort & SORT_LAST) ^ !(C_Sort & SORT_REVERSE)) ? thread->child : tmp; + sort_key = ((!(C_Sort & SORT_LAST)) ^ (!(C_Sort & SORT_REVERSE))) ? + thread->child : + tmp; /* we just sorted its children */ thread->sort_children = false; diff --git a/muttlib.c b/muttlib.c index 0809f3579..9e2348cd4 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1666,7 +1666,7 @@ int mutt_inbox_cmp(const char *a, const char *b) const char *b_end = strrchr(b, '/'); /* If one path contains a '/', but not the other */ - if (!a_end ^ !b_end) + if ((!a_end) ^ (!b_end)) return 0; /* If neither path contains a '/' */ diff --git a/test/url/url_parse.c b/test/url/url_parse.c index 8b0f94309..4a69e3e5b 100644 --- a/test/url/url_parse.c +++ b/test/url/url_parse.c @@ -131,7 +131,7 @@ void test_url_parse(void) for (size_t i = 0; i < mutt_array_size(test); ++i) { struct Url *url = url_parse(test[i].source); - if (!TEST_CHECK(!(!!url ^ !!test[i].valid))) + if (!TEST_CHECK(!((!!url) ^ (!!test[i].valid)))) { TEST_MSG("Expected: %sNULL", test[i].valid ? "not " : ""); TEST_MSG("Actual : %sNULL", url ? "not " : ""); -- 2.40.0