From: Michael Wallner Date: Mon, 6 Jan 2020 11:28:11 +0000 (+0100) Subject: c++: fix -Wenum-in-bool-context X-Git-Tag: pre_cmake~86 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4c1122cf139f7b073807f0a9187306518988a08f;p=m6w6%2Flibmemcached c++: fix -Wenum-in-bool-context --- diff --git a/libmemcached/connect.cc b/libmemcached/connect.cc index 52cd293a..006810bf 100644 --- a/libmemcached/connect.cc +++ b/libmemcached/connect.cc @@ -294,7 +294,7 @@ static bool set_socket_options(memcached_instance_st* server) // If SOCK_CLOEXEC exists then we don't need to call the following if (SOCK_CLOEXEC == 0) { - if (FD_CLOEXEC) + if (FD_CLOEXEC != 0) { int flags; do @@ -447,12 +447,12 @@ static memcached_return_t unix_socket_connect(memcached_instance_st* server) do { int type= SOCK_STREAM; - if (SOCK_CLOEXEC) + if (SOCK_CLOEXEC != 0) { type|= SOCK_CLOEXEC; } - if (SOCK_NONBLOCK) + if (SOCK_NONBLOCK != 0) { type|= SOCK_NONBLOCK; } @@ -542,12 +542,12 @@ static memcached_return_t network_connect(memcached_instance_st* server) } int type= server->address_info_next->ai_socktype; - if (SOCK_CLOEXEC) + if (SOCK_CLOEXEC != 0) { type|= SOCK_CLOEXEC; } - if (SOCK_NONBLOCK) + if (SOCK_NONBLOCK != 0) { type|= SOCK_NONBLOCK; }