Skip to content

Commit cb92711

Browse files
author
pfeatherstone
committed
removed some unecessary bit_casts
1 parent 5d7790a commit cb92711

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/msgpack.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,23 +668,23 @@ namespace msgpackcpp
668668
// negative - int16
669669
char buf[3];
670670
buf[0] = MSGPACK_I16;
671-
store(&buf[1], host_to_b16(bit_cast<uint16_t>(static_cast<int16_t>(v))));
671+
store(&buf[1], host_to_b16(static_cast<int16_t>(v)));
672672
out(buf, sizeof(buf));
673673
}
674674
else if (v >= std::numeric_limits<int32_t>::min())
675675
{
676676
// negative - int32_t
677677
char buf[5];
678678
buf[0] = MSGPACK_I32;
679-
store(&buf[1], host_to_b32(bit_cast<uint32_t>(static_cast<int32_t>(v))));
679+
store(&buf[1], host_to_b32(static_cast<int32_t>(v)));
680680
out(buf, sizeof(buf));
681681
}
682682
else
683683
{
684684
// negative - int64_t
685685
char buf[9];
686686
buf[0] = MSGPACK_I64;
687-
store(&buf[1], host_to_b64(bit_cast<uint64_t>(static_cast<int64_t>(v))));
687+
store(&buf[1], host_to_b64(static_cast<int64_t>(v)));
688688
out(buf, sizeof(buf));
689689
}
690690
}

0 commit comments

Comments
 (0)