mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 05:29:43 +01:00
Fixed 7 MSVC2008 Compiler Warning (level 3) C4800: 'const int' : forcing value to bool 'true' or 'false' (performance warning)
- added explicit test "(xxx != 0)" to get a "bool" value out of the "int" expression - see the MSDN recommandation http://msdn.microsoft.com/en-us/library/b6801kcy(v=vs.90).aspx
This commit is contained in:
@@ -185,7 +185,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
/* Deprecated in favor of ZMQ_IPV6 */
|
||||
case ZMQ_IPV4ONLY:
|
||||
if (is_int && (value == 0 || value == 1))
|
||||
ipv6 = 1 - value;
|
||||
ipv6 = (value == 0);
|
||||
else
|
||||
valid = false;
|
||||
break;
|
||||
@@ -193,7 +193,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
/* To replace the somewhat surprising IPV4ONLY */
|
||||
case ZMQ_IPV6:
|
||||
if (is_int && (value == 0 || value == 1))
|
||||
ipv6 = value;
|
||||
ipv6 = (value != 0);
|
||||
else
|
||||
valid = false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user