0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-28 07:58:14 +08:00

fixed compiler warning cast from uint64 to bool in socket_base.cpp

This commit is contained in:
malosek 2009-09-17 11:31:28 +02:00
parent 1bd6d5e0f6
commit dffbdbb60c

View File

@ -163,9 +163,14 @@ int zmq::socket_base_t::setsockopt (int option_, const void *optval_,
return -1;
}
if ((int64_t) *((int64_t*) optval_) == 0 ||
(int64_t) *((int64_t*) optval_) == 1) {
options.use_multicast_loop = (bool) *((int64_t*) optval_);
if ((int64_t) *((int64_t*) optval_) == 0) {
options.use_multicast_loop = false;
} else if ((int64_t) *((int64_t*) optval_) == 1) {
options.use_multicast_loop = true;
} else {
errno = EINVAL;
return -1;