Boost logo

Boost-Commit :

From: chris_at_[hidden]
Date: 2008-01-14 08:25:24


Author: chris_kohlhoff
Date: 2008-01-14 08:25:24 EST (Mon, 14 Jan 2008)
New Revision: 42756
URL: http://svn.boost.org/trac/boost/changeset/42756

Log:
Silence some integer truncation warnings.

Text files modified:
   trunk/boost/asio/detail/socket_ops.hpp | 8 +++++---
   1 files changed, 5 insertions(+), 3 deletions(-)

Modified: trunk/boost/asio/detail/socket_ops.hpp
==============================================================================
--- trunk/boost/asio/detail/socket_ops.hpp (original)
+++ trunk/boost/asio/detail/socket_ops.hpp 2008-01-14 08:25:24 EST (Mon, 14 Jan 2008)
@@ -1812,19 +1812,21 @@
 # if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) || defined(UNDER_CE)
   // Building for Windows XP, Windows Server 2003, or later.
   clear_error(ec);
- int error = ::getnameinfo(addr, addrlen, host, static_cast<DWORD>(hostlen),
+ int error = ::getnameinfo(addr, static_cast<socklen_t>(addrlen),
+ host, static_cast<DWORD>(hostlen),
       serv, static_cast<DWORD>(servlen), flags);
   return ec = translate_addrinfo_error(error);
 # else
   // Building for Windows 2000 or earlier.
   typedef int (WSAAPI *gni_t)(const socket_addr_type*,
- int, char*, std::size_t, char*, std::size_t, int);
+ int, char*, DWORD, char*, DWORD, int);
   if (HMODULE winsock_module = ::GetModuleHandleA("ws2_32"))
   {
     if (gni_t gni = (gni_t)::GetProcAddress(winsock_module, "getnameinfo"))
     {
       clear_error(ec);
- int error = gni(addr, addrlen, host, hostlen, serv, servlen, flags);
+ int error = gni(addr, addrlen, host, static_cast<DWORD>(hostlen),
+ serv, static_cast<DWORD>(servlen), flags);
       return ec = translate_addrinfo_error(error);
     }
   }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk