@@ -77,7 +77,7 @@ inline bool is_little_endian()
77
77
inline void write_network_order (unsigned char *buf, const uint32_t value)
78
78
{
79
79
if (is_little_endian ()) {
80
- ZMQ_CONSTEXPR_VAR uint32_t mask = std::numeric_limits<std::uint8_t >::max ();
80
+ ZMQ_CONSTEXPR_VAR uint32_t mask = ( std::numeric_limits<std::uint8_t >::max) ();
81
81
*buf++ = static_cast <unsigned char >((value >> 24 ) & mask);
82
82
*buf++ = static_cast <unsigned char >((value >> 16 ) & mask);
83
83
*buf++ = static_cast <unsigned char >((value >> 8 ) & mask);
@@ -224,12 +224,12 @@ message_t encode(const Range &parts)
224
224
// First pass check sizes
225
225
for (const auto &part : parts) {
226
226
const size_t part_size = part.size ();
227
- if (part_size > std::numeric_limits<std::uint32_t >::max ()) {
227
+ if (part_size > ( std::numeric_limits<std::uint32_t >::max) ()) {
228
228
// Size value must fit into uint32_t.
229
229
throw std::range_error (" Invalid size, message part too large" );
230
230
}
231
231
const size_t count_size =
232
- part_size < std::numeric_limits<std::uint8_t >::max () ? 1 : 5 ;
232
+ part_size < ( std::numeric_limits<std::uint8_t >::max) () ? 1 : 5 ;
233
233
mmsg_size += part_size + count_size;
234
234
}
235
235
@@ -240,12 +240,12 @@ message_t encode(const Range &parts)
240
240
const unsigned char *part_data =
241
241
static_cast <const unsigned char *>(part.data ());
242
242
243
- if (part_size < std::numeric_limits<std::uint8_t >::max ()) {
243
+ if (part_size < ( std::numeric_limits<std::uint8_t >::max) ()) {
244
244
// small part
245
245
*buf++ = (unsigned char ) part_size;
246
246
} else {
247
247
// big part
248
- *buf++ = std::numeric_limits<uint8_t >::max ();
248
+ *buf++ = ( std::numeric_limits<uint8_t >::max) ();
249
249
detail::write_network_order (buf, part_size);
250
250
buf += sizeof (part_size);
251
251
}
@@ -279,7 +279,7 @@ template<class OutputIt> OutputIt decode(const message_t &encoded, OutputIt out)
279
279
280
280
while (source < limit) {
281
281
size_t part_size = *source++;
282
- if (part_size == std::numeric_limits<std::uint8_t >::max ()) {
282
+ if (part_size == ( std::numeric_limits<std::uint8_t >::max) ()) {
283
283
if (static_cast <size_t >(limit - source) < sizeof (uint32_t )) {
284
284
throw std::out_of_range (
285
285
" Malformed encoding, overflow in reading size" );
0 commit comments