diff --git a/src/atomic_counter.hpp b/src/atomic_counter.hpp index d05837a1..371779fb 100644 --- a/src/atomic_counter.hpp +++ b/src/atomic_counter.hpp @@ -197,7 +197,10 @@ class atomic_counter_t #endif } - integer_t get () const ZMQ_NOEXCEPT { return _value; } + integer_t get () const ZMQ_NOEXCEPT + { + return _value; + } private: #if defined ZMQ_ATOMIC_COUNTER_CXX11 diff --git a/src/blob.hpp b/src/blob.hpp index 54a41d52..06a41913 100644 --- a/src/blob.hpp +++ b/src/blob.hpp @@ -114,7 +114,7 @@ struct blob_t unsigned char *data () { return _data; } // Defines an order relationship on blob_t. - bool operator< (blob_t const &other_) const + bool operator<(blob_t const &other_) const { const int cmpres = memcmp (_data, other_._data, std::min (_size, other_._size)); @@ -182,7 +182,10 @@ struct blob_t return *this; } #else - blob_t (const blob_t &other) : _owned (false) { set_deep_copy (other); } + blob_t (const blob_t &other) : _owned (false) + { + set_deep_copy (other); + } blob_t &operator= (const blob_t &other) { if (this != &other) { diff --git a/src/mailbox.hpp b/src/mailbox.hpp index 0cd92d20..ab0119b2 100644 --- a/src/mailbox.hpp +++ b/src/mailbox.hpp @@ -58,7 +58,10 @@ class mailbox_t ZMQ_FINAL : public i_mailbox // close the file descriptors in the signaller. This is used in a forked // child process to close the file descriptors so that they do not interfere // with the context in the parent process. - void forked () ZMQ_FINAL { _signaler.forked (); } + void forked () ZMQ_FINAL + { + _signaler.forked (); + } #endif private: diff --git a/src/proxy.cpp b/src/proxy.cpp index 8a517c78..878fe2bf 100644 --- a/src/proxy.cpp +++ b/src/proxy.cpp @@ -397,13 +397,13 @@ int zmq::proxy (class socket_base_t *frontend_, frontend_in = (events[i].events & ZMQ_POLLIN) != 0; frontend_out = (events[i].events & ZMQ_POLLOUT) != 0; } else - // This 'if' needs to be after check for 'frontend_' in order never - // to be reached in case frontend_==backend_, so we ensure backend_in=false in that case. - if (events[i].socket == backend_) { - backend_in = (events[i].events & ZMQ_POLLIN) != 0; - backend_out = (events[i].events & ZMQ_POLLOUT) != 0; - } else if (events[i].socket == control_) - control_in = (events[i].events & ZMQ_POLLIN) != 0; + // This 'if' needs to be after check for 'frontend_' in order never + // to be reached in case frontend_==backend_, so we ensure backend_in=false in that case. + if (events[i].socket == backend_) { + backend_in = (events[i].events & ZMQ_POLLIN) != 0; + backend_out = (events[i].events & ZMQ_POLLOUT) != 0; + } else if (events[i].socket == control_) + control_in = (events[i].events & ZMQ_POLLIN) != 0; } diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 4c291d9c..9c367c42 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -1511,7 +1511,7 @@ int zmq::socket_base_t::process_commands (int timeout_, bool throttle_) while (rc == 0 || errno == EINTR) { if (rc == 0) { cmd.destination->process_command (cmd); - } + } rc = _mailbox->recv (&cmd, 0); } diff --git a/src/ypipe_conflate.hpp b/src/ypipe_conflate.hpp index 7c96d574..c81e66ae 100644 --- a/src/ypipe_conflate.hpp +++ b/src/ypipe_conflate.hpp @@ -69,13 +69,19 @@ template class ypipe_conflate_t ZMQ_FINAL : public ypipe_base_t #endif // There are no incomplete items for conflate ypipe - bool unwrite (T *) { return false; } + bool unwrite (T *) + { + return false; + } // Flush is no-op for conflate ypipe. Reader asleep behaviour // is as of the usual ypipe. // Returns false if the reader thread is sleeping. In that case, // caller is obliged to wake the reader up before using the pipe again. - bool flush () { return reader_awake; } + bool flush () + { + return reader_awake; + } // Check whether item is available for reading. bool check_read () @@ -100,7 +106,10 @@ template class ypipe_conflate_t ZMQ_FINAL : public ypipe_base_t // Applies the function fn to the first element in the pipe // and returns the value returned by the fn. // The pipe mustn't be empty or the function crashes. - bool probe (bool (*fn_) (const T &)) { return dbuffer.probe (fn_); } + bool probe (bool (*fn_) (const T &)) + { + return dbuffer.probe (fn_); + } protected: dbuffer_t dbuffer; diff --git a/tests/test_hwm_pubsub.cpp b/tests/test_hwm_pubsub.cpp index b85e6dc6..2452ddb0 100644 --- a/tests/test_hwm_pubsub.cpp +++ b/tests/test_hwm_pubsub.cpp @@ -273,7 +273,10 @@ void test_blocking (const char *bind_endpoint_) test_defaults_small (bind_endpoint); \ } \ \ - void test_blocking_##name () { test_blocking (bind_endpoint); } + void test_blocking_##name () \ + { \ + test_blocking (bind_endpoint); \ + } #define RUN_REGULAR_TEST_CASES(name) \ RUN_TEST (test_defaults_large_##name); \ diff --git a/tests/test_poller.cpp b/tests/test_poller.cpp index 78a352b0..7320308c 100644 --- a/tests/test_poller.cpp +++ b/tests/test_poller.cpp @@ -333,7 +333,10 @@ void call_poller_wait_all_null_event_fails_event_count_zero (void *poller_) } #define TEST_CASE_FUNC_PARAM(name, func) \ - void test_##name () { func (name); } + void test_##name () \ + { \ + func (name); \ + } TEST_CASE_FUNC_PARAM (call_poller_wait_null_event_fails, test_with_valid_poller) TEST_CASE_FUNC_PARAM (call_poller_wait_all_null_event_fails_event_count_nonzero, diff --git a/tests/test_radio_dish.cpp b/tests/test_radio_dish.cpp index 3c3fb18e..c977156b 100644 --- a/tests/test_radio_dish.cpp +++ b/tests/test_radio_dish.cpp @@ -41,7 +41,10 @@ // Helper macro to define the v4/v6 function pairs #define MAKE_TEST_V4V6(_test) \ - static void _test##_ipv4 () { _test (false); } \ + static void _test##_ipv4 () \ + { \ + _test (false); \ + } \ \ static void _test##_ipv6 () \ { \ diff --git a/tests/test_spec_dealer.cpp b/tests/test_spec_dealer.cpp index e7b6eb2d..0867a5b1 100644 --- a/tests/test_spec_dealer.cpp +++ b/tests/test_spec_dealer.cpp @@ -185,7 +185,10 @@ void test_block_on_send_no_peers (const char *bind_address_) { \ test_round_robin_out (bind_address); \ } \ - void test_fair_queue_in_##name () { test_fair_queue_in (bind_address); } \ + void test_fair_queue_in_##name () \ + { \ + test_fair_queue_in (bind_address); \ + } \ void test_block_on_send_no_peers_##name () \ { \ test_block_on_send_no_peers (bind_address); \ diff --git a/tests/test_spec_router.cpp b/tests/test_spec_router.cpp index 9e882f0a..d9b716fb 100644 --- a/tests/test_spec_router.cpp +++ b/tests/test_spec_router.cpp @@ -168,7 +168,10 @@ void test_destroy_queue_on_disconnect (const char *bind_address_) } #define TEST_SUITE(name, bind_address) \ - void test_fair_queue_in_##name () { test_fair_queue_in (bind_address); } \ + void test_fair_queue_in_##name () \ + { \ + test_fair_queue_in (bind_address); \ + } \ void test_destroy_queue_on_disconnect_##name () \ { \ test_destroy_queue_on_disconnect (bind_address); \ diff --git a/tests/test_tcp_accept_filter.cpp b/tests/test_tcp_accept_filter.cpp index 1bb4117b..be5975db 100644 --- a/tests/test_tcp_accept_filter.cpp +++ b/tests/test_tcp_accept_filter.cpp @@ -83,7 +83,10 @@ void test_bad_filter_string (const char *const filter_) } #define TEST_BAD_FILTER_STRING(case, filter) \ - void test_bad_filter_string_##case () { test_bad_filter_string (filter); } + void test_bad_filter_string_##case () \ + { \ + test_bad_filter_string (filter); \ + } TEST_BAD_FILTER_STRING (foo, "foo") TEST_BAD_FILTER_STRING (zeros_foo, "0.0.0.0foo") diff --git a/tests/testutil_unity.hpp b/tests/testutil_unity.hpp index b00c0c89..6fe051d7 100644 --- a/tests/testutil_unity.hpp +++ b/tests/testutil_unity.hpp @@ -197,8 +197,14 @@ void recv_array_expect_success (void *socket_, // Use this is an test executable to perform a default setup and teardown of // the test context, which is appropriate for many libzmq test cases. #define SETUP_TEARDOWN_TESTCONTEXT \ - void setUp () { setup_test_context (); } \ - void tearDown () { teardown_test_context (); } + void setUp () \ + { \ + setup_test_context (); \ + } \ + void tearDown () \ + { \ + teardown_test_context (); \ + } // The maximum number of sockets that can be managed by the test context. #define MAX_TEST_SOCKETS 128