Commit 14ab7946 authored by Simon Giesecke's avatar Simon Giesecke

Problem: local functions not declared static

Solution: add static
parent fa804c77
......@@ -63,7 +63,7 @@
#define ZMQ_CTX_TAG_VALUE_GOOD 0xabadcafe
#define ZMQ_CTX_TAG_VALUE_BAD 0xdeadbeef
int clipped_maxsocket (int max_requested_)
static int clipped_maxsocket (int max_requested_)
{
if (max_requested_ >= zmq::poller_t::max_fds ()
&& zmq::poller_t::max_fds () != -1)
......
......@@ -102,9 +102,9 @@ static int do_getsockopt_curve_key (void *const optval_,
#endif
template <typename T>
int do_setsockopt (const void *const optval_,
const size_t optvallen_,
T *const out_value_)
static int do_setsockopt (const void *const optval_,
const size_t optvallen_,
T *const out_value_)
{
if (optvallen_ == sizeof (T)) {
memcpy (out_value_, optval_, sizeof (T));
......@@ -176,9 +176,9 @@ do_setsockopt_string_allow_empty_relaxed (const void *const optval_,
}
template <typename T>
int do_setsockopt_set (const void *const optval_,
const size_t optvallen_,
std::set<T> *const set_)
static int do_setsockopt_set (const void *const optval_,
const size_t optvallen_,
std::set<T> *const set_)
{
if (optvallen_ == 0 && optval_ == NULL) {
set_->clear ();
......@@ -592,7 +592,7 @@ int zmq::options_t::setsockopt (int option_,
case ZMQ_ZAP_DOMAIN:
return do_setsockopt_string_allow_empty_relaxed (
optval_, optvallen_, &zap_domain, UCHAR_MAX);
// If curve encryption isn't built, these options provoke EINVAL
#ifdef ZMQ_HAVE_CURVE
case ZMQ_CURVE_SERVER:
......
......@@ -89,9 +89,8 @@ typedef struct
// Utility functions
int capture (class zmq::socket_base_t *capture_,
zmq::msg_t *msg_,
int more_ = 0)
static int
capture (class zmq::socket_base_t *capture_, zmq::msg_t *msg_, int more_ = 0)
{
// Copy message to capture socket if any
if (capture_) {
......@@ -109,12 +108,12 @@ int capture (class zmq::socket_base_t *capture_,
return 0;
}
int forward (class zmq::socket_base_t *from_,
zmq_socket_stats_t *from_stats_,
class zmq::socket_base_t *to_,
zmq_socket_stats_t *to_stats_,
class zmq::socket_base_t *capture_,
zmq::msg_t *msg_)
static int forward (class zmq::socket_base_t *from_,
zmq_socket_stats_t *from_stats_,
class zmq::socket_base_t *to_,
zmq_socket_stats_t *to_stats_,
class zmq::socket_base_t *capture_,
zmq::msg_t *msg_)
{
// Forward a burst of messages
for (unsigned int i = 0; i < zmq::proxy_burst_size; i++) {
......@@ -184,9 +183,9 @@ static int loop_and_send_multipart_stat (zmq::socket_base_t *control_,
return rc;
}
int reply_stats (class zmq::socket_base_t *control_,
zmq_socket_stats_t *frontend_stats_,
zmq_socket_stats_t *backend_stats_)
static int reply_stats (class zmq::socket_base_t *control_,
zmq_socket_stats_t *frontend_stats_,
zmq_socket_stats_t *backend_stats_)
{
// first part: frontend stats - the first send might fail due to HWM
if (loop_and_send_multipart_stat (control_, frontend_stats_->msg_in, true,
......
......@@ -726,7 +726,7 @@ const char *zmq_msg_gets (const zmq_msg_t *msg_, const char *property_)
// Polling.
#if defined ZMQ_HAVE_POLLER
inline int zmq_poller_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
static int zmq_poller_poll (zmq_pollitem_t *items_, int nitems_, long timeout_)
{
// implement zmq_poll on top of zmq_poller
int rc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment