mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-06 00:31:14 +01:00
Problem: conversion warnings
Solution: Silence them with casts
This commit is contained in:
parent
18db4568f9
commit
486b7226cb
@ -78,10 +78,10 @@ inline void write_network_order(unsigned char *buf, const uint32_t value)
|
|||||||
{
|
{
|
||||||
if (is_little_endian()) {
|
if (is_little_endian()) {
|
||||||
ZMQ_CONSTEXPR_VAR uint32_t mask = std::numeric_limits<std::uint8_t>::max();
|
ZMQ_CONSTEXPR_VAR uint32_t mask = std::numeric_limits<std::uint8_t>::max();
|
||||||
*buf++ = (value >> 24) & mask;
|
*buf++ = static_cast<unsigned char>((value >> 24) & mask);
|
||||||
*buf++ = (value >> 16) & mask;
|
*buf++ = static_cast<unsigned char>((value >> 16) & mask);
|
||||||
*buf++ = (value >> 8) & mask;
|
*buf++ = static_cast<unsigned char>((value >> 8) & mask);
|
||||||
*buf++ = value & mask;
|
*buf++ = static_cast<unsigned char>(value & mask);
|
||||||
} else {
|
} else {
|
||||||
std::memcpy(buf, &value, sizeof(value));
|
std::memcpy(buf, &value, sizeof(value));
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ message_t encode(const Range &parts)
|
|||||||
message_t encoded(mmsg_size);
|
message_t encoded(mmsg_size);
|
||||||
unsigned char *buf = encoded.data<unsigned char>();
|
unsigned char *buf = encoded.data<unsigned char>();
|
||||||
for (const auto &part : parts) {
|
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 =
|
const unsigned char *part_data =
|
||||||
static_cast<const unsigned char *>(part.data());
|
static_cast<const unsigned char *>(part.data());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user