mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-27 15:41:05 +08:00
Merge pull request #1938 from hitstergtd/decoder-fix
Problem: style issues in decoder.hpp
This commit is contained in:
commit
89ef8b38c0
@ -119,7 +119,8 @@ namespace zmq
|
|||||||
bytes_used_ = size_;
|
bytes_used_ = size_;
|
||||||
|
|
||||||
while (!to_read) {
|
while (!to_read) {
|
||||||
const int rc = (static_cast <T *> (this)->*next) (data_ + bytes_used_);
|
const int rc =
|
||||||
|
(static_cast <T *> (this)->*next) (data_ + bytes_used_);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -128,11 +129,11 @@ namespace zmq
|
|||||||
|
|
||||||
while (bytes_used_ < size_) {
|
while (bytes_used_ < size_) {
|
||||||
// Copy the data from buffer to the message.
|
// Copy the data from buffer to the message.
|
||||||
const std::size_t to_copy = std::min (to_read, size_ - bytes_used_);
|
const size_t to_copy = std::min (to_read, size_ - bytes_used_);
|
||||||
// only copy when the destination address is different from the
|
// Only copy when destination address is different from the
|
||||||
// current address in the buffer
|
// current address in the buffer.
|
||||||
if (read_pos != data_ + bytes_used_) {
|
if (read_pos != data_ + bytes_used_) {
|
||||||
std::memcpy (read_pos, data_ + bytes_used_, to_copy);
|
memcpy (read_pos, data_ + bytes_used_, to_copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
read_pos += to_copy;
|
read_pos += to_copy;
|
||||||
@ -142,7 +143,8 @@ namespace zmq
|
|||||||
// If none is available, return.
|
// If none is available, return.
|
||||||
while (to_read == 0) {
|
while (to_read == 0) {
|
||||||
// pass current address in the buffer
|
// pass current address in the buffer
|
||||||
const int rc = (static_cast <T *> (this)->*next) (data_ + bytes_used_);
|
const int rc =
|
||||||
|
(static_cast <T *> (this)->*next) (data_ + bytes_used_);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user