From 308239d7583928c98dd36b6654b3b1970e2de36d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20N=C3=B8kland?= Date: Mon, 30 Nov 2015 16:55:51 +0100 Subject: [PATCH] Correction to pull request #56 A better/nicer solution to fix the type mismatch warnings (size_t to int). Working with size_t as long as possible and doing the static_cast right before calling the zmq_poll() function of libzmq --- zmq.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zmq.hpp b/zmq.hpp index 79ed2fb..42d85da 100644 --- a/zmq.hpp +++ b/zmq.hpp @@ -127,9 +127,9 @@ namespace zmq int errnum; }; - inline int poll (zmq_pollitem_t const* items_, int nitems_, long timeout_ = -1) + inline int poll (zmq_pollitem_t const* items_, size_t nitems_, long timeout_ = -1) { - int rc = zmq_poll (const_cast(items_), nitems_, timeout_); + int rc = zmq_poll (const_cast(items_), static_cast(nitems_), timeout_); if (rc < 0) throw error_t (); return rc; @@ -137,7 +137,7 @@ namespace zmq inline int poll(zmq_pollitem_t const* items, size_t nitems) { - return poll(items, static_cast(nitems), -1); + return poll(items, nitems, -1); } #ifdef ZMQ_CPP11 @@ -153,7 +153,7 @@ namespace zmq inline int poll(std::vector const& items, long timeout_ = -1) { - return poll(items.data(), static_cast(items.size()), timeout_); + return poll(items.data(), items.size(), timeout_); } #endif