Skip to content

Commit 82f6e93

Browse files
committed
Use C++ cast instead of old style cast
This to avoid the following warning with the '-Wold-style-cast' flag enabled : ./zmq.hpp:763:29: warning: use of old-style cast [-Wold-style-cast] return (size_t) nbytes; ^ ./zmq.hpp: In member function ‘size_t zmq::socket_t::recv(void*, size_t, int)’: ./zmq.hpp:793:29: warning: use of old-style cast [-Wold-style-cast] return (size_t) nbytes;
1 parent b0ac8ac commit 82f6e93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

zmq.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ class socket_t
760760
{
761761
int nbytes = zmq_send(ptr, buf_, len_, flags_);
762762
if (nbytes >= 0)
763-
return (size_t) nbytes;
763+
return static_cast<size_t>(nbytes);
764764
if (zmq_errno() == EAGAIN)
765765
return 0;
766766
throw error_t();
@@ -790,7 +790,7 @@ class socket_t
790790
{
791791
int nbytes = zmq_recv(ptr, buf_, len_, flags_);
792792
if (nbytes >= 0)
793-
return (size_t) nbytes;
793+
return static_cast<size_t>(nbytes);
794794
if (zmq_errno() == EAGAIN)
795795
return 0;
796796
throw error_t();

0 commit comments

Comments
 (0)