From 486b7226cbd81047991309781126de2cf5c1d1ba Mon Sep 17 00:00:00 2001 From: Gudmundur Adalsteinsson Date: Sun, 25 Oct 2020 09:10:37 +0000 Subject: [PATCH] Problem: conversion warnings Solution: Silence them with casts --- zmq_addon.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zmq_addon.hpp b/zmq_addon.hpp index 021ab954..7665cfaa 100644 --- a/zmq_addon.hpp +++ b/zmq_addon.hpp @@ -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::max(); - *buf++ = (value >> 24) & mask; - *buf++ = (value >> 16) & mask; - *buf++ = (value >> 8) & mask; - *buf++ = value & mask; + *buf++ = static_cast((value >> 24) & mask); + *buf++ = static_cast((value >> 16) & mask); + *buf++ = static_cast((value >> 8) & mask); + *buf++ = static_cast(value & mask); } else { std::memcpy(buf, &value, sizeof(value)); } @@ -236,7 +236,7 @@ message_t encode(const Range &parts) message_t encoded(mmsg_size); unsigned char *buf = encoded.data(); for (const auto &part : parts) { - const uint32_t part_size = part.size(); + const uint32_t part_size = static_cast(part.size()); const unsigned char *part_data = static_cast(part.data());