Skip to content

Commit

Permalink
fix warning. (dmlc#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
zheng-da authored and aksnzhy committed Apr 6, 2019
1 parent 4ea42e3 commit 9565db6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/graph/network/msg_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class MessageQueue {
/*!
* \brief Used to check all producers will no longer produce anything
*/
int num_producers_;
size_t num_producers_;

/*!
* \brief Messages in the queue
Expand Down
6 changes: 3 additions & 3 deletions src/graph/network/socket_communicator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void SocketCommunicator::MsgHandler(TCPSocket* socket, MessageQueue* queue) {
// First recv the size
int64_t received_bytes = 0;
int64_t data_size = 0;
while (received_bytes < sizeof(int64_t)) {
while (static_cast<size_t>(received_bytes) < sizeof(int64_t)) {
int64_t max_len = sizeof(int64_t) - received_bytes;
int64_t tmp = socket->Receive(
reinterpret_cast<char*>(&data_size)+received_bytes,
Expand Down Expand Up @@ -150,7 +150,7 @@ void SocketCommunicator::FinalizeSender() {
if (socket_[0] != nullptr) {
int64_t size = -1;
int64_t sent_bytes = 0;
while (sent_bytes < sizeof(int64_t)) {
while (static_cast<size_t>(sent_bytes) < sizeof(int64_t)) {
int64_t max_len = sizeof(int64_t) - sent_bytes;
int64_t tmp = socket_[0]->Send(
reinterpret_cast<char*>(&size)+sent_bytes,
Expand Down Expand Up @@ -185,7 +185,7 @@ int64_t SocketCommunicator::Send(char* src, int64_t size) {
TCPSocket* client = socket_[0];
// First sent the size of data
int64_t sent_bytes = 0;
while (sent_bytes < sizeof(int64_t)) {
while (static_cast<size_t>(sent_bytes) < sizeof(int64_t)) {
int64_t max_len = sizeof(int64_t) - sent_bytes;
int64_t tmp = client->Send(
reinterpret_cast<char*>(&size)+sent_bytes,
Expand Down

0 comments on commit 9565db6

Please sign in to comment.