mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 19:52:00 +01:00
Problem: formatting inconsistent
Solution: applied clang-format
This commit is contained in:
10
src/sub.cpp
10
src/sub.cpp
@@ -45,8 +45,9 @@ zmq::sub_t::~sub_t ()
|
||||
{
|
||||
}
|
||||
|
||||
int zmq::sub_t::xsetsockopt (int option_, const void *optval_,
|
||||
size_t optvallen_)
|
||||
int zmq::sub_t::xsetsockopt (int option_,
|
||||
const void *optval_,
|
||||
size_t optvallen_)
|
||||
{
|
||||
if (option_ != ZMQ_SUBSCRIBE && option_ != ZMQ_UNSUBSCRIBE) {
|
||||
errno = EINVAL;
|
||||
@@ -57,11 +58,10 @@ int zmq::sub_t::xsetsockopt (int option_, const void *optval_,
|
||||
msg_t msg;
|
||||
int rc = msg.init_size (optvallen_ + 1);
|
||||
errno_assert (rc == 0);
|
||||
unsigned char *data = (unsigned char*) msg.data ();
|
||||
unsigned char *data = (unsigned char *) msg.data ();
|
||||
if (option_ == ZMQ_SUBSCRIBE)
|
||||
*data = 1;
|
||||
else
|
||||
if (option_ == ZMQ_UNSUBSCRIBE)
|
||||
else if (option_ == ZMQ_UNSUBSCRIBE)
|
||||
*data = 0;
|
||||
// We explicitly allow a NULL subscription with size zero
|
||||
if (optvallen_) {
|
||||
|
||||
Reference in New Issue
Block a user