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

Merge pull request #4146 from gummif/gfa/unused-vars

Problem: Unused member variables _last_in
This commit is contained in:
Luca Boccassi 2021-02-19 14:05:44 +00:00 committed by GitHub
commit 31ebe35144
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2 additions and 26 deletions

View File

@ -39,7 +39,6 @@
zmq::dgram_t::dgram_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
socket_base_t (parent_, tid_, sid_),
_pipe (NULL),
_last_in (NULL),
_more_out (false)
{
options.type = ZMQ_DGRAM;
@ -71,9 +70,6 @@ void zmq::dgram_t::xattach_pipe (pipe_t *pipe_,
void zmq::dgram_t::xpipe_terminated (pipe_t *pipe_)
{
if (pipe_ == _pipe) {
if (_last_in == _pipe) {
_last_in = NULL;
}
_pipe = NULL;
}
}
@ -147,7 +143,6 @@ int zmq::dgram_t::xrecv (msg_t *msg_)
errno = EAGAIN;
return -1;
}
_last_in = _pipe;
return 0;
}

View File

@ -62,8 +62,6 @@ class dgram_t ZMQ_FINAL : public socket_base_t
private:
zmq::pipe_t *_pipe;
zmq::pipe_t *_last_in;
// If true, more outgoing message parts are expected.
bool _more_out;

View File

@ -33,7 +33,7 @@
#include "err.hpp"
#include "msg.hpp"
zmq::fq_t::fq_t () : _active (0), _last_in (NULL), _current (0), _more (false)
zmq::fq_t::fq_t () : _active (0), _current (0), _more (false)
{
}
@ -62,10 +62,6 @@ void zmq::fq_t::pipe_terminated (pipe_t *pipe_)
_current = 0;
}
_pipes.erase (pipe_);
if (_last_in == pipe_) {
_last_in = NULL;
}
}
void zmq::fq_t::activated (pipe_t *pipe_)
@ -100,7 +96,6 @@ int zmq::fq_t::recvpipe (msg_t *msg_, pipe_t **pipe_)
*pipe_ = _pipes[_current];
_more = (msg_->flags () & msg_t::more) != 0;
if (!_more) {
_last_in = _pipes[_current];
_current = (_current + 1) % _active;
}
return 0;

View File

@ -65,11 +65,6 @@ class fq_t
// beginning of the pipes array.
pipes_t::size_type _active;
// Pointer to the last pipe we received message from.
// NULL when no message has been received or the pipe
// has terminated.
pipe_t *_last_in;
// Index of the next bound pipe to read a message from.
pipes_t::size_type _current;

View File

@ -36,8 +36,7 @@
zmq::pair_t::pair_t (class ctx_t *parent_, uint32_t tid_, int sid_) :
socket_base_t (parent_, tid_, sid_),
_pipe (NULL),
_last_in (NULL)
_pipe (NULL)
{
options.type = ZMQ_PAIR;
}
@ -67,9 +66,6 @@ void zmq::pair_t::xattach_pipe (pipe_t *pipe_,
void zmq::pair_t::xpipe_terminated (pipe_t *pipe_)
{
if (pipe_ == _pipe) {
if (_last_in == _pipe) {
_last_in = NULL;
}
_pipe = NULL;
}
}
@ -117,7 +113,6 @@ int zmq::pair_t::xrecv (msg_t *msg_)
errno = EAGAIN;
return -1;
}
_last_in = _pipe;
return 0;
}

View File

@ -62,8 +62,6 @@ class pair_t ZMQ_FINAL : public socket_base_t
private:
zmq::pipe_t *_pipe;
zmq::pipe_t *_last_in;
ZMQ_NON_COPYABLE_NOR_MOVABLE (pair_t)
};
}