0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Problem: style issues in decoder.hpp

Solution: fix it
This commit is contained in:
hitstergtd 2016-04-30 21:20:31 +01:00
parent 95acb29bfb
commit 8820e35a56

View File

@ -119,7 +119,8 @@ namespace zmq
bytes_used_ = size_;
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)
return rc;
}
@ -128,11 +129,11 @@ namespace zmq
while (bytes_used_ < size_) {
// Copy the data from buffer to the message.
const std::size_t to_copy = std::min (to_read, size_ - bytes_used_);
// only copy when the destination address is different from the
// current address in the buffer
const size_t to_copy = std::min (to_read, size_ - bytes_used_);
// Only copy when destination address is different from the
// current address in the buffer.
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;
@ -142,7 +143,8 @@ namespace zmq
// If none is available, return.
while (to_read == 0) {
// 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)
return rc;
}