From fc1c6b08d191b3ee9964bf53ea95767bc54377ee Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Sat, 1 Jan 2005 11:32:23 +0000 Subject: Converted all C-style casts to C++-style casts + added unit test for utility::md5. --- src/platforms/posix/posixSocket.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/platforms') diff --git a/src/platforms/posix/posixSocket.cpp b/src/platforms/posix/posixSocket.cpp index 09c8820e..40fa71e5 100644 --- a/src/platforms/posix/posixSocket.cpp +++ b/src/platforms/posix/posixSocket.cpp @@ -70,12 +70,12 @@ void posixSocket::connect(const vmime::string& address, const vmime::port_t port memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; - addr.sin_port = htons((unsigned short) port); + addr.sin_port = htons(static_cast (port)); addr.sin_addr.s_addr = ::inet_addr(address.c_str()); - if (addr.sin_addr.s_addr == (::in_addr_t) -1) + if (addr.sin_addr.s_addr == static_cast (-1)) { - ::hostent* hostInfo = (hostent*) ::gethostbyname(address.c_str()); + ::hostent* hostInfo = ::gethostbyname(address.c_str()); if (hostInfo == NULL) { @@ -83,7 +83,7 @@ void posixSocket::connect(const vmime::string& address, const vmime::port_t port throw vmime::exceptions::connection_error(); } - bcopy(hostInfo->h_addr, (char*) &addr.sin_addr, hostInfo->h_length); + bcopy(hostInfo->h_addr, reinterpret_cast (&addr.sin_addr), hostInfo->h_length); } else { @@ -98,7 +98,7 @@ void posixSocket::connect(const vmime::string& address, const vmime::port_t port throw vmime::exceptions::connection_error(); // Start connection - if (::connect(m_desc, (sockaddr*) &addr, sizeof(addr)) == -1) + if (::connect(m_desc, reinterpret_cast (&addr), sizeof(addr)) == -1) { ::close(m_desc); m_desc = -1; -- cgit