Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: conversion warnings #459

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions zmq_addon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ inline void write_network_order(unsigned char *buf, const uint32_t value)
{
if (is_little_endian()) {
ZMQ_CONSTEXPR_VAR uint32_t mask = std::numeric_limits<std::uint8_t>::max();
*buf++ = (value >> 24) & mask;
*buf++ = (value >> 16) & mask;
*buf++ = (value >> 8) & mask;
*buf++ = value & mask;
*buf++ = static_cast<unsigned char>((value >> 24) & mask);
*buf++ = static_cast<unsigned char>((value >> 16) & mask);
*buf++ = static_cast<unsigned char>((value >> 8) & mask);
*buf++ = static_cast<unsigned char>(value & mask);
} else {
std::memcpy(buf, &value, sizeof(value));
}
Expand Down Expand Up @@ -236,7 +236,7 @@ message_t encode(const Range &parts)
message_t encoded(mmsg_size);
unsigned char *buf = encoded.data<unsigned char>();
for (const auto &part : parts) {
const uint32_t part_size = part.size();
const uint32_t part_size = static_cast<uint32_t>(part.size());
const unsigned char *part_data =
static_cast<const unsigned char *>(part.data());

Expand Down