From 82f6e93dd1ce41a11aa5f9c230fe88c03b5471a8 Mon Sep 17 00:00:00 2001 From: Pierre-Jean Texier Date: Tue, 23 Apr 2019 23:08:24 +0200 Subject: [PATCH] Use C++ cast instead of old style cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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; --- zmq.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zmq.hpp b/zmq.hpp index e10c0c8..760e098 100644 --- a/zmq.hpp +++ b/zmq.hpp @@ -760,7 +760,7 @@ class socket_t { int nbytes = zmq_send(ptr, buf_, len_, flags_); if (nbytes >= 0) - return (size_t) nbytes; + return static_cast(nbytes); if (zmq_errno() == EAGAIN) return 0; throw error_t(); @@ -790,7 +790,7 @@ class socket_t { int nbytes = zmq_recv(ptr, buf_, len_, flags_); if (nbytes >= 0) - return (size_t) nbytes; + return static_cast(nbytes); if (zmq_errno() == EAGAIN) return 0; throw error_t();